1import{r as o,j as t,i as C}from"./vendor-react-BGN68_Lp.js";import{g as a,E}from"./vendor-styled-pkIKgjgv.js";import{u as R,r as S,M as D,k as L,p as B,l as Y,m as j,n as z,b as O,S as P,g as G,j as H,o as U}from"./index-uear5Vpj.js";import{u as q,T as J,a as g}from"./PlayerActionMenu.styles-B06VDehf.js";import{A as W,D as F,a as K,M as V,B as Q,b as X}from"./MatchIcons-CVn1p0ME.js";import{a as Z,u as b}from"./vendor-redux-D8sX5Eqv.js";import{u as ee}from"./vendor-i18n-BWleq_Sd.js";import"./vendor-socket-DSYo_sTV.js";import"./vendor-router-CYD8mbvC.js";const te=new Audio(G("/pages/matches/sounds/default/invite.wav")),k=250,A=250,se=E` 2 from { 3 opacity: 0; 4 transform: translateY(10px) scale(0.98); 5 } 6 7 to { 8 opacity: 1; 9 transform: translateY(0) scale(1); 10 } 11`,i=a.aside` 12 position: relative; 13 z-index: ${s=>100-s.$order}; 14 display: flex; 15 align-items: center; 16 gap: 20px; 17 width: 100%; 18 height: 84px; 19 padding: 12px 18px 12px 14px; 20 border-radius: 18px; 21 overflow: hidden; 22 background: #1c2334; 23 box-shadow: 0 8px 24px rgba(8, 11, 17, 0.32); 24 opacity: ${s=>s.$closing?0:1}; 25 pointer-events: ${s=>s.$closing?"none":"auto"}; 26 transition: 27 opacity ${k}ms ease, 28 margin-top 0.25s ease, 29 transform 0.25s ease; 30 animation: ${se} 0.28s ease-out; 31 32 &::before { 33 content: ''; 34 position: absolute; 35 inset: 0 auto 0 0; 36 width: calc((1 - var(--invite-progress, 0)) * 100%); 37 background: rgba(64, 76, 114, 0.24); 38 pointer-events: none; 39 transition: width ${A}ms linear; 40 } 41 42 @media (max-width: 700px) { 43 gap: 12px; 44 } 45`,ne=a.div` 46 position: fixed; 47 top: calc(70px + 16px); 48 right: 36px; 49 z-index: 110; 50 width: 386px; 51 pointer-events: ${s=>s.$loading?"none":"auto"}; 52 53 ${i} + ${i} { 54 margin-top: ${s=>s.$stacked?"-74px":"8px"}; 55 transform: ${s=>s.$stacked?"translateY(5px) scale(0.98)":"none"}; 56 } 57 58 &:hover ${i} + ${i}, &:focus-within ${i} + ${i} { 59 margin-top: 8px; 60 transform: none; 61 } 62 63 @media (max-width: 700px) { 64 right: 12px; 65 width: calc(100vw - 24px); 66 } 67`,ae=a.div` 68 display: flex; 69 align-items: flex-start; 70 gap: 14px; 71 width: 210px; 72 min-width: 210px; 73 74 @media (max-width: 700px) { 75 width: auto; 76 min-width: 0; 77 flex: 1; 78 } 79`,oe=a.div` 80 position: relative; 81 flex: 0 0 auto; 82 box-sizing: content-box; 83 width: 44px; 84 height: 44px; 85 padding: 3px; 86 border: 1.5px solid #576995; 87 border-radius: 10px; 88 89 .invite-map { 90 border-radius: 7px; 91 } 92`,ie=a.img` 93 position: absolute; 94 right: -4.5px; 95 bottom: -4.5px; 96 box-sizing: content-box; 97 width: 22px; 98 height: 22px; 99 padding: 2px; 100 background: #242d43; 101 border-radius: 50%; 102 object-fit: cover; 103`,re=a.div` 104 display: flex; 105 flex: 1; 106 flex-direction: column; 107 justify-content: center; 108 gap: 5px; 109 min-width: 0; 110`,ce=a.div` 111 overflow: hidden; 112 color: #708cff; 113 font-size: 12px; 114 font-weight: 500; 115 line-height: normal; 116 letter-spacing: 0.36px; 117 text-overflow: ellipsis; 118 text-transform: uppercase; 119 white-space: nowrap; 120`,de=a.div` 121 display: flex; 122 flex-direction: column; 123 gap: 5px; 124 width: 100%; 125`,le=a.div` 126 overflow: hidden; 127 color: #fff; 128 font-size: 15px; 129 font-weight: 700; 130 text-overflow: ellipsis; 131 white-space: nowrap; 132`,pe=a.div` 133 overflow: hidden; 134 color: #9ca8c5; 135 font-size: 14px; 136 font-weight: 500; 137 line-height: 16px; 138 text-overflow: ellipsis; 139 white-space: nowrap; 140`,xe=a.div` 141 display: flex; 142 align-items: center; 143 flex: 0 0 auto; 144 gap: 8px; 145`,$=a.button` 146 display: flex; 147 align-items: center; 148 justify-content: center; 149 width: 36px; 150 height: 36px; 151 padding: 8px; 152 border-radius: 10px; 153 color: #fff; 154 background: rgba(93, 108, 146, 0.5); 155 backdrop-filter: blur(13.5px); 156 transition: 157 transform 0.16s ease, 158 filter 0.16s ease, 159 background 0.16s ease; 160 161 &.accept { 162 background: linear-gradient(270deg, #708cff -38.46%, #5971d2 146.15%); 163 } 164 165 &:hover { 166 filter: brightness(1.12); 167 transform: translateY(-1px); 168 } 169 170 &:active { 171 transform: translateY(0) scale(0.97); 172 } 173 174 svg {
175 width: 20px; 176 height: 20px; 177 } 178 179 @media (max-width: 700px) { 180 &.decline { 181 display: none; 182 } 183 } 184`,ue=a.button` 185 display: flex; 186 align-items: center; 187 justify-content: center; 188 width: 36px; 189 height: 36px; 190 padding: 2px; 191 color: #9fb1c9; 192 background: transparent; 193 transition: color 0.16s ease; 194 195 &:hover { 196 color: #d3ddeb; 197 } 198 199 @media (max-width: 700px) { 200 display: none; 201 } 202`,je=()=>{const{t:s}=ee(),w=R(),r=Z(),M=b(e=>e.root.currentGame),_=b(e=>e.auth.name_unique?`id/${e.auth.name_unique}`:`profile/${e.auth.steamid64}`),c=b(e=>e.auth.invites),h=q(A,c.length>0),[f,v]=o.useState([]),[l,I]=o.useState(!1),x=o.useRef(new Map),y=o.useRef(new Set),p=o.useCallback(e=>{clearTimeout(x.current.get(e)),v(n=>[...n,e]),x.current.set(e,setTimeout(()=>{r(S(e)),v(n=>n.filter(d=>d!==e)),x.current.delete(e)},k))},[r]);o.useEffect(()=>{const e=x.current,n=d=>{const u=L(d);u&&(y.current.has(u.key)||(y.current.add(u.key),B(te)),r(Y([u])))};return window.socket.on("receiveMessage",n),()=>{window.socket.off("receiveMessage",n),e.forEach(clearTimeout),e.clear()}},[r]),o.useEffect(()=>{c.forEach(e=>{h>=e.endAt&&!f.includes(e.key)&&p(e.key)})},[h,c,f,p]);const N=e=>{if(l)return;const n=()=>{p(e.key),H(M)&&r(U(2)),w(`/match/${e.targetId}`)};if(e.targetType==="lobby"){if(e.password){I(!0),j.connectLobby(e.targetId,void 0,e.password).then(d=>{(d?.result==="success"||d?.code===z.ALREADY_IN_LOBBY)&&n()}).finally(()=>I(!1));return}n();return}p(e.key),e.ip&&e.port&&r(O(P[Number(e.gameId)],{ip:e.ip,port:e.port,source:"invite_widget"}))},T=e=>Math.min(1,Math.max(0,(h-e.startAt)/(e.endAt-e.startAt))),m=(e,n)=>{l||(e.hash&&j.updateInviteStatus(e.hash,n),p(e.key))};return c.length?t.jsx(ne,{$stacked:c.length>2,$loading:l,children:[...c].sort((e,n)=>n.receivedAt-e.receivedAt).map((e,n)=>t.jsxs(i,{$order:n,$closing:f.includes(e.key),style:{"--invite-progress":T(e)},"aria-label":s("Invitation"),children:[t.jsxs(ae,{children:[t.jsxs(oe,{children:[t.jsx(D,{className:"invite-map",src:e.mapImage,alt:"",shimmer:!1}),e.avatar&&t.jsx(ie,{src:e.avatar,alt:""})]}),t.jsxs(re,{children:[t.jsx(ce,{children:s("Invitation")}),t.jsxs(de,{children:[t.jsx(le,{children:e.inviterName}),t.jsxs(pe,{children:[e.targetType==="lobby"?s("Lobby"):e.serverMode||s("Server"),e.targetId&&` - #${e.targetId}`]})]})]})]}),t.jsxs(xe,{children:[t.jsx($,{type:"button",className:"accept","aria-label":s("Accept"),onClick:()=>N(e),children:t.jsx(W,{})}),t.jsx($,{type:"button",className:"decline","aria-label":s("Decline"),onClick:()=>m(e,"cancel"),children:t.jsx(F,{})}),t.jsx(C,{disabled:l,interactive:!0,appendTo:()=>document.body,placement:"top-end",theme:"empty",content:t.jsxs(J,{children:[t.jsx(g,{onClick:()=>m(e,"block_24h_invites"),children:t.jsxs("div",{children:[t.jsx(V,{}),s("MuteFor24Hours")]})}),t.jsx(g,{onClick:()=>m(e,"block_user"),children:t.jsxs("div",{children:[t.jsx(Q,{}),s("BlockPlayer")]})}),t.jsx(g,{onClick:()=>{l||w(`/${_}/settings/privacy`)},children:t.jsxs("div",{children:[t.jsx(X,{}),s("ConfigureNotifications")]})})]}),children:t.jsx(ue,{type:"button","aria-label":s("More"),children:t.jsx(K,{})})})]})]},e.key))}):null};export{je 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.