{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "analytics-funnel",
  "title": "Analytics Funnel",
  "description": "An activation funnel chart steps down while a tooltip shows breakdowns.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "registryDependencies": ["@remocn/gsh"],
  "files": [
    {
      "path": "registry/remocn/analytics-funnel/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Geist\";\nimport type React from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  spring,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/remocn/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/remocn/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/remocn/gsh/presets\";\n\nconst { fontFamily } = loadFont(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\n\nexport interface FunnelStep {\n  label: string;\n  event: string;\n  control: number;\n  variant: number;\n}\n\nexport interface FunnelBreakdownRow {\n  label: string;\n  share: number;\n}\n\nexport interface AnalyticsFunnelProps {\n  steps?: FunnelStep[];\n  title?: string;\n  variantLabel?: string;\n  tooltipStep?: number;\n  breakdown?: FunnelBreakdownRow[];\n  dateRange?: string;\n  theme?: \"light\" | \"dark\";\n  accent?: string;\n  speed?: number;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_STEPS: FunnelStep[] = [\n  {\n    label: \"Visit\",\n    event: \"Viewed landing page\",\n    control: 18420,\n    variant: 18420,\n  },\n  { label: \"Sign up\", event: \"Signed up\", control: 7920, variant: 8288 },\n  {\n    label: \"Activate\",\n    event: \"Created first project\",\n    control: 4277,\n    variant: 5304,\n  },\n  { label: \"Pay\", event: \"Started subscription\", control: 1540, variant: 1820 },\n];\nconst DEFAULT_BREAKDOWN: FunnelBreakdownRow[] = [\n  { label: \"Web\", share: 0.61 },\n  { label: \"iOS\", share: 0.26 },\n  { label: \"Android\", share: 0.13 },\n];\n\nconst CL = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst enterEase = Easing.bezier(0.32, 0.72, 0, 1);\nconst exitEase = Easing.bezier(0.55, 0, 1, 0.45);\nconst camEase = Easing.bezier(0.87, 0, 0.13, 1);\nconst tween = (f: number, a: number, b: number, easing = enterEase) =>\n  interpolate(f, [a, b], [0, 1], { ...CL, easing });\nconst clamp = (v: number, lo: number, hi: number) =>\n  Math.min(hi, Math.max(lo, v));\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\nconst fmt = (n: number) =>\n  String(Math.round(n)).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\nconst pct = (v: number) => `${v.toFixed(1)}%`;\n\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 };\nconst MORPH = { damping: 200 };\n\nfunction withAlpha(color: string, alpha: number) {\n  const hex = color.replace(\"#\", \"\");\n  const full = hex.length === 3 ? hex.replace(/(.)/g, \"$1$1\") : hex;\n  if (!/^[0-9a-fA-F]{6}$/.test(full)) return color;\n  const n = Number.parseInt(full, 16);\n  return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;\n}\n\ninterface Pal {\n  win: string;\n  tip: string;\n  line: string;\n  track: string;\n  text: string;\n  muted: string;\n  faint: string;\n  green: string;\n  greenBg: string;\n  knobOff: string;\n  scrim: string;\n  winShadow: string;\n  tipShadow: string;\n  stageText: string;\n  stageMuted: string;\n  dark: boolean;\n}\n\nfunction palette(theme: \"light\" | \"dark\"): Pal {\n  return theme === \"dark\"\n    ? {\n        win: \"#0E0F12\",\n        tip: \"#17181C\",\n        line: \"rgba(255,255,255,0.07)\",\n        track: \"rgba(255,255,255,0.08)\",\n        text: \"#EEEEF0\",\n        muted: \"rgba(238,238,240,0.6)\",\n        faint: \"rgba(238,238,240,0.4)\",\n        green: \"#62D893\",\n        greenBg: \"rgba(98,216,147,0.12)\",\n        knobOff: \"rgba(255,255,255,0.16)\",\n        scrim: \"rgba(3,4,10,0.28)\",\n        winShadow:\n          \"0 0 0 1px rgba(255,255,255,0.09), inset 0 1px 0 rgba(255,255,255,0.05), 0 40px 90px -24px rgba(0,0,0,0.75), 0 10px 28px rgba(0,0,0,0.35)\",\n        tipShadow:\n          \"0 0 0 1px rgba(255,255,255,0.11), inset 0 1px 0 rgba(255,255,255,0.06), 0 24px 48px -12px rgba(0,0,0,0.7)\",\n        stageText: \"#F2F2F4\",\n        stageMuted: \"rgba(242,242,244,0.62)\",\n        dark: true,\n      }\n    : {\n        win: \"#FCFCFB\",\n        tip: \"#FFFFFF\",\n        line: \"rgba(22,23,26,0.08)\",\n        track: \"rgba(22,23,26,0.07)\",\n        text: \"#16171A\",\n        muted: \"rgba(22,23,26,0.6)\",\n        faint: \"rgba(22,23,26,0.42)\",\n        green: \"#18794E\",\n        greenBg: \"rgba(24,121,78,0.1)\",\n        knobOff: \"rgba(22,23,26,0.16)\",\n        scrim: \"rgba(238,240,246,0.18)\",\n        winShadow:\n          \"0 0 0 1px rgba(17,19,24,0.07), 0 1px 2px rgba(17,19,24,0.05), 0 30px 70px -20px rgba(28,38,92,0.28)\",\n        tipShadow:\n          \"0 0 0 1px rgba(17,19,24,0.08), 0 2px 4px rgba(17,19,24,0.05), 0 22px 44px -14px rgba(28,38,92,0.3)\",\n        stageText: \"#14151A\",\n        stageMuted: \"rgba(20,21,26,0.6)\",\n        dark: false,\n      };\n}\n\nconst ICONS = {\n  arrowUp: \"M8 12.5v-9M4.5 7 8 3.5 11.5 7\",\n  calendar: \"M3.25 4h9.5v9.25h-9.5zM3.25 6.75h9.5M5.75 2.5v2.75M10.25 2.5v2.75\",\n} as const;\n\nfunction Icon({\n  name,\n  color,\n  size = 16,\n}: {\n  name: keyof typeof ICONS;\n  color: string;\n  size?: number;\n}) {\n  return (\n    <svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 16 16\"\n      style={{ flexShrink: 0, display: \"block\" }}\n    >\n      <path\n        d={ICONS[name]}\n        fill=\"none\"\n        stroke={color}\n        strokeWidth={1.5}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nfunction Cursor({ x, y, scale }: { x: number; y: number; scale: number }) {\n  return (\n    <svg\n      width={24}\n      height={28}\n      viewBox=\"0 0 20 24\"\n      style={{\n        position: \"absolute\",\n        left: x - 2,\n        top: y - 2,\n        transformOrigin: \"2px 2px\",\n        transform: `scale(${scale})`,\n        filter: \"drop-shadow(0 3px 6px rgba(0,0,0,0.3))\",\n        overflow: \"visible\",\n      }}\n    >\n      <path\n        d=\"M2 2 L2 19.5 L6.6 15.4 L9.8 22.4 L12.9 21 L9.8 14.2 L16 14.2 Z\"\n        fill=\"#FFFFFF\"\n        stroke=\"#16171A\"\n        strokeWidth={1.1}\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nconst T = {\n  win: 0,\n  bars: 8,\n  cursorIn: 26,\n  click: 50,\n  morph: 56,\n  badge: 74,\n  toHover: 70,\n  tip: 96,\n  end: 165,\n};\n\nexport function AnalyticsFunnel({\n  steps = DEFAULT_STEPS,\n  title = \"Activation funnel\",\n  variantLabel = \"New onboarding\",\n  tooltipStep = 2,\n  breakdown = DEFAULT_BREAKDOWN,\n  dateRange = \"Last 30 days\",\n  theme = \"light\",\n  accent = \"#3B5BFD\",\n  speed = 1,\n  ground,\n  groundParams,\n}: AnalyticsFunnelProps) {\n  const frame = useCurrentFrame() * speed;\n  const { width: W, height: H, fps } = useVideoConfig();\n  const pal = palette(theme);\n  const tall = H > W * 1.2;\n  const D = tall ? { w: 800, h: 1422 } : { w: 1280, h: 720 };\n  const s = Math.min(W / D.w, H / D.h);\n  const sp = (at: number, config: object) =>\n    spring({ frame: frame - at, fps, config });\n\n  const WIN = tall\n    ? { x: 40, y: 330, w: 720, h: 1000 }\n    : { x: 156, y: 60, w: 968, h: 600 };\n  const PAD = tall ? 28 : 32;\n  const HEAD_H = 76;\n  const KPI_Y = HEAD_H + 22;\n  const CT = tall ? HEAD_H + 112 : KPI_Y + 112;\n  const AXIS_W = 52;\n  const PLOT = {\n    x: PAD + AXIS_W,\n    y: CT + 62,\n    w: WIN.w - PAD * 2 - AXIS_W,\n    h: WIN.h - PAD - 64 - (CT + 62),\n  };\n  const n = steps.length;\n  const slot = PLOT.w / n;\n  const BAR_W = Math.min(124, slot * 0.58);\n  const colX = (i: number) => PLOT.x + slot * i + (slot - BAR_W) / 2;\n  const yOf = (p: number) => PLOT.y + PLOT.h * (1 - p / 100);\n\n  const morph = steps.map((_, i) => sp(T.morph + i * 3, MORPH));\n  const value = (i: number) =>\n    lerp(steps[i].control, steps[i].variant, morph[i]);\n  const first = value(0) || 1;\n  const ofFirst = (i: number) => (value(i) / first) * 100;\n  const fromPrev = (i: number) =>\n    i === 0 ? 100 : (value(i) / value(i - 1)) * 100;\n  const grow = steps.map((_, i) => sp(T.bars + i * 3, CARD));\n  const totalC = (steps[n - 1].control / steps[0].control) * 100;\n  const totalV = (steps[n - 1].variant / steps[0].variant) * 100;\n  const uplift = Math.round(((totalV - totalC) / totalC) * 100);\n  const totalNow = lerp(totalC, totalV, morph[n - 1]);\n\n  const win = sp(T.win, HEAVY);\n  const winA = tween(frame, 0, 10);\n  const toggleOn = sp(T.click + 2, CHIP);\n  const on = toggleOn > 0.5;\n  const badge = sp(T.badge, CHIP);\n  const tip = sp(T.tip, CARD);\n  const tipA = tween(frame, T.tip, T.tip + 8);\n  const tt = clamp(tooltipStep, 0, n - 1);\n  const cam = tween(frame, 20, T.end, camEase);\n\n  const TOG_W = 236;\n  const togX = WIN.w - PAD - TOG_W;\n  const togglePt = { x: WIN.x + togX + 14 + 18, y: WIN.y + HEAD_H / 2 + 4 };\n  const hoverPt = {\n    x: WIN.x + colX(tt) + BAR_W * 0.6,\n    y: WIN.y + yOf(ofFirst(tt) * 0.55),\n  };\n  const startPt = { x: D.w * 0.86, y: D.h + 40 };\n  const leg1 = sp(T.cursorIn, HEAVY);\n  const leg2 = sp(T.toHover, HEAVY);\n  const arc = (\n    a: { x: number; y: number },\n    b: { x: number; y: number },\n    p: number,\n  ) => {\n    const dx = b.x - a.x;\n    const dy = b.y - a.y;\n    const d = Math.hypot(dx, dy) || 1;\n    const bow = Math.sin(clamp(p, 0, 1) * Math.PI) * Math.min(60, d * 0.18);\n    return {\n      x: lerp(a.x, b.x, p) + (dy / d) * bow,\n      y: lerp(a.y, b.y, p) - (dx / d) * bow,\n    };\n  };\n  const cur =\n    frame < T.toHover\n      ? arc(startPt, togglePt, leg1)\n      : arc(togglePt, hoverPt, leg2);\n  const press = sp(T.click - 3, CHIP) - sp(T.click + 2, CHIP);\n  const cursorScale = 1 - 0.04 * clamp(press, 0, 1.2);\n  const cursorA =\n    tween(frame, T.cursorIn, T.cursorIn + 6) *\n    (1 - tween(frame, T.end - 20, T.end - 10, exitEase));\n\n  const tint = withAlpha(accent, pal.dark ? 0.16 : 0.1);\n  const ink = (t: number) => (t > 0.5 ? pal.text : pal.muted);\n\n  const stat = (label: string, val: React.ReactNode, i: number) => {\n    const a = tween(frame, 12 + i * 3, 24 + i * 3);\n    return (\n      <div\n        style={{\n          paddingLeft: tall && i === 0 ? 0 : 24,\n          borderLeft: tall && i === 0 ? \"none\" : `1px solid ${pal.line}`,\n          opacity: a,\n          transform: `translateY(${(1 - a) * 8}px)`,\n          flex: tall ? 1 : undefined,\n        }}\n      >\n        <div style={{ fontSize: 16, color: pal.muted }}>{label}</div>\n        <div\n          style={{\n            fontSize: 26,\n            fontWeight: 300,\n            color: pal.text,\n            marginTop: 6,\n            letterSpacing: \"-0.02em\",\n            fontVariantNumeric: \"tabular-nums\",\n          }}\n        >\n          {val}\n        </div>\n      </div>\n    );\n  };\n\n  const badgeEl = (size: number) => (\n    <span\n      style={{\n        display: \"inline-flex\",\n        alignItems: \"center\",\n        gap: 4,\n        height: size * 1.75,\n        padding: `0 ${size * 0.55}px 0 ${size * 0.4}px`,\n        borderRadius: 8,\n        background: pal.greenBg,\n        color: pal.green,\n        fontSize: size,\n        fontVariantNumeric: \"tabular-nums\",\n        opacity: clamp(badge * 2, 0, 1),\n        transform: `translateY(${(1 - badge) * 10}px) scale(${0.85 + 0.15 * badge})`,\n        transformOrigin: \"0% 50%\",\n        whiteSpace: \"nowrap\",\n      }}\n    >\n      <Icon name=\"arrowUp\" color={pal.green} size={size} />\n      {uplift > 0 ? \"+\" : \"\"}\n      {uplift}%\n    </span>\n  );\n\n  const tipW = tall ? 312 : 264;\n  const tipX = PLOT.x + PLOT.w - tipW + 8;\n  const tipY = tall ? PLOT.y - 8 : PLOT.y - 20;\n  const rowH = tall ? 32 : 26;\n  const stepV = value(tt);\n\n  return (\n    <AbsoluteFill\n      style={{\n        fontFamily,\n        fontWeight: 400,\n        overflow: \"hidden\",\n        WebkitFontSmoothing: \"antialiased\",\n        background: pal.dark ? \"#03050C\" : \"#EEF0F6\",\n      }}\n    >\n      <GshGround\n        preset={ground ?? (pal.dark ? \"film-blue\" : \"glasswork\")}\n        params={groundParams}\n        timeOffset={pal.dark ? 4 : 3}\n        timeScale={0.3}\n      />\n      <AbsoluteFill style={{ background: pal.scrim }} />\n      <div\n        style={{\n          position: \"absolute\",\n          left: (W - D.w * s) / 2,\n          top: (H - D.h * s) / 2,\n          width: D.w,\n          height: D.h,\n          transformOrigin: \"0 0\",\n          transform: `scale(${s})`,\n        }}\n      >\n        <div\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            transformOrigin: `${WIN.x + tipX}px ${WIN.y + tipY + 120}px`,\n            transform: `scale(${1 + 0.035 * cam})`,\n          }}\n        >\n          {tall ? (\n            <div style={{ position: \"absolute\", left: 48, top: 92, right: 48 }}>\n              <div\n                style={{\n                  fontSize: 24,\n                  color: pal.stageMuted,\n                  opacity: tween(frame, 4, 16),\n                }}\n              >\n                Paid conversion · {dateRange.toLowerCase()}\n              </div>\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  gap: 22,\n                  marginTop: 10,\n                  overflow: \"hidden\",\n                }}\n              >\n                <span\n                  style={{\n                    fontSize: 132,\n                    fontWeight: 300,\n                    letterSpacing: \"-0.045em\",\n                    lineHeight: 1.05,\n                    color: pal.stageText,\n                    fontVariantNumeric: \"tabular-nums\",\n                    transform: `translateY(${(1 - tween(frame, 6, 20)) * 100}%)`,\n                  }}\n                >\n                  {pct(totalNow)}\n                </span>\n                {badgeEl(30)}\n              </div>\n            </div>\n          ) : null}\n          <div\n            style={{\n              position: \"absolute\",\n              left: WIN.x,\n              top: WIN.y,\n              width: WIN.w,\n              height: WIN.h,\n              opacity: winA,\n              transform: `translateY(${(1 - win) * 48}px) scale(${0.97 + 0.03 * win})`,\n              transformOrigin: \"50% 100%\",\n            }}\n          >\n            <div\n              style={{\n                position: \"absolute\",\n                inset: 0,\n                borderRadius: 16,\n                background: pal.win,\n                boxShadow: pal.winShadow,\n                overflow: \"hidden\",\n              }}\n            >\n              <div\n                style={{\n                  height: HEAD_H,\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  gap: 14,\n                  padding: `0 ${PAD}px`,\n                  borderBottom: `1px solid ${pal.line}`,\n                }}\n              >\n                <span\n                  style={{\n                    fontSize: 20,\n                    color: pal.text,\n                    letterSpacing: \"-0.01em\",\n                  }}\n                >\n                  {tall ? \"Funnel\" : title}\n                </span>\n                <span\n                  style={{\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: 6,\n                    fontSize: 16,\n                    color: pal.muted,\n                  }}\n                >\n                  <Icon name=\"calendar\" color={pal.faint} />\n                  {dateRange}\n                </span>\n                <div style={{ flex: 1 }} />\n                <div\n                  style={{\n                    width: TOG_W,\n                    height: 40,\n                    boxSizing: \"border-box\",\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: 10,\n                    padding: \"0 14px\",\n                    borderRadius: 10,\n                    background: on\n                      ? withAlpha(accent, pal.dark ? 0.14 : 0.07)\n                      : \"transparent\",\n                    boxShadow: `inset 0 0 0 1px ${on ? withAlpha(accent, 0.4) : pal.line}`,\n                    transform: `scale(${1 - 0.04 * clamp(press, 0, 1.2)})`,\n                  }}\n                >\n                  <div\n                    style={{\n                      width: 36,\n                      height: 22,\n                      borderRadius: 99,\n                      position: \"relative\",\n                      flexShrink: 0,\n                      background: on ? accent : pal.knobOff,\n                    }}\n                  >\n                    <div\n                      style={{\n                        position: \"absolute\",\n                        top: 3,\n                        left: 3 + 14 * toggleOn,\n                        width: 16,\n                        height: 16,\n                        borderRadius: 99,\n                        background: \"#fff\",\n                        boxShadow: \"0 1px 2px rgba(0,0,0,0.25)\",\n                      }}\n                    />\n                  </div>\n                  <span style={{ fontSize: 16, color: pal.text }}>\n                    {variantLabel}\n                  </span>\n                </div>\n              </div>\n\n              {!tall ? (\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: PAD,\n                    right: PAD,\n                    top: KPI_Y,\n                    display: \"flex\",\n                    alignItems: \"flex-end\",\n                    gap: 24,\n                  }}\n                >\n                  <div>\n                    <div style={{ fontSize: 16, color: pal.muted }}>\n                      Total conversion\n                    </div>\n                    <div\n                      style={{\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        gap: 14,\n                        marginTop: 2,\n                        overflow: \"hidden\",\n                      }}\n                    >\n                      <span\n                        style={{\n                          fontSize: 54,\n                          fontWeight: 300,\n                          letterSpacing: \"-0.04em\",\n                          color: pal.text,\n                          fontVariantNumeric: \"tabular-nums\",\n                          lineHeight: 1.1,\n                          transform: `translateY(${(1 - tween(frame, 8, 22)) * 100}%)`,\n                        }}\n                      >\n                        {pct(totalNow)}\n                      </span>\n                      {badgeEl(18)}\n                    </div>\n                  </div>\n                  <div style={{ flex: 1 }} />\n                  {stat(\"Visits\", fmt(value(0)), 0)}\n                  {stat(\"Paying users\", fmt(value(n - 1)), 1)}\n                  {stat(\n                    \"Time to pay\",\n                    morph[n - 1] > 0.5 ? \"1d 19h\" : \"2d 6h\",\n                    2,\n                  )}\n                </div>\n              ) : (\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: PAD,\n                    right: PAD,\n                    top: HEAD_H + 20,\n                    display: \"flex\",\n                    gap: 24,\n                  }}\n                >\n                  {stat(\"Visits\", fmt(value(0)), 0)}\n                  {stat(\"Paying users\", fmt(value(n - 1)), 1)}\n                  {stat(\n                    \"Time to pay\",\n                    morph[n - 1] > 0.5 ? \"1d 19h\" : \"2d 6h\",\n                    2,\n                  )}\n                </div>\n              )}\n\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: PAD,\n                  right: PAD,\n                  top: CT,\n                  height: 1,\n                  background: pal.line,\n                }}\n              />\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: PAD,\n                  right: PAD,\n                  top: CT + 18,\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  gap: 22,\n                  justifyContent: \"flex-end\",\n                  fontSize: 16,\n                  color: pal.muted,\n                }}\n              >\n                <span style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n                  <span\n                    style={{\n                      width: 10,\n                      height: 10,\n                      borderRadius: 3,\n                      background: accent,\n                    }}\n                  />\n                  {on ? variantLabel : \"All users\"}\n                </span>\n                <span\n                  style={{\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: 8,\n                    opacity: tween(frame, T.morph + 4, T.morph + 14),\n                  }}\n                >\n                  <span\n                    style={{\n                      width: 16,\n                      borderTop: `1.5px dashed ${pal.faint}`,\n                    }}\n                  />\n                  Control\n                </span>\n              </div>\n\n              <svg\n                width={WIN.w}\n                height={WIN.h}\n                style={{ position: \"absolute\", left: 0, top: 0 }}\n              >\n                {[0, 50, 100].map((g) => (\n                  <g key={g}>\n                    <line\n                      x1={PLOT.x}\n                      x2={PLOT.x + PLOT.w}\n                      y1={yOf(g)}\n                      y2={yOf(g)}\n                      stroke={pal.line}\n                      strokeDasharray={g ? \"2 5\" : undefined}\n                    />\n                    <text\n                      x={PLOT.x - 14}\n                      y={yOf(g) + 5}\n                      textAnchor=\"end\"\n                      fontSize={15}\n                      fill={pal.faint}\n                      fontFamily={fontFamily}\n                      style={{ fontVariantNumeric: \"tabular-nums\" }}\n                    >\n                      {g}%\n                    </text>\n                  </g>\n                ))}\n                <rect\n                  x={colX(tt) - 12}\n                  y={PLOT.y - 6}\n                  width={BAR_W + 24}\n                  height={yOf(0) - PLOT.y + 6}\n                  rx={10}\n                  fill={pal.track}\n                  opacity={tipA * 0.7}\n                />\n                {steps.map((st, i) => {\n                  const g = grow[i];\n                  const x = colX(i);\n                  const prev = i === 0 ? 100 : ofFirst(i - 1);\n                  const curP = ofFirst(i);\n                  const ctrl = (st.control / steps[0].control) * 100;\n                  const top = yOf(prev * g);\n                  const bar = yOf(curP * g);\n                  const dim = i === tt ? 0 : tipA;\n                  const ghost =\n                    i > 0\n                      ? tween(frame, T.morph + 6 + i * 3, T.morph + 16 + i * 3)\n                      : 0;\n                  return (\n                    <g key={st.label}>\n                      <rect\n                        x={x}\n                        y={top}\n                        width={BAR_W}\n                        height={Math.max(0, bar - top)}\n                        rx={6}\n                        fill={tint}\n                      />\n                      <rect\n                        x={x}\n                        y={bar}\n                        width={BAR_W}\n                        height={Math.max(0, yOf(0) - bar)}\n                        rx={6}\n                        fill={accent}\n                        opacity={1 - 0.3 * dim}\n                      />\n                      {ghost > 0 && Math.abs(ctrl - curP) > 0.3 ? (\n                        <line\n                          x1={x - 8}\n                          x2={lerp(x - 8, x + BAR_W + 8, ghost)}\n                          y1={yOf(ctrl)}\n                          y2={yOf(ctrl)}\n                          stroke={pal.dark ? \"#FFFFFF\" : \"#16171A\"}\n                          strokeOpacity={0.7}\n                          strokeWidth={1.5}\n                          strokeDasharray=\"4 4\"\n                        />\n                      ) : null}\n                    </g>\n                  );\n                })}\n              </svg>\n\n              {steps.map((st, i) => {\n                const x = colX(i);\n                const lab = tween(\n                  frame,\n                  T.bars + i * 3 + 6,\n                  T.bars + i * 3 + 18,\n                );\n                return (\n                  <div key={st.label}>\n                    <div\n                      style={{\n                        position: \"absolute\",\n                        left: x,\n                        width: BAR_W,\n                        textAlign: \"center\",\n                        top: yOf(ofFirst(i) * grow[i]) - 30,\n                        opacity: lab,\n                        fontSize: 16,\n                        color: pal.text,\n                        fontVariantNumeric: \"tabular-nums\",\n                      }}\n                    >\n                      {pct(ofFirst(i))}\n                    </div>\n                    <div\n                      style={{\n                        position: \"absolute\",\n                        left: x,\n                        top: yOf(0) + 14,\n                        opacity: lab,\n                        transform: `translateY(${(1 - lab) * 6}px)`,\n                        whiteSpace: \"nowrap\",\n                      }}\n                    >\n                      <div style={{ fontSize: 17, color: ink(1) }}>\n                        {st.label}\n                      </div>\n                      <div\n                        style={{\n                          fontSize: 16,\n                          color: pal.muted,\n                          marginTop: 3,\n                          fontVariantNumeric: \"tabular-nums\",\n                        }}\n                      >\n                        {fmt(value(i))}\n                      </div>\n                    </div>\n                  </div>\n                );\n              })}\n            </div>\n\n            <div\n              style={{\n                position: \"absolute\",\n                left: tipX,\n                top: tipY,\n                width: tipW,\n                opacity: tipA,\n                transform: `translateY(${(1 - tip) * 12}px) scale(${0.94 + 0.06 * tip})`,\n                transformOrigin: \"0% 0%\",\n                background: pal.tip,\n                borderRadius: 14,\n                boxShadow: pal.tipShadow,\n                padding: tall ? \"16px 18px 14px\" : \"12px 16px 10px\",\n                boxSizing: \"border-box\",\n              }}\n            >\n              <div style={{ fontSize: 16, color: pal.muted }}>\n                {tt + 1} · {steps[tt].event}\n              </div>\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"baseline\",\n                  gap: 10,\n                  marginTop: tall ? 6 : 4,\n                  fontVariantNumeric: \"tabular-nums\",\n                }}\n              >\n                <span\n                  style={{\n                    fontSize: tall ? 34 : 30,\n                    lineHeight: 1.2,\n                    fontWeight: 300,\n                    color: pal.text,\n                    letterSpacing: \"-0.03em\",\n                  }}\n                >\n                  {fmt(stepV)}\n                </span>\n                <span style={{ fontSize: 16, color: pal.muted }}>\n                  {pct(fromPrev(tt))} of{\" \"}\n                  {steps[Math.max(0, tt - 1)].label.toLowerCase()}\n                </span>\n              </div>\n              <div\n                style={{\n                  height: 1,\n                  background: pal.line,\n                  margin: tall ? \"14px 0 8px\" : \"10px 0 6px\",\n                }}\n              />\n              {breakdown.map((b, k) => {\n                const r = sp(T.tip + 6 + k * 3, CARD);\n                return (\n                  <div\n                    key={b.label}\n                    style={{\n                      display: \"flex\",\n                      alignItems: \"center\",\n                      gap: 12,\n                      height: rowH,\n                      fontSize: 16,\n                      color: pal.text,\n                      fontVariantNumeric: \"tabular-nums\",\n                    }}\n                  >\n                    <span style={{ width: 66 }}>{b.label}</span>\n                    <div\n                      style={{\n                        flex: 1,\n                        height: 6,\n                        borderRadius: 3,\n                        background: pal.track,\n                      }}\n                    >\n                      <div\n                        style={{\n                          width: `${b.share * 100 * clamp(r, 0, 1.04)}%`,\n                          height: \"100%\",\n                          borderRadius: 3,\n                          background: withAlpha(accent, 1 - k * 0.28),\n                        }}\n                      />\n                    </div>\n                    <span\n                      style={{\n                        width: 52,\n                        textAlign: \"right\",\n                        color: pal.muted,\n                      }}\n                    >\n                      {fmt(stepV * b.share)}\n                    </span>\n                  </div>\n                );\n              })}\n            </div>\n          </div>\n          <div style={{ opacity: cursorA }}>\n            <Cursor x={cur.x} y={cur.y} scale={cursorScale} />\n          </div>\n        </div>\n      </div>\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/analytics-funnel.tsx"
    }
  ],
  "type": "registry:component"
}
