1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44698],{44698:(e,t,a)=>{a.r(t),a.d(t,{GameOverScreen:()=>p});var n=a(83764),s=a(14607),r=a(696),o=a(56514),i=a(20647),c=a(17332),l=a(41289),d=a(61206),m=a(74830);let x=(0,c.default)(()=>Promise.all([a.e(32661),a.e(26680),a.e(45242),a.e(39442),a.e(86159),a.e(73512),a.e(35352),a.e(2524),a.e(60832)]).then(a.bind(a,2524)),{loadableGenerated:{webpack:()=>[2524]},ssr:!1,loading:()=>(0,n.jsx)("p",{role:"status",className:"fixed inset-x-0 bottom-6 z-[150] text-center text-sm text-white",children:"Loading sharing optionsâ¦"})});function h(e){let t=Math.floor(e/60),a=Math.floor(e%60);return t>0?"".concat(t,"m ").concat(a,"s"):"".concat(a,"s")}function p(e){let{reason:t,onRestart:a,onRestartFromCheckpoint:c,onQuickRetry:p,onNextGame:u,isRestarting:g,hasCheckpoint:b=!1,isAdmin:w=!1,gameTitle:f,gameId:v,previewVideoUrl:k,thumbnailUrl:_,playTimeSeconds:j,currentLevel:y,currentBeat:N,creatorUsername:C,creatorDisplayName:I,creatorPhotoURL:R,showCreatorProfile:U=!1}=e,S=(0,s.useRouter)(),[T,L]=(0,r.useState)(!1),[G,P]=(0,r.useState)(!1),[M,E]=(0,r.useState)(5),[B,D]=(0,r.useState)(!1),[O,W]=(0,r.useState)(!1),z=p||(b&&c?c:a),A=!!(j&&j>0),F="undefined"!=typeof navigator&&"function"==typeof navigator.share;(0,r.useEffect)(()=>{let e=setTimeout(()=>L(!0),100);return()=>clearTimeout(e)},[]),(0,r.useEffect)(()=>{if(B||M<=0||g)return;let e=setTimeout(()=>E(e=>e-1),1e3);return()=>clearTimeout(e)},[M,B,g]),(0,r.useEffect)(()=>{M>0||B||g||(u?u():z())},[M,B,g,u,z]);let Q=(0,r.useCallback)(e=>{let t=(0,d.ue)({targetType:"game",targetId:v,surface:"game_over"}),a=new URL(v?(0,d.tx)(v,{origin:window.location.origin}):window.location.href);j&&j>0&&(a.searchParams.set("challenge","true"),a.searchParams.set("time",String(Math.round(1e3*j))));let n={shareId:t,targetType:"game",targetId:v,targetTitle:f,surface:"game_over",method:e,source:e,medium:"email"===e?"email":"copy_link"===e?"copy_link":"social",campaign:v?"game-over-".concat(v):"game-over",content:"game-over-share-menu-".concat(e)};return{shareId:t,shareUrl:(0,d.vk)(a.toString(),n),trackingProps:(0,d.QO)(n)}},[v,f,j]),V=(0,r.useCallback)(e=>{let{shareId:t,shareUrl:a,trackingProps:n}=Q(e),s=j&&j>0?"I lasted ".concat(h(j),' in "').concat(f||"this game",'" on Gameer. Can you beat my run?'):'I just got eliminated in "'.concat(f||"this game",'" on Gameer. Think you can beat my run?');D(!0),l.posthog.capture("game_share_clicked",{...n,game_id:v,game_title:f,location:"game_over",share_url:a});let r=()=>o.D.trackGameShared({share_method:e,share_url:a,share_id:t,share_recipient_match_key:t,share_surface:"game_over",utm_source:e,utm_medium:"email"===e?"email":"copy_link"===e?"copy_link":"social",utm_campaign:v?"game-over-".concat(v):"game-over",utm_content:"game-over-share-menu-".concat(e)});switch(e){case"copy_link":case"discord":navigator.clipboard.writeText("".concat(s," ").concat(a)).then(()=>{r(),P(!0),setTimeout(()=>P(!1),2e3)});break;case"native":var i,c;null==(i=(c=navigator).share)||i.call(c,{title:f||"Gameer",text:s,url:a}).then(r).catch(()=>{});break;case"twitter":window.open("https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(s),"&url=").concat(encodeURIComponent(a)),"_blank"),r();break;case"facebook":window.open("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(a)),"_blank"),r();break;case"whatsapp":window.open("https://wa.me/?text=".concat(encodeURIComponent("".concat(s," ").concat(a))),"_blank"),r();break;case"telegram":window.open("https://t.me/share/url?url=".concat(encodeURIComponent(a),"&text=").concat(encodeURIComponent(s)),"_blank"),r();break;case"reddit":window.open("https://www.reddit.com/submit?url=".concat(encodeURIComponent(a),"&title=").concat(encodeURIComponent(s)),"_blank"),r();break;case"linkedin":window.open("https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURIComponent(a)),"_blank"),r();break;case"email":window.location.href="mailto:?subject=".concat(encodeURIComponent("Can you beat my run in ".concat(f||"Gameer","?")),"&body=").concat(encodeURIComponent("".concat(s,"\n\n").concat(a))),r()}},[v,f,Q,j]),Z=(0,r.useCallback)(()=>{V(F?"native":"copy_link")}
1,[V,F]),q=new URL((0,d.tx)(v));return j&&j>0&&(q.searchParams.set("challenge","true"),q.searchParams.set("time",String(Math.round(1e3*j)))),(0,n.jsxs)("div",{"data-testid":"game-over-screen",className:"fixed inset-0 z-50 overflow-hidden bg-black text-white",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(60%_45%_at_50%_0%,rgba(239,68,68,0.22),transparent_70%)]"}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(40%_40%_at_50%_100%,rgba(249,115,22,0.14),transparent_70%)]"}),(0,n.jsx)("div",{className:"absolute inset-0 bg-black/70"}),(0,n.jsx)("div",{className:"relative z-10 flex h-[100dvh] w-full items-center justify-center px-3 py-[max(0.75rem,env(safe-area-inset-top,0px))] sm:px-4",children:(0,n.jsxs)("div",{"data-testid":"game-over-card",className:"relative flex max-h-[calc(100dvh-1.5rem)] w-full max-w-3xl flex-col items-center gap-2 overflow-hidden rounded-2xl border border-white/10 bg-[linear-gradient(180deg,rgba(10,16,31,0.96),rgba(3,7,18,0.94))] p-2.5 pt-10 text-center shadow-2xl shadow-red-950/25 transition-all duration-700 sm:gap-2.5 sm:rounded-[1.75rem] sm:p-4 sm:pt-10 md:p-5 md:pt-11 ".concat(T?"opacity-100 scale-100":"opacity-0 scale-95"),children:[(0,n.jsx)("button",{onClick:()=>S.push("/feed"),className:"absolute left-2.5 top-2.5 rounded-xl border border-white/12 px-3 py-1.5 text-xs font-medium text-white/55 transition hover:border-white/20 hover:text-white sm:left-4 sm:top-4",children:"Back"}),(0,n.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,n.jsx)("div",{className:"rounded-full border border-red-300/15 bg-red-500/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.24em] text-red-200/80",children:"Run ended"})}),(0,n.jsxs)("div",{className:"flex min-h-0 w-full flex-col items-center justify-center gap-2.5 sm:gap-3",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("div",{className:"inline-block text-2xl sm:text-4xl",children:"\uD83D\uDC80"}),(0,n.jsx)("h1",{className:"bg-gradient-to-b from-white via-red-100 to-red-400 bg-clip-text text-2xl font-black tracking-[0.14em] text-transparent sm:text-5xl",children:"GAME OVER"}),(0,n.jsx)("p",{className:"mx-auto max-w-xl text-xs leading-relaxed text-red-100/80 sm:text-sm",children:t||"Better luck next time."})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(m.F,{username:C,displayName:I,photoURL:null!=R?R:void 0,showCreatorProfile:U})}),(0,n.jsxs)("div",{className:"grid w-full max-w-2xl grid-cols-1 gap-2 sm:grid-cols-3",children:[(0,n.jsx)("button",{onClick:z,disabled:g,className:"rounded-xl bg-white px-4 py-2.5 text-sm font-bold text-black transition hover:brightness-95 disabled:opacity-50",children:(0,n.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,n.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M16.25 10a6.25 6.25 0 1 1-1.83-4.42",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M16.25 4.5v4h-4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,n.jsx)("span",{children:g?"Restarting...":"Try again"})]})}),u&&(0,n.jsx)("button",{onClick:u,className:"rounded-xl border border-white/15 bg-white/[0.06] px-4 py-2.5 text-sm font-semibold text-white transition hover:border-white/25 hover:bg-white/[0.1]",children:(0,n.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,n.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M5.75 4.5v11m2.5-5.5 6-4.5v9L8.25 10Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("span",{children:"Play Next Now"})]})}),(0,n.jsx)("button",{onClick:()=>S.push("/feed"),className:"rounded-xl border border-white/15 bg-white/[0.06] px-4 py-2.5 text-sm font-semibold text-white transition hover:border-white/25 hover:bg-white/[0.1]",children:"Open Game Feed"})]})]}),A&&(0,n.jsx)("div",{className:"w-full max-w-md rounded-2xl border border-white/10 bg-white/[0.035] px-3 py-2.5",children:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("p",{className:"text-[9px] uppercase tracking-[0.2em] text-white/40",children:"Survived"}),(0,n.jsx)("p",{className:"mt-0.5 text-lg font-black text-white sm:text-xl",children:h(j)})]}),void 0!==y&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"h-8 w-px bg-white/10"}),(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("p",{className:"text-[9px] uppercase tracking-[0.2em] text-white/40",children:"Reached"}),(0,n.jsx)("p",{className:"mt-0.5 text-base font-bold text-white sm:text-lg",children:void 0!==N?"L".concat(y,":B").concat(N):"L".concat(y)})]})]})]})}),v&&(0,n.jsxs)("div",{className:"w-full max-w-2xl rounded-2xl border border-sky-400/20 bg-[linear-gradient(180deg,rgba(14,25,47,0.9),rgba(5,10,24,0.88))] p-3 shadow-[0_20px_60px_-28px_rgba(56,189,248,0.38)] sm:p-3.5",children:[(0,n.jsxs)("div",{className:"grid gap-2.5 md:grid-cols-[minmax(0,1fr)_minmax(240px,0.64fr)] md:items-center",children:[(0,n.jsxs)("div",{className:"text-center md:text-left",children:[(0,n.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-sky-200/80",children:"Challenge friends"}),(0,n.jsx)("h2",{className:"mt-1 text-base font-semibold text-white sm:text-lg",children:"Invite a friend to beat your run"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:Z,className:"rounded-xl px-4 py-2.5 text-sm font-bold transition ".concat(G?"bg-emerald-300 text-slate-950":"border border-sky-200/35 bg-sky-300/10 text-white shadow-[0_12px_40px_-24px_rgba(56,189,248,0.9)] hover:border-sky-200/55 hover:bg-sky-300/15"),children:G?"Challenge copied":"Challenge a friend"}),(0,n.jsx)("button",{type:"button",onClick:()=>{D(!0),W(!0),l.posthog.capture("game_video_share_opened",{game_id:v,game_title:f,location:"game_over",play_time_seconds:j})},className:"rounded-xl border border-white/15 bg-white/5 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-white/10",children:"Share video"})]})]}),(0,n.jsxs)("div",{className:"mt-2.5 grid gap-2 border-t border-white/10 pt-2.5 sm:grid-cols-[minmax(0,0.8fr)_minmax(260px,1fr)] sm:items-center",children:[(0,n.jsxs)("div",{className:"text-center sm:text-left",children:[(0,n.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.2em] text-emerald-200/75",children:"New-game alerts"}),(0,n.jsx)("p",{className:"mt-0.5 text-xs text-white/45",children:"Get the next good drop."})]}),(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)(i.A,{location:"game_over",heading:"",subtext:"",buttonLabel:"Notify me",variant:"inline",className:"min-w-0 flex-col sm:flex-row [&_button]:h-10 [&_button]:shrink-0 [&_button]:whitespace-nowrap [&_button]:rounded-xl [&_button]:bg-gradient-to-r [&_button]:from-emerald-300 [&_button]:to-lime-200 [&_button]:px-3 [&_button]:text-xs [&_button]:font-bold [&_button]:text-slate-950 [&_input]:h-10 [&_input]:min-w-0 [&_input]:rounded-xl [&_input]:border-emerald-200/15 [&_input]:bg-black/30 [&_input]:text-xs"})})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,n.jsxs)("div",{className:"relative h-12 w-12",children:[(0,n.jsxs)("svg",{className:"h-12 w-12 -rotate-90",viewBox:"0 0 80 80",children:[(0,n.jsx)("circle",{cx:"40",cy:"40",r:"35",fill:"none",stroke:"rgba(255,255,255,0.1)",strokeWidth:"4"}),(0,n.jsx)("circle",{cx:"40",cy:"40",r:"35",fill:"none",stroke:"#ef4444",strokeWidth:"4",strokeDasharray:"".concat(2*Math.PI*35),strokeDashoffset:"".concat(2*Math.PI*35*(1-M/5)),strokeLinecap:"round",style:{transition:"stroke-dashoffset 1s linear"}})]}),(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-lg font-black text-white",children:M})})]}),(0,n.jsxs)("div",{className:"text-left",children:[(0,n.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-red-200/65",children:B?"Paused":u?"
1Next game":"Retry"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,n.jsx)("p",{children:B?"Auto-advance paused":u?"Starting soon":"Trying again soon"}),!B&&(0,n.jsx)("button",{onClick:()=>D(!0),className:"text-xs text-gray-500 underline decoration-white/20 underline-offset-4 transition-colors hover:text-gray-300",children:"Cancel"})]})]})]})]})}),O&&v&&(0,n.jsx)(x,{isOpen:!0,onClose:()=>W(!1),location:"game_over_video",target:{gameId:v,gameTitle:f||"Gameer",shareText:j&&j>0?"I lasted ".concat(h(j),' in "').concat(f||"this game",'" on Gameer. Can you beat my run?'):'I just got eliminated in "'.concat(f||"this game",'" on Gameer. Think you can beat my run?'),previewVideoUrl:k,thumbnailUrl:_,playUrl:q.toString(),shareUrl:q.toString()}})]})}}}]);
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.