{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"upvote-burst","type":"registry:component","title":"Upvote Burst","description":"A launch leaderboard climbs and a #1 Product of the Day badge stamps in.","dependencies":["remotion","@remotion/google-fonts"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>.","registryDependencies":["https://kuchi.kalarislabs.com/r/gradient-ground.json"],"files":[{"path":"components/kuchi/upvote-burst.tsx","type":"registry:component","target":"components/kuchi/upvote-burst.tsx","content":"/*! Portions Copyright (c) 2026 Remocn. MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Geist\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  Img,\n  interpolate,\n  spring,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/kuchi/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/kuchi/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/kuchi/gsh/presets\";\n\nconst { fontFamily: geist } = loadFont(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\nconst { fontFamily: mono } = loadMono(\"normal\", {\n  weights: [\"400\"],\n  subsets: [\"latin\"],\n});\n\ntype ThumbGlyph = \"play\" | \"wave\" | \"bolt\" | \"ring\" | \"grid\" | \"spark\";\n\nexport interface UpvoteProduct {\n  name: string;\n  tagline: string;\n  topic: string;\n  comments?: number;\n  color?: string;\n  glyph?: ThumbGlyph;\n  src?: string;\n}\n\nexport interface UpvoteRival extends UpvoteProduct {\n  votes: number;\n}\n\nexport interface UpvoteBurstProps {\n  product?: UpvoteProduct;\n  rivals?: UpvoteRival[];\n  startRank?: number;\n  startVotes?: number;\n  endVotes?: number;\n  title?: string;\n  dateLabel?: string;\n  badgeLabel?: string;\n  /** Status label in the board header. */\n  liveLabel?: string;\n  /** Line under the headline, after the vote count. */\n  votesLabel?: string;\n  theme?: \"light\" | \"dark\";\n  accent?: string;\n  /** Text color of the board and headline; overrides the theme ink. */\n  ink?: string;\n  /** Solid fill in place of the gradient ground; \"transparent\" drops it. */\n  background?: string;\n  /** Typeface for the board and headline. Load it yourself; Geist by default. */\n  fontFamily?: string;\n  /** Size of the board and badge, around the frame's center. */\n  scale?: number;\n  /** Frames to hold the first frame before anything moves. */\n  delay?: number;\n  speed?: number;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_PRODUCT: UpvoteProduct = {\n  name: \"acme\",\n  tagline: \"Launch videos from copy-paste Remotion components\",\n  topic: \"Video\",\n  comments: 96,\n};\n\nconst r = (\n  name: string,\n  tagline: string,\n  topic: string,\n  votes: number,\n  comments: number,\n  color: string,\n): UpvoteRival => ({ name, tagline, topic, votes, comments, color });\n\n// biome-ignore format: compact data table\nconst DEFAULT_RIVALS: UpvoteRival[] = [\n  r(\"Halcyon\", \"Meeting notes that draft your follow-ups\", \"Productivity\", 1184, 142, \"#C9A27A\"),\n  r(\"Quarry\", \"Query any database in plain English\", \"Developer tools\", 962, 88, \"#8EA6A0\"),\n  r(\"Orbitly\", \"The calendar for teams across time zones\", \"Productivity\", 731, 64, \"#9AA3C2\"),\n  r(\"Tessel\", \"Design tokens that sync straight to code\", \"Design tools\", 548, 41, \"#C2A0A8\"),\n  r(\"Fernway\", \"Expense reports that file themselves\", \"Fintech\", 297, 23, \"#A3B08A\"),\n];\n\n\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\nconst CAM = Easing.bezier(0.87, 0, 0.13, 1);\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\n\nconst BEAT = {\n  sheet: 0,\n  rows: 4,\n  cursor: 6,\n  press: 18,\n  countFrom: 24,\n  countTo: 60,\n  clearPad: 12,\n};\n\nfunction hexToRgba(hex: string, a: number) {\n  const h = hex.replace(\"#\", \"\");\n  const full =\n    h.length === 3\n      ? h\n          .split(\"\")\n          .map((c) => c + c)\n          .join(\"\")\n      : h.slice(0, 6);\n  const v = Number.parseInt(full, 16);\n  return `rgba(${(v >> 16) & 255}, ${(v >> 8) & 255}, ${v & 255}, ${a})`;\n}\n\ninterface Palette {\n  ink: string;\n  muted: string;\n  faint: string;\n  sheet: string;\n  sheetShadow: string;\n  raised: string;\n  raisedShadow: string;\n  hairline: string;\n  boxBorder: string;\n  tileInk: string;\n}\n\nfunction Thumb({\n  item,\n  isProduct,\n  accent,\n  pal,\n}: {\n  item: UpvoteProduct;\n  isProduct: boolean;\n  accent: string;\n  pal: Palette;\n}) {\n  const box: React.CSSProperties = {\n    width: 44,\n    height: 44,\n    borderRadius: 10,\n    flexShrink: 0,\n  };\n  if (item.src) {\n    return (\n      <Img\n        src={item.src}\n        style={{\n          ...box,\n          objectFit: \"cover\",\n          outline: `1px solid ${pal.hairline}`,\n          outlineOffset: -1,\n        }}\n      />\n    );\n  }\n  if (isProduct) {\n    return (\n      <div\n        style={{\n          ...box,\n          background: accent,\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"center\",\n          boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.22)\",\n        }}\n      >\n        <svg viewBox=\"0 0 124.06 134.26\" height={18} aria-hidden>\n          <circle cx=\"62.03\" cy=\"67.13\" r=\"56\" fill=\"#fff\"  />\n        </svg>\n      </div>\n    );\n  }\n  const tone = item.color ?? \"#9AA3B5\";\n  return (\n    <div\n      style={{\n        ...box,\n        background: hexToRgba(tone, 0.22),\n        boxShadow: `inset 0 0 0 1px ${hexToRgba(tone, 0.35)}`,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n        fontSize: 20,\n        fontWeight: 400,\n        color: pal.tileInk,\n        letterSpacing: \"-0.02em\",\n      }}\n    >\n      {item.name.slice(0, 1)}\n    </div>\n  );\n}\n\nfunction Odometer({ value, color }: { value: number; color: string }) {\n  const lh = 20;\n  const digits = String(Math.floor(value)).split(\"\");\n  const nodes: React.ReactNode[] = [];\n  digits.forEach((_, di) => {\n    const place = digits.length - 1 - di;\n    const unit = 10 ** place;\n    let pos = Math.floor(value / unit) % 10;\n    const rem = value % unit;\n    if (place > 0 && rem > unit - 1) pos += rem - (unit - 1);\n    nodes.push(\n      <span key={`d${place}`} style={{ height: lh, overflow: \"hidden\" }}>\n        <span\n          style={{ display: \"block\", transform: `translateY(${-pos * lh}px)` }}\n        >\n          {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((n, idx) => (\n            <span\n              key={`${place}-${idx}`}\n              style={{ display: \"block\", height: lh }}\n            >\n              {n}\n            </span>\n          ))}\n        </span>\n      </span>,\n    );\n    if (place > 0 && place % 3 === 0)\n      nodes.push(<span key={`c${place}`}>,</span>);\n  });\n  return (\n    <span\n      style={{\n        display: \"inline-flex\",\n        fontFamily: mono,\n        fontSize: 16,\n        lineHeight: `${lh}px`,\n        color,\n        fontVariantNumeric: \"tabular-nums\",\n        fontWeight: 400,\n        letterSpacing: \"-0.02em\",\n      }}\n    >\n      {nodes}\n    </span>\n  );\n}\n\nfunction Chevron({ color }: { color: string }) {\n  return (\n    <svg width={14} height={10} viewBox=\"0 0 14 10\" aria-hidden>\n      <path\n        d=\"M2 8 7 2.6 12 8\"\n        fill=\"none\"\n        stroke={color}\n        strokeWidth={1.6}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nfunction Badge({\n  accent,\n  label,\n  sub,\n  id,\n  fontFamily,\n}: {\n  accent: string;\n  label: string;\n  sub: string;\n  id: string;\n  fontFamily: string;\n}) {\n  const R = 124;\n  const tr = R - 26;\n  return (\n    <svg width={R * 2} height={R * 2} style={{ overflow: \"visible\" }}>\n      <defs>\n        <radialGradient id={`${id}-face`} cx=\"0.35\" cy=\"0.28\" r=\"0.9\">\n          <stop offset=\"0\" stopColor=\"#ffffff\" stopOpacity=\"0.28\" />\n          <stop offset=\"0.55\" stopColor=\"#ffffff\" stopOpacity=\"0\" />\n        </radialGradient>\n        <path\n          id={`${id}-top`}\n          d={`M ${R - tr},${R} A ${tr} ${tr} 0 0 1 ${R + tr},${R}`}\n        />\n        <path\n          id={`${id}-bot`}\n          d={`M ${R - tr - 12},${R} A ${tr + 12} ${tr + 12} 0 0 0 ${R + tr + 12},${R}`}\n        />\n      </defs>\n      <circle\n        cx={R}\n        cy={R + 14}\n        r={R - 6}\n        fill=\"#0a0d24\"\n        opacity={0.28}\n        style={{ filter: \"blur(18px)\" }}\n      />\n      <circle cx={R} cy={R} r={R} fill={accent} />\n      <circle cx={R} cy={R} r={R} fill={`url(#${id}-face)`} />\n      <circle\n        cx={R}\n        cy={R}\n        r={R - 1}\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeOpacity={0.3}\n      />\n      <circle\n        cx={R}\n        cy={R}\n        r={R - 44}\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeOpacity={0.35}\n      />\n      <text\n        fill=\"#fff\"\n        fontFamily={mono}\n        fontSize={16}\n        fontWeight={400}\n        letterSpacing={3.2}\n      >\n        <textPath\n          href={`#${id}-top`}\n          startOffset=\"50%\"\n          textAnchor=\"middle\"\n          style={{ textTransform: \"uppercase\" }}\n        >\n          {label}\n        </textPath>\n      </text>\n      <text\n        fill=\"#fff\"\n        fillOpacity={0.78}\n        fontFamily={mono}\n        fontSize={16}\n        fontWeight={400}\n        letterSpacing={3.2}\n      >\n        <textPath\n          href={`#${id}-bot`}\n          startOffset=\"50%\"\n          textAnchor=\"middle\"\n          style={{ textTransform: \"uppercase\" }}\n        >\n          {sub}\n        </textPath>\n      </text>\n      <text\n        x={R - 4}\n        y={R + 30}\n        textAnchor=\"middle\"\n        fill=\"#fff\"\n        fontFamily={fontFamily}\n        fontSize={92}\n        fontWeight={300}\n        letterSpacing={-4}\n      >\n        #1\n      </text>\n    </svg>\n  );\n}\n\nfunction Cursor() {\n  return (\n    <svg\n      width={26}\n      height={30}\n      viewBox=\"0 0 26 30\"\n      style={{ overflow: \"visible\", display: \"block\" }}\n      aria-hidden\n    >\n      <path\n        d=\"M3 2.5v21.2l5.7-5.4 3.7 8.6 3.9-1.7-3.7-8.4h7.9z\"\n        fill=\"#0d0f14\"\n        stroke=\"#fff\"\n        strokeWidth={1.6}\n        strokeLinejoin=\"round\"\n        style={{ filter: \"drop-shadow(0 3px 6px rgba(0,0,0,0.3))\" }}\n      />\n    </svg>\n  );\n}\n\n/** The foreground at `scale`, around the frame's center; nothing extra at 1. */\nfunction ScaleLayer({\n  scale,\n  children,\n}: {\n  scale: number;\n  children: React.ReactNode;\n}) {\n  if (scale === 1) return children;\n  return (\n    <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n      {children}\n    </AbsoluteFill>\n  );\n}\n\nexport function UpvoteBurst({\n  product = DEFAULT_PRODUCT,\n  rivals = DEFAULT_RIVALS,\n  startRank = 5,\n  startVotes = 412,\n  endVotes = 1342,\n  title = \"Top products launching today\",\n  dateLabel = \"Thu, Oct 23\",\n  badgeLabel = \"Product of the day\",\n  liveLabel = \"Live\",\n  votesLabel = \"upvotes in 24 hours\",\n  theme = \"light\",\n  accent = \"#3B5BFD\",\n  ink,\n  background,\n  fontFamily = geist,\n  scale = 1,\n  delay = 0,\n  speed = 1,\n  ground,\n  groundParams,\n}: UpvoteBurstProps) {\n  const rawFrame = Math.max(0, useCurrentFrame() - delay);\n  const { fps, width, height } = useVideoConfig();\n  const frame = rawFrame * speed;\n  const tall = height > width;\n  const stageW = tall ? 820 : 1280;\n  const k = width / stageW;\n  const stageH = height / k;\n  const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const dark = theme === \"dark\";\n  const basePal: Palette = dark\n    ? {\n        ink: \"#F4F5F8\",\n        muted: \"rgba(236,239,247,0.62)\",\n        faint: \"rgba(236,239,247,0.42)\",\n        sheet: \"rgba(14,16,24,0.86)\",\n        sheetShadow:\n          \"0 0 0 1px rgba(255,255,255,0.09), inset 0 1px 0 rgba(255,255,255,0.06), 0 30px 80px -20px rgba(0,0,0,0.7)\",\n        raised: \"#1A1D28\",\n        raisedShadow:\n          \"0 0 0 1px rgba(255,255,255,0.12), inset 0 1px 0 rgba(255,255,255,0.07)\",\n        hairline: \"rgba(255,255,255,0.07)\",\n        boxBorder: \"rgba(255,255,255,0.13)\",\n        tileInk: \"#F4F5F8\",\n      }\n    : {\n        ink: \"#14161D\",\n        muted: \"#474C59\",\n        faint: \"#8A8F9C\",\n        sheet: \"rgba(255,255,255,0.94)\",\n        sheetShadow:\n          \"0 0 0 1px rgba(16,20,40,0.06), 0 2px 4px rgba(16,20,40,0.04), 0 24px 60px -18px rgba(16,24,64,0.28)\",\n        raised: \"#FFFFFF\",\n        raisedShadow:\n          \"0 0 0 1px rgba(16,20,40,0.07), 0 2px 4px rgba(16,20,40,0.05), 0 14px 30px -12px rgba(16,24,64,0.22)\",\n        hairline: \"rgba(16,20,40,0.07)\",\n        boxBorder: \"rgba(16,20,40,0.12)\",\n        tileInk: \"#2A2E38\",\n      };\n  const pal: Palette = ink === undefined ? basePal : { ...basePal, ink };\n  const sp = (from: number, config: typeof CARD) =>\n    spring({ frame: frame - from, fps, config });\n\n  const sRank = Math.max(1, Math.min(startRank, rivals.length + 1));\n  const rowH = 68;\n  const pad = 8;\n  const headerH = 66;\n  const sheetW = 700;\n  const sheetH = pad * 2 + headerH + (rivals.length + 1) * rowH;\n  const sheetX = (stageW - sheetW) / 2;\n  const sheetY = (stageH - sheetH) / 2;\n  const listTop = sheetY + pad + headerH;\n  const rowX = sheetX + pad;\n  const rowW = sheetW - pad * 2;\n\n  const votesAt = (f: number) =>\n    interpolate(f, [BEAT.countFrom, BEAT.countTo], [startVotes, endVotes], {\n      ...CLAMP,\n      easing: MOVE,\n    });\n  const rivalVotesAt = (i: number, f: number) =>\n    rivals[i].votes +\n    Math.floor(Math.max(0, f) * (0.03 + ((i * 37) % 5) * 0.012));\n  const productVotes = votesAt(frame);\n  const crossAt: (number | null)[] = rivals.map((_, i) => {\n    if (i >= sRank - 1) return null;\n    for (let f = BEAT.countFrom; f <= BEAT.countTo + 1; f++) {\n      if (votesAt(f) > rivalVotesAt(i, f)) return f;\n    }\n    return null;\n  });\n  const swap = (c: number) => sp(c, CARD);\n  const passed = crossAt.filter((c) => c !== null && frame >= c + 3).length;\n  const lastCross = Math.max(BEAT.countFrom, ...crossAt.map((c) => c ?? 0));\n  const reachedTop = crossAt.slice(0, sRank - 1).every((c) => c !== null);\n\n  const pressS = sp(BEAT.press, CHIP);\n  const press =\n    frame < BEAT.press\n      ? 1\n      : 0.96 +\n        0.04 *\n          interpolate(frame - BEAT.press, [0, 3], [0, 1], CLAMP) *\n          Math.min(1, pressS);\n  const fill = sp(BEAT.press, CARD);\n  const dim = reachedTop\n    ? interpolate(frame, [lastCross + 4, lastCross + 14], [0, 1], {\n        ...CLAMP,\n        easing: ENTER,\n      })\n    : 0;\n  const clearAt = Math.max(BEAT.countTo, lastCross) + BEAT.clearPad;\n  const stampAt = clearAt + 4;\n  const stamp = sp(stampAt, CARD);\n  const tl = frame - (stampAt + 5);\n  const shake = tl >= 0 ? 3 * Math.exp(-tl / 3) : 0;\n  const captionIn = (d: number) =>\n    interpolate(frame, [stampAt + 8 + d, stampAt + 22 + d], [0, 1], {\n      ...CLAMP,\n      easing: ENTER,\n    });\n  const sheetIn = sp(BEAT.sheet, HEAVY);\n  const sheetOut = interpolate(frame, [clearAt, clearAt + 10], [0, 1], {\n    ...CLAMP,\n    easing: EXIT,\n  });\n  const ripple = interpolate(frame - BEAT.press, [0, 14], [0, 1], {\n    ...CLAMP,\n    easing: ENTER,\n  });\n  const ring = interpolate(frame, [stampAt + 3, stampAt + 24], [0, 1], {\n    ...CLAMP,\n    easing: ENTER,\n  });\n  const push = interpolate(frame, [0, 135], [1, 1.03], CLAMP);\n  const camIn = interpolate(frame, [0, 30], [1.04, 1], {\n    ...CLAMP,\n    easing: CAM,\n  });\n\n  const rows = [\n    ...rivals.map((item, i) => ({\n      item: item as UpvoteProduct,\n      ri: i,\n      slot: i < sRank - 1 ? i : i + 1,\n    })),\n    { item: product, ri: -1, slot: sRank - 1 },\n  ];\n\n  const voteX = rowX + rowW - 12 - 30;\n  const voteY0 = listTop + (sRank - 1) * rowH + rowH / 2;\n  const cur = interpolate(frame, [BEAT.cursor, BEAT.press - 1], [0, 1], {\n    ...CLAMP,\n    easing: MOVE,\n  });\n  const curFrom = { x: sheetX + sheetW + 150, y: sheetY + sheetH + 40 };\n  const curX = curFrom.x + (voteX + 4 - curFrom.x) * cur;\n  const curY =\n    curFrom.y + (voteY0 + 6 - curFrom.y) * cur - Math.sin(Math.PI * cur) * 70;\n  const curShow =\n    interpolate(frame, [BEAT.cursor, BEAT.cursor + 6], [0, 1], CLAMP) *\n    interpolate(frame, [BEAT.press + 12, BEAT.press + 20], [1, 0], {\n      ...CLAMP,\n      easing: EXIT,\n    });\n  const curLeave = interpolate(\n    frame,\n    [BEAT.press + 10, BEAT.press + 20],\n    [0, 1],\n    {\n      ...CLAMP,\n      easing: EXIT,\n    },\n  );\n\n  const badgeC = tall\n    ? { x: stageW / 2, y: stageH * 0.4 }\n    : { x: 360, y: stageH / 2 };\n  const capStyle: React.CSSProperties = tall\n    ? {\n        left: 40,\n        right: 40,\n        top: badgeC.y + 180,\n        textAlign: \"center\",\n      }\n    : { left: 540, width: 620, top: stageH / 2 - 70, textAlign: \"left\" };\n\n  return (\n    <AbsoluteFill style={{ overflow: \"hidden\", fontFamily }}>\n      {background !== undefined ? (\n        <AbsoluteFill\n          style={{\n            background: background === \"transparent\" ? undefined : background,\n          }}\n        />\n      ) : (\n        <>\n          <GshGround\n            preset={ground ?? (dark ? \"cobalt-rise\" : \"paper-crease\")}\n            params={groundParams}\n            timeOffset={4}\n            timeScale={0.4}\n          />\n          {dark ? (\n            <AbsoluteFill\n              style={{\n                background:\n                  \"radial-gradient(70% 60% at 50% 40%, rgba(4,6,16,0.55), rgba(4,6,16,0) 100%)\",\n              }}\n            />\n          ) : null}\n        </>\n      )}\n      <ScaleLayer scale={scale}>\n        <div\n          style={{\n            position: \"absolute\",\n            width: stageW,\n            height: stageH,\n            transform: `scale(${k * push * camIn}) translate(${shake * Math.sin(tl * 2.9)}px, ${shake * 0.7 * Math.cos(tl * 3.7)}px)`,\n            transformOrigin: `${stageW / 2}px ${stageH / 2}px`,\n            left: (width - stageW) / 2,\n            top: (height - stageH) / 2,\n          }}\n        >\n          <div\n            style={{\n              position: \"absolute\",\n              left: sheetX,\n              top: sheetY,\n              width: sheetW,\n              height: sheetH,\n              borderRadius: 20,\n              background: pal.sheet,\n              boxShadow: pal.sheetShadow,\n              opacity: Math.min(1, sheetIn * 1.4) * (1 - sheetOut),\n              transform: `translateY(${(1 - sheetIn) * 60 + sheetOut * 24}px) scale(${0.97 + 0.03 * sheetIn - sheetOut * 0.03})`,\n              filter: sheetOut > 0 ? `blur(${sheetOut * 6}px)` : undefined,\n            }}\n          >\n            <div\n              style={{\n                position: \"absolute\",\n                left: pad + 16,\n                right: pad + 16,\n                top: pad,\n                height: headerH,\n                display: \"flex\",\n                alignItems: \"center\",\n                justifyContent: \"space-between\",\n                borderBottom: `1px solid ${pal.hairline}`,\n              }}\n            >\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"baseline\",\n                  gap: 14,\n                }}\n              >\n                <span\n                  style={{\n                    fontSize: 22,\n                    fontWeight: 400,\n                    color: pal.ink,\n                    letterSpacing: \"-0.02em\",\n                  }}\n                >\n                  {title}\n                </span>\n                <span\n                  style={{ fontFamily: mono, fontSize: 16, color: pal.faint }}\n                >\n                  {dateLabel}\n                </span>\n              </div>\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  gap: 8,\n                  fontFamily: mono,\n                  fontSize: 16,\n                  color: pal.muted,\n                }}\n              >\n                <span\n                  style={{\n                    width: 7,\n                    height: 7,\n                    borderRadius: 9,\n                    background: \"#2FB36B\",\n                    boxShadow: `0 0 0 ${3 + 2 * Math.sin(frame / 5)}px rgba(47,179,107,0.18)`,\n                  }}\n                />\n                {liveLabel}\n              </div>\n            </div>\n          </div>\n\n          {rows.map(({ item, ri, slot }) => {\n            const isProduct = ri < 0;\n            let y = listTop + slot * rowH;\n            let rank = slot + 1;\n            let lift = 0;\n            let bump = 0;\n            if (isProduct) {\n              for (const c of crossAt) {\n                if (c === null) continue;\n                const s = swap(c);\n                y -= s * rowH;\n                lift = Math.max(lift, Math.sin(Math.PI * Math.min(1, s)));\n                bump = Math.max(\n                  bump,\n                  interpolate(frame - c, [0, 4, 12], [0, 1, 0], CLAMP),\n                );\n              }\n              rank = sRank - passed;\n            } else {\n              const c = crossAt[ri];\n              if (c !== null) {\n                y += swap(c) * rowH;\n                if (frame >= c + 3) rank += 1;\n              }\n            }\n            const rowIn = sp(BEAT.rows + slot * 2, CARD);\n            const t0 = clearAt + (isProduct ? 2 : (rivals.length - slot) * 1);\n            const out = interpolate(frame, [t0, t0 + 8], [0, 1], {\n              ...CLAMP,\n              easing: EXIT,\n            });\n            const isLast = slot === rivals.length;\n            const voteBorder = isProduct\n              ? hexToRgba(accent, Math.min(1, fill))\n              : pal.boxBorder;\n\n            return (\n              <div\n                key={isProduct ? \"product\" : `${item.name}-${ri}`}\n                style={{\n                  position: \"absolute\",\n                  left: rowX,\n                  width: rowW,\n                  top: y,\n                  height: rowH,\n                  zIndex: isProduct ? 10 : 1,\n                  opacity:\n                    Math.min(1, rowIn * 1.3) *\n                    (isProduct ? 1 : 1 - dim * 0.55) *\n                    (1 - out),\n                  transform: `translateY(${(1 - rowIn) * 16 + out * (isProduct ? -8 : 12)}px) scale(${1 + lift * 0.018})`,\n                }}\n              >\n                {isProduct ? (\n                  <div\n                    style={{\n                      position: \"absolute\",\n                      inset: 0,\n                      borderRadius: 12,\n                      background: pal.raised,\n                      boxShadow: pal.raisedShadow,\n                      opacity: Math.min(1, fill * 1.2),\n                    }}\n                  />\n                ) : null}\n                <div\n                  style={{\n                    position: \"absolute\",\n                    inset: \"0 12px 0 16px\",\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: 14,\n                    borderBottom:\n                      isProduct || isLast\n                        ? \"none\"\n                        : `1px solid ${pal.hairline}`,\n                  }}\n                >\n                  <div\n                    style={{\n                      width: 24,\n                      fontFamily: mono,\n                      fontSize: 16,\n                      color: isProduct && rank === 1 ? accent : pal.faint,\n                      fontVariantNumeric: \"tabular-nums\",\n                    }}\n                  >\n                    {rank}\n                  </div>\n                  <Thumb\n                    item={item}\n                    isProduct={isProduct}\n                    accent={accent}\n                    pal={pal}\n                  />\n                  <div style={{ flex: 1, minWidth: 0 }}>\n                    <div\n                      style={{\n                        display: \"flex\",\n                        alignItems: \"baseline\",\n                        gap: 10,\n                      }}\n                    >\n                      <span\n                        style={{\n                          fontSize: 18,\n                          fontWeight: 400,\n                          color: pal.ink,\n                          letterSpacing: \"-0.01em\",\n                        }}\n                      >\n                        {item.name}\n                      </span>\n                      <span style={{ fontSize: 16, color: pal.faint }}>\n                        {item.topic}\n                      </span>\n                    </div>\n                    <div\n                      style={{\n                        fontSize: 16,\n                        color: pal.muted,\n                        marginTop: 2,\n                        whiteSpace: \"nowrap\",\n                        overflow: \"hidden\",\n                        textOverflow: \"ellipsis\",\n                      }}\n                    >\n                      {item.tagline}\n                    </div>\n                  </div>\n                  <div\n                    style={{\n                      position: \"relative\",\n                      width: 60,\n                      height: 52,\n                      borderRadius: 10,\n                      flexShrink: 0,\n                      boxShadow: `inset 0 0 0 1px ${voteBorder}`,\n                      overflow: \"hidden\",\n                      transform: `scale(${(1 + bump * 0.06) * (isProduct ? press : 1)})`,\n                    }}\n                  >\n                    <div\n                      style={{\n                        position: \"absolute\",\n                        inset: 0,\n                        display: \"flex\",\n                        flexDirection: \"column\",\n                        alignItems: \"center\",\n                        justifyContent: \"center\",\n                        gap: 2,\n                      }}\n                    >\n                      <Chevron color={pal.muted} />\n                      <Odometer\n                        value={\n                          isProduct ? productVotes : rivalVotesAt(ri, frame)\n                        }\n                        color={pal.ink}\n                      />\n                    </div>\n                    {isProduct ? (\n                      <div\n                        style={{\n                          position: \"absolute\",\n                          inset: 0,\n                          display: \"flex\",\n                          flexDirection: \"column\",\n                          alignItems: \"center\",\n                          justifyContent: \"center\",\n                          gap: 2,\n                          background: accent,\n                          clipPath: `circle(${Math.max(0, fill) * 75}% at 50% 30%)`,\n                        }}\n                      >\n                        <Chevron color=\"#fff\" />\n                        <Odometer value={productVotes} color=\"#fff\" />\n                      </div>\n                    ) : null}\n                  </div>\n                </div>\n                {isProduct && frame >= BEAT.press ? (\n                  <div\n                    style={{\n                      position: \"absolute\",\n                      right: 12,\n                      top: rowH / 2 - 26,\n                      width: 60,\n                      height: 52,\n                      borderRadius: 12,\n                      boxShadow: `0 0 0 1.5px ${accent}`,\n                      opacity: 0.55 * (1 - ripple),\n                      transform: `scale(${1 + ripple * 0.3})`,\n                    }}\n                  />\n                ) : null}\n              </div>\n            );\n          })}\n\n          {curShow > 0 ? (\n            <div\n              style={{\n                position: \"absolute\",\n                left: curX + curLeave * 40,\n                top: curY + curLeave * 30,\n                opacity: curShow,\n                zIndex: 30,\n                transform: `scale(${frame >= BEAT.press - 1 && frame < BEAT.press + 5 ? 0.9 : 1})`,\n                transformOrigin: \"4px 4px\",\n              }}\n            >\n              <Cursor />\n            </div>\n          ) : null}\n\n          {frame >= stampAt ? (\n            <>\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: badgeC.x,\n                  top: badgeC.y,\n                  width: 0,\n                  height: 0,\n                }}\n              >\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: -150,\n                    top: -150,\n                    width: 300,\n                    height: 300,\n                    borderRadius: 300,\n                    boxShadow: `0 0 0 1.5px ${hexToRgba(accent, 0.6)}`,\n                    opacity: (1 - ring) * Math.min(1, ring * 6),\n                    transform: `scale(${0.8 + ring * 0.5})`,\n                  }}\n                />\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: -124,\n                    top: -124,\n                    transform: `scale(${interpolate(stamp, [0, 1], [1.35, 1])}) rotate(${interpolate(stamp, [0, 1], [-14, -5])}deg)`,\n                    opacity: interpolate(\n                      frame - stampAt,\n                      [0, 3],\n                      [0, 1],\n                      CLAMP,\n                    ),\n                  }}\n                >\n                  <Badge\n                    accent={accent}\n                    label={badgeLabel}\n                    sub={product.name}\n                    id={id}\n                    fontFamily={fontFamily}\n                  />\n                </div>\n              </div>\n              <div style={{ position: \"absolute\", ...capStyle }}>\n                <div style={{ overflow: \"hidden\", paddingBottom: 6 }}>\n                  <div\n                    style={{\n                      fontSize: tall ? 76 : 68,\n                      fontWeight: 300,\n                      lineHeight: 1.02,\n                      color: pal.ink,\n                      letterSpacing: \"-0.04em\",\n                      transform: `translateY(${(1 - captionIn(0)) * 105}%)`,\n                    }}\n                  >\n                    {product.name} is #1 today\n                  </div>\n                </div>\n                <div\n                  style={{\n                    marginTop: 16,\n                    fontFamily: mono,\n                    fontSize: tall ? 24 : 20,\n                    color: pal.muted,\n                    fontVariantNumeric: \"tabular-nums\",\n                    opacity: captionIn(5),\n                    transform: `translateY(${(1 - captionIn(5)) * 12}px)`,\n                  }}\n                >\n                  {Math.round(endVotes).toLocaleString(\"en-US\")} {votesLabel}\n                </div>\n              </div>\n            </>\n          ) : null}\n        </div>\n      </ScaleLayer>\n    </AbsoluteFill>\n  );\n}\n"}]}