1import{j as e}from"./jsx-runtime-gV1wv1qP.js";import{r as g,a as k,L as p,f as ge,u as De}from"./chunk-OIYGIGL5-fdmY2nYp.js";import{G as ue}from"./index-81b20-OW.js";import{a as E}from"./AuthProvider-DOHvdORr.js";import{c as h}from"./index-DsWCR0wz.js";import{I as x}from"./Icon-Bnvw45GS.js";import{u as K}from"./AuthModalProvider-0ca-gwl9.js";import{u as j}from"./useGetCurrentUserProfile-BOzd3IXW.js";import{g as N}from"./generateImageUrl-DLH3iL-N.js";import{g as S}from"./generateAssetsId-BfVy5FDw.js";import{u as l}from"./events-DZsKUDfK.js";import{D as A}from"./luxon-nsqPv9fP.js";import{u as Oe}from"./useAlert-BOADQujH.js";import{u as Be}from"./QueryClientProvider-Bod6POJi.js";import{z as f}from"./config-vDsGohDc.js";import{A as Pe,u as Fe,g as me}from"./useGetUserWallet-FPzZP-2q.js";import{A as Z}from"./index-CjaZquaH.js";import{m as Q}from"./proxy-xoOj-uij.js";import{s as J}from"./ssl-rank-CWPHANVf.js";import{u as D}from"./useGoToRegister-MRf5LVNK.js";import{u as he}from"./index-6VivemGR.js";import{D as I}from"./DownArrow-CCl1vhVB.js";import{C as pe}from"./client-only-Dklc0vo8.js";import{K as _}from"./transition-n28TrCrv.js";import{u as Re}from"./useOS-CIAosZlk.js";import{X as Ge}from"./x-DB8-2dzZ.js";import{G as T}from"./GameIcon-DkKB_TdP.js";import{g as M}from"./contants-C0kAJufs.js";import{t as G}from"./bundle-mjs-DUwR9S26.js";import{B as He,S as We,g as Ue}from"./detailNav-GC0FGTXz.js";import{D as Ee}from"./DetailNavIdentity-BV-kuRnY.js";import{S as Ke}from"./SearchButton-Bo7kjcLz.js";import{M as Ze,a as Qe,B as Je,I as Ve}from"./listbox-Cd1-Cwz5.js";import{F as xe}from"./FlagIcon-Bo04fcwk.js";import{g as qe}from"./generatePlayerPageUrl-BGEl3QPU.js";import{g as Xe}from"./generateTeamLink-BbWTPJOl.js";import{g as Ye}from"./generateTeamLogoSrc-RaN99xao.js";import{b as es,M as ss,a as be,u as fe}from"./config-CDx0QSKg.js";import{T as P}from"./Tooltip-DGB6wZpq.js";import{P as rs}from"./plus-CPljTJjQ.js";import{S as ns}from"./StreakFlame-cXESS6NI.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s._sentryModuleMetadata=s._sentryModuleMetadata||{},s._sentryModuleMetadata[new s.Error().stack]=(function(o){for(var a=1;a<arguments.length;a++){var n=arguments[a];if(n!=null)for(var t in n)n.hasOwnProperty(t)&&(o[t]=n[t])}return o})({},s._sentryModuleMetadata[new s.Error().stack],{"_sentryBundlerPluginAppKey:portal-frontend-ssr":!0});var r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="a2989986-b42b-44f5-b4d8-ab3422079227",s._sentryDebugIdIdentifier="sentry-dbid-a2989986-b42b-44f5-b4d8-ab3422079227")}catch{}})();const as=s=>{const r=["cs","dota","rl","fortnite"];return[...s].sort((o,a)=>{const n=r.indexOf(o),t=r.indexOf(a);return n!==-1&&t!==-1?n-t:n!==-1?-1:t!==-1?1:0})},ke=(s,r)=>s.children?s.children.some(o=>o._type==="groupedNavbarItems"?o.children.some(a=>a.route&&r.includes(a.route)):o.route&&r.includes(o.route)):!1,ye=({navbarItems:s,subNavItems:r,tournamentTimeline:o})=>{const{gameId:a,enabledGames:n}=g.useContext(ue),{isAuthenticated:t}=E(),{pathname:i}=k(),c=g.useMemo(()=>{const u=as(n);return a&&!u.includes(a)&&u.push(a),u},[n,a]),d=a?`/${a}`:"/";return{gameId:a,games:c,navbarItems:s,sectionItems:r?.length?r:s,tournamentTimeline:o,isAuthenticated:t,isHome:i===d,homeRoute:d}},ve=()=>{const[s,r]=g.useState(null),[o,a]=g.useState(!1),{pathname:n,search:t}=k(),i=g.useCallback(()=>{a(!1),r(null)},[]);return g.useEffect(()=>{i()},[n,t,i]),g.useEffect(()=>{if(!o)return;const c=u=>{u.key==="Escape"&&i()},d=document.body.style.overflow;return document.body.style.overflow="hidden",window.addEventListener("keydown",c),()=>{document.body.style.overflow=d,window.removeEventListener("keydown",c)}},[o,i]),{isMenuOpen:o,expandedSectionKey:s,toggleMenu:()=>o?i():a(!0),openSection:c=>{r(c),a(!0)},toggleSection:c=>r(d=>d===c?null:c),closeMenu:i}},ts=()=>{const s=g.useContext(Pe);if(!s)throw new Error("useWebSocket must be used within a WebSocketProvider");return s},os=f.object({type:f.literal("user"),user:f.object({type:f.literal("points_received"),points_received:f.object({amount:f.number().int().min(0),context:f.string(),purpose:f.string().default(""),transactionDate:f.string().datetime()})})});function is(s){const r=/^([A-Za-z0-9]+)_([\d]+)$/,o=s.match(r);if(o){const a=o[1],n=parseInt(o[2],10),t=a.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])(\d+)/g,"$1 $2").replace(/(\d+)([A-Za-z])/g,"$1 $2").split(/[_\s]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1).toLowerCase()).join(" ");let i;switch(a){case"DailyVisit":i=n===1?"visiting BLAST.tv. Come back tomorrow to start a streak!":`visiting BLAST.tv ${n} days in a row!`;break;case"CounterStrikleStarted":i=n===1?"playing Counter-Strikle.":`playing Counter-Strikle for ${n} days.`;break;case"CounterStrikleWon":i=n===1?"winning Counter-Strikle.":`winning Counter-Strikle for ${n} days.`;break;case"CSQuizStarted":i=n===1?"playing CS Quiz.":`playing CS Quiz for ${n} days.`;break;case"CSQuizDefused":i=n===1?"defusing the bomb in CS Quiz.":`defusing the bomb in CS Quiz for ${n} days.`;break;case"CSGuessrStarted":i=n===1?"playing CS Guessr.":`playing CS Guessr for ${n} days.`;break;case"CSGuessrPerfectAnswer":i=n===1?"getting the maximum score in a CS Guessr answer!":`getting the maximum score in CS Guessr for ${n} times.`;break;case"PickemsSubmitted":i="submitting your Pick'ems.";break;case"LivePollVote":i="participating in a Live Poll!";break;case"FantasySubmitted":i="submitting your Fantasy team.";break;case"HigherLowerStarted":i=n===1?"playing Higher Lower.":`playing Higher Lower for ${n} consecutive days.`;break;case"HigherLower10InARow":i=n===1?"getting 10 correct answers in a row in Higher Lower.":`getting 10 correct answers in a row in Higher Lower for ${n} consecutive days.`;break;case"HigherLower20InARow":i=n===1?"getting 20 correct answers in a row in Higher Lower.":`getting 20 correct answers in a row in Higher Lower for ${n} consecutive days.`;break;case"HigherLower30InARow":i=n===1?"getting 30 correct answers in a row in Higher Lower.":`getting 30 correct answers in a row in Higher Lower for ${n} consecutive days.`;break;case"TeamTakeoverVictory":i="instigating a team takeover and being victorious!";break;default:i="purpose"}return{title:`${t}${n>1?` Streak ${n}`:""}`,message:i}}else return{title:s,message:s}}function ls(s){const{appSyncClient:r}=ts(),o=Be(),{userId:a}=E(),n=g.useMemo(()=>s?.onPointsReceived,[s?.onPointsReceived]),t=g.useCallback(i=>{const{data:c}=os.safeParse(i);if(c){if(!c.user.points_received.purpose?.startsWith("PointsClaimed")){const{title:d,message:u}=is(c.user.points_received.purpose);
1n?.({amount:c.user.points_received.amount,title:d,message:u})}a&&o.invalidateQueries({queryKey:["userWallet",a]})}},[n,o,a]);g.useEffect(()=>{if(a&&r)return r.subscribe(`/user/${a}`,t),()=>{r.unsubscribe(`/user/${a}`,t)}},[r,a,t])}const je=()=>{const[s,r]=g.useState(null),o=g.useRef(null),a=g.useCallback(({amount:t,title:i,message:c})=>{const d=A.now().toMillis();r({id:d,amount:t,title:i,message:c}),o.current=setTimeout(()=>{r(null)},5e3)},[]);ls({onPointsReceived:a});const n=Oe();return e.jsx(Z,{children:s&&e.jsx(Q.button,{className:h("z-pointsNotification text-primary-100 flex items-center gap-1 rounded-full px-1 py-2","max-sd:bg-background-100/50 max-sd:shadow-sm max-sd:shadow-background-100"),initial:{opacity:0,x:32,scale:.5},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:32,scale:.5},onClick:()=>{n.addPointsNotification(s)},children:e.jsxs("span",{className:"font-style-label-l3 whitespace-nowrap",children:["+ ",s.amount]})})})},cs=({gameId:s,topLevelNavItem:r,data:o})=>{const a=r.route,n=g.useMemo(()=>({cs:[{_key:"blast-tournaments",title:"BLAST Tournaments",_type:"navbarItem",route:`${a}?type=BLAST`},{_key:"major-tournaments",title:"Majors",_type:"navbarItem",route:`${a}?type=Major`}],dota:[{_key:"blast-tournaments",title:"BLAST Tournaments",_type:"navbarItem",route:`${a}?type=BLAST`},{_key:"the-international-tournaments",title:"The International",_type:"navbarItem",route:`${a}?type=The+International`}],rl:[{_key:"lan-tournaments",title:"LAN Tournaments",_type:"navbarItem",route:`${a}?type=LAN`}],fortnite:[{_key:"lan-tournaments",title:"LAN Tournaments",_type:"navbarItem",route:`${a}?type=LAN`}],fr:[],gaming:[]}),[a]),t=g.useMemo(()=>{const c=[{_key:"all-tournaments",title:"All Tournaments",_type:"navbarItem",route:a},...s?n[s]:[]];if(o?.live.length){const d=o.live.sort((u,m)=>m.startDate.localeCompare(u.startDate));c.push({_key:"live",_type:"groupedNavbarItems",badge:"live",headerText:"Ongoing",children:d.map(u=>{const m=A.fromISO(u.startDate),b=m.toFormat("LLL"),y=m.toFormat("d"),$=A.fromISO(u.endDate),q=$.toFormat("LLL"),X=$.toFormat("d"),ze=`${b} ${y} - `+(b===q?X:`${q} ${X}`);return{_key:u.id,title:u.name,_type:"navbarItem",route:`${a}/${u.id}`,subText:ze}})})}if(o?.upcoming.length){const u=o.upcoming.sort((m,b)=>m.startDate.localeCompare(b.startDate)).slice(0,2);c.push({_key:"upcoming",_type:"groupedNavbarItems",headerText:"Upcoming",children:u.map(m=>({_key:m.id,title:m.name,_type:"navbarItem",route:`${a}/${m.id}`}))})}if(o?.past.length){const u=o.past.sort((m,b)=>b.startDate.localeCompare(m.startDate)).slice(0,2);c.push({_key:"finished",_type:"groupedNavbarItems",headerText:"Finished",children:u.map(m=>({_key:m.id,title:m.name,_type:"navbarItem",route:`${a}/${m.id}`}))})}return c},[s,o,a,n]);return g.useMemo(()=>({_type:"navbarItem",_key:"tournament-timeline-nav",route:a,title:"Tournaments",children:t}),[t,a])},O=({children:s,className:r,onClick:o})=>{const{gameId:a}=g.useContext(ue),{route:n}=g.useMemo(()=>({route:a?`/${a}`:"/"}),[a]);return e.jsx(p,{to:n,title:"Go to homepage",className:h("block",r),onClick:o,children:s})},Ne="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20127.14%2096.36'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:%23fff;}%3c/style%3e%3c/defs%3e%3cg%20id='å¾å±_2'%20data-name='å¾å±%202'%3e%3cg%20id='Discord_Logos'%20data-name='Discord%20Logos'%3e%3cg%20id='Discord_Logo_-_Large_-_White'%20data-name='Discord%20Logo%20-%20Large%20-%20White'%3e%3cpath%20class='cls-1'%20d='M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ds=()=>e.jsx("div",{className:"relative size-10",children:e.jsxs("a",{href:"https://discord.gg/GMAWpkuwJe",target:"_blank",rel:"noreferrer",className:"rounded-small group absolute flex h-full w-10 cursor-pointer items-center gap-3 overflow-hidden bg-[#5865F2] p-3 transition-all hover:w-36",children:[e.jsx("img",{src:Ne,className:"w-4",height:16,width:16,alt:"Discord Clyde logo"}),e.jsx("span",{className:"font-style-label-l4 whitespace-nowrap opacity-0 group-hover:opacity-100 group-hover:transition-opacity group-hover:delay-100 group-hover:duration-200",children:"Join discord"})]})}),gs=()=>e.jsxs("a",{href:"https://discord.gg/GMAWpkuwJe",target:"_blank",rel:"noreferrer",className:"rounded-small flex w-fit items-center gap-2 bg-[#5865F2] px-4 py-3 transition-all hover:bg-[#5865F2]/80",children:[e.jsx("img",{src:Ne,className:"w-4",height:16,width:16,alt:"Discord Clyde logo"}),e.jsx("span",{className:"font-style-label-l4 whitespace-nowrap",children:"Join discord"})]}),us=()=>e.jsx("span",{className:"font-style-label-l4 text-background-100 absolute -top-1.5 right-0 rounded-full bg-white px-1 py-0.5",children:"New"}),ms=({onClick:s})=>e.jsxs("div",{className:"relative w-fit",children:[e.jsxs(p,{to:"/rl/user",onClick:s,className:"rounded-small border-background-80 bg-background-95 hover:bg-background-90 flex h-10 w-fit items-center gap-1 border px-2.5 py-2 transition-all",children:[e.jsx("img",{src:J,className:"h-8 w-9 object-contain",height:32,width:36,alt:"Supersonic Legend rank"}),e.jsx("span",{className:"font-style-label-l4 whitespace-nowrap",children:"Search for your profile"})]}),e.jsx(us,{})]}),B=()=>{const{data:s}=j();return Fe(s?.id)},we="bg-background-90 border-background-85 flex items-center gap-2.5 rounded-large border border-solid p-2.5",Ce="bg-background-85 flex w-18 shrink-0 items-center justify-center rounded-large p-2",hs=({onNavigate:s,location:r})=>{const{data:o}=j(),{data:a,isLoading:n}=B(),t=g.useMemo(()=>
1{if(o?.avatarId)return N("avatars",S(o.avatarId,"3d"),{height:200})},[o]);return e.jsxs("div",{className:we,children:[e.jsx("div",{className:Ce,children:t?e.jsx("img",{alt:"",src:t,className:"size-14 rounded-full"}):e.jsx(x,{icon:"anonUser",className:"text-neutral size-14"})}),e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[o?.username&&e.jsx("span",{className:"font-style-heading-h4 w-full truncate",children:o.username}),e.jsxs(p,{to:"/profile/redeem",onClick:()=>{l.navbarItemClicked({location:r,label:"points",href:"/profile/redeem"}),s()},className:"bg-background-85 border-background-80 flex items-center gap-1 rounded-full border border-solid px-2 py-1",children:[e.jsx(x,{icon:"blastCoin",className:"text-primary-100 size-3.5"}),n?e.jsx("span",{className:"bg-background-80 block h-4 w-10 animate-pulse rounded-full"}):e.jsx("span",{className:"font-style-body-b3",children:a?.amount.toLocaleString()})]}),e.jsx(p,{to:"/profile",onClick:()=>{l.navbarItemClicked({location:r,label:"manage-profile",href:"/profile"}),s()},className:"font-style-label-l4 text-primary-100",children:"Manage Profile"})]})]})},ps=({location:s})=>{const r=D();return e.jsxs("div",{className:we,children:[e.jsx("div",{className:Ce,children:e.jsx(x,{icon:"anonUser",className:"text-neutral size-14"})}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-style-body-b4 text-foreground-95",children:"Create an account"}),e.jsx("span",{className:"font-style-body-b3",children:"Follow the action, play minigames, stay in the loop."})]}),e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:s,label:"signup"}),r()},className:"button h-8 w-full px-7",children:"Sign up"})]})]})},xs=({isAuthenticated:s,onNavigate:r,location:o})=>s?e.jsx(hs,{onNavigate:r,location:o}):e.jsx(ps,{location:o}),bs=({onOpen:s,location:r})=>{const{openSearch:o}=he();return e.jsxs("div",{className:"flex w-full flex-col gap-3",children:[e.jsx("span",{className:"font-style-heading-h5",children:"Search on blast.tv"}),e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:r,label:"search"}),s(),o()},className:"border-primary-100 flex h-10 w-full items-center justify-between rounded-full border border-solid px-3",children:[e.jsx("span",{className:"font-style-body-b3 text-neutral",children:"Teams, players & tournaments..."}),e.jsx(x,{icon:"magnifyingGlass",className:"size-3 shrink-0"})]})]})},fs=s=>s.externalLink?s.externalLink.startsWith("/")?s.externalLink:new URL(s.externalLink).pathname:s.route??"#",v=g.forwardRef(({navbarItem:s,children:r,className:o,onClick:a,"aria-current":n},t)=>s.externalLink?e.jsx("a",{href:s.externalLink,target:"_blank",rel:"noreferrer",className:o,ref:t,onClick:a,"aria-current":n,children:r}):e.jsx(p,{to:fs(s),className:o,ref:t,onClick:a,"aria-current":n,children:r}));v.displayName="NavLink";const Le=({className:s})=>e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:h("inline",s),children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.79566 8.45333L9.32772 8.45332L9.32775 0.256961L0.814337 0.256952L0.814284 1.78893L6.78417 1.78893L1.75091 6.8222L2.80524 7.87653L7.79566 2.88611L7.79566 8.45333Z",fill:"currentColor"})}),Se=({navbarItem:s,onNavLinkClick:r,className:o,trackLocation:a})=>{const n=k();return e.jsx(e.Fragment,{children:s._type==="groupedNavbarItems"?e.jsx(ks,{groupedItems:s,onNavLinkClick:r,trackLocation:a,className:h("last:border-b-background-90 redesign:last:border-b-[#B2B4BA] redesign-dark:last:border-b-[#666A74] border-y border-transparent",o)}):e.jsx(v,{navbarItem:s,onClick:()=>{a&&l.navbarItemClicked({location:a,label:s.title,href:s.route??s.externalLink}),r?.()},className:h("border-t-background-90 last:border-b-background-90 redesign:border-t-[#B2B4BA] redesign:last:border-b-[#B2B4BA] redesign-dark:border-t-[#666A74] redesign-dark:last:border-b-[#666A74] redesign:py-5 flex flex-col gap-2 border-y border-transparent py-4 first:border-t-transparent",{"text-primary-100":s.route===`${n.pathname}${n.search}`,"text-foreground-90 redesign:text-foreground-100":s.route!==`${n.pathname}${n.search}`},o),children:e.jsxs("div",{className:"font-style-label-l3 redesign:font-style-heading-h3",children:[s.title,s.externalLink&&e.jsx(Le,{className:"ml-2"})]})})})},ks=({groupedItems:s,onNavLinkClick:r,className:o,trackLocation:a})=>{const n=k();return e.jsxs("div",{className:o,children:[s.headerText&&e.jsxs("div",{className:"redesign:mt-0 redesign:gap-2.5 mt-1 flex items-center gap-3",children:[e.jsx("div",{className:"font-style-body-b3 text-neutral redesign:bg-foreground-100 redesign:text-background-100 redesign:font-style-label-l1 redesign:rounded-full redesign:px-2 redesign:py-1 shrink-0",children:s.headerText}),e.jsx("div",{className:"bg-background-90 redesign:bg-[#B2B4BA] redesign-dark:bg-[#666A74] h-px w-full flex-1"})]}),s.children.map((t,i)=>e.jsxs(v,{navbarItem:t,onClick:()=>{a&&l.navbarItemClicked({location:a,label:t.title,href:t.route??t.externalLink}),r?.()},className:h("border-b-background-90 redesign:border-b-[#B2B4BA] redesign-dark:border-b-[#666A74] redesign:gap-3 redesign:py-5 flex flex-col gap-2 border-y border-t-transparent py-4 last:border-b-transparent",{"text-primary-100":t.route===`${n.pathname}${n.search}`,"text-foreground-90 redesign:text-foreground-100":t.route!==`${n.pathname}${n.search}`}),children:[e.jsxs("div",{className:"font-style-label-l3 redesign:font-style-heading-h3",children:[t.title,t.externalLink&&e.jsx(Le,{className:"ml-2"})]}),(s.badge||t.subText)&&e.jsxs("div",{className:"redesign:gap-3 flex items-center gap-2",children:[t.subText&&e.jsx(pe,{children:()=>e.jsx("div",{className:"font-style-body-b3 text-neutral redesign:font-style-label-l1 redesign:text-[#666A74]",children:t.subText})}),s.badge==="live"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-error redesign:hidden size-1 rounded-full"}),e.jsx("div",{className:"text-error font-style-label-l4 redesign:font-style-label-l1 redesign:uppercase",children:"Live"})]})]})]},i))]})},Y="font-style-label-l2 flex items-center gap-1.5 text-left uppercase",ys=({item:s,isExpanded:r,onToggle:o,onNavigate:a,location:n})=>{const{pathname:t,search:i}=k(),c=`${t}${i}`,d=s.children??[],u=d.length>0,m=u?ke(s,c):!!(s.route&&c.includes(s.route));return e.jsxs("div",{className:"flex w-full flex-col gap-2",children:[e.jsxs("div",{className:"flex w-fit flex-col gap-2",children:[u?e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:n,label:`${s.title} (${r?"collapse":"expand"})`}),o()},"aria-expanded":r,className:Y,children:[e.jsx("span",{children:s.title}),e.jsx(I,{className:h("transition-transform",{"text-primary-100 rotate-180":r,"text-foreground-90":!r})})]}):e.jsx(v,{navbarItem:s,onClick:()=>{l.navbarItemClicked({location:n,label:s.title,href:s.route??s.externalLink}),a()},className:Y,children:e.jsx("span",{children:s.title})}),e.jsx("div",{className:h("bg-foreground-100 h-1 w-full",{"opacity-0":!m})})]}),e.jsx(Z,{initial:!1,children:r&&u&&e.jsx(Q.div,{initial:{height:0,opacity:0}
1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"flex w-full flex-col overflow-hidden",children:d.map((b,y)=>e.jsx(Se,{navbarItem:b,onNavLinkClick:a,trackLocation:n},b._key??y))})})]})},Ie=({navbarItems:s,tournamentTimeline:r,gameId:o})=>{const a=s.find(t=>t._type==="navbarTournamentsItem"),n=cs({gameId:o,topLevelNavItem:a??{route:""},data:r});return s.map(t=>t._type==="navbarTournamentsItem"?{...n,_key:t._key,title:t.title}:t)},vs=({model:s,isOpen:r,expandedSectionKey:o,onToggleSection:a,onClose:n,location:t="mobile-drawer"})=>{const{pathname:i}=k(),c=Ie(s);return e.jsx(_,{as:"div",show:r,enter:"transition-opacity duration-200 ease-in-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity delay-100 duration-200 ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",className:"z-navbarMenu bg-background-100/60 fixed inset-x-0 top-15 bottom-0 backdrop-blur-sm",onClick:n,children:e.jsxs(_,{as:"div",show:r,enter:"transition-transform duration-200 ease-in-out",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transition-transform duration-200 ease-in-out",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",className:"bg-background-95 no-scrollbar ml-auto flex h-full w-72 flex-col gap-5 overflow-y-auto p-4",onClick:d=>d.stopPropagation(),children:[e.jsx(xs,{isAuthenticated:s.isAuthenticated,onNavigate:n,location:t}),e.jsxs("div",{className:"flex flex-col gap-7",children:[e.jsx(bs,{onOpen:n,location:t}),e.jsx(O,{onClick:()=>{l.navbarItemClicked({location:t,label:"home",href:s.homeRoute}),n()},className:"w-fit",children:e.jsxs("span",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"font-style-label-l2 uppercase",children:"Home"}),e.jsx("span",{className:h("bg-foreground-100 block h-1 w-full",{"opacity-0":i!==s.homeRoute})})]})}),c.map(d=>e.jsx(ys,{item:d,isExpanded:o===d._key,onToggle:()=>a(d._key),onNavigate:n,location:t},d._key)),s.gameId==="rl"&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(ms,{onClick:()=>{l.navbarItemClicked({location:t,label:"rl-profile",href:"/rl/user"}),n()}}),e.jsx("span",{className:"contents",onClickCapture:()=>l.navbarItemClicked({location:t,label:"discord"}),children:e.jsx(gs,{})})]})]})]})})},H="desktop-drawer",$e="bg-background-90 border-background-85 redesign:border-[#B2B4BA] redesign-dark:border-[#4D515D] redesign:gap-3 redesign:bg-transparent redesign:p-3 flex w-full items-center gap-2.5 rounded-large border border-solid p-2.5",js=({onNavigate:s})=>{const{data:r}=j(),{data:o,isLoading:a}=B(),n=g.useMemo(()=>{if(r?.avatarId)return N("avatars",S(r.avatarId,"3d"),{height:200})},[r]);return e.jsxs("div",{className:$e,children:[e.jsx("div",{className:"bg-background-85 redesign-dark:bg-background-80 rounded-large redesign:p-5 flex size-25 shrink-0 items-center justify-center p-2.5",children:n?e.jsx("img",{alt:"",src:n,className:"redesign:size-15 size-20 object-contain"}):e.jsx(x,{icon:"anonUser",className:"text-neutral redesign:text-foreground-100 redesign:[&_path]:stroke-current redesign:[&_circle]:stroke-current redesign:size-15 size-14"})}),e.jsxs("div",{className:"redesign:gap-2 flex min-w-0 flex-1 flex-col items-start gap-3",children:[r?.username&&e.jsx("span",{className:"font-style-heading-h4 redesign:font-style-heading-h1 w-full truncate",children:r.username}),e.jsxs(p,{to:"/profile/redeem",onClick:()=>{l.navbarItemClicked({location:H,label:"points",href:"/profile/redeem"}),s()},className:"bg-background-85 border-background-80 redesign:bg-transparent redesign:border-0 redesign:p-0 redesign:flex-row-reverse flex items-center gap-1 rounded-full border border-solid px-2 py-1",children:[e.jsx(x,{icon:"blastCoin",className:"text-primary-100 redesign:size-5 size-3.5"}),a?e.jsx("span",{className:"bg-background-80 block h-4 w-10 animate-pulse rounded-full"}):e.jsx("span",{className:"font-style-body-b3 redesign:font-style-heading-h1",children:o?.amount.toLocaleString()})]}),e.jsx(p,{to:"/profile",onClick:()=>{l.navbarItemClicked({location:H,label:"manage-profile",href:"/profile"}),s()},className:"font-style-label-l3 redesign:font-style-label-l1 text-primary-100 redesign:bg-primary-100 redesign:hover:bg-[#265DF2] redesign:active:bg-[#002690] redesign:rounded-full redesign:px-2 redesign:py-1 redesign:text-white redesign:normal-case uppercase transition-colors",children:"Manage Profile"})]})]})},Ns=()=>{const s=D();return e.jsxs("div",{className:$e,children:[e.jsx("div",{className:"bg-background-85 redesign-dark:bg-background-80 rounded-large redesign:p-5 flex w-25 shrink-0 items-center justify-center self-stretch p-2",children:e.jsx(x,{icon:"anonUser",className:"text-neutral redesign:text-foreground-100 redesign:[&_path]:stroke-current redesign:[&_circle]:stroke-current redesign:size-15 size-14"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[e.jsxs("div",{className:"redesign:gap-2 flex flex-col gap-1",children:[e.jsx("span",{className:"font-style-body-b3 redesign:font-style-label-l1 text-foreground-95 redesign:text-foreground-100",children:"Create an account"}),e.jsx("span",{className:"font-style-body-b2 redesign:font-style-body-b3",children:"Follow the action, play minigames, stay in the loop."})]}),e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:H,label:"signup"}),s()},className:"button redesign:font-style-label-l1 redesign:h-auto redesign:w-auto redesign:px-2 redesign:py-1 redesign:normal-case h-8 w-full",children:"Sign up"})]})]})},ws=({isAuthenticated:s,onNavigate:r})=>s?e.jsx(js,{onNavigate:r}):e.jsx(Ns,{}),L=({isActive:s})=>e.jsx("span",{className:h("absolute inset-x-0 bottom-0 h-1 transition-opacity",{"bg-primary-100":s,"bg-foreground-100 redesign:bg-primary-100 opacity-0 group-hover:opacity-100":!s})}),F="desktop-drawer",W="font-style-label-l1 hover:text-foreground-95 redesign:font-style-heading-h1 redesign:gap-2.5 redesign:px-0 redesign:normal-case group relative flex h-full items-center gap-1.5 px-2 text-left uppercase transition-colors",Cs=({item:s,isExpanded:r,onToggle:o,onNavigate:a})=>{const{pathname:n,search:t}=k(),i=`${n}${t}`,c=s.children??[],d=c.length>0,u=d?ke(s,i):!!(s.route&&i.includes(s.route));return e.jsxs("div",{className:"flex w-full flex-col",children:[e.jsx("div",{className:"redesign:h-12.5 flex h-15 w-full items-center",children:d?e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:F,label:`${s.title} (${r?"collapse":"expand"})`}),o()},"aria-expanded":r,className:W,children:[e.jsx("span",{children:s.title}),e.jsx(I,{className:h("redesign:text-foreground-100 redesign:size-3 size-2.5 transition-transform",{"text-primary-100 rotate-180":r,"text-foreground-90":!r})}),e.jsx(L,{isActive:u})]}):e.jsxs(v,{navbarItem:s,onClick:()=>{l.navbarItemClicked({location:F,label:s.title,href:s.route??s.externalLink}),a()},className:W,children:[e.jsx("span",{children:s.title}),e.jsx(L,{isActive:u})]})}),e.jsx(Z,{initial:!1,children:r&&d&&e.jsx(Q.div,{initial:{height:0,opacity:0}
1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"flex w-full flex-col overflow-hidden",children:c.map((m,b)=>e.jsx(Se,{navbarItem:m,onNavLinkClick:a,trackLocation:F},m._key??b))})})]})},C="desktop-drawer",Ls=()=>{const s=Re();return e.jsx(pe,{fallback:e.jsx(e.Fragment,{children:"(Ctrl + K)"}),children:()=>e.jsx(e.Fragment,{children:s==="mac"?"(â + K)":"(Ctrl + K)"})})},Ss=({onOpen:s})=>{const{openSearch:r}=he();return e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:C,label:"search"}),s(),r()},className:"border-primary-100 bg-background-90 hover:bg-background-85 redesign:bg-transparent redesign-dark:border-[#7096FF] redesign:hover:bg-background-90 redesign-dark:hover:bg-background-85 flex h-12.5 w-full items-center justify-between rounded-full border border-solid px-5 transition-colors",children:[e.jsxs("span",{className:"font-style-body-b2 redesign:font-style-heading-h3",children:["Search ",e.jsx(Ls,{})]}),e.jsx(x,{icon:"magnifyingGlass",className:"redesign:fill-primary-100 redesign-dark:fill-[#7096FF] redesign:size-4.5 size-5 shrink-0"})]})},Is=({onNavigate:s})=>e.jsxs(p,{to:"/rl/user",onClick:()=>{l.navbarItemClicked({location:C,label:"rl-profile",href:"/rl/user"}),s()},className:"bg-background-90 border-background-80 hover:bg-background-85 redesign:bg-background-95 redesign-dark:bg-background-90 redesign:border-[#B2B4BA] redesign-dark:border-[#4D515D] redesign:hover:bg-background-90 redesign-dark:hover:bg-background-85 redesign:h-10 redesign:gap-2 redesign:py-0 flex h-15 w-full items-center gap-3 rounded-full border border-solid px-5 py-2 transition-colors",children:[e.jsx("img",{src:J,className:"redesign:h-7.5 redesign:w-9 h-full w-auto object-contain",alt:""}),e.jsx("span",{className:"font-style-label-l2 redesign:font-style-heading-h3 redesign:normal-case uppercase",children:"Search for your profile"})]}),Ae=({model:s,isOpen:r,expandedSectionKey:o,onToggleSection:a,onClose:n})=>{const t=Ie(s);return e.jsx(_,{as:"div",show:r,enter:"transition-opacity duration-200 ease-in-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity delay-100 duration-200 ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",className:"z-navbarMenu bg-background-100/60 fixed inset-0 backdrop-blur-sm",onClick:n,children:e.jsxs(_,{as:"div",show:r,enter:"transition-transform duration-200 ease-in-out",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transition-transform duration-200 ease-in-out",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",className:"bg-background-95 redesign-dark:bg-background-90 no-scrollbar redesign:gap-5 redesign:p-5 redesign:max-sd:w-full ml-auto flex h-full w-100 flex-col gap-2.5 overflow-y-auto p-6",onClick:i=>i.stopPropagation(),children:[e.jsx("div",{className:"redesign:p-0 flex w-full items-center justify-end p-2",children:e.jsx("button",{"aria-label":"Close Menu",onClick:()=>{l.navbarItemClicked({location:C,label:"close-menu"}),n()},className:"redesign:border-foreground-100 redesign:size-7.5 redesign:rounded-full redesign:border flex size-10 items-center justify-center",children:e.jsx(Ge,{className:"redesign:size-4 size-6"})})}),e.jsxs("div",{className:"flex w-full flex-col gap-5",children:[e.jsx(ws,{isAuthenticated:s.isAuthenticated,onNavigate:n}),e.jsx(Ss,{onOpen:n}),s.gameId==="rl"&&e.jsx(Is,{onNavigate:n})]}),e.jsxs("div",{className:"redesign:gap-3 flex w-full flex-col gap-2.5",children:[e.jsx(O,{onClick:()=>{l.navbarItemClicked({location:C,label:"home",href:s.homeRoute}),n()},className:"redesign:h-12.5 flex h-15 w-full shrink-0 items-center",children:e.jsxs("span",{className:W,children:["Home",e.jsx(L,{isActive:s.isHome})]})}),t.map(i=>e.jsx(Cs,{item:i,isExpanded:o===i._key,onToggle:()=>a(i._key),onNavigate:n},i._key)),s.gameId==="rl"&&e.jsx("div",{className:"flex h-15 w-full shrink-0 items-center p-2",children:e.jsx("span",{className:"contents",onClickCapture:()=>l.navbarItemClicked({location:C,label:"discord"}),children:e.jsx(ds,{})})})]})]})})},$s=(s=8)=>{const[r,o]=g.useState(!1);return g.useEffect(()=>{const a=()=>{const n=window.scrollY>s;o(t=>t===n?t:n)};return a(),window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[s]),r},As="/ssr-assets/2024-10-15/logo-christmas-K9MHsb5G.svg",_e=({className:s})=>g.useMemo(()=>A.utc().month===12,[])?e.jsx("img",{className:h("size-full",s),alt:"Home",src:As}):e.jsx("svg",{viewBox:"0 0 26 30",fill:"none",role:"img","aria-label":"Home",className:h("redesign:text-foreground-100 size-full text-white",s),children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8233 0L10.8688 6.15782L20.2874 13.4723L13.8233 0ZM12.5626 17.1676L18.367 16.6396L17.4623 14.7538L7.86423 7.29977L2.69927 18.0645L9.03341 17.4884L10.875 13.65L12.5626 17.1676ZM14.4962 19.6912L20.3007 19.1633L25.5 30H0L4.51005 20.5996L10.8442 20.0232L8.66156 24.5728H16.8384L14.4962 19.6912Z",fill:"currentColor"})}),ee="flex h-9 shrink-0 items-center rounded-full px-3 transition-colors",se="mobile-top-games",_s=({games:s,activeGameId:r})=>e.jsxs("div",{className:"no-scrollbar redesign:gap-3 flex min-w-0 items-center gap-1 overflow-x-auto",children:[e.jsx(O,{className:"shrink-0",onClick:()=>l.navbarItemClicked({location:se,label:"home",href:"/"}),children:e.jsx("span",{className:G(h(ee,"redesign:h-10")),children:e.jsx("span",{className:"redesign:bg-background-95 redesign-dark:bg-background-90 redesign:size-10 redesign:rounded-full redesign:p-2.5 flex h-6 w-5 items-center justify-center",children:e.jsx(_e,{})})})}),s.map(o=>e.jsx(p,{to:`/${o}`,"aria-label":M[o],"aria-current":o===r?"page":void 0,onClick:()=>l.navbarItemClicked({location:se,label:o,href:`/${o}
1`}),className:G(h(ee,"redesign:size-10 redesign:justify-center redesign:px-0 px-2.5",{"bg-background-85 redesign:bg-background-95 redesign-dark:bg-background-85":o===r})),children:e.jsx(T,{gameId:o,colored:!0,className:"size-5 shrink-0"})},o))]}),re="mobile-top-sections",V=s=>s._type==="navbarTournamentsItem"||!!("children"in s&&s.children?.length),Te=(s,r,o)=>{let a=null,n=-1;for(const t of s){if(V(t))continue;const i=t.route;if(!i)continue;(i.includes("?")?o===i:r===i||r.startsWith(`${i}/`))&&i.length>n&&(a=t._key,n=i.length)}return a},Ts=({items:s,onOpenSection:r,className:o})=>{const{pathname:a,search:n}=k(),t=Te(s,a,`${a}${n}`);return e.jsx("div",{className:h("bg-background-95 no-scrollbar px-content redesign:justify-start redesign:gap-7.5 redesign:px-5 flex h-15 items-center justify-between gap-4 overflow-x-auto px-7",o),children:s.map(i=>{const c=e.jsx("span",{className:"font-style-label-l3 redesign:font-style-heading-h3 redesign:normal-case whitespace-nowrap",children:i.title});return V(i)?e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:re,label:i.title}),r(i._key)},"aria-expanded":!1,className:"relative flex h-full shrink-0 items-center gap-1.5",children:[c,e.jsx(I,{className:"text-foreground-90"})]},i._key):e.jsxs(v,{navbarItem:i,onClick:()=>l.navbarItemClicked({location:re,label:i.title,href:i.route??("externalLink"in i?i.externalLink:void 0)}),className:"relative flex h-full shrink-0 items-center",children:[c,i._key===t&&e.jsx("span",{className:"bg-foreground-100 redesign:bg-primary-100 absolute inset-x-0 bottom-0 h-1"})]},i._key)})})},Ms=({detailNav:s,location:r})=>e.jsxs("div",{className:"bg-background-100 px-content flex h-10 items-center justify-between py-2",children:[e.jsx(He,{fallback:s.backFallback,location:r}),e.jsx(Ee,{}),e.jsx(We,{className:"size-5",umamiLocation:s.shareLocation,analytics:{category:"RL Nav",label:s.shareLocation}})]}),w="mobile-top",zs=()=>{const{data:s}=j(),r=g.useMemo(()=>{if(s?.avatarId)return N("avatars",S(s.avatarId,"3d"),{height:200})},[s]);return e.jsx(p,{to:"/profile","aria-label":"Profile",onClick:()=>l.navbarItemClicked({location:w,label:"avatar",href:"/profile"}),className:"redesign:border-[#D9D9D9] redesign-dark:border-background-80 redesign:size-10 flex size-9 shrink-0 items-center justify-center rounded-full border border-solid border-white",children:r?e.jsx("img",{alt:"",src:r,className:"size-6 rounded-full"}):e.jsx(x,{icon:"anonUser",className:"redesign:text-foreground-100 redesign:[&_path]:stroke-current redesign:[&_circle]:stroke-current size-6"})})},Ds=({model:s,isMenuOpen:r,expandedSectionKey:o,onToggleMenu:a,onOpenSection:n,onToggleSection:t,onCloseMenu:i,className:c})=>{const{openModal:d}=K(),u=$s(),m=s.sectionItems.length>0,b=ge(),y=Ue(b),$=me(b)!==void 0;return e.jsxs("div",{className:h("relative flex flex-col transition-shadow duration-200 ease-out",{"shadow-background-100 shadow-lg":u},c),children:[e.jsxs("div",{className:"bg-background-100 px-content flex h-15 items-center gap-3",children:[e.jsx(_s,{games:s.games,activeGameId:s.gameId}),e.jsxs("div",{className:"redesign:gap-2.5 ml-auto flex shrink-0 items-center gap-2",children:[s.isAuthenticated?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"contents",onClickCapture:()=>l.navbarItemClicked({location:w,label:"points-notification"}),children:e.jsx(je,{})}),e.jsx(zs,{})]}):e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:w,label:"login"}),d()},className:"font-style-label-l3 text-primary-100 flex h-9 shrink-0 items-center px-2 whitespace-nowrap",children:"Log in"}),e.jsx("button",{"aria-label":r?"Close Menu":"Open Menu","aria-expanded":r,onClick:()=>{l.navbarItemClicked({location:w,label:r?"close-menu":"open-menu"}),a()},className:"redesign:bg-background-95 redesign-dark:bg-background-90 redesign:size-10 redesign:justify-center redesign:rounded-full redesign:px-0 flex h-9 shrink-0 items-center px-3",children:e.jsx(x,{icon:"burgerMenu",className:"redesign:size-5 size-6"})})]})]}),y?e.jsx(Ms,{detailNav:y,location:w}):m?e.jsx(Ts,{items:s.sectionItems,onOpenSection:n}):e.jsx("style",{children:":root{--nav-height-mobile:var(--nav-height-mobile-single-bar)}
1"}),y&&e.jsx("style",{children:":root{--nav-height-mobile:var(--nav-height-mobile-detail-bar)}"}),$?e.jsx(Ae,{model:s,isOpen:r,expandedSectionKey:o,onToggleSection:t,onClose:i}):e.jsx(vs,{model:s,isOpen:r,expandedSectionKey:o,onToggleSection:t,onClose:i})]})},Os=({navbarItems:s,subNavItems:r,tournamentTimeline:o,className:a})=>{const n=ve(),t=ye({navbarItems:s,subNavItems:r,tournamentTimeline:o});return e.jsx(Ds,{model:t,className:a,isMenuOpen:n.isMenuOpen,expandedSectionKey:n.expandedSectionKey,onToggleMenu:n.toggleMenu,onOpenSection:n.openSection,onToggleSection:n.toggleSection,onCloseMenu:n.closeMenu})},Bs=()=>{const{data:s,isLoading:r}=B();return e.jsxs("a",{href:"/profile/redeem",className:"bg-background-90 hover:bg-background-85 flex items-center justify-between gap-2 rounded-full px-2 py-1 transition-all duration-200 ease-in-out",children:[e.jsx(x,{icon:"blastCoin",className:"text-primary-100"}),r?e.jsx("span",{className:"bg-background-80 block h-4 w-12 animate-pulse rounded-full"}):e.jsx("span",{className:"font-style-label-l2 text-white",children:s?.amount.toLocaleString()})]})},Ps="desktop-top-games",Fs=({games:s,activeGameId:r})=>{const o=De();return e.jsxs(Ze,{value:r,onChange:a=>{l.navbarItemClicked({location:Ps,label:a,href:`/${a}`}),o(`/${a}`)},children:[e.jsxs(Qe,{className:"bg-background-90 redesign:bg-background-95 redesign-dark:bg-background-85 redesign:w-43 redesign:rounded-large redesign:hover:bg-background-90 redesign-dark:hover:bg-background-80 relative flex h-10 w-48 shrink-0 items-center gap-2 rounded px-3 transition-colors",children:[e.jsx(T,{gameId:r,colored:!0,className:"redesign:size-5 size-4 shrink-0"}),e.jsx("span",{className:"font-style-label-l3 redesign:font-style-heading-h3 redesign:normal-case truncate pr-3 uppercase",children:M[r]}),e.jsx(I,{className:"text-foreground-90 pointer-events-none absolute top-1/2 right-3 size-2 -translate-y-1/2"})]}),e.jsx(Je,{anchor:"bottom",transition:!0,className:h("z-navbar bg-background-90 redesign:bg-background-100 redesign:rounded-large redesign:[--anchor-gap:0.5rem] w-[var(--button-width)] rounded [--anchor-gap:0.25rem] focus:outline-hidden","origin-top transition duration-150 ease-out data-[closed]:-translate-y-4 data-[closed]:opacity-0 data-[leave]:data-[closed]:opacity-0","shadow-background-100/50 redesign:shadow-none shadow-xl"),children:s.map(a=>e.jsxs(Ve,{value:a,className:"data-[focus]:bg-background-85 redesign:data-[focus]:bg-background-90 redesign-dark:data-[focus]:bg-background-85 redesign:rounded-large redesign:h-10 redesign:py-0 flex cursor-pointer items-center gap-2 px-3 py-3 transition-all data-[selected]:hidden",children:[e.jsx(T,{gameId:a,colored:!0,className:"redesign:size-5 size-4 shrink-0"}),e.jsx("span",{className:"font-style-label-l3 redesign:font-style-heading-h3 redesign:normal-case uppercase",children:M[a]})]},a))})]})},Me=4,R="desktop-account-bar",z="redesign:size-7.5 redesign:lg:size-7.5 size-6 shrink-0 lg:size-8",ne=`${z} bg-background-85 redesign-dark:bg-background-80 flex items-center justify-center rounded-full`,ae=({title:s,items:r,addHref:o})=>{const a=r.slice(0,Me),n=r.length-a.length;return e.jsx("div",{className:"border-background-85 redesign-dark:border-background-80 redesign:bg-background-100 redesign:px-3 redesign:py-2 redesign:lg:px-3 redesign:lg:py-2 flex h-16 min-w-32 shrink-0 items-center rounded-lg border p-5 lg:p-4",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[a.map(t=>e.jsx(P,{enterDelay:200,content:t.name,children:e.jsx(p,{to:t.href,"aria-label":t.name,onClick:()=>l.navbarItemClicked({location:R,label:`favorite:${s}`,href:t.href}),className:`${z} transition-transform hover:scale-110`,children:t.image})},t.id)),n>0&&e.jsx(P,{enterDelay:200,content:`${n} more in your profile`,children:e.jsxs(p,{to:"/profile","aria-label":`${n} more ${s.toLowerCase()} in your profile`,onClick:()=>l.navbarItemClicked({location:R,label:`favorite:${s}:more`,href:"/profile"}),className:`${ne} font-style-body-b2`,children:["+",n]})}),n===0&&e.jsx(P,{enterDelay:200,content:`Add favorite ${s.toLowerCase()}`,children:e.jsx(p,{to:o,"aria-label":`Add favorite ${s.toLowerCase()}`,onClick:()=>l.navbarItemClicked({location:R,label:`favorite:${s}:add`,href:o}),className:`${ne} hover:bg-background-80 redesign-dark:hover:bg-[#404452] transition-colors`,children:e.jsx(rs,{className:"redesign:size-3 redesign:lg:size-3 size-4 lg:size-5"})})})]})})},Rs="desktop-account-bar",Gs=({iconOnly:s=!1})=>e.jsxs(p,{to:"/rl/user",title:"Search for your profile",onClick:()=>l.navbarItemClicked({location:Rs,label:"rl-profile",href:"/rl/user"}),className:h("bg-background-90 border-background-80 hover:bg-background-85 redesign:bg-background-95 redesign-dark:bg-background-90 redesign:border-[#B2B4BA] redesign-dark:border-[#4D515D] redesign:hover:bg-background-90 redesign-dark:hover:bg-background-85 redesign:h-10 redesign:gap-2 flex h-11 shrink-0 items-center gap-1.5 rounded-full border px-3 transition-colors",s?"redesign:px-4":"redesign:px-5 redesign:max-xl:px-4"),children:[e.jsx("img",{src:J,className:"redesign:h-7.5 redesign:w-9 h-6 w-7 object-contain",height:24,width:28,alt:""}),e.jsx(x,{icon:"magnifyingGlass",className:h("fill-primary-100 hidden size-3 shrink-0",s?"redesign:block":"redesign:max-xl:block")}),e.jsx("span",{className:h("font-style-label-l3 redesign:font-style-heading-h3 redesign:normal-case whitespace-nowrap uppercase max-xl:hidden",{"redesign:hidden":s}),children:"Search for your profile"})]}),Hs=s=>s.stats.some(r=>r.icon==="fire"),Ws=(s,r,o)=>{const a=s.filter(n=>n.gameId===o&&Hs(n));return a.length===0?null:a.reduce((n,t)=>{const i=r?.find(d=>d.game===t.game&&d.mode===t.mode),c=i?i.currentWinStreak||i.longestWinStreak:0;return c>n.streak?{card:t,streak:c}:n},{card:a[0],streak:0})},Us="desktop-account-bar",Es=({gameId:s})=>{const{userId:r}=E(),{data:o,isLoading:a}=es({userId:r}),n=g.useMemo(()=>Ws(ss,o?.games,s),[o?.games,s]);if(!n)return null;const{card:t,streak:i}=n;return e.jsxs(p,{to:t.link,onClick:()=>l.navbarItemClicked({location:Us,label:`streak:${t.game}`,href:t.link}),className:"border-background-80 redesign:border-background-85 redesign-dark:border-background-80 redesign:bg-background-100 redesign:w-31.5 hover:bg-background-90 flex h-16 w-32 shrink-0 flex-col justify-between rounded-lg border p-2 transition-colors",children:[e.jsx("span",{className:"font-style-body-b2 redesign:font-style-body-b3 truncate",children:t.title}),a?e.jsx("span",{className:"bg-background-85 block h-5 w-12 animate-pulse rounded"}):i>0?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ns,{className:"h-4 w-auto shrink-0"}),e.jsx("span",{className:"font-style-heading-h4 redesign:font-style-heading-h3",children:i})]}):e.jsx("span",{className:"font-style-label-l2 text-primary-100 uppercase",children:"Play"})]})},U=({children:s,className:r})=>e.jsx("span",{className:G("font-style-label-l4 redesign:text-[10px] redesign:leading-3 redesign:font-normal text-foreground-90 redesign:text-foreground-100 redesign-dark:text-[#B2B4BA] redesign:flex redesign:w-3 redesign:justify-center shrink-0 -rotate-90 whitespace-nowrap uppercase",r),children:s}),Ks="desktop-account-bar",Zs=s=>s==="cs"||s==="rl",Qs=()=>{const{data:s}=j(),{data:r,isLoading:o}=B(),a=g.useMemo(()=>
1{if(s?.avatarId)return N("avatars",S(s.avatarId,"3d"),{height:200})},[s]),n=s?.country??s?.location??"xx";return e.jsxs(p,{to:"/profile","aria-label":"Profile",onClick:()=>l.navbarItemClicked({location:Ks,label:"profile",href:"/profile"}),className:"redesign:gap-3 flex min-w-0 shrink-0 items-center gap-4",children:[a?e.jsx("img",{alt:"",src:a,className:"size-15 shrink-0 object-contain",height:60,width:60}):e.jsx(x,{icon:"anonUser",className:"text-neutral redesign:text-foreground-100 redesign:[&_path]:stroke-current redesign:[&_circle]:stroke-current size-15 shrink-0"}),e.jsxs("span",{className:"redesign:gap-1 flex min-w-0 flex-col gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(xe,{countryCode:n,widthPx:21,hideTitle:!0,className:"redesign:order-last shrink-0"}),e.jsx("span",{className:"font-style-heading-h4 redesign:font-style-heading-h3 max-w-40 truncate",children:s?.username})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{icon:"blastCoin",className:"text-primary-100 size-4 shrink-0"}),o?e.jsx("span",{className:"bg-background-85 block h-4 w-10 animate-pulse rounded-full"}):e.jsx("span",{className:"font-style-heading-h5 redesign:font-style-heading-h3",children:r?.amount.toLocaleString()})]})]})]})},Js=({gameId:s})=>{const{teams:r}=be(s),{players:o}=fe(s);return e.jsxs(e.Fragment,{children:[e.jsx(U,{children:"Teams"}),e.jsx(ae,{title:"Teams",addHref:`/${s}/team`,items:r.map(a=>({id:a.id,name:a.name,href:Xe({gameId:s,id:a.id,shortName:a.shortName??a.name}),image:e.jsx("img",{src:Ye({id:a.id,height:64,format:"auto"}),alt:a.name,className:`${z} team-logo-halo object-contain`,height:32,width:32})}))}),e.jsx(U,{children:"Players"}),e.jsx(ae,{title:"Players",addHref:`/${s}/player`,items:o.map(a=>({id:a.id,name:a.nickname,href:qe({gameId:s,playerId:a.id,playerNickname:a.nickname}),image:e.jsx("span",{className:`${z} bg-background-85 block overflow-hidden rounded-full`,children:e.jsx("img",{src:N("players",a.id,{height:128,format:"auto"}),alt:a.nickname,className:"size-full origin-top scale-150 object-cover object-top",height:32,width:32})})}))})]})},te=Me-1,Vs=()=>{const{teams:s}=be("rl"),{players:r}=fe("rl"),o=s.length>=te&&r.length>=te;return e.jsx(Gs,{iconOnly:o})},qs=({gameId:s})=>e.jsxs("div",{className:"no-scrollbar redesign:gap-5 redesign:lg:gap-5 flex w-full items-center gap-8 overflow-x-auto lg:gap-10",children:[e.jsx(Qs,{}),e.jsxs("div",{className:"redesign:gap-3 flex min-w-0 items-center",children:[(s==="cs"||s==="dota"||s==="rl")&&e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"max-lg:hidden",children:"Stats"}),e.jsx(Es,{gameId:s})]}),Zs(s)&&e.jsx(Js,{gameId:s})]}),s==="rl"&&e.jsx("div",{className:"ml-auto shrink-0",children:e.jsx(Vs,{})})]}),oe="desktop-account-bar",Xs=()=>{const{openModal:s}=K(),r=D(),o=me(ge())!==void 0,a=e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:oe,label:"signup"}),r()},className:"button redesign:normal-case redesign:h-10 h-9 px-5 whitespace-nowrap uppercase",children:"Sign Up"},"signup"),n=e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:oe,label:"login"}),s()},className:o?"button-tertiary whitespace-nowrap":"font-style-label-l4 text-primary-100 hover:text-foreground-100 flex h-9 items-center px-5 whitespace-nowrap uppercase transition-colors",children:"Log In"},"login");return e.jsxs("div",{className:"bg-background-90 border-background-80 redesign:bg-background-100 redesign:border-background-85 redesign-dark:border-background-80 flex w-full items-center justify-between gap-5 rounded-lg border px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"bg-background-85 redesign:bg-primary-100 flex size-10 shrink-0 items-center justify-center rounded-full",children:e.jsx(x,{icon:"anonUser",className:"text-foreground-90 redesign:text-white size-6"})}),e.jsx("span",{className:"font-style-heading-h4 redesign:font-style-heading-h3 truncate",children:"Follow your favorite teams, players and play our daily games!"})]}),e.jsx("div",{className:"redesign:gap-3 flex shrink-0 items-center gap-2",children:o?[n,a]:[a,n]})]})},Ys=({gameId:s,isAuthenticated:r})=>e.jsx("div",{className:"bg-background-95 redesign-dark:bg-background-90 px-content py-3",children:e.jsx("div",{className:"redesign:max-w-[970px] mx-auto flex h-16 w-full max-w-7xl items-center",children:r?e.jsx(qs,{gameId:s}):e.jsx(Xs,{})})}),er="desktop-top-games",sr=({games:s}
1)=>e.jsx("div",{className:"flex items-center gap-8",children:s.map(r=>e.jsxs(p,{to:`/${r}`,onClick:()=>l.navbarItemClicked({location:er,label:r,href:`/${r}`}),className:"hover:bg-background-90 flex h-9 shrink-0 items-center gap-2 rounded-full px-2 transition-colors",children:[e.jsx(T,{gameId:r,colored:!0,className:"size-5 shrink-0"}),e.jsx("span",{className:"font-style-label-l3 whitespace-nowrap uppercase",children:M[r]})]},r))}),ie="desktop-top-sections",le="hover:text-foreground-95 redesign:px-0 group relative flex h-full shrink-0 items-center px-2 transition-colors",rr=({items:s,onOpenSection:r})=>{const{pathname:o,search:a}=k(),n=Te(s,o,`${o}${a}`);return e.jsx("div",{className:"no-scrollbar redesign:gap-7.5 flex h-full min-w-0 items-center gap-5 overflow-x-auto",children:s.map(t=>{const i=e.jsx("span",{className:"font-style-label-l3 redesign:font-style-heading-h3 redesign:normal-case whitespace-nowrap uppercase",children:t.title});return V(t)?e.jsxs("button",{onClick:()=>{l.navbarItemClicked({location:ie,label:t.title}),r(t._key)},"aria-expanded":!1,className:`${le} gap-1.5`,children:[i,e.jsx(I,{className:"text-foreground-90"}),e.jsx(L,{isActive:!1})]},t._key):e.jsxs(v,{navbarItem:t,onClick:()=>l.navbarItemClicked({location:ie,label:t.title,href:t.route??("externalLink"in t?t.externalLink:void 0)}),className:le,children:[i,e.jsx(L,{isActive:t._key===n})]},t._key)})})},nr="desktop-nav",ar=()=>{const{data:s}=j(),r=g.useMemo(()=>{if(s?.avatarId)return N("avatars",S(s.avatarId,"3d"),{height:200})},[s]),o=s?.country??s?.location??"xx";return e.jsxs(p,{to:"/profile","aria-label":"Profile",onClick:()=>l.navbarItemClicked({location:nr,label:"profile",href:"/profile"}),className:"border-neutral flex h-9 items-center gap-2 rounded-full border border-solid px-3",children:[r?e.jsx("img",{alt:"avatar",src:r,id:s?.avatarId,className:"size-6 shrink-0 scale-125 rounded-full"}):e.jsx(x,{icon:"anonUser",className:"size-6 shrink-0"}),e.jsx(xe,{countryCode:o,widthPx:21,hideTitle:!0,className:"shrink-0"}),s?.username&&e.jsx("span",{className:"font-style-body-b2 max-w-32 truncate",children:s.username})]})},ce="desktop-nav",tr=()=>{const{openModal:s}=K(),r=D();return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:ce,label:"login"}),s()},className:"font-style-label-l3 text-foreground-100 hover:text-foreground-95 flex h-9 items-center px-3 whitespace-nowrap uppercase transition-all",children:"Log in"}),e.jsx("button",{onClick:()=>{l.navbarItemClicked({location:ce,label:"signup"}),r()},className:"button h-9 px-5 whitespace-nowrap uppercase",children:"Sign Up"})]})},de="desktop-nav",or=({isAuthenticated:s})=>s?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{}),e.jsx(Bs,{}),e.jsx(ar,{})]}):e.jsx(tr,{}),ir=({navbarItems:s,subNavItems:r,tournamentTimeline:o,className:a})=>{const n=ve(),t=ye({navbarItems:s,subNavItems:r,tournamentTimeline:o}),i=t.navbarItems.length>0;return e.jsxs("div",{className:h("flex flex-col",a),children:[e.jsx("div",{className:"bg-background-100 px-content flex h-15 items-center",children:e.jsxs("div",{className:"redesign:max-w-[970px] redesign:gap-7.5 mx-auto flex h-full w-full max-w-7xl items-center gap-5",children:[e.jsxs("div",{className:"redesign:gap-3 flex h-full shrink-0 items-center gap-5",children:[e.jsx(O,{className:"shrink-0",onClick:()=>l.navbarItemClicked({location:de,label:"home",href:"/"}),children:e.jsx("span",{className:"redesign:bg-background-95 redesign-dark:bg-background-90 redesign:size-10 redesign:rounded-full redesign:p-2.5 flex h-7 w-6 items-center justify-center",children:e.jsx(_e,{})})}),t.gameId?e.jsx(Fs,{games:t.games,activeGameId:t.gameId}):e.jsx(sr,{games:t.games})]}),t.gameId&&e.jsx(rr,{items:t.sectionItems,onOpenSection:n.openSection}),e.jsxs("div",{className:"redesign:gap-3 ml-auto flex shrink-0 items-center gap-5",children:[e.jsx(Ke,{className:"redesign:h-10 redesign:w-auto redesign:gap-2 redesign:px-5 h-9 w-44 justify-between max-lg:w-9 max-lg:justify-center max-lg:px-0",textClassName:"max-lg:hidden"}),!t.gameId&&e.jsx(or,{isAuthenticated:t.isAuthenticated}),i&&e.jsx("button",{"aria-label":n.isMenuOpen?"Close Menu":"Open Menu","aria-expanded":n.isMenuOpen,onClick:()=>{l.navbarItemClicked({location:de,label:n.isMenuOpen?"close-menu":"open-menu"}),n.toggleMenu()},className:"bg-background-95 redesign-dark:bg-background-90 redesign:size-10 redesign:hover:bg-background-90 redesign-dark:hover:bg-background-85 flex size-12 shrink-0 items-center justify-center rounded-full transition-colors",children:e.jsx(x,{icon:"burgerMenuFull",className:"redesign:size-5 size-6"})})]})]})}),t.gameId&&e.jsxs(e.Fragment,{children:[e.jsx(Ys,{gameId:t.gameId,isAuthenticated:t.isAuthenticated}),e.jsx("style",{children:":root{--nav-height-desktop:var(--nav-height-desktop-double-bar)}"})]}),e.jsx(Ae,{model:t,isOpen:n.isMenuOpen,expandedSectionKey:n.expandedSectionKey,onToggleSection:n.toggleSection,onClose:n.closeMenu})]})},Jr=({navbarItems:s,subNavItems:r,tournamentTimeline:o})=>e.jsxs("nav",{className:"z-navbar fixed top-0 w-screen",children:[e.jsx(Os,{navbarItems:s??[],subNavItems:r,tournamentTimeline:o,className:"sd:hidden"}),e.jsx(ir,{navbarItems:s??[],subNavItems:r,tournamentTimeline:o,className:"max-sd:hidden"})]});
1export{Jr as N};
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.