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AAA,EAAA,CAAA,IAAArB,EAAE,mCAAmC,CAAA,CAAA,kBAHlCG,EAAA4F,CAAS,IAAK,cAAazE,EAAAkG,CAAA,EAAAlG,EAAAM,EAAA,EAAA,MADhC2F,CAAC,MAADA,CAAC,mBA/BO,QAAOjG,EAAAC,EAAA,EAAApB,EAWPyF,CAAQ,EAAAtE,EAAAY,EAAA,CAAA,EAAA/B,EAmBR4F,CAAS,GAAAzE,EAAAsB,GAAA,CAAA,MA7CnBtC,CAAG,IALJgG,CAAO,EAaJvF,EAAAM,GAAAiB,EAAAsE,EAAA,IAAAvF,GAAA,EAAA,EAAA,EAAA,CAAA,IAAArB,EAAE,OAAO,CAAA,CAAA,OAbZsG,CAAO,MAPA","names":["animating","direction","showActions","displayName","$.derived","$$props","t","totalVotes","approvalPct","$.get","reportOpen","$.state","div","$.first_child","fragment","div_1","$.sibling","$.child","div_2","video","root_2","$.template_effect","$.set_attribute","$.append","$$anchor","img","root_3","$0","$$render","consequent","alternate","div_3","root_4","consequent_1","alternate_1","div_4","root_5","consequent_2","div_5","root_6","consequent_3","div_6","root_7","span","$.set_text","text_2","div_7","root_8","span_1","text_3","consequent_5","div_8","p","div_9","span_2","fragment_2","consequent_6","span_3","fragment_3","span_4","consequent_7","div_10","root_11","span_5","root_12","text_8","consequent_8","span_6","root_13","text_9","consequent_9","span_7","root_14","text_10","consequent_10","span_8","root_15","text_11","consequent_11","consequent_12","$.reset","div_11","root_16","button","button_1","$1","$.delegated","consequent_13","div_12","node_12","button_2","text_12","ReportContentModal","node_13","$.set","$$value","$.set_class","item","hasVoted","$.proxy","votedDirection","voteError","submitting","$.user_effect","handleVote","vote","goto","r","section","root","$.head","meta","root_1","a","text","ArenaCard","node","p_1","a_1","p_2","text_4","text_5","text_6","p_3","a_2","p_4","consequent_4"],"sources":["../../../../../../src/lib/components/arena/ArenaCard.svelte","../../../../../../src/routes/a/s/[id]/+page.svelte"],"sourcesContent":["<script lang=\"ts\">\n\timport { t } from '$lib/i18n';\n\timport type { ArenaFeedItem } from '$lib/types/arena';\n\timport ReportContentModal from '$lib/components/ReportContentModal.svelte';\n\n\tinterface Props {\n\t\titem: ArenaFeedItem;\n\t\tonvote: (vote: 'up' | 'down') => void;\n\t\tanimating?: boolean;\n\t\tdirection?: 'left' | 'right' | null;\n\t\t/** Hide the up/down vote buttons for read-only states (owner / already voted). */\n\t\tshowActions?: boolean;\n\t}\n\n\tlet { item, onvote, animating = false, direction = null, showActions = true }: Props = $props();\n\n\tconst displayName = $derived(item.isAnonymous || !item.nickname ? t('anonymous') : item.nickname);\n\tconst totalVotes = $derived(item.totalUpvotes + item.totalDownvotes);\n\tconst approvalPct = $derived(totalVotes > 0 ? Math.round((item.totalUpvotes / totalVotes) * 100) : 0);\n\n\t// RAT-236: report trigger.\n\tlet reportOpen = $state(false);\n</script>\n\n<div class=\"relative\">\n\t<!-- Depth stack cards -->\n\t<div class=\"absolute top-2 right-[-6px] bottom-[-6px] left-2 rounded-2xl border border-border bg-surface opacity-40\"></div>\n\t<div class=\"absolute top-1 right-[-3px] bottom-[-3px] left-1 rounded-2xl border border-border bg-surface-2 opacity-60\"></div>\n\n\t<!-- Main card -->\n\t<div\n\t\tclass=\"relative z-[2] overflow-hidden rounded-2xl border border-border bg-surface transition-all duration-500 ease-out\n\t\t\t{animating && direction === 'left' ? '-translate-x-[120%] rotate-[-12deg] opacity-0' : ''}\n\t\t\t{animating && direction === 'right' ? 'translate-x-[120%] rotate-[12deg] opacity-0' : ''}\n\t\t\t{!animating ? 'translate-x-0 rotate-0 opacity-100' : ''}\"\n\t>\n\t\t<!-- Photo / video -->\n\t\t<div class=\"relative aspect-[3/4] w-full overflow-hidden bg-bg\">\n\t\t\t{#if item.imageUrl}\n\t\t\t\t{#if item.mediaType === 'video'}\n\t\t\t\t\t<video\n\t\t\t\t\t\tsrc={item.imageUrl}\n\t\t\t\t\t\tautoplay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tplaysinline\n\t\t\t\t\t\tpreload=\"metadata\"\n\t\t\t\t\t\tclass=\"h-full w-full object-cover\"\n\t\t\t\t\t></video>\n\t\t\t\t{:else}\n\t\t\t\t\t<img src={item.imageUrl} alt={t('Arena submission')} class=\"h-full w-full object-cover\" loading=\"lazy\" />\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t<div class=\"flex h-full w-full items-center justify-center\">\n\t\t\t\t\t<svg class=\"h-16 w-16 text-white/[.04]\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1\">\n\t\t\t\t\t\t<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n\t\t\t\t\t\t<circle cx=\"9\" cy=\"9\" r=\"2\" />\n\t\t\t\t\t\t<path d=\"m21 15-3.086-3.086a2 2 0 00-2.828 0L6 21\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t\t<div class=\"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent\"></div>\n\n\t\t\t<!-- Badges on photo -->\n\t\t\t{#if item.aiScore}\n\t\t\t\t<div class=\"absolute top-3 left-3 rounded border border-orange/20 bg-bg/80 px-2.5 py-1 text-[11px] font-medium text-orange backdrop-blur-sm\">\n\t\t\t\t\t{item.aiScore} / 10\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t\t{#if totalVotes > 0}\n\t\t\t\t<div class=\"absolute top-3 right-3 rounded border border-green/20 bg-bg/80 px-2.5 py-1 text-[11px] font-medium text-green backdrop-blur-sm\">\n\t\t\t\t\t{approvalPct}%\n\t\t\t\t</div>\n\t\t\t{/if}\n\n\t\t\t{#if item.contestEntryId}\n\t\t\t\t<!-- cross-posted contest entry: upvoting here also votes in the weekly\n\t\t\t\t     contest (deduped). Contest entries are always boosted, so this\n\t\t\t\t     badge stands in for the plain \"boosted\" one. -->\n\t\t\t\t<div class=\"absolute bottom-14 left-3 flex items-center gap-1 rounded border border-yellow/30 bg-bg/85 px-2 py-0.5 backdrop-blur-sm\">\n\t\t\t\t\t<span class=\"text-[10px] leading-none\">🏆</span>\n\t\t\t\t\t<span class=\"text-[9px] font-bold uppercase tracking-wider text-yellow\">{t('contest entry')}</span>\n\t\t\t\t</div>\n\t\t\t{:else if item.isBoosted}\n\t\t\t\t<div class=\"absolute bottom-14 left-3 flex items-center gap-1 rounded border border-orange/20 bg-bg/80 px-2 py-0.5 backdrop-blur-sm\">\n\t\t\t\t\t<svg class=\"h-3 w-3 text-orange\" fill=\"currentColor\" viewBox=\"0 0 24 24\"><path d=\"M13 10V3L4 14h7v7l9-11h-7z\"/></svg>\n\t\t\t\t\t<span class=\"text-[9px] font-bold uppercase tracking-wider text-orange\">{t('boosted')}</span>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</div>\n\n\t\t<!-- Card info -->\n\t\t<div class=\"p-4\">\n\t\t\t<p class=\"font-display text-lg font-bold tracking-tight\">{displayName}</p>\n\t\t\t<div class=\"mt-1 flex items-center gap-2 text-[11px]\">\n\t\t\t\t{#if item.aiScore}\n\t\t\t\t\t<span class=\"text-orange\">{item.aiScore} / 10</span>\n\t\t\t\t\t<span class=\"h-0.5 w-0.5 rounded-full bg-muted/20\"></span>\n\t\t\t\t{/if}\n\t\t\t\t{#if totalVotes > 0}\n\t\t\t\t\t<span class=\"text-green\">{t('{pct}% approval', { pct: approvalPct })}</span>\n\t\t\t\t\t<span class=\"h-0.5 w-0.5 rounded-full bg-muted/20\"></span>\n\t\t\t\t\t<span class=\"text-muted/40\">{t('{n} votes', { n: totalVotes })}</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t{#if item.emotes.fire + item.emotes.water + item.emotes.crown + item.emotes.skull > 0}\n\t\t\t\t<div class=\"mt-2 flex gap-2 text-[11px] text-muted/40\">\n\t\t\t\t\t{#if item.emotes.fire > 0}\n\t\t\t\t\t\t<span class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<svg class=\"h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.362 5.214A8.252 8.252 0 0112 21 8.25 8.25 0 016.038 7.047 8.287 8.287 0 009 9.601a8.983 8.983 0 013.361-6.867 8.21 8.21 0 003 2.48z\" /></svg>\n\t\t\t\t\t\t\t{item.emotes.fire}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if item.emotes.water > 0}\n\t\t\t\t\t\t<span class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<svg class=\"h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 21a8.25 8.25 0 006.222-13.618A8.303 8.303 0 0012 3.25a8.303 8.303 0 00-6.222 4.132A8.25 8.25 0 0012 21z\" /></svg>\n\t\t\t\t\t\t\t{item.emotes.water}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if item.emotes.crown > 0}\n\t\t\t\t\t\t<span class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<svg class=\"h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z\" /></svg>\n\t\t\t\t\t\t\t{item.emotes.crown}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if item.emotes.skull > 0}\n\t\t\t\t\t\t<span class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<svg class=\"h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n\t\t\t\t\t\t\t{item.emotes.skull}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</div>\n\t</div>\n</div>\n\n<!-- Swipe buttons -->\n{#if showActions}\n\t<div class=\"mt-5 flex items-center justify-center gap-4\">\n\t\t<button\n\t\t\tclass=\"flex h-14 w-14 cursor-pointer items-center justify-center rounded-full border border-coral/20 bg-coral/[.08] text-coral transition-all hover:scale-105 hover:bg-coral/15 active:scale-95\"\n\t\t\tonclick={() => onvote('down')}\n\t\t\taria-label={t('Nope')}\n\t\t>\n\t\t\t<svg class=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2.5\">\n\t\t\t\t<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n\t\t\t</svg>\n\t\t</button>\n\n\t\t<button\n\t\t\tclass=\"flex h-[72px] w-[72px] cursor-pointer items-center justify-center rounded-full border border-green/20 bg-green/[.08] text-green transition-all hover:scale-105 hover:bg-green/15 active:scale-95\"\n\t\t\tonclick={() => onvote('up')}\n\t\t\taria-label={t('Approve')}\n\t\t>\n\t\t\t<svg class=\"h-7 w-7\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2.5\">\n\t\t\t\t<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\" />\n\t\t\t</svg>\n\t\t</button>\n\t</div>\n{/if}\n\n<!-- RAT-236: faint report link under the swipe buttons -->\n<div class=\"mt-4 text-center\">\n\t<button\n\t\ttype=\"button\"\n\t\tonclick={() => (reportOpen = true)}\n\t\tclass=\"text-[11px] text-muted/40 underline-offset-2 transition-colors hover:text-muted hover:underline\"\n\t>\n\t\t{t('report this submission')}\n\t</button>\n</div>\n\n<ReportContentModal\n\tbind:open={reportOpen}\n\tentityType=\"arena_submission\"\n\tentityId={item.id}\n\tonclose={() => (reportOpen = false)}\n/>\n","<script lang=\"ts\">\n\timport { t } from '$lib/i18n';\n\timport { goto } from '$app/navigation';\n\timport ArenaCard from '$lib/components/arena/ArenaCard.svelte';\n\timport type { ArenaFeedItem } from '$lib/types/arena';\n\n\tlet { data } = $props();\n\n\tconst item = $derived(data.item as ArenaFeedItem);\n\n\tlet hasVoted = $state(data.alreadyVoted);\n\tlet votedDirection = $state<'up' | 'down' | null>(null);\n\tlet voteError = $state<'daily_limit' | 'generic' | null>(null);\n\tlet submitting = $state(false);\n\n\t// RAT-117 pattern: re-seed local state when `data` reloads (e.g. navigating\n\t// from one submission deeplink straight to another reuses this component).\n\t$effect(() => {\n\t\thasVoted = data.alreadyVoted;\n\t\tvotedDirection = null;\n\t\tvoteError = null;\n\t});\n\n\tasync function handleVote(vote: 'up' | 'down') {\n\t\t// Logged-out: the card is public but voting isn't — send them to\n\t\t// register, returning here afterwards so they can swipe. Must run\n\t\t// synchronously (no await before goto) to keep the click activation.\n\t\tif (!data.isLoggedIn) {\n\t\t\tgoto(`/auth/sign-in?next=${encodeURIComponent(`/a/s/${item.id}`)}`);\n\t\t\treturn;\n\t\t}\n\t\tif (submitting || hasVoted || data.isOwner) return;\n\t\tsubmitting = true;\n\t\tvoteError = null;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/arena/vote', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ submissionId: item.id, vote })\n\t\t\t});\n\t\t\tconst r = await res.json();\n\t\t\tif (r.ok) {\n\t\t\t\tvotedDirection = vote;\n\t\t\t\thasVoted = true;\n\t\t\t} else if (r.error === 'already_voted' || r.error === 'own_submission') {\n\t\t\t\thasVoted = true;\n\t\t\t} else if (r.error === 'daily_limit') {\n\t\t\t\tvoteError = 'daily_limit';\n\t\t\t} else {\n\t\t\t\tvoteError = 'generic';\n\t\t\t}\n\t\t} catch {\n\t\t\tvoteError = 'generic';\n\t\t} finally {\n\t\t\tsubmitting = false;\n\t\t}\n\t}\n</script>\n\n<svelte:head>\n\t<title>{t('arena submission — ratemyd.')}</title>\n\t<meta name=\"robots\" content=\"noindex\" />\n</svelte:head>\n\n<section class=\"relative min-h-[calc(100dvh-64px)] px-4 pt-20 pb-16 md:pt-24\">\n\t<div\n\t\tclass=\"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(255,255,255,.006)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,.006)_1px,transparent_1px)] bg-[size:60px_60px]\"\n\t></div>\n\n\t<div class=\"relative z-10 mx-auto w-full max-w-[360px]\">\n\t\t<a\n\t\t\thref=\"/a\"\n\t\t\tclass=\"inline-flex items-center gap-1 text-sm text-muted no-underline transition-colors hover:text-accent\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 19l-7-7 7-7\" />\n\t\t\t</svg>\n\t\t\t{t('arena')}\n\t\t</a>\n\n\t\t<div class=\"mt-6\">\n\t\t\t<ArenaCard {item} onvote={handleVote} showActions={!hasVoted && !data.isOwner} />\n\t\t</div>\n\n\t\t{#if data.isOwner}\n\t\t\t<div class=\"mt-6 rounded-2xl border border-border bg-surface p-5 text-center\">\n\t\t\t\t<p class=\"font-display text-sm font-bold text-text\">{t('this is your submission')}</p>\n\t\t\t\t<p class=\"mt-1 text-[13px] text-muted\">{t(\"you can't vote on your own shot.\")}</p>\n\t\t\t\t<a\n\t\t\t\t\thref=\"/a/dashboard/{item.id}\"\n\t\t\t\t\tclass=\"mt-4 inline-flex items-center justify-center rounded-lg bg-accent px-5 py-3 font-display text-sm font-bold text-white no-underline transition-colors hover:bg-accent-dark\"\n\t\t\t\t>\n\t\t\t\t\t{t('view your stats →')}\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t{:else if hasVoted}\n\t\t\t<div class=\"mt-6 rounded-2xl border border-border bg-surface p-5 text-center\">\n\t\t\t\t<p class=\"font-display text-sm font-bold text-text\">\n\t\t\t\t\t{#if votedDirection === 'up'}\n\t\t\t\t\t\t{t('approved')} <span class=\"text-green\">✓</span>\n\t\t\t\t\t{:else if votedDirection === 'down'}\n\t\t\t\t\t\t{t('noped')}\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t{t('you already voted on this')}\n\t\t\t\t\t{/if}\n\t\t\t\t</p>\n\t\t\t\t<p class=\"mt-1 text-[13px] text-muted\">{t(\"keep going — the crowd's waiting.\")}</p>\n\t\t\t\t<a\n\t\t\t\t\thref=\"/a\"\n\t\t\t\t\tclass=\"mt-4 inline-flex items-center justify-center rounded-lg bg-accent px-5 py-3 font-display text-sm font-bold text-white no-underline transition-colors hover:bg-accent-dark\"\n\t\t\t\t>\n\t\t\t\t\t{t('enter the arena →')}\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t{:else if voteError}\n\t\t\t<p class=\"mt-5 text-center text-[13px] text-coral\">\n\t\t\t\t{#if voteError === 'daily_limit'}\n\t\t\t\t\t{t(\"you're out of swipes for today.\")}\n\t\t\t\t{:else}\n\t\t\t\t\t{t('something went wrong — try again.')}\n\t\t\t\t{/if}\n\t\t\t</p>\n\t\t{/if}\n\t</div>\n</section>\n"],"version":3}