1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4476],{610:(e,n,t)=>{t.d(n,{default:()=>b});var r=t(61975),i=t(22043),o=t(45377),a=t(71450),s=t(95155),u=t(12115),c=t(20063),l=t(16645),d=t(59030),f=t(90809),h=t(81071),m="gj.home.surprise";function v(){try{var e=(0,h.GJ)("session",m);if(!e)return[];var n=JSON.parse(e);return Array.isArray(n)?n.map(String):[]}catch(e){return[]}}function p(e){(0,h.PX)("session",m,JSON.stringify(e))}function b(e){var n=e.className,t=e.excludeIds,h=void 0===t?[]:t,m=e.icon,b=void 0===m?(0,s.jsx)(l.A,{size:14,strokeWidth:2.5}):m,g=(0,i._)((0,u.useState)(!1),2),x=g[0],k=g[1],y=(0,c.useRouter)(),w=(0,u.useCallback)(function(){return(0,r._)(function(){var e,n,t,r,i,s,u,c;return(0,a.YH)(this,function(a){switch(a.label){case 0:k(!0),a.label=1;case 1:return a.trys.push([1,6,,7]),[4,fetch("/api/forward/homepage/widgets?placement=homepage",{method:"GET",cache:"no-store"})];case 2:if(!(e=a.sent()).ok)return[3,4];return[4,e.json()];case 3:return t=a.sent(),[3,5];case 4:t=[],a.label=5;case 5:if(n=t,r=new Set,!(i=n.flatMap(function(e){var n;return null!=(n=e.games)?n:[]}).filter(function(e){return!(!e.gameId||!e.slug||r.has(e.gameId))&&(r.add(e.gameId),!0)})).length)return y.push("/games/all"),[2];return s=new Set((0,o._)(v()).concat((0,o._)(h))),(u=i.filter(function(e){return!s.has(e.gameId)})).length||(p([]),s=new Set(h),u=i.filter(function(e){return!s.has(e.gameId)})),c=u.length?function(e){for(var n=e.map(function(e){var n,t;
1return Math.max(1,null!=(t=null!=(n=e.plays7d)?n:e.gamePlays)?t:0)}),t=Math.random()*n.reduce(function(e,n){return e+n},0),r=0;r<e.length;r++)if((t-=n[r])<=0)return e[r];return e[e.length-1]}(u):i[0],p((0,o._)(v()).concat([c.gameId])),(0,f.trackEvent)({event:"game_click",properties:{game_id:c.gameId,game_name:c.title||"",surface:"surprise_me",publisher_id:c.publisherId}}).catch(function(){}),y.push((0,d.O)(c)),[3,7];case 6:return a.sent(),y.push("/games/all"),k(!1),[3,7];case 7:return[2]}})})()},[h,y]);return(0,s.jsx)("button",{type:"button",onClick:function(){w()},disabled:x,className:"inline-flex h-[34px] min-h-11 items-center justify-center gap-1.5 rounded-full bg-gradient-to-br from-[#8B5CF6] to-[#5B21B6] px-3.5 text-[13px] font-semibold text-white hover:opacity-90 disabled:opacity-60 sm:min-h-0 ".concat(void 0===n?"":n).trim(),children:x?"Pickingâ¦":(0,s.jsxs)(s.Fragment,{children:[b,"Surprise me"]})})}},36362:(e,n,t)=>{t.d(n,{b:()=>v});var r=t(61975),i=t(82732),o=t(45849),a=t(22043),s=t(45377),u=t(71450),c=t(12115),l=t(50890),d=t(89657),f=t(77527),h=t(41919),m=!1;function v(e){var n,t=(0,a._)((0,c.useState)(null),2),v=t[0],p=t[1],b=(0,a._)((0,c.useState)(!0),2),g=b[0],x=b[1],k=(0,a._)((0,c.useState)(!1),2),y=k[0],w=k[1],_=(0,c.useRef)(void 0),N=(0,c.useRef)([]),S=null!=(n=null==e?void 0:e.pollIntervalMs)?n:9e3,j=(null==e?void 0:e.enabled)!==!1,I=(0,c.useCallback)(function(e){return(0,r._)(function(){var n,t,r,a,s;return(0,u.YH)(this,function(u){switch(u.label){case 0:e&&(_.current=void 0,p(null)),n=new URLSearchParams,void 0!==_.current&&n.set("sinceVersion",_.current.toString()),N.current.length>0&&(n.set("ackNudgeIds",N.current.join(",")),N.current=[]),t=n.toString(),r="/api/forward/users/me/xp-state".concat(t?"?".concat(t):""),u.label=1;case 1:var c;return u.trys.push([1,4,,5]),[4,fetch(r,{headers:(c=(0,f.jt)().experiments[h.wD])?{"x-exp-arms":"".concat(h.wD,"=").concat(c)}:{}})];case 2:if(!(a=u.sent()).ok)return w(!0),[2];return[4,a.json()];case 3:if(s=u.sent(),w(!1),(0,l.hc)(s.stateVersion,_.current,e))return[2];if(_.current=s.stateVersion,!function(e){if(!m){var n=1e3*e.xpLifetime+5e3;e.coins<=n||(m=!0,(0,d.c)("user.coins.implausible",{coins:e.coins,xpLifetime:e.xpLifetime,path:window.location.pathname}))}}(s),!1===s.xpChanged)return p(function(e){return e?(0,o._)((0,i._)({},e),{stateVersion:s.stateVersion,xpChanged:!1,pendingNudges:[],returnBoost:s.returnBoost}):s}),[2];return p(s),[3,5];case 4:return console.error("[useXpState] failed to fetch xp state:",u.sent()),w(!0),[3,5];case 5:return[2]}})})()},[]);return(0,c.useEffect)(function(){if(j){var e=!1;x(!0),I().finally(function(){e||x(!1)});var n=setInterval(function(){"undefined"!=typeof document&&document.hidden||I()},S),t=function(){"undefined"==typeof document||document.hidden||I()};return"undefined"!=typeof document&&document.addEventListener("visibilitychange",t),function(){e=!0,clearInterval(n),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",t)}}},[j,I,S]),{data:v,loading:g,error:y,ackNudges:(0,c.useCallback)(function(e){var n;(n=N.current).push.apply(n,(0,s._)(e))},[]),refetch:I}}},50890:(e,n,t)=>{function r(e){var n,t;if(e)return null!=(t=e.stateVersion)?t:null==(n=e.xp)?void 0:n.stateVersion}function i(e,n,t){return void 0!==e&&void 0!==n.current&&!!(e<n.current)}function o(e,n){void 0!==e&&(n.current=e)}function a(e,n,t){return!t&&void 0!==n&&e<n}t.d(n,{A:()=>r,Ku:()=>o,hc:()=>a,r_:()=>i})},96423:(e,n,t)=>{t.d(n,{V:()=>c,default:()=>l});var r=t(82732),i=t(45849),o=t(17389),a=t(95155),s={primary:"font-bold bg-accent text-ink-950 shadow-ink-glow hover:-translate-y-px hover:bg-accent-hi motion-reduce:transform-none",secondary:"font-semibold bg-ink-800 text-ink-t1 hover:bg-ink-750",outlined:"font-semibold border border-ink-line-2 text-ink-t2 hover:border-ink-t3 hover:bg-ink-800 hover:text-ink-t1",paper:"font-semibold border border-ink-line-2 text-ink-t1 hover:border-ink-t3 hover:bg-ink-800",ghost:"font-semibold text-ink-t2 hover:bg-ink-800 hover:text-ink-t1",danger:"font-semibold text-bad hover:bg-bad/10",developer:"font-bold bg-dev-primary-dark text-white hover:brightness-105",quiet:"font-semibold text-ink-t3 hover:text-ink-t1 px-2.5",live:"font-bold bg-live/13 text-live border border-live/34 hover:brightness-105"},u={sm:"min-h-11 px-3 py-1.5 text-sm",md:"min-h-11 px-4 py-2 text-sm",lg:"min-h-[50px] px-5 py-2.5 text-base",icon:"min-h-11 min-w-11 p-2"};function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.variant,t=e.size,r=e.fullWidth,i=e.className;return["inline-flex items-center justify-center gap-2 rounded-full transition-[background-color,border-color,color,transform] duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50 disabled:cursor-not-allowed motion-reduce:transition-none",s[void 0===n?"primary":n],u[void 0===t?"md":t],void 0!==r&&r?"w-full":"",void 0===i?"":i].filter(
1Boolean).join(" ")}function l(e){var n=e.variant,t=e.size,s=e.loading,u=void 0!==s&&s,l=e.fullWidth,d=e.disabled,f=e.className,h=e.children,m=(0,o._)(e,["variant","size","loading","fullWidth","disabled","className","children"]),v=c({variant:void 0===n?"primary":n,size:void 0===t?"md":t,fullWidth:void 0!==l&&l,className:void 0===f?"":f});return(0,a.jsxs)("button",(0,i._)((0,r._)({disabled:d||u,className:v},m),{children:[u&&(0,a.jsx)("span",{className:"animate-spin rounded-full h-4 w-4 border-2 border-current border-t-transparent flex-shrink-0"}),h]}))}},97262:(e,n,t)=>{function r(e){return new Intl.NumberFormat("en-US").format(e)}function i(e){var n=Number.isFinite(e)&&e>0?Math.floor(e):0,t=Math.floor(n/3600),r=Math.floor(n%3600/60);return t>0?"".concat(t,"h ").concat(r,"m"):"".concat(r,"m")}function o(e){return r(null!=e?e:0)}function a(e,n){return"number"==typeof n&&n>0?"".concat(e,"/").concat(n):"".concat(e," XP")}function s(e,n){if(null==e||e<=0)return"Unranked";var t="#".concat(r(e));return"number"==typeof n&&n>0?"".concat(t," of ").concat(r(n)):t}function u(e,n){return null==e||e<=0||null==n||n<=0?null:"".concat(r(e)," XP behind ").concat(s(n))}function c(e){return e?e.split(/([\s-]+)/).map(function(e){return/^[\s-]+$/.test(e)||/[A-Z]/.test(e.slice(1))?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(""):""}function l(e){if(!Number.isFinite(e)||e<=0)return"Recently";var n=Math.floor((Date.now()-e)/864e5);if(n<=0)return"Today";if(1===n)return"Yesterday";if(n<7)return"".concat(n," days ago");var t=Math.floor(n/7);return t<5?1===t?"1 week ago":"".concat(t," weeks ago"):"Recently"}t.d(n,{Ir:()=>o,Sn:()=>c,Uf:()=>s,V7:()=>a,ZV:()=>r,Zg:()=>i,cj:()=>u,fw:()=>l})}}]);
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.