{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-mega-preview",
  "type": "registry:component",
  "title": "Navbar Mega Preview",
  "description": "A header whose menus open a two-pane panel: a list of destinations on the left and a live illustrated preview on the right that redraws for whichever item is hovered or focused. Switching menus slides the list in the direction of travel.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "mega menu",
    "preview",
    "dropdown",
    "keyboard",
    "header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-mega-preview",
  "files": [
    {
      "path": "registry/hyperblur/navbar-mega-preview.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-mega-preview.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type NavbarMegaPreviewArt = \"graph\" | \"terminal\" | \"globe\" | \"shield\" | \"bars\" | \"stack\";\n\nexport interface NavbarMegaPreviewItem {\n  title: string;\n  description: string;\n  href: string;\n  art?: NavbarMegaPreviewArt;\n  tag?: string;\n}\n\nexport interface NavbarMegaPreviewMenu {\n  id: string;\n  label: string;\n  href?: string;\n  items?: NavbarMegaPreviewItem[];\n  footer?: { label: string; href: string };\n}\n\nexport interface NavbarMegaPreviewProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  menus?: NavbarMegaPreviewMenu[];\n  openId?: string | null;\n  defaultOpenId?: string | null;\n  onOpenChange?: (id: string | null) => void;\n  defaultItem?: number;\n  signIn?: { label: string; href: string } | null;\n  cta?: { label: string; href: string } | null;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-xi6 {\n  --hb-xi6-accent: #22d3a5;\n  --hb-xi6-ease: cubic-bezier(.22,1,.36,1);\n  position: relative;\n  z-index: 40;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #09090b;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xi6 *, .hb-xi6 *::before, .hb-xi6 *::after { box-sizing: border-box; }\n.hb-xi6-bar { position: relative; z-index: 3; border-bottom: 1px solid #1f1f23; background: rgba(9,9,11,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }\n.hb-xi6-row { display: flex; align-items: center; gap: 22px; max-width: 1140px; height: 62px; margin: 0 auto; padding: 0 24px; }\n.hb-xi6-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 650; letter-spacing: -.02em; text-decoration: none; border-radius: 6px; }\n.hb-xi6-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 3px; padding: 4px; border-radius: 7px; background: #fff; }\n.hb-xi6-mark i { width: 7px; height: 7px; border-radius: 2px; background: #09090b; font-style: normal; }\n.hb-xi6-mark i:nth-child(2) { background: var(--hb-xi6-accent); }\n.hb-xi6-menus { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.hb-xi6-trig { display: inline-flex; align-items: center; gap: 6px; height: 36px; margin: 0; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #a1a1aa; font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: color .2s ease, background-color .2s ease; }\n.hb-xi6-trig:hover, .hb-xi6-trig[aria-expanded=\"true\"] { color: #fff; background: rgba(255,255,255,.06); }\n.hb-xi6-trig svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .35s var(--hb-xi6-ease); }\n.hb-xi6-trig[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n.hb-xi6-end { display: flex; align-items: center; gap: 6px; margin-left: auto; }\n.hb-xi6-in { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 9px; color: #d4d4d8; font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .2s ease; }\n.hb-xi6-in:hover { background: rgba(255,255,255,.06); }\n.hb-xi6-cta { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; background: linear-gradient(180deg, #fafafa, #d9d9de); color: #09090b; font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 1px 0 #fff inset, 0 6px 18px -8px color-mix(in srgb, var(--hb-xi6-accent) 70%, transparent); transition: transform .2s var(--hb-xi6-ease); }\n.hb-xi6-cta:hover { transform: translateY(-1px); }\n.hb-xi6-cta:active { transform: scale(.97); }\n.hb-xi6-panel {\n  position: absolute;\n  top: calc(100% + 10px);\n  left: 50%;\n  z-index: 5;\n  width: min(900px, calc(100% - 32px));\n  border-radius: 18px;\n  background: linear-gradient(180deg, #131316, #0e0e11);\n  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -30px rgba(0,0,0,.85), 0 12px 24px -12px rgba(0,0,0,.6);\n  transform: translateX(-50%);\n  transform-origin: 50% 0;\n  overflow: hidden;\n  animation: hb-xi6-pop .38s var(--hb-xi6-ease) both;\n}\n.hb-xi6-grid { display: grid; grid-template-columns: 330px 1fr; min-height: 300px; }\n.hb-xi6-list { display: grid; align-content: start; gap: 2px; margin: 0; padding: 10px; list-style: none; border-right: 1px solid #1f1f23; animation: hb-xi6-slide .42s var(--hb-xi6-ease) both; }\n.hb-xi6-list[data-dir=\"left\"] { animation-name: hb-xi6-slide-l; }\n.hb-xi6-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color .2s ease; }\n.hb-xi6-item[data-hot=\"true\"] { background: rgba(255,255,255,.05); }\n.hb-xi6-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #18181c; box-shadow: 0 0 0 1px rgba(255,255,255,.07) inset; color: #a1a1aa; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }\n.hb-xi6-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xi6-item[data-hot=\"true\"] .hb-xi6-ico { color: var(--hb-xi6-accent); background: color-mix(in srgb, var(--hb-xi6-accent) 12%, #18181c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--hb-xi6-accent) 35%, transparent) inset; }\n.hb-xi6-it { display: flex; align-items: center; gap: 8px; color: #fafafa; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }\n.hb-xi6-tag { padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--hb-xi6-accent) 16%, transparent); color: var(--hb-xi6-accent); font-size: 10.5px; font-weight: 650; }\n.hb-xi6-id { margin-top: 3px; color: #8b8b94; font-size: 12.5px; line-height: 1.45; }\n.hb-xi6-prev { position: relative; display: flex; flex-direction: column; padding: 14px; }\n.hb-xi6-art { position: relative; color: var(--hb-xi6-accent); flex: 1; min-height: 190px; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 100% at 80% 0%, color-mix(in srgb, var(--hb-xi6-accent) 18%, transparent), transparent 60%), #0b0b0d; box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset; animation: hb-xi6-fade .45s var(--hb-xi6-ease) both; }\n.hb-xi6-art::before { content: \"\"; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 24px 24px; }\n.hb-xi6-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }\n.hb-xi6-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hb-xi6-draw 1.1s var(--hb-xi6-ease) .1s forwards; }\n.hb-xi6-rise { transform-box: fill-box; transform-origin: 50% 100%; animation: hb-xi6-rise .7s var(--hb-xi6-ease) both; }\n.hb-xi6-blip { transform-box: fill-box; transform-origin: center; animation: hb-xi6-blip .5s var(--hb-xi6-ease) both; }\n.hb-xi6-cap { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 4px 2px; animation: hb-xi6-fade .45s var(--hb-xi6-ease) .05s both; }\n.hb-xi6-cap b { display: block; color: #fafafa; font-size: 15px; font-weight: 600; }\n.hb-xi6-cap span { display: block; margin-top: 3px; color: #8b8b94; font-size: 12.5px; }\n.hb-xi6-go { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; background: rgba(255,255,255,.06); color: #fafafa; font-size: 13px; font-weight: 550; text-decoration: none; transition: background-color .2s ease; }\n.hb-xi6-go:hover { background: rgba(255,255,255,.1); }\n.hb-xi6-go svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .25s var(--hb-xi6-ease); }\n.hb-xi6-go:hover svg { transform: translateX(2px); }\n.hb-xi6-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid #1f1f23; background: rgba(255,255,255,.015); color: #8b8b94; font-size: 12.5px; }\n.hb-xi6-foot a { color: #fafafa; font-weight: 550; text-decoration: none; }\n.hb-xi6-foot a:hover { color: var(--hb-xi6-accent); }\n.hb-xi6-burger { display: none; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 9px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }\n.hb-xi6-burger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }\n.hb-xi6-sheet { display: none; }\n.hb-xi6-panel:focus { outline: none; }\n.hb-xi6 a:focus-visible, .hb-xi6 button:focus-visible { outline: 2px solid var(--hb-xi6-accent); outline-offset: 2px; }\n.hb-xi6-stage { position: relative; z-index: 1; height: 620px; overflow: hidden; }\n.hb-xi6-hero { max-width: 1140px; margin: 0 auto; padding: 120px 24px 0; }\n.hb-xi6-h { max-width: 720px; margin: 0; font-size: clamp(34px, 6cqi, 64px); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }\n.hb-xi6-h span { color: var(--hb-xi6-accent); }\n.hb-xi6-sub { max-width: 520px; margin: 18px 0 0; color: #8b8b94; font-size: 17px; line-height: 1.55; }\n.hb-xi6-glow { position: absolute; right: -120px; top: 40px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-xi6-accent) 22%, transparent), transparent); }\n@keyframes hb-xi6-pop { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.97); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }\n@keyframes hb-xi6-slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xi6-slide-l { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xi6-fade { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }\n@keyframes hb-xi6-draw { to { stroke-dashoffset: 0; } }\n@keyframes hb-xi6-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n@keyframes hb-xi6-blip { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }\n@keyframes hb-xi6-acc { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }\n@container (max-width: 820px) {\n  .hb-xi6-menus, .hb-xi6-in, .hb-xi6-panel { display: none; }\n  .hb-xi6-burger { display: grid; }\n  .hb-xi6-row { height: 58px; padding: 0 16px; gap: 12px; }\n  .hb-xi6-sheet[data-open=\"true\"] { position: relative; z-index: 3; display: block; padding: 6px 12px 14px; border-bottom: 1px solid #1f1f23; background: #0b0b0d; }\n  .hb-xi6-acc { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 50px; margin: 0; padding: 0 8px; border: 0; border-bottom: 1px solid #18181c; background: transparent; color: #fafafa; font: inherit; font-size: 15px; font-weight: 550; text-align: left; text-decoration: none; cursor: pointer; }\n  .hb-xi6-acc svg { width: 12px; height: 12px; fill: none; stroke: #8b8b94; stroke-width: 1.8; stroke-linecap: round; transition: transform .3s var(--hb-xi6-ease); }\n  .hb-xi6-acc[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n  .hb-xi6-accp { display: grid; gap: 2px; padding: 6px 0 10px; animation: hb-xi6-acc .3s var(--hb-xi6-ease) both; }\n  .hb-xi6-accp .hb-xi6-item { padding: 8px; }\n  .hb-xi6-glow { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xi6 *, .hb-xi6 *::before, .hb-xi6 *::after { animation: none !important; transition: none !important; }\n  .hb-xi6-draw { stroke-dashoffset: 0; }\n}\n`;\n\nconst defaultMenus: NavbarMegaPreviewMenu[] = [\n  {\n    id: \"platform\",\n    label: \"Platform\",\n    items: [\n      { title: \"Workflows\", description: \"Chain jobs into durable, retryable pipelines.\", href: \"#\", art: \"graph\" },\n      { title: \"Edge functions\", description: \"Run TypeScript in 38 regions with cold starts under 5 ms.\", href: \"#\", art: \"globe\", tag: \"Beta\" },\n      { title: \"Observability\", description: \"Traces, logs and metrics in one timeline.\", href: \"#\", art: \"bars\" },\n      { title: \"Secrets\", description: \"Rotate keys without a redeploy.\", href: \"#\", art: \"shield\" },\n    ],\n    footer: { label: \"See the platform tour\", href: \"#\" },\n  },\n  {\n    id: \"developers\",\n    label: \"Developers\",\n    items: [\n      { title: \"CLI\", description: \"Deploy, tail logs and roll back from your terminal.\", href: \"#\", art: \"terminal\" },\n      { title: \"SDKs\", description: \"Typed clients for TypeScript, Go, Python and Rust.\", href: \"#\", art: \"stack\" },\n      { title: \"Status\", description: \"Live uptime across every region.\", href: \"#\", art: \"bars\" },\n    ],\n    footer: { label: \"Read the docs\", href: \"#\" },\n  },\n  {\n    id: \"solutions\",\n    label: \"Solutions\",\n    items: [\n      { title: \"Fintech\", description: \"Ledger-grade queues with exactly-once delivery.\", href: \"#\", art: \"shield\" },\n      { title: \"Media pipelines\", description: \"Long-running transcode jobs that never time out.\", href: \"#\", art: \"graph\", tag: \"New\" },\n      { title: \"Commerce\", description: \"Absorb launch-day traffic without warming servers.\", href: \"#\", art: \"globe\" },\n    ],\n    footer: { label: \"Talk to solutions engineering\", href: \"#\" },\n  },\n  { id: \"pricing\", label: \"Pricing\", href: \"#\" },\n  { id: \"changelog\", label: \"Changelog\", href: \"#\" },\n];\n\nconst icons: Record<NavbarMegaPreviewArt, React.ReactNode> = {\n  graph: <path d=\"M4 5.5a1.5 1.5 0 1 0 0-.01M12 4a1.5 1.5 0 1 0 0-.01M12 12a1.5 1.5 0 1 0 0-.01M5.4 5.2L10.6 4.3M5.2 6.3l5.6 5\" />,\n  terminal: <path d=\"M2.5 3.5h11v9h-11zM5 7l2 1.5L5 10M8.5 10.5H11\" />,\n  globe: <path d=\"M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2zM2 8h12M8 2c2 2 2 10 0 12M8 2c-2 2-2 10 0 12\" />,\n  shield: <path d=\"M8 2l5 2v4c0 3-2.2 5-5 6-2.8-1-5-3-5-6V4zM5.8 8l1.6 1.6L10.4 6.6\" />,\n  bars: <path d=\"M3 13V8M6.3 13V4M9.6 13V6.5M13 13V3\" />,\n  stack: <path d=\"M8 2.5l5.5 2.8L8 8 2.5 5.3zM2.5 8L8 10.7 13.5 8M2.5 10.7L8 13.4l5.5-2.7\" />,\n};\n\nfunction Art({ kind }: { kind: NavbarMegaPreviewArt }) {\n  const a = \"currentColor\";\n  if (kind === \"graph\") {\n    const nodes = [\n      [60, 50], [150, 40], [240, 70], [100, 120], [200, 135], [280, 140],\n    ];\n    const edges = [[0, 1], [1, 2], [0, 3], [3, 4], [1, 4], [4, 5], [2, 5]];\n    return (\n      <svg viewBox=\"0 0 320 180\" preserveAspectRatio=\"xMidYMid meet\">\n        {edges.map(([p, q], i) => (\n          <path key={i} className=\"hb-xi6-draw\" pathLength={1} d={`M${nodes[p][0]} ${nodes[p][1]}L${nodes[q][0]} ${nodes[q][1]}`} stroke={i % 3 === 0 ? a : \"rgba(255,255,255,.22)\"} strokeWidth=\"1.5\" fill=\"none\" style={{ animationDelay: `${(i * 0.08).toFixed(2)}s` }} />\n        ))}\n        {nodes.map(([x, y], i) => (\n          <g key={i} className=\"hb-xi6-blip\" style={{ animationDelay: `${(0.2 + i * 0.07).toFixed(2)}s` }}>\n            <rect x={x - 22} y={y - 11} width=\"44\" height=\"22\" rx=\"7\" fill=\"#141418\" stroke={i === 1 || i === 4 ? a : \"rgba(255,255,255,.14)\"} />\n            <circle cx={x - 12} cy={y} r=\"3\" fill={i === 1 || i === 4 ? a : \"#55555c\"} />\n            <rect x={x - 5} y={y - 2} width=\"20\" height=\"4\" rx=\"2\" fill=\"rgba(255,255,255,.25)\" />\n          </g>\n        ))}\n      </svg>\n    );\n  }\n  if (kind === \"terminal\") {\n    const rows = [[22, 90, a], [22, 150, \"#55555c\"], [34, 120, \"#55555c\"], [34, 70, a], [22, 180, \"#55555c\"], [22, 60, \"#f5a524\"]];\n    return (\n      <svg viewBox=\"0 0 320 180\">\n        <rect x=\"30\" y=\"22\" width=\"260\" height=\"140\" rx=\"10\" fill=\"#111114\" stroke=\"rgba(255,255,255,.1)\" />\n        <circle cx=\"46\" cy=\"36\" r=\"3.5\" fill=\"#3a3a40\" />\n        <circle cx=\"58\" cy=\"36\" r=\"3.5\" fill=\"#3a3a40\" />\n        <circle cx=\"70\" cy=\"36\" r=\"3.5\" fill=\"#3a3a40\" />\n        {rows.map(([x, w, c], i) => (\n          <rect key={i} className=\"hb-xi6-blip\" x={30 + Number(x)} y={58 + i * 15} width={Number(w)} height=\"6\" rx=\"3\" fill={String(c)} style={{ animationDelay: `${(i * 0.09).toFixed(2)}s`, transformOrigin: \"left center\" }} />\n        ))}\n        <rect x=\"52\" y=\"148\" width=\"7\" height=\"10\" fill={a}>\n          <animate attributeName=\"opacity\" values=\"1;0;1\" dur=\"1.1s\" repeatCount=\"indefinite\" />\n        </rect>\n      </svg>\n    );\n  }\n  if (kind === \"globe\") {\n    const dots = [[118, 72], [176, 60], [202, 104], [140, 118], [160, 90]];\n    return (\n      <svg viewBox=\"0 0 320 180\" fill=\"none\">\n        <circle cx=\"160\" cy=\"90\" r=\"64\" stroke=\"rgba(255,255,255,.18)\" />\n        <ellipse cx=\"160\" cy=\"90\" rx=\"64\" ry=\"22\" stroke=\"rgba(255,255,255,.1)\" />\n        <ellipse cx=\"160\" cy=\"90\" rx=\"26\" ry=\"64\" stroke=\"rgba(255,255,255,.1)\" />\n        <path d=\"M96 90h128\" stroke=\"rgba(255,255,255,.08)\" />\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M118 72Q150 30 176 60\" stroke={a} strokeWidth=\"1.6\" />\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M176 60Q215 70 202 104\" stroke={a} strokeWidth=\"1.6\" style={{ animationDelay: \".25s\" }} />\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M202 104Q175 135 140 118\" stroke={a} strokeWidth=\"1.6\" style={{ animationDelay: \".45s\" }} />\n        {dots.map(([x, y], i) => (\n          <g key={i} className=\"hb-xi6-blip\" style={{ animationDelay: `${(i * 0.1).toFixed(2)}s` }}>\n            <circle cx={x} cy={y} r=\"8\" fill={a} opacity=\".15\" />\n            <circle cx={x} cy={y} r=\"3\" fill={a} />\n          </g>\n        ))}\n      </svg>\n    );\n  }\n  if (kind === \"shield\") {\n    return (\n      <svg viewBox=\"0 0 320 180\" fill=\"none\">\n        <circle cx=\"160\" cy=\"90\" r=\"70\" stroke=\"rgba(255,255,255,.06)\" />\n        <circle cx=\"160\" cy=\"90\" r=\"52\" stroke=\"rgba(255,255,255,.09)\" />\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M160 44l36 14v28c0 22-16 38-36 46-20-8-36-24-36-46V58z\" stroke={a} strokeWidth=\"2\" fill=\"rgba(255,255,255,.02)\" />\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M144 90l11 11 22-24\" stroke=\"#fff\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" style={{ animationDelay: \".5s\" }} />\n        <rect x=\"216\" y=\"56\" width=\"70\" height=\"20\" rx=\"6\" fill=\"#141418\" stroke=\"rgba(255,255,255,.1)\" className=\"hb-xi6-blip\" style={{ animationDelay: \".7s\" }} />\n        <rect x=\"224\" y=\"64\" width=\"40\" height=\"4\" rx=\"2\" fill={a} className=\"hb-xi6-blip\" style={{ animationDelay: \".75s\" }} />\n      </svg>\n    );\n  }\n  if (kind === \"bars\") {\n    const h = [38, 62, 48, 86, 70, 104, 92, 118];\n    return (\n      <svg viewBox=\"0 0 320 180\">\n        {h.map((v, i) => (\n          <rect key={i} className=\"hb-xi6-rise\" x={48 + i * 30} y={150 - v} width=\"18\" height={v} rx=\"4\" fill={i === h.length - 1 ? a : \"rgba(255,255,255,.13)\"} style={{ animationDelay: `${(i * 0.05).toFixed(2)}s` }} />\n        ))}\n        <path className=\"hb-xi6-draw\" pathLength={1} d=\"M57 104L87 84L117 96L147 62L177 76L207 44L237 54L267 30\" stroke={a} strokeWidth=\"1.6\" fill=\"none\" style={{ animationDelay: \".3s\" }} />\n        <path d=\"M40 150h240\" stroke=\"rgba(255,255,255,.12)\" />\n      </svg>\n    );\n  }\n  return (\n    <svg viewBox=\"0 0 320 180\" fill=\"none\">\n      {[0, 1, 2].map((i) => (\n        <path key={i} className=\"hb-xi6-blip\" d={`M160 ${48 + i * 26}l64 26-64 26-64-26z`} fill=\"#141418\" stroke={i === 0 ? a : \"rgba(255,255,255,.16)\"} style={{ fill: i === 0 ? \"color-mix(in srgb, var(--hb-xi6-accent) 30%, #141418)\" : undefined, animationDelay: `${(0.3 - i * 0.12).toFixed(2)}s` }} />\n      ))}\n    </svg>\n  );\n}\n\nexport function NavbarMegaPreview({\n  brand = \"Lattice\",\n  menus = defaultMenus,\n  openId,\n  defaultOpenId = null,\n  onOpenChange,\n  defaultItem = 0,\n  signIn = { label: \"Log in\", href: \"#\" },\n  cta = { label: \"Deploy free\", href: \"#\" },\n  accent = \"#22d3a5\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  ...rest\n}: NavbarMegaPreviewProps) {\n  const uid = React.useId();\n  const rootRef = React.useRef<HTMLElement>(null);\n  const [innerOpen, setInnerOpen] = React.useState<string | null>(defaultOpenId);\n  const [hot, setHot] = React.useState(defaultItem);\n  const [dir, setDir] = React.useState<\"left\" | \"right\">(\"right\");\n  const [sheet, setSheet] = React.useState(false);\n  const [acc, setAcc] = React.useState<string | null>(null);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const current = openId === undefined ? innerOpen : openId;\n  const menu = menus.find((m) => m.id === current && m.items?.length);\n\n  React.useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n\n  const setOpen = (id: string | null, item = 0) => {\n    if (id && current && id !== current) {\n      const a = menus.findIndex((m) => m.id === current);\n      const b = menus.findIndex((m) => m.id === id);\n      setDir(b < a ? \"left\" : \"right\");\n    }\n    if (id !== current) setHot(item);\n    if (openId === undefined) setInnerOpen(id);\n    if (id !== current) onOpenChange?.(id);\n  };\n\n  const clear = () => {\n    if (timer.current) clearTimeout(timer.current);\n    timer.current = null;\n  };\n\n  const intent = (id: string) => {\n    clear();\n    if (current) setOpen(id);\n    else timer.current = setTimeout(() => setOpen(id), 90);\n  };\n\n  const scheduleClose = () => {\n    clear();\n    timer.current = setTimeout(() => setOpen(null), 220);\n  };\n\n  const focusItem = (index: number) => {\n    const el = rootRef.current?.querySelectorAll<HTMLElement>(\"[data-hb-xi6-item]\")[index];\n    el?.focus();\n  };\n\n  const onTrigKey = (e: React.KeyboardEvent<HTMLButtonElement>, id: string) => {\n    if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n      e.preventDefault();\n      setOpen(id, 0);\n      window.requestAnimationFrame(() => focusItem(0));\n    }\n  };\n\n  const onPanelKey = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    if (!menu?.items) return;\n    const n = menu.items.length;\n    if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n      e.preventDefault();\n      const next = (hot + (e.key === \"ArrowDown\" ? 1 : -1) + n) % n;\n      setHot(next);\n      focusItem(next);\n    }\n  };\n\n  const closeToTrigger = () => {\n    const id = current;\n    setOpen(null);\n    if (id) rootRef.current?.querySelector<HTMLElement>(`[data-hb-xi6-trig=\"${id}\"]`)?.focus();\n  };\n\n  const chevron = (\n    <svg viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n      <path d=\"M2 3.5l3 3 3-3\" />\n    </svg>\n  );\n  const arrow = (\n    <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n      <path d=\"M2.5 6h7M6.5 3l3 3-3 3\" />\n    </svg>\n  );\n\n  const item = menu?.items ? menu.items[Math.min(hot, menu.items.length - 1)] : null;\n\n  return (\n    <header\n      ref={rootRef}\n      className={`hb-xi6 ${className}`}\n      style={{ \"--hb-xi6-accent\": accent, ...style } as React.CSSProperties}\n      onKeyDown={(e) => {\n        if (e.key !== \"Escape\") return;\n        if (current) closeToTrigger();\n        else if (sheet) setSheet(false);\n      }}\n      onBlur={(e) => {\n        if (current && !e.currentTarget.contains(e.relatedTarget as Node | null)) setOpen(null);\n      }}\n      {...rest}\n    >\n      <style href=\"hb-navbar-mega-preview\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-xi6-bar\" onPointerLeave={scheduleClose} onPointerEnter={() => current && clear()}>\n        <nav className=\"hb-xi6-row\" aria-label=\"Main\">\n          <a href=\"#\" className=\"hb-xi6-brand\" aria-label={`${brand} home`}>\n            <span className=\"hb-xi6-mark\" aria-hidden=\"true\">\n              <i />\n              <i />\n              <i />\n              <i />\n            </span>\n            {brand}\n          </a>\n          <ul className=\"hb-xi6-menus\">\n            {menus.map((m) => (\n              <li key={m.id}>\n                {m.items?.length ? (\n                  <button\n                    type=\"button\"\n                    className=\"hb-xi6-trig\"\n                    data-hb-xi6-trig={m.id}\n                    aria-expanded={current === m.id}\n                    aria-controls={`${uid}-panel`}\n                    onPointerEnter={(e) => {\n                      if (e.pointerType === \"mouse\") intent(m.id);\n                    }}\n                    onClick={() => setOpen(current === m.id ? null : m.id)}\n                    onKeyDown={(e) => onTrigKey(e, m.id)}\n                  >\n                    {m.label}\n                    {chevron}\n                  </button>\n                ) : (\n                  <a href={m.href ?? \"#\"} className=\"hb-xi6-trig\" onPointerEnter={() => current && scheduleClose()}>\n                    {m.label}\n                  </a>\n                )}\n              </li>\n            ))}\n          </ul>\n          <div className=\"hb-xi6-end\">\n            {signIn && (\n              <a href={signIn.href} className=\"hb-xi6-in\">\n                {signIn.label}\n              </a>\n            )}\n            {cta && (\n              <a href={cta.href} className=\"hb-xi6-cta\">\n                {cta.label}\n              </a>\n            )}\n            <button\n              type=\"button\"\n              className=\"hb-xi6-burger\"\n              aria-label={sheet ? \"Close menu\" : \"Open menu\"}\n              aria-expanded={sheet}\n              aria-controls={`${uid}-sheet`}\n              onClick={() => setSheet((v) => !v)}\n            >\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                {sheet ? <path d=\"M4 4l8 8M12 4l-8 8\" /> : <path d=\"M2.5 5h11M2.5 8h11M2.5 11h7\" />}\n              </svg>\n            </button>\n          </div>\n        </nav>\n        {menu?.items && item && (\n          <div id={`${uid}-panel`} className=\"hb-xi6-panel\" tabIndex={-1} role=\"region\" aria-label={`${menu.label} menu`} onKeyDown={onPanelKey}>\n            <div className=\"hb-xi6-grid\">\n              <ul key={menu.id} className=\"hb-xi6-list\" data-dir={dir}>\n                {menu.items.map((it, i) => (\n                  <li key={it.title}>\n                    <a\n                      href={it.href}\n                      className=\"hb-xi6-item\"\n                      data-hb-xi6-item=\"\"\n                      data-hot={i === hot ? \"true\" : \"false\"}\n                      onPointerEnter={() => setHot(i)}\n                      onFocus={() => setHot(i)}\n                    >\n                      <span className=\"hb-xi6-ico\" aria-hidden=\"true\">\n                        <svg viewBox=\"0 0 16 16\">{icons[it.art ?? \"graph\"]}</svg>\n                      </span>\n                      <span>\n                        <span className=\"hb-xi6-it\">\n                          {it.title}\n                          {it.tag && <span className=\"hb-xi6-tag\">{it.tag}</span>}\n                        </span>\n                        <span className=\"hb-xi6-id\">{it.description}</span>\n                      </span>\n                    </a>\n                  </li>\n                ))}\n              </ul>\n              <div className=\"hb-xi6-prev\">\n                <div key={`${menu.id}-${hot}`} className=\"hb-xi6-art\" aria-hidden=\"true\">\n                  <Art kind={item.art ?? \"graph\"} />\n                </div>\n                <div key={`${menu.id}-${hot}-c`} className=\"hb-xi6-cap\">\n                  <div>\n                    <b>{item.title}</b>\n                    <span>{item.description}</span>\n                  </div>\n                  <a href={item.href} className=\"hb-xi6-go\" tabIndex={-1}>\n                    Explore\n                    {arrow}\n                  </a>\n                </div>\n              </div>\n            </div>\n            {menu.footer && (\n              <div className=\"hb-xi6-foot\">\n                <span>Trusted by 4,200 engineering teams</span>\n                <a href={menu.footer.href}>{menu.footer.label}</a>\n              </div>\n            )}\n          </div>\n        )}\n      </div>\n      <div id={`${uid}-sheet`} className=\"hb-xi6-sheet\" data-open={sheet ? \"true\" : \"false\"}>\n        {menus.map((m) =>\n          m.items?.length ? (\n            <div key={m.id}>\n              <button type=\"button\" className=\"hb-xi6-acc\" aria-expanded={acc === m.id} onClick={() => setAcc(acc === m.id ? null : m.id)}>\n                {m.label}\n                {chevron}\n              </button>\n              {acc === m.id && (\n                <div className=\"hb-xi6-accp\">\n                  {m.items.map((it) => (\n                    <a key={it.title} href={it.href} className=\"hb-xi6-item\" onClick={() => setSheet(false)}>\n                      <span className=\"hb-xi6-ico\" aria-hidden=\"true\">\n                        <svg viewBox=\"0 0 16 16\">{icons[it.art ?? \"graph\"]}</svg>\n                      </span>\n                      <span>\n                        <span className=\"hb-xi6-it\">{it.title}</span>\n                        <span className=\"hb-xi6-id\">{it.description}</span>\n                      </span>\n                    </a>\n                  ))}\n                </div>\n              )}\n            </div>\n          ) : (\n            <a key={m.id} href={m.href ?? \"#\"} className=\"hb-xi6-acc\" onClick={() => setSheet(false)}>\n              {m.label}\n            </a>\n          ),\n        )}\n        {signIn && (\n          <a href={signIn.href} className=\"hb-xi6-acc\" onClick={() => setSheet(false)}>\n            {signIn.label}\n          </a>\n        )}\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-xi6-stage\" aria-hidden=\"true\">\n          <span className=\"hb-xi6-glow\" />\n          <div className=\"hb-xi6-hero\">\n            <h2 className=\"hb-xi6-h\">\n              Background jobs that <span>finish</span>, every single time.\n            </h2>\n            <p className=\"hb-xi6-sub\">Durable workflows, edge functions and queues on one platform, with retries and tracing built in.</p>\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}