{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-breadcrumb-switcher",
  "type": "registry:component",
  "title": "Navbar Breadcrumb Switcher",
  "description": "An app header where each breadcrumb is a switcher: team, project and environment open searchable lists with keyboard control. Picking a team cascades to its first project and environment, and changed crumbs swap in with a short blur.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "breadcrumb",
    "switcher",
    "workspace",
    "combobox",
    "app header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-breadcrumb-switcher",
  "files": [
    {
      "path": "registry/hyperblur/navbar-breadcrumb-switcher.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-breadcrumb-switcher.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarBreadcrumbSwitcherProject {\n  id: string;\n  name: string;\n  envs: string[];\n}\n\nexport interface NavbarBreadcrumbSwitcherOrg {\n  id: string;\n  name: string;\n  plan?: string;\n  tone?: string;\n  projects: NavbarBreadcrumbSwitcherProject[];\n}\n\nexport interface NavbarBreadcrumbSwitcherValue {\n  org: string;\n  project: string;\n  env: string;\n}\n\ntype Level = \"org\" | \"project\" | \"env\";\n\nexport interface NavbarBreadcrumbSwitcherProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\" | \"onChange\" | \"defaultValue\"> {\n  orgs?: NavbarBreadcrumbSwitcherOrg[];\n  value?: NavbarBreadcrumbSwitcherValue;\n  defaultValue?: NavbarBreadcrumbSwitcherValue;\n  onValueChange?: (value: NavbarBreadcrumbSwitcherValue) => void;\n  onCreate?: (level: Level) => void;\n  status?: { label: string; tone?: \"ready\" | \"building\" | \"error\" } | null;\n  user?: { name: string; initials?: string } | null;\n  defaultOpen?: Level | null;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst defaultOrgs: NavbarBreadcrumbSwitcherOrg[] = [\n  {\n    id: \"acme\",\n    name: \"Acme Studio\",\n    plan: \"Pro\",\n    tone: \"linear-gradient(135deg,#f97316,#db2777)\",\n    projects: [\n      { id: \"marketing-site\", name: \"marketing-site\", envs: [\"Production\", \"Preview\", \"Development\"] },\n      { id: \"payments-api\", name: \"payments-api\", envs: [\"Production\", \"Staging\"] },\n      { id: \"docs\", name: \"docs\", envs: [\"Production\", \"Preview\"] },\n      { id: \"mobile-app\", name: \"mobile-app\", envs: [\"Production\", \"Beta\", \"Internal\"] },\n    ],\n  },\n  {\n    id: \"ines\",\n    name: \"Ines Duarte\",\n    plan: \"Hobby\",\n    tone: \"linear-gradient(135deg,#22c55e,#0ea5e9)\",\n    projects: [\n      { id: \"portfolio\", name: \"portfolio\", envs: [\"Production\", \"Preview\"] },\n      { id: \"recipe-box\", name: \"recipe-box\", envs: [\"Production\"] },\n    ],\n  },\n  {\n    id: \"northwind\",\n    name: \"Northwind Labs\",\n    plan: \"Enterprise\",\n    tone: \"linear-gradient(135deg,#6366f1,#a855f7)\",\n    projects: [\n      { id: \"dashboard\", name: \"dashboard\", envs: [\"Production\", \"Staging\", \"QA\"] },\n      { id: \"edge-gateway\", name: \"edge-gateway\", envs: [\"Production\", \"Canary\"] },\n    ],\n  },\n];\n\nconst ease = \"cubic-bezier(.22,1,.36,1)\";\n\nconst css = `\n.hb-xj10 {\n  --hb-xj10-accent: #2f7bff;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xj10 *, .hb-xj10 *::before, .hb-xj10 *::after { box-sizing: border-box; }\n.hb-xj10[data-backdrop=\"true\"] { min-height: 620px; overflow: hidden; background: #0a0a0a; }\n.hb-xj10-bar {\n  position: relative;\n  z-index: 4;\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  height: 60px;\n  padding: 0 16px;\n  border-bottom: 1px solid #1f1f1f;\n  background: #0c0c0c;\n}\n.hb-xj10-logo { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: #ededed; border-radius: 8px; text-decoration: none; }\n.hb-xj10-logo svg { width: 22px; height: 22px; }\n.hb-xj10-crumbs { display: flex; align-items: center; min-width: 0; margin: 0; padding: 0; list-style: none; }\n.hb-xj10-crumbs > li { position: relative; display: flex; align-items: center; min-width: 0; }\n.hb-xj10-sep { width: 22px; height: 22px; flex: none; color: #333; }\n.hb-xj10-seg {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  min-width: 0;\n  height: 36px;\n  padding: 0 6px 0 8px;\n  border: 0;\n  border-radius: 9px;\n  background: none;\n  color: #ededed;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background-color .2s ease;\n}\n.hb-xj10-seg:hover, .hb-xj10-seg[aria-expanded=\"true\"] { background: rgba(255,255,255,.06); }\n.hb-xj10-name { display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: hb-xj10-swap .45s ${ease}; }\n@keyframes hb-xj10-swap { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }\n.hb-xj10-tile { width: 20px; height: 20px; flex: none; border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }\n.hb-xj10-proj { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1px solid #2f2f2f; background: #161616; color: #a1a1a1; font-size: 10px; font-weight: 700; text-transform: uppercase; }\n.hb-xj10-plan { height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid #2a2a2a; color: #a1a1a1; font-size: 11px; font-weight: 500; line-height: 18px; white-space: nowrap; }\n.hb-xj10-plan[data-plan=\"Pro\"], .hb-xj10-plan[data-plan=\"Enterprise\"] { border-color: color-mix(in srgb, var(--hb-xj10-accent) 45%, transparent); color: color-mix(in srgb, var(--hb-xj10-accent) 55%, #fff); background: color-mix(in srgb, var(--hb-xj10-accent) 10%, transparent); }\n.hb-xj10-env { display: inline-flex; align-items: center; gap: 7px; }\n.hb-xj10-edot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }\n.hb-xj10-edot[data-env=\"other\"] { background: #eab308; box-shadow: 0 0 0 3px rgba(234,179,8,.15); }\n.hb-xj10-chev { width: 16px; height: 16px; flex: none; color: #6b6b6b; }\n.hb-xj10-pop {\n  position: absolute;\n  top: calc(100% + 10px);\n  left: 0;\n  z-index: 6;\n  width: 300px;\n  border: 1px solid #262626;\n  border-radius: 14px;\n  background: linear-gradient(180deg, #151515, #101010);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 30px 60px -20px rgba(0,0,0,.95);\n  overflow: hidden;\n  transform-origin: 20px 0;\n  animation: hb-xj10-pop .3s ${ease};\n}\n@keyframes hb-xj10-pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }\n.hb-xj10-find { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-bottom: 1px solid #1f1f1f; }\n.hb-xj10-find svg { width: 15px; height: 15px; flex: none; fill: none; stroke: #6b6b6b; stroke-width: 2; stroke-linecap: round; }\n.hb-xj10-find input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: #ededed; font: inherit; font-size: 13.5px; }\n.hb-xj10-find input::placeholder { color: #6b6b6b; }\n.hb-xj10-find kbd { height: 20px; padding: 0 6px; border: 1px solid #2a2a2a; border-radius: 5px; color: #8f8f8f; font-family: var(--font-mono, monospace); font-size: 10.5px; line-height: 18px; }\n.hb-xj10-cap { padding: 10px 14px 4px; color: #6b6b6b; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }\n.hb-xj10-list { max-height: 240px; margin: 0; padding: 4px 6px 6px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }\n.hb-xj10-opt { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; border-radius: 9px; color: #d4d4d4; font-size: 13.5px; cursor: pointer; }\n.hb-xj10-opt[data-active=\"true\"] { background: rgba(255,255,255,.06); color: #fff; }\n.hb-xj10-opt > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-xj10-opt small { color: #6b6b6b; font-size: 11.5px; }\n.hb-xj10-check { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--hb-xj10-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xj10-none { padding: 18px 12px; color: #8f8f8f; font-size: 13px; text-align: center; }\n.hb-xj10-new { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 14px; border: 0; border-top: 1px solid #1f1f1f; background: none; color: #a1a1a1; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }\n.hb-xj10-new:hover { color: #fff; background: rgba(255,255,255,.04); }\n.hb-xj10-new svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.hb-xj10-grow { flex: 1; }\n.hb-xj10-status { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px; border: 1px solid #222; border-radius: 999px; color: #a1a1a1; font-size: 12.5px; white-space: nowrap; }\n.hb-xj10-pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }\n.hb-xj10-pulse::after { content: \"\"; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid currentColor; color: #22c55e; animation: hb-xj10-ping 2s ${ease} infinite; }\n.hb-xj10-pulse[data-tone=\"building\"] { background: #eab308; }\n.hb-xj10-pulse[data-tone=\"building\"]::after { color: #eab308; }\n.hb-xj10-pulse[data-tone=\"error\"] { background: #ef4444; }\n.hb-xj10-pulse[data-tone=\"error\"]::after { color: #ef4444; }\n@keyframes hb-xj10-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }\n.hb-xj10-fb { height: 32px; padding: 0 12px; border: 1px solid #262626; border-radius: 8px; background: none; color: #a1a1a1; font: inherit; font-size: 13px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }\n.hb-xj10-fb:hover { color: #ededed; border-color: #333; }\n.hb-xj10-av { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; font-size: 11px; font-weight: 700; }\n.hb-xj10 a:focus-visible, .hb-xj10 button:focus-visible { outline: 2px solid var(--hb-xj10-accent); outline-offset: 2px; }\n@container (max-width: 820px) {\n  .hb-xj10-fb { display: none; }\n}\n@container (max-width: 640px) {\n  .hb-xj10-bar { padding: 0 10px; gap: 4px; }\n  .hb-xj10-crumbs > li { position: static; }\n  .hb-xj10-orgname, .hb-xj10-plan, .hb-xj10-envname, .hb-xj10-status span:last-child { display: none; }\n  .hb-xj10-status { padding: 0 9px; }\n  .hb-xj10-sep { width: 16px; }\n  .hb-xj10-seg { padding: 0 4px 0 6px; }\n  .hb-xj10-pop { left: 8px; right: 8px; width: auto; top: calc(100% + 6px); }\n}\n.hb-xj10-sub { position: relative; z-index: 1; display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid #1a1a1a; background: #0c0c0c; overflow-x: auto; scrollbar-width: none; }\n.hb-xj10-sub span { position: relative; padding: 12px 10px; color: #8f8f8f; font-size: 13.5px; white-space: nowrap; }\n.hb-xj10-sub span:first-child { color: #ededed; }\n.hb-xj10-sub span:first-child::after { content: \"\"; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: #ededed; }\n.hb-xj10-page { position: relative; z-index: 1; padding: 26px 20px; max-width: 980px; margin: 0 auto; }\n.hb-xj10-page h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.025em; }\n.hb-xj10-page p { margin: 4px 0 18px; color: #8f8f8f; font-size: 13px; }\n.hb-xj10-rows { border: 1px solid #1f1f1f; border-radius: 12px; overflow: hidden; }\n.hb-xj10-row { display: grid; grid-template-columns: 1.4fr 1fr .6fr; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid #1a1a1a; background: #0f0f0f; font-size: 13px; color: #d4d4d4; }\n.hb-xj10-row:first-child { border-top: 0; }\n.hb-xj10-row code { color: #8f8f8f; font-family: var(--font-mono, monospace); font-size: 12px; }\n.hb-xj10-row em { display: inline-flex; align-items: center; gap: 6px; font-style: normal; color: #a1a1a1; }\n.hb-xj10-row em i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; font-style: normal; }\n.hb-xj10-row small { justify-self: end; color: #6b6b6b; font-size: 12px; }\n@container (max-width: 640px) { .hb-xj10-row { grid-template-columns: 1fr auto; } .hb-xj10-row code { display: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xj10 *, .hb-xj10 *::before, .hb-xj10 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nfunction Slash() {\n  return (\n    <svg className=\"hb-xj10-sep\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n      <path d=\"M15.5 4 8.5 20\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" fill=\"none\" />\n    </svg>\n  );\n}\n\nfunction Chev() {\n  return (\n    <svg className=\"hb-xj10-chev\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <path d=\"m5 6.5 3-3 3 3M5 9.5l3 3 3-3\" />\n    </svg>\n  );\n}\n\ninterface Option {\n  id: string;\n  label: string;\n  meta?: string;\n  tone?: string;\n}\n\nfunction Switcher({\n  level,\n  options,\n  selected,\n  onPick,\n  onClose,\n  onCreate,\n  listId,\n  focusOnMount,\n}: {\n  level: Level;\n  options: Option[];\n  selected: string;\n  onPick: (id: string) => void;\n  onClose: (refocus: boolean) => void;\n  onCreate?: (level: Level) => void;\n  listId: string;\n  focusOnMount: boolean;\n}) {\n  const [q, setQ] = React.useState(\"\");\n  const inputRef = React.useRef<HTMLInputElement>(null);\n\n  React.useEffect(() => {\n    if (focusOnMount) inputRef.current?.focus();\n  }, [focusOnMount]);\n  const [active, setActive] = React.useState(() => Math.max(0, options.findIndex((o) => o.id === selected)));\n  const shown = options.filter((o) => o.label.toLowerCase().includes(q.trim().toLowerCase()));\n  const at = Math.min(active, Math.max(0, shown.length - 1));\n  const noun = level === \"org\" ? \"team\" : level === \"project\" ? \"project\" : \"environment\";\n\n  const onKey = (e: React.KeyboardEvent<HTMLInputElement>) => {\n    if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n      e.preventDefault();\n      if (!shown.length) return;\n      setActive((at + (e.key === \"ArrowDown\" ? 1 : -1) + shown.length) % shown.length);\n    } else if (e.key === \"Enter\") {\n      e.preventDefault();\n      if (shown[at]) onPick(shown[at].id);\n    } else if (e.key === \"Escape\") {\n      e.preventDefault();\n      e.stopPropagation();\n      onClose(true);\n    } else if (e.key === \"Tab\") {\n      onClose(false);\n    }\n  };\n\n  return (\n    <div className=\"hb-xj10-pop\">\n      <div className=\"hb-xj10-find\">\n        <svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n          <circle cx=\"9\" cy=\"9\" r=\"5.5\" />\n          <path d=\"m13.2 13.2 3.3 3.3\" />\n        </svg>\n        <input\n          ref={inputRef}\n          role=\"combobox\"\n          aria-expanded=\"true\"\n          aria-controls={listId}\n          aria-activedescendant={shown[at] ? `${listId}-${at}` : undefined}\n          aria-label={`Find ${noun}`}\n          placeholder={`Find ${noun}…`}\n          value={q}\n          onChange={(e) => {\n            setQ(e.target.value);\n            setActive(0);\n          }}\n          onKeyDown={onKey}\n        />\n        <kbd>esc</kbd>\n      </div>\n      <div className=\"hb-xj10-cap\">{level === \"org\" ? \"Teams\" : level === \"project\" ? \"Projects\" : \"Environments\"}</div>\n      <ul className=\"hb-xj10-list\" id={listId} role=\"listbox\" aria-label={`${noun}s`}>\n        {shown.length === 0 && (\n          <li className=\"hb-xj10-none\" role=\"presentation\">\n            No {noun} matches “{q}”\n          </li>\n        )}\n        {shown.map((o, i) => (\n          <li\n            key={o.id}\n            id={`${listId}-${i}`}\n            role=\"option\"\n            aria-selected={o.id === selected}\n            className=\"hb-xj10-opt\"\n            data-active={i === at ? \"true\" : \"false\"}\n            onPointerMove={() => i !== at && setActive(i)}\n            onPointerDown={(e) => e.preventDefault()}\n            onClick={() => onPick(o.id)}\n          >\n            {level === \"org\" ? (\n              <span className=\"hb-xj10-tile\" style={{ background: o.tone }} aria-hidden=\"true\" />\n            ) : level === \"project\" ? (\n              <span className=\"hb-xj10-proj\" aria-hidden=\"true\">\n                {o.label.slice(0, 1)}\n              </span>\n            ) : (\n              <span className=\"hb-xj10-edot\" data-env={o.label === \"Production\" ? undefined : \"other\"} aria-hidden=\"true\" />\n            )}\n            <span>{o.label}</span>\n            {o.meta && <small>{o.meta}</small>}\n            {o.id === selected && (\n              <svg className=\"hb-xj10-check\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                <path d=\"m3.5 8.5 3 3 6-7\" />\n              </svg>\n            )}\n          </li>\n        ))}\n      </ul>\n      {onCreate && (\n        <button type=\"button\" className=\"hb-xj10-new\" onClick={() => onCreate(level)}>\n          <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n            <path d=\"M8 3v10M3 8h10\" />\n          </svg>\n          New {noun}\n        </button>\n      )}\n    </div>\n  );\n}\n\nexport function NavbarBreadcrumbSwitcher({\n  orgs = defaultOrgs,\n  value,\n  defaultValue,\n  onValueChange,\n  onCreate,\n  status = { label: \"Ready, deployed 2m ago\", tone: \"ready\" },\n  user = { name: \"Ines Duarte\", initials: \"ID\" },\n  defaultOpen = null,\n  accent = \"#2f7bff\",\n  showBackdrop = true,\n  className,\n  style,\n  ...rest\n}: NavbarBreadcrumbSwitcherProps) {\n  const fallback: NavbarBreadcrumbSwitcherValue = {\n    org: orgs[0]?.id ?? \"\",\n    project: orgs[0]?.projects[0]?.id ?? \"\",\n    env: orgs[0]?.projects[0]?.envs[0] ?? \"\",\n  };\n  const [inner, setInner] = React.useState<NavbarBreadcrumbSwitcherValue>(defaultValue ?? fallback);\n  const [open, setOpen] = React.useState<Level | null>(defaultOpen);\n  const [touched, setTouched] = React.useState(false);\n  const rootRef = React.useRef<HTMLElement>(null);\n  const segRefs = React.useRef<Record<Level, HTMLButtonElement | null>>({ org: null, project: null, env: null });\n  const baseId = React.useId();\n  const current = value ?? inner;\n\n  const org = orgs.find((o) => o.id === current.org) ?? orgs[0];\n  const project = org?.projects.find((p) => p.id === current.project) ?? org?.projects[0];\n  const env = project?.envs.includes(current.env) ? current.env : (project?.envs[0] ?? \"\");\n\n  React.useEffect(() => {\n    if (!open) return;\n    const onDown = (e: PointerEvent) => {\n      const pop = rootRef.current?.querySelector(\".hb-xj10-pop\");\n      const seg = segRefs.current[open];\n      if (pop?.contains(e.target as Node) || seg?.contains(e.target as Node)) return;\n      setOpen(null);\n    };\n    document.addEventListener(\"pointerdown\", onDown);\n    return () => document.removeEventListener(\"pointerdown\", onDown);\n  }, [open]);\n\n  const commit = (next: NavbarBreadcrumbSwitcherValue) => {\n    if (value === undefined) setInner(next);\n    onValueChange?.(next);\n  };\n\n  const pick = (level: Level, id: string) => {\n    if (level === \"org\") {\n      const o = orgs.find((x) => x.id === id);\n      const p = o?.projects[0];\n      commit({ org: id, project: p?.id ?? \"\", env: p?.envs[0] ?? \"\" });\n    } else if (level === \"project\") {\n      const p = org?.projects.find((x) => x.id === id);\n      commit({ org: org?.id ?? \"\", project: id, env: p?.envs[0] ?? \"\" });\n    } else {\n      commit({ org: org?.id ?? \"\", project: project?.id ?? \"\", env: id });\n    }\n    setOpen(null);\n    segRefs.current[level]?.focus();\n  };\n\n  const close = (level: Level, refocus: boolean) => {\n    setOpen(null);\n    if (refocus) segRefs.current[level]?.focus();\n  };\n\n  const options: Record<Level, Option[]> = {\n    org: orgs.map((o) => ({ id: o.id, label: o.name, meta: o.plan, tone: o.tone })),\n    project: (org?.projects ?? []).map((p) => ({ id: p.id, label: p.name, meta: `${p.envs.length} env` })),\n    env: (project?.envs ?? []).map((e) => ({ id: e, label: e })),\n  };\n\n  const seg = (level: Level, children: React.ReactNode, label: string) => (\n    <li>\n      <button\n        ref={(el) => {\n          segRefs.current[level] = el;\n        }}\n        type=\"button\"\n        className=\"hb-xj10-seg\"\n        aria-haspopup=\"listbox\"\n        aria-expanded={open === level}\n        aria-label={label}\n        onClick={() => {\n          setTouched(true);\n          setOpen(open === level ? null : level);\n        }}\n        onKeyDown={(e) => {\n          if (e.key === \"ArrowDown\" && open !== level) {\n            e.preventDefault();\n            setTouched(true);\n            setOpen(level);\n          }\n        }}\n      >\n        {children}\n        <Chev />\n      </button>\n      {open === level && (\n        <Switcher\n          key={`${level}-${current.org}-${current.project}`}\n          level={level}\n          options={options[level]}\n          selected={level === \"org\" ? (org?.id ?? \"\") : level === \"project\" ? (project?.id ?? \"\") : env}\n          onPick={(id) => pick(level, id)}\n          onClose={(r) => close(level, r)}\n          onCreate={onCreate}\n          listId={`${baseId}-${level}`}\n          focusOnMount={touched}\n        />\n      )}\n    </li>\n  );\n\n  return (\n    <header\n      ref={rootRef}\n      className={[\"hb-xj10\", className].filter(Boolean).join(\" \")}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      style={{ \"--hb-xj10-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-navbar-breadcrumb-switcher\" precedence=\"default\">\n        {css}\n      </style>\n      <nav className=\"hb-xj10-bar\" aria-label=\"Workspace\">\n        <a className=\"hb-xj10-logo\" href=\"#top\" aria-label=\"Home\">\n          <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n            <path d=\"M12 3 21 19H3Z\" fill=\"currentColor\" />\n          </svg>\n        </a>\n        <Slash />\n        <ol className=\"hb-xj10-crumbs\">\n          {seg(\n            \"org\",\n            <>\n              <span className=\"hb-xj10-tile\" style={{ background: org?.tone }} aria-hidden=\"true\" />\n              <span className=\"hb-xj10-name hb-xj10-orgname\" key={org?.id}>\n                {org?.name}\n              </span>\n              {org?.plan && (\n                <span className=\"hb-xj10-plan\" data-plan={org.plan}>\n                  {org.plan}\n                </span>\n              )}\n            </>,\n            `Team: ${org?.name}`,\n          )}\n          <li aria-hidden=\"true\">\n            <Slash />\n          </li>\n          {seg(\n            \"project\",\n            <>\n              <span className=\"hb-xj10-proj\" aria-hidden=\"true\">\n                {project?.name.slice(0, 1)}\n              </span>\n              <span className=\"hb-xj10-name\" key={`${org?.id}-${project?.id}`}>\n                {project?.name}\n              </span>\n            </>,\n            `Project: ${project?.name}`,\n          )}\n          <li aria-hidden=\"true\">\n            <Slash />\n          </li>\n          {seg(\n            \"env\",\n            <span className=\"hb-xj10-env\">\n              <span className=\"hb-xj10-edot\" data-env={env === \"Production\" ? undefined : \"other\"} aria-hidden=\"true\" />\n              <span className=\"hb-xj10-name hb-xj10-envname\" key={`${project?.id}-${env}`}>\n                {env}\n              </span>\n            </span>,\n            `Environment: ${env}`,\n          )}\n        </ol>\n        <span className=\"hb-xj10-grow\" />\n        {status && (\n          <span className=\"hb-xj10-status\" role=\"status\">\n            <span className=\"hb-xj10-pulse\" data-tone={status.tone ?? \"ready\"} aria-hidden=\"true\" />\n            <span>{status.label}</span>\n          </span>\n        )}\n        <button type=\"button\" className=\"hb-xj10-fb\">\n          Feedback\n        </button>\n        {user && (\n          <span className=\"hb-xj10-av\" role=\"img\" aria-label={user.name}>\n            {user.initials ?? user.name.slice(0, 2).toUpperCase()}\n          </span>\n        )}\n      </nav>\n      {showBackdrop && (\n        <>\n          <div className=\"hb-xj10-sub\" aria-hidden=\"true\">\n            <span>Deployments</span>\n            <span>Logs</span>\n            <span>Analytics</span>\n            <span>Domains</span>\n            <span>Settings</span>\n          </div>\n          <div className=\"hb-xj10-page\" aria-hidden=\"true\">\n            <h2>{project?.name}</h2>\n            <p>\n              {org?.name} · {env}\n            </p>\n            <div className=\"hb-xj10-rows\">\n              {[\n                [\"Fix hydration on checkout\", \"a1f9c2e\", \"2m\"],\n                [\"Add usage based billing\", \"7be04d1\", \"1h\"],\n                [\"Move images to edge cache\", \"c33a8f0\", \"6h\"],\n                [\"Bump framework to 16.4\", \"09d71aa\", \"1d\"],\n              ].map(([t, c, w]) => (\n                <div className=\"hb-xj10-row\" key={c}>\n                  <em>\n                    <i />\n                    {t}\n                  </em>\n                  <code>{c}</code>\n                  <small>{w} ago</small>\n                </div>\n              ))}\n            </div>\n          </div>\n        </>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}