1import{u as h}from"./vendor-query-bOUN_gKe.js";import{b as d,N as k}from"./index-BKzE8EQ8.js";const l=12,f={hero:6,trending:12,top:10,viral:6},p={continue_playing:{title:"Continue Playing",subtitle:"Pick up where you left off"},from_creators_you_follow:{title:"From Creators You Follow",subtitle:"New games from the people you follow"},for_you:{title:"For You",subtitle:"Based on games you've favorited"}};function g(e){return e?.response?.status}function w(){const{isAuthenticated:e,user:t}=d(),{data:s}=h({queryKey:["marketplace-me",t?.id??null],queryFn:k.getMe,enabled:e,staleTime:60*1e3,retry:(o,r)=>{const i=g(r);return i===401||i===403||i===404?!1:o<1}});return e&&s?s:null}function _(e){if(!e)return()=>!1;const t=new Set(e.blocked_creator_ids??[]),s=new Set((e.blocked_creator_usernames??[]).map(o=>o.toLowerCase()));return t.size===0&&s.size===0?()=>!1:o=>typeof o.user_id=="number"&&t.has(o.user_id)||!!o.user&&s.has(o.user.toLowerCase())}function c(e,t,s){const o=_(t),r=t?new Set(t.favorite_game_ids??[]):null,i=[];for(const u of e??[]){if(!u||o(u))continue;const n=r?r.has(u.id):u.is_favorited;if(i.push(n===u.is_favorited?u:{...u,is_favorited:n}),s!==void 0&&i.length>=s)break}return i}function v(e,t,s){return c(e,t,s).map((r,i)=>r.rank===i+1?r:{...r,rank:i+1})}function L(e,t){const s=_(t),o=n=>(n??[]).filter(a=>!a.game||!s(a.game)).map(a=>a.game?{...a,game:c([a.game],t)[0]}:a),r=[];if(t)for(const n of Object.keys(p)){const a=c(t.rails?.[n],t,l);a.length!==0&&r.push({key:n,...p[n],see_all_url:null,games:a})}const i=new Set(r.map(n=>n.key)),u=[...r,...e.rails.filter(n=>!i.has(n.key)).map(n=>({...n,games:c(n.games,t,l)}))];return{...e,...e.hero?{hero:o(e.hero)}:{},...e.spotlight?{spotlight:o(e.spotlight)}:{},...e.featured?{featured:c(e.featured,t)}:{},...e.staff_picks?{staff_picks:c(e.staff_picks,t)}:{},rails:u}}function m(e,t){const s=c(e.hero,t,f.hero),o=new Set(s.map(r=>r.id));return{hero:s,trending:c(e.trending.filter(r=>!o.has(r.id)),t,f.trending),top:v(e.top,t,f.top),viral:c(e.viral,t,f.viral)}}export{f as L,c as a,L as b,m as o,w as u};
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.