{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "marketing-06",
  "title": "Docs site",
  "description": "A Wickerline docs site in one component: a home with one search across every page and three category cards, then pages with the sidebar, a page header, install steps whose package manager rolls the command, callouts, a table of events, an On this page rail and previous and next links. A small router keeps the state, and a search for install opens the page while bun rolls into the command.",
  "dependencies": [
    "@wickerline/sdk",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/badge.json",
    "https://ui.ndekocode.dev/r/breadcrumb.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/chat-motion.json",
    "https://ui.ndekocode.dev/r/company-mark.json",
    "https://ui.ndekocode.dev/r/copy-button.json",
    "https://ui.ndekocode.dev/r/demonstration.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/inline-sheet.json",
    "https://ui.ndekocode.dev/r/input.json",
    "https://ui.ndekocode.dev/r/live-region.json",
    "https://ui.ndekocode.dev/r/motion-number.json",
    "https://ui.ndekocode.dev/r/motion-presets.json",
    "https://ui.ndekocode.dev/r/motion-word-roll.json",
    "https://ui.ndekocode.dev/r/recipes.json",
    "https://ui.ndekocode.dev/r/replay-button.json",
    "https://ui.ndekocode.dev/r/table.json",
    "https://ui.ndekocode.dev/r/tabs.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/toggle-group.json",
    "https://ui.ndekocode.dev/r/use-is-narrow.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/use-session.json",
    "https://ui.ndekocode.dev/r/utils.json",
    "https://ui.ndekocode.dev/r/words.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/templates/docs/marketing-06/index.tsx",
      "content": "'use client';\n\nimport { useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport { useIsNarrow } from '@/registry/ndeko/hooks/use-is-narrow';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { useSession } from '@/registry/ndeko/hooks/use-session';\nimport { spokenUnless } from '@/registry/ndeko/lib/demonstration';\nimport { InlineSheet } from '@/registry/ndeko/ui/inline-sheet';\nimport { LiveRegion } from '@/registry/ndeko/ui/live-region';\n\nimport type { Manager, InstallTab } from './data';\nimport { DocPage } from './doc-page';\nimport { DocsHeader } from './docs-header';\nimport { DocsNav } from './docs-nav';\nimport { HomePage } from './home-page';\nimport { initCommandOf } from './install';\nimport { pageOf, type DocPage as DocPageContent, type PageId } from './pages';\nimport { searchOf, type SearchResult } from './search';\nimport {\n  INITIAL,\n  LOOP_AFTER_MS,\n  reducer,\n  RESTING,\n  SCRIPT,\n  TOP,\n  type Route,\n} from './session';\n\nconst SESSION = {\n  reducer,\n  initial: INITIAL,\n  resting: RESTING,\n  script: SCRIPT,\n  loopAfter: LOOP_AFTER_MS,\n};\n\n/** A heading counts as read once it rises above this line of the frame. */\nconst READ_LINE_PX = 96;\n\n/** Where a heading lands after a jump, just under the read line. */\nconst LANDING_PX = 64;\n\nconst COPIED_FOR_MS = 1600;\n\n/** The width of the `@3xl` container step, where the sidebar takes the place of the sheet. */\nconst SIDEBAR_FROM_REM = 48;\n\nfunction scrollBehaviorOf(shouldReduceMotion: boolean): ScrollBehavior {\n  if (shouldReduceMotion) {\n    return 'auto';\n  }\n  return 'smooth';\n}\n\nfunction docPageOf(route: Route): DocPageContent | null {\n  if (route === 'home') {\n    return null;\n  }\n  return pageOf(route);\n}\n\nfunction headingOfResult(result: SearchResult) {\n  return result.entry.headingId ?? undefined;\n}\n\n/** The heading the rail marks, once the page it belongs to is the one on screen. */\nfunction activeHeadingOf(page: DocPageContent, activeId: string) {\n  const isOnPage = page.sections.some((section) => section.id === activeId);\n  if (isOnPage) {\n    return activeId;\n  }\n  return page.sections[0].id;\n}\n\nfunction readHeadingOf(frame: HTMLElement, fallback: string) {\n  const frameTop = frame.getBoundingClientRect().top;\n  const headings = frame.querySelectorAll<HTMLElement>('[data-heading]');\n  let active = fallback;\n  for (const heading of headings) {\n    const top = heading.getBoundingClientRect().top - frameTop;\n    const isRead = top <= READ_LINE_PX;\n    const id = heading.dataset.heading;\n    if (isRead && id) {\n      active = id;\n    }\n  }\n  return active;\n}\n\nexport default function Marketing06() {\n  const {\n    ref,\n    isAutoplaying,\n    state,\n    act,\n    pressed,\n    isFinished,\n    restart,\n    takeOver,\n  } = useSession(SESSION);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const isNarrow = useIsNarrow(ref, SIDEBAR_FROM_REM);\n  const baseId = useId();\n  const frameRef = useRef<HTMLDivElement>(null);\n  const pendingFrame = useRef<number | null>(null);\n  const [activeId, setActiveId] = useState('');\n  const page = docPageOf(state.route);\n  const isHome = page === null;\n  const hasSidebar = !isHome;\n  const canShowSheet = isNarrow && hasSidebar;\n  const isSheetShown = canShowSheet && state.isNavOpen;\n  const canReplay = isFinished && !isAutoplaying;\n  const message = spokenUnless(isAutoplaying, state.spoken);\n  const searchId = `${baseId}-search`;\n\n  const headingIdOf = useCallback(\n    (headingId: string) => `${baseId}-${headingId}`,\n    [baseId]\n  );\n\n  const scrollFrameTo = useCallback(\n    (headingId: string) => {\n      const frame = frameRef.current;\n      const behavior = scrollBehaviorOf(shouldReduceMotion);\n      if (!frame) {\n        return null;\n      }\n      if (headingId === TOP) {\n        frame.scrollTo({ top: 0, behavior: 'auto' });\n        return null;\n      }\n      const selector = `[data-heading=\"${headingId}\"]`;\n      const heading = frame.querySelector<HTMLElement>(selector);\n      if (!heading) {\n        return null;\n      }\n      const headingTop = heading.getBoundingClientRect().top;\n      const frameTop = frame.getBoundingClientRect().top;\n      const top = headingTop - frameTop + frame.scrollTop - LANDING_PX;\n      frame.scrollTo({ top, behavior });\n      return heading;\n    },\n    [shouldReduceMotion]\n  );\n\n  useEffect(() => {\n    if (state.readRequest === 0) {\n      return;\n    }\n    scrollFrameTo(state.readTo);\n  }, [state.readRequest, state.readTo, scrollFrameTo]);\n\n  useEffect(() => {\n    if (!state.isCommandCopied) {\n      return;\n    }\n    const timer = setTimeout(() => {\n      act({ type: 'commandReset' });\n    }, COPIED_FOR_MS);\n    return () => clearTimeout(timer);\n  }, [state.isCommandCopied, act]);\n\n  useEffect(() => {\n    return () => {\n      const frameRequest = pendingFrame.current;\n      if (frameRequest !== null) {\n        cancelAnimationFrame(frameRequest);\n      }\n    };\n  }, []);\n\n  function focusLater(selector: string) {\n    requestAnimationFrame(() => {\n      const target = ref.current?.querySelector<HTMLElement>(selector);\n      target?.focus();\n    });\n  }\n\n  /** The page changes under the pointer of a person, so the keyboard starts reading from the top of the new one. */\n  function startReading() {\n    focusLater('[data-frame]');\n  }\n\n  function openPage(pageId: PageId) {\n    act({ type: 'opened', route: pageId });\n    startReading();\n  }\n\n  function openHome() {\n    act({ type: 'opened', route: 'home' });\n    startReading();\n  }\n\n  function openResult(result: SearchResult) {\n    const heading = headingOfResult(result);\n    act({ type: 'opened', route: result.entry.pageId, heading });\n    startReading();\n  }\n\n  function openFirstResult() {\n    const [first] = searchOf(state.query);\n    if (first) {\n      openResult(first);\n    }\n  }\n\n  function search(query: string) {\n    act({ type: 'searched', query });\n  }\n\n  function measureReading() {\n    pendingFrame.current = null;\n    const frame = frameRef.current;\n    if (frame && page) {\n      const first = page.sections[0].id;\n      setActiveId(readHeadingOf(frame, first));\n    }\n  }\n\n  /** The rail follows the scroll at most once a frame. */\n  function followReading() {\n    if (pendingFrame.current !== null) {\n      return;\n    }\n    pendingFrame.current = requestAnimationFrame(measureReading);\n  }\n\n  function yieldToWheel() {\n    if (isAutoplaying) {\n      takeOver();\n    }\n  }\n\n  /** A jump also hands the focus to the heading, so the keyboard reads on from there. */\n  function jumpTo(headingId: string) {\n    const heading = scrollFrameTo(headingId);\n    heading?.focus({ preventScroll: true });\n  }\n\n  async function copyCommand() {\n    try {\n      const command = initCommandOf(state.manager);\n      await navigator.clipboard.writeText(command);\n    } catch {\n      return;\n    }\n    act({ type: 'commandCopied' });\n  }\n\n  function openSheet() {\n    act({ type: 'nav', isOpen: true });\n    focusLater('[data-sheet-nav] input');\n  }\n\n  function closeSheet() {\n    act({ type: 'nav', isOpen: false });\n    focusLater('[data-sheet-trigger]');\n  }\n\n  function replay() {\n    frameRef.current?.scrollTo({ top: 0 });\n    restart();\n  }\n\n  const install = {\n    manager: state.manager,\n    tab: state.installTab,\n    isCommandCopied: state.isCommandCopied,\n    pressed,\n    onPickManager: (manager: Manager) =>\n      act({ type: 'managerPicked', manager }),\n    onPickTab: (tab: InstallTab) => act({ type: 'tabPicked', tab }),\n    onCopyCommand: copyCommand,\n  };\n\n  const nav = page && (\n    <DocsNav\n      searchId={searchId}\n      query={state.query}\n      pageId={page.id}\n      pressed={pressed}\n      onSearch={search}\n      onEnter={openFirstResult}\n      onOpenResult={openResult}\n      onOpenPage={openPage}\n    />\n  );\n\n  return (\n    <div\n      ref={ref}\n      className='bg-background text-foreground @container relative flex h-dvh min-h-[36rem] w-full flex-col overflow-hidden'\n    >\n      <div inert={isSheetShown} className='flex min-h-0 flex-1 flex-col'>\n        <DocsHeader\n          isHome={isHome}\n          pressed={pressed}\n          canReplay={canReplay}\n          onOpenHome={openHome}\n          onOpenMenu={openSheet}\n          onReplay={replay}\n        />\n        <div className='flex min-h-0 flex-1'>\n          {!isHome && (\n            <aside\n              aria-label='Sidebar'\n              className='hairline-r border-border hidden w-64 shrink-0 overflow-y-auto p-4 @3xl:block'\n            >\n              {!isNarrow && nav}\n            </aside>\n          )}\n          <div\n            ref={frameRef}\n            data-frame\n            tabIndex={-1}\n            onScroll={followReading}\n            onWheel={yieldToWheel}\n            className='relative min-h-0 flex-1 overflow-y-auto overscroll-contain outline-none'\n          >\n            {isHome && (\n              <HomePage\n                searchId={searchId}\n                query={state.query}\n                pressed={pressed}\n                onSearch={search}\n                onEnter={openFirstResult}\n                onOpenResult={openResult}\n                onOpenPage={openPage}\n              />\n            )}\n            {page && (\n              <DocPage\n                page={page}\n                activeId={activeHeadingOf(page, activeId)}\n                pressed={pressed}\n                install={install}\n                headingIdOf={headingIdOf}\n                onJump={jumpTo}\n                onOpenPage={openPage}\n                onOpenHome={openHome}\n              />\n            )}\n          </div>\n        </div>\n      </div>\n      <InlineSheet\n        side='start'\n        isOpen={isSheetShown}\n        onClose={closeSheet}\n        label='Docs'\n        closeLabel='Close the docs menu'\n        className='z-40 @3xl:hidden'\n        panelClassName='gap-2 overflow-y-auto p-3'\n      >\n        <div data-sheet-nav className='px-1 pb-2'>\n          {isNarrow && nav}\n        </div>\n      </InlineSheet>\n      <LiveRegion message={message} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/index.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/callout.tsx",
      "content": "import {\n  InfoIcon,\n  LightbulbIcon,\n  TriangleAlertIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport type { Tone } from './pages';\n\nconst TRAY: Record<Tone, string> = {\n  info: 'bg-info/10',\n  warning: 'bg-warning/10',\n  tip: 'bg-success/10',\n};\n\nconst GLYPH_TONE: Record<Tone, string> = {\n  info: 'text-info-foreground',\n  warning: 'text-warning-foreground',\n  tip: 'text-success-foreground',\n};\n\nconst GLYPH: Record<Tone, Icon> = {\n  info: InfoIcon,\n  warning: TriangleAlertIcon,\n  tip: LightbulbIcon,\n};\n\nconst WORD: Record<Tone, string> = {\n  info: 'Note',\n  warning: 'Warning',\n  tip: 'Tip',\n};\n\ntype CalloutProps = {\n  tone: Tone;\n  children: React.ReactNode;\n};\n\nexport function Callout({ tone, children }: CalloutProps) {\n  const ToneIcon = GLYPH[tone];\n\n  return (\n    <div\n      className={cn(\n        'flex items-start gap-3 rounded-xl px-4 py-3 text-[13px] leading-5',\n        TRAY[tone]\n      )}\n    >\n      <ToneIcon className={cn('mt-px size-4 shrink-0', GLYPH_TONE[tone])} />\n      <p className='min-w-0 text-pretty'>\n        <span className='sr-only'>{WORD[tone]}: </span>\n        {children}\n      </p>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/callout.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/code-block.tsx",
      "content": "'use client';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { CopyButton } from '@/registry/ndeko/ui/copy-button';\n\nexport const CODE_TRAY = 'bg-foreground/[0.04] rounded-lg';\n\nexport function CodeBlock({ code }: { code: string }) {\n  return (\n    <div className='relative'>\n      <pre\n        tabIndex={0}\n        className={cn(\n          CODE_TRAY,\n          'focus-visible:ring-ring/25 relative overflow-x-auto py-2.5 ps-3 pe-10 font-mono text-[12.5px] leading-relaxed outline-none focus-visible:ring-[3px]'\n        )}\n      >\n        <code>{code}</code>\n      </pre>\n      <CopyButton\n        text={code}\n        label='Copy the code'\n        className='absolute end-1.5 top-1.5'\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/code-block.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/data.ts",
      "content": "import {\n  BlocksIcon,\n  BookOpenIcon,\n  RocketIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\n\nimport type { PageId } from './pages';\n\nexport type Manager = 'pnpm' | 'npm' | 'yarn' | 'bun';\n\nexport type InstallTab = 'cli' | 'manual';\n\nexport const PRODUCT = {\n  name: 'Wickerline',\n  version: 'v2',\n  title: 'Wickerline documentation',\n  lead: 'Record what your agents do, and hold the risky steps for a person.',\n};\n\nexport const SAMPLE_NOTE =\n  'Wickerline is an example product. Its pages, keys and addresses are samples.';\n\nexport type Category = {\n  id: string;\n  title: string;\n  text: string;\n  icon: Icon;\n  pageId: PageId;\n};\n\nexport const CATEGORIES: Category[] = [\n  {\n    id: 'start',\n    title: 'Get started',\n    text: 'Install the SDK, add your project key and record a first run.',\n    icon: RocketIcon,\n    pageId: 'installation',\n  },\n  {\n    id: 'build',\n    title: 'Build',\n    text: 'Hold a step for a person and answer from your own app.',\n    icon: BlocksIcon,\n    pageId: 'approvals',\n  },\n  {\n    id: 'reference',\n    title: 'Reference',\n    text: 'Every event a run sends, with its fields and its retries.',\n    icon: BookOpenIcon,\n    pageId: 'events',\n  },\n];\n\nexport const SUGGESTIONS = ['install', 'approval', 'retries'];\n\nexport const MANAGERS: { value: Manager; label: string }[] = [\n  { value: 'pnpm', label: 'pnpm' },\n  { value: 'npm', label: 'npm' },\n  { value: 'yarn', label: 'yarn' },\n  { value: 'bun', label: 'bun' },\n];\n\nexport const RUNNER: Record<Manager, string> = {\n  pnpm: 'pnpm dlx',\n  npm: 'npx',\n  yarn: 'yarn dlx',\n  bun: 'bunx',\n};\n\nexport const ADDER: Record<Manager, string> = {\n  pnpm: 'pnpm add',\n  npm: 'npm install',\n  yarn: 'yarn add',\n  bun: 'bun add',\n};\n\nexport const INIT_ARGS = 'wickerline init';\n\nexport const PACKAGE = '@wickerline/sdk';\n\nexport type ManualStep = {\n  id: string;\n  title: string;\n  code?: string;\n};\n\nexport const MANUAL_STEPS: ManualStep[] = [\n  { id: 'package', title: 'Add the package to your project.' },\n  {\n    id: 'key',\n    title: 'Put the project key in your environment.',\n    code: 'WICKERLINE_KEY=wl_pk_live_4d1a',\n  },\n  {\n    id: 'record',\n    title: 'Start your agent through the recorder.',\n    code: \"const run = await record('weekly-digest', agent);\",\n  },\n  { id: 'open', title: 'Open the run from your dashboard.' },\n];\n\nexport const INSTALL_SEARCH_TEXT =\n  'Run the command with pnpm, npm, yarn or bun, or add the package by hand.';\n\nexport const CLI_NOTE =\n  'The command adds the package, asks for your project key and wraps your agent. It asks before it changes a file.';\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/data.ts"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/doc-blocks.tsx",
      "content": "'use client';\n\nimport { ArrowRightIcon } from '@/registry/ndeko/lib/icons';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from '@/registry/ndeko/ui/table';\n\nimport { Callout } from './callout';\nimport { CodeBlock } from './code-block';\nimport { InlineText } from './inline-text';\nimport { Install } from './install';\nimport type { Block, PageId, PageLink } from './pages';\n\ntype InstallProps = React.ComponentProps<typeof Install>;\n\nfunction TableBlock({ head, rows }: { head: string[]; rows: string[][] }) {\n  return (\n    <div className='bg-card hairline-ring ring-border dark:bg-foreground/[0.03] overflow-clip rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n      <Table>\n        <TableHeader>\n          <TableRow>\n            {head.map((title) => (\n              <TableHead key={title}>{title}</TableHead>\n            ))}\n          </TableRow>\n        </TableHeader>\n        <TableBody>\n          {rows.map(([name, meaning]) => (\n            <TableRow key={name}>\n              <TableCell className='px-3 py-2.5 font-mono text-xs whitespace-nowrap'>\n                {name}\n              </TableCell>\n              <TableCell className='text-muted-foreground px-3 py-2.5'>\n                {meaning}\n              </TableCell>\n            </TableRow>\n          ))}\n        </TableBody>\n      </Table>\n    </div>\n  );\n}\n\ntype LinksBlockProps = {\n  links: PageLink[];\n  onOpenPage: (pageId: PageId) => void;\n};\n\nfunction LinksBlock({ links, onOpenPage }: LinksBlockProps) {\n  return (\n    <ul className='flex flex-col'>\n      {links.map((link) => {\n        function open(event: React.MouseEvent<HTMLAnchorElement>) {\n          event.preventDefault();\n          onOpenPage(link.pageId);\n        }\n\n        return (\n          <li key={link.pageId}>\n            <a\n              href={`#${link.pageId}`}\n              onClick={open}\n              className={cn(\n                'group text-primary-ink inline-flex items-center gap-1.5 rounded-sm py-1 text-[15px] font-medium underline-offset-4 hover:underline',\n                FOCUS_RING\n              )}\n            >\n              {link.label}\n              <ArrowRightIcon className='size-4 transition-transform duration-100 group-hover:translate-x-0.5' />\n            </a>\n          </li>\n        );\n      })}\n    </ul>\n  );\n}\n\ntype BlockViewProps = {\n  block: Block;\n  install: InstallProps;\n  onOpenPage: (pageId: PageId) => void;\n};\n\nfunction BlockView({ block, install, onOpenPage }: BlockViewProps) {\n  switch (block.kind) {\n    case 'text':\n      return (\n        <p className='text-[15px] leading-7 text-pretty'>\n          <InlineText text={block.text} />\n        </p>\n      );\n    case 'list':\n      return (\n        <ul className='flex flex-col gap-2 text-[15px] leading-6'>\n          {block.items.map((item) => (\n            <li key={item} className='flex items-baseline gap-3'>\n              <span\n                aria-hidden='true'\n                className='bg-foreground/30 size-1.5 shrink-0 translate-y-[-0.15em] rounded-full'\n              />\n              <span className='min-w-0'>\n                <InlineText text={item} />\n              </span>\n            </li>\n          ))}\n        </ul>\n      );\n    case 'code':\n      return <CodeBlock code={block.code} />;\n    case 'callout':\n      return (\n        <Callout tone={block.tone}>\n          <InlineText text={block.text} />\n        </Callout>\n      );\n    case 'install':\n      return <Install {...install} />;\n    case 'table':\n      return <TableBlock head={block.head} rows={block.rows} />;\n    case 'links':\n      return <LinksBlock links={block.links} onOpenPage={onOpenPage} />;\n  }\n}\n\ntype DocBlocksProps = {\n  blocks: Block[];\n  install: InstallProps;\n  onOpenPage: (pageId: PageId) => void;\n};\n\nexport function DocBlocks({ blocks, install, onOpenPage }: DocBlocksProps) {\n  return (\n    <>\n      {blocks.map((block, index) => (\n        <BlockView\n          key={index}\n          block={block}\n          install={install}\n          onOpenPage={onOpenPage}\n        />\n      ))}\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/doc-blocks.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/doc-page.tsx",
      "content": "'use client';\n\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  Breadcrumb,\n  BreadcrumbItem,\n  BreadcrumbLink,\n  BreadcrumbList,\n  BreadcrumbPage,\n  BreadcrumbSeparator,\n} from '@/registry/ndeko/ui/breadcrumb';\n\nimport { SAMPLE_NOTE } from './data';\nimport { DocBlocks } from './doc-blocks';\nimport { OnThisPage } from './on-this-page';\nimport { PageFooter } from './page-footer';\nimport type { DocPage as DocPageContent, PageId } from './pages';\n\ntype DocPageProps = {\n  page: DocPageContent;\n  activeId: string;\n  pressed: string | null;\n  install: React.ComponentProps<typeof DocBlocks>['install'];\n  headingIdOf: (headingId: string) => string;\n  onJump: (headingId: string) => void;\n  onOpenPage: (pageId: PageId) => void;\n  onOpenHome: () => void;\n};\n\nexport function DocPage({\n  page,\n  activeId,\n  pressed,\n  install,\n  headingIdOf,\n  onJump,\n  onOpenPage,\n  onOpenHome,\n}: DocPageProps) {\n  function openHome(event: React.MouseEvent<HTMLAnchorElement>) {\n    event.preventDefault();\n    onOpenHome();\n  }\n\n  return (\n    <div className='mx-auto grid max-w-5xl gap-10 px-4 py-8 @2xl:px-8 @5xl:grid-cols-[minmax(0,1fr)_11rem]'>\n      <article className='flex min-w-0 flex-col gap-10'>\n        <header className='flex flex-col gap-4'>\n          <Breadcrumb>\n            <BreadcrumbList>\n              <BreadcrumbItem>\n                <BreadcrumbLink href='#home' onClick={openHome}>\n                  Docs\n                </BreadcrumbLink>\n              </BreadcrumbItem>\n              <BreadcrumbSeparator />\n              <BreadcrumbItem>{page.category}</BreadcrumbItem>\n              <BreadcrumbSeparator />\n              <BreadcrumbItem>\n                <BreadcrumbPage>{page.title}</BreadcrumbPage>\n              </BreadcrumbItem>\n            </BreadcrumbList>\n          </Breadcrumb>\n          <h1 className='text-2xl font-semibold text-balance @sm:text-3xl'>\n            {page.title}\n          </h1>\n          <p className='text-muted-foreground text-base leading-7 text-pretty'>\n            {page.lead}\n          </p>\n        </header>\n        {page.sections.map((section) => (\n          <section key={section.id} className='flex flex-col gap-4'>\n            <h2\n              id={headingIdOf(section.id)}\n              data-heading={section.id}\n              tabIndex={-1}\n              className={cn(\n                'rounded-sm text-xl font-semibold text-balance',\n                FOCUS_RING\n              )}\n            >\n              {section.title}\n            </h2>\n            <DocBlocks\n              blocks={section.blocks}\n              install={install}\n              onOpenPage={onOpenPage}\n            />\n          </section>\n        ))}\n        <PageFooter pageId={page.id} pressed={pressed} onOpen={onOpenPage} />\n        <p className='text-muted-foreground text-xs'>{SAMPLE_NOTE}</p>\n      </article>\n      <aside className='hidden @5xl:block'>\n        <div className='sticky top-6'>\n          <OnThisPage\n            sections={page.sections}\n            activeId={activeId}\n            headingIdOf={headingIdOf}\n            onJump={onJump}\n          />\n        </div>\n      </aside>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/doc-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/docs-header.tsx",
      "content": "'use client';\n\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { MenuIcon } from '@/registry/ndeko/lib/icons';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\nimport { ReplayButton } from '@/registry/ndeko/ui/replay-button';\n\nimport { PRODUCT } from './data';\n\ntype DocsHeaderProps = {\n  isHome: boolean;\n  pressed: string | null;\n  canReplay: boolean;\n  onOpenHome: () => void;\n  onOpenMenu: () => void;\n  onReplay: () => void;\n};\n\nfunction currentOf(isHome: boolean): 'page' | undefined {\n  if (isHome) {\n    return 'page';\n  }\n  return undefined;\n}\n\nexport function DocsHeader({\n  isHome,\n  pressed,\n  canReplay,\n  onOpenHome,\n  onOpenMenu,\n  onReplay,\n}: DocsHeaderProps) {\n  function openHome(event: React.MouseEvent<HTMLAnchorElement>) {\n    event.preventDefault();\n    onOpenHome();\n  }\n\n  return (\n    <header className='hairline-b border-border flex h-14 shrink-0 items-center gap-3 px-4 @2xl:px-6'>\n      {!isHome && (\n        <Button\n          type='button'\n          variant='ghost'\n          size='icon'\n          aria-label='Open the docs menu'\n          data-sheet-trigger\n          onClick={onOpenMenu}\n          className='text-muted-foreground -ms-1.5 @3xl:hidden'\n        >\n          <MenuIcon />\n        </Button>\n      )}\n      <a\n        href='#home'\n        aria-current={currentOf(isHome)}\n        onClick={openHome}\n        className={cn(\n          'flex items-center gap-2 rounded-md text-sm font-semibold',\n          FOCUS_RING,\n          pressedQuietOf(pressed === 'brand')\n        )}\n      >\n        <CompanyMark seed={PRODUCT.name} size='lg' />\n        {PRODUCT.name}\n        <span className='text-muted-foreground font-normal'>Docs</span>\n      </a>\n      <Badge variant='secondary' className='tabular-nums'>\n        {PRODUCT.version}\n      </Badge>\n      <span className='flex-1' />\n      <ReplayButton isShown={canReplay} onReplay={onReplay} label='Replay' />\n    </header>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/docs-header.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/docs-nav.tsx",
      "content": "'use client';\n\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { PAGES, type PageId } from './pages';\nimport { wordsOf, type SearchResult } from './search';\nimport { SearchField } from './search-field';\nimport { SearchResults } from './search-results';\n\nfunction currentOf(isCurrent: boolean): 'page' | undefined {\n  if (isCurrent) {\n    return 'page';\n  }\n  return undefined;\n}\n\ntype DocsNavProps = {\n  searchId: string;\n  query: string;\n  pageId: PageId;\n  pressed: string | null;\n  onSearch: (query: string) => void;\n  onEnter: () => void;\n  onOpenResult: (result: SearchResult) => void;\n  onOpenPage: (pageId: PageId) => void;\n};\n\nexport function DocsNav({\n  searchId,\n  query,\n  pageId,\n  pressed,\n  onSearch,\n  onEnter,\n  onOpenResult,\n  onOpenPage,\n}: DocsNavProps) {\n  const isSearching = wordsOf(query).length > 0;\n\n  function clear() {\n    onSearch('');\n  }\n\n  return (\n    <nav aria-label='Documentation' className='flex flex-col gap-5'>\n      <SearchField\n        id={searchId}\n        value={query}\n        label='Search the docs'\n        placeholder='Search the docs'\n        onChange={onSearch}\n        onEnter={onEnter}\n      />\n      {isSearching && (\n        <SearchResults\n          query={query}\n          pressed={pressed}\n          onOpen={onOpenResult}\n          onClear={clear}\n        />\n      )}\n      {!isSearching &&\n        PAGES.map((page) => {\n          const isCurrent = page.id === pageId;\n\n          function open(event: React.MouseEvent<HTMLAnchorElement>) {\n            event.preventDefault();\n            onOpenPage(page.id);\n          }\n\n          return (\n            <section key={page.id} className='flex flex-col gap-1'>\n              <h3 className='text-muted-foreground px-2 text-xs font-medium'>\n                {page.category}\n              </h3>\n              <a\n                href={`#${page.id}`}\n                aria-current={currentOf(isCurrent)}\n                onClick={open}\n                className={cn(\n                  'text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground block rounded-md px-2 py-1.5 text-[13px] transition-colors duration-100',\n                  isCurrent && 'bg-foreground/[0.06] text-foreground',\n                  FOCUS_RING\n                )}\n              >\n                {page.title}\n              </a>\n            </section>\n          );\n        })}\n    </nav>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/docs-nav.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/home-page.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { ArrowRightIcon } from '@/registry/ndeko/lib/icons';\nimport { fadePresence } from '@/registry/ndeko/lib/motion-presets';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\n\nimport {\n  CATEGORIES,\n  PRODUCT,\n  SAMPLE_NOTE,\n  SUGGESTIONS,\n  type Category,\n} from './data';\nimport { pageOf, type PageId } from './pages';\nimport { wordsOf, type SearchResult } from './search';\nimport { SearchField } from './search-field';\nimport { SearchResults } from './search-results';\n\nfunction CategoryCard({\n  category,\n  onOpenPage,\n}: {\n  category: Category;\n  onOpenPage: (pageId: PageId) => void;\n}) {\n  const CategoryIcon = category.icon;\n  const page = pageOf(category.pageId);\n\n  function open(event: React.MouseEvent<HTMLAnchorElement>) {\n    event.preventDefault();\n    onOpenPage(category.pageId);\n  }\n\n  return (\n    <a\n      href={`#${category.pageId}`}\n      onClick={open}\n      className={cn(\n        'bg-card hairline-ring ring-border dark:bg-foreground/[0.03] hover:bg-foreground/[0.02] group flex h-full flex-col gap-3 rounded-xl p-4 shadow-[0_1px_2px_rgb(0_0_0/0.04)] transition-colors duration-150',\n        FOCUS_RING\n      )}\n    >\n      <span className='flex items-center gap-2.5'>\n        <span className='keycap-3d text-muted-foreground flex size-7 shrink-0 items-center justify-center rounded-md'>\n          <CategoryIcon className='size-4' />\n        </span>\n        <span className='text-sm font-medium'>{category.title}</span>\n      </span>\n      <span className='text-muted-foreground text-[13px] leading-5 text-pretty'>\n        {category.text}\n      </span>\n      <span className='text-primary-ink mt-auto flex items-center gap-1.5 text-xs font-medium'>\n        {page.title}\n        <ArrowRightIcon className='size-3.5 transition-transform duration-150 group-hover:translate-x-0.5' />\n      </span>\n    </a>\n  );\n}\n\ntype SuggestionsProps = {\n  onPick: (query: string) => void;\n};\n\nfunction Suggestions({ onPick }: SuggestionsProps) {\n  return (\n    <div className='flex flex-wrap items-center gap-2'>\n      <span className='text-muted-foreground text-xs'>Try</span>\n      {SUGGESTIONS.map((suggestion) => {\n        function pick() {\n          onPick(suggestion);\n        }\n\n        return (\n          <button\n            key={suggestion}\n            type='button'\n            onClick={pick}\n            className={cn(\n              'bg-foreground/[0.05] hover:bg-foreground/[0.08] cursor-pointer rounded-full px-3 py-1 text-xs transition-colors duration-150 active:scale-[0.97]',\n              FOCUS_RING\n            )}\n          >\n            {suggestion}\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n\ntype HomePageProps = {\n  searchId: string;\n  query: string;\n  pressed: string | null;\n  onSearch: (query: string) => void;\n  onEnter: () => void;\n  onOpenResult: (result: SearchResult) => void;\n  onOpenPage: (pageId: PageId) => void;\n};\n\nexport function HomePage({\n  searchId,\n  query,\n  pressed,\n  onSearch,\n  onEnter,\n  onOpenResult,\n  onOpenPage,\n}: HomePageProps) {\n  const fade = fadePresence();\n  const isSearching = wordsOf(query).length > 0;\n\n  function clear() {\n    onSearch('');\n  }\n\n  return (\n    <div className='mx-auto flex w-full max-w-4xl flex-col gap-10 px-4 py-12 @2xl:px-8 @2xl:py-16'>\n      <div className='flex flex-col items-center gap-3 text-center'>\n        <h1 className='text-3xl font-semibold text-balance @2xl:text-4xl'>\n          {PRODUCT.title}\n        </h1>\n        <p className='text-muted-foreground max-w-md text-base text-pretty'>\n          {PRODUCT.lead}\n        </p>\n      </div>\n      <div className='mx-auto flex w-full max-w-xl flex-col gap-3'>\n        <SearchField\n          id={searchId}\n          value={query}\n          label='Search the docs'\n          placeholder='Search every page'\n          size='lg'\n          onChange={onSearch}\n          onEnter={onEnter}\n        />\n        <AnimatedSize>\n          <AnimatePresence initial={false} mode='wait'>\n            {!isSearching && (\n              <motion.div key='suggestions' {...fade}>\n                <Suggestions onPick={onSearch} />\n              </motion.div>\n            )}\n            {isSearching && (\n              <motion.div key='results' {...fade}>\n                <SearchResults\n                  query={query}\n                  pressed={pressed}\n                  onOpen={onOpenResult}\n                  onClear={clear}\n                />\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </AnimatedSize>\n      </div>\n      <ul className='grid gap-3 @2xl:grid-cols-3'>\n        {CATEGORIES.map((category) => (\n          <li key={category.id}>\n            <CategoryCard category={category} onOpenPage={onOpenPage} />\n          </li>\n        ))}\n      </ul>\n      <p className='text-muted-foreground text-center text-xs'>{SAMPLE_NOTE}</p>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/home-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/inline-text.tsx",
      "content": "type InlineTextProps = {\n  text: string;\n};\n\n/** Words between backticks are code. */\nexport function InlineText({ text }: InlineTextProps) {\n  const pieces = text.split('`');\n\n  return (\n    <>\n      {pieces.map((piece, index) => {\n        const isCode = index % 2 === 1;\n        if (isCode) {\n          return (\n            <code\n              key={index}\n              className='bg-foreground/[0.06] rounded-[5px] px-1.5 py-0.5 font-mono text-[0.85em]'\n            >\n              {piece}\n            </code>\n          );\n        }\n        return <span key={index}>{piece}</span>;\n      })}\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/inline-text.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/install.tsx",
      "content": "'use client';\n\nimport { WordRoll, type WordRollWord } from '@/components/core/word-roll';\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { CheckIcon, CopyIcon, InfoIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Swap } from '@/registry/ndeko/ui/chat-motion';\nimport { CopyButton } from '@/registry/ndeko/ui/copy-button';\nimport { Tabs, TabsList, TabsPanel, TabsTab } from '@/registry/ndeko/ui/tabs';\nimport { ToggleGroup, ToggleGroupItem } from '@/registry/ndeko/ui/toggle-group';\n\nimport { CODE_TRAY, CodeBlock } from './code-block';\nimport {\n  ADDER,\n  CLI_NOTE,\n  INIT_ARGS,\n  MANAGERS,\n  MANUAL_STEPS,\n  PACKAGE,\n  RUNNER,\n  type InstallTab,\n  type Manager,\n} from './data';\n\nconst THUMB =\n  'bg-card shadow-[0_1px_2px_rgb(0_0_0/0.08)] hairline-ring ring-foreground/10 dark:bg-foreground/[0.09] dark:ring-foreground/15';\n\n/** The words before the package keep their key while the package manager changes, so only they roll. */\nfunction commandWordsOf(lead: string, rest: string): WordRollWord[] {\n  return [\n    { key: `lead-${lead}`, text: lead, node: lead },\n    { key: 'rest', text: rest, node: rest },\n  ];\n}\n\nexport function initCommandOf(manager: Manager) {\n  return `${RUNNER[manager]} ${INIT_ARGS}`;\n}\n\nexport function addCommandOf(manager: Manager) {\n  return `${ADDER[manager]} ${PACKAGE}`;\n}\n\nfunction copyLabelOf(isCopied: boolean) {\n  if (isCopied) {\n    return 'Copied';\n  }\n  return 'Copy the command';\n}\n\nfunction managerOf(values: unknown[]) {\n  const [value] = values;\n  const option = MANAGERS.find((candidate) => candidate.value === value);\n  return option?.value;\n}\n\nfunction tabOf(value: unknown): InstallTab | null {\n  if (value === 'cli') {\n    return 'cli';\n  }\n  if (value === 'manual') {\n    return 'manual';\n  }\n  return null;\n}\n\ntype InstallProps = {\n  manager: Manager;\n  tab: InstallTab;\n  isCommandCopied: boolean;\n  pressed: string | null;\n  onPickManager: (manager: Manager) => void;\n  onPickTab: (tab: InstallTab) => void;\n  onCopyCommand: () => void;\n};\n\nexport function Install({\n  manager,\n  tab,\n  isCommandCopied,\n  pressed,\n  onPickManager,\n  onPickTab,\n  onCopyCommand,\n}: InstallProps) {\n  const initWords = commandWordsOf(RUNNER[manager], INIT_ARGS);\n  const addWords = commandWordsOf(ADDER[manager], PACKAGE);\n\n  function pickManager(values: unknown[]) {\n    const picked = managerOf(values);\n    if (picked) {\n      onPickManager(picked);\n    }\n  }\n\n  function pickTab(value: unknown) {\n    const picked = tabOf(value);\n    if (picked) {\n      onPickTab(picked);\n    }\n  }\n\n  return (\n    <Tabs value={tab} onValueChange={pickTab} className='gap-4'>\n      <div className='flex flex-wrap items-center justify-between gap-3'>\n        <TabsList variant='segmented'>\n          <TabsTab\n            value='cli'\n            className={pressedQuietOf(pressed === 'tab-cli')}\n          >\n            Command line\n          </TabsTab>\n          <TabsTab\n            value='manual'\n            className={pressedQuietOf(pressed === 'tab-manual')}\n          >\n            By hand\n          </TabsTab>\n        </TabsList>\n        <ToggleGroup\n          aria-label='Package manager'\n          value={[manager]}\n          onValueChange={pickManager}\n          travel\n          indicatorClassName={THUMB}\n          className='bg-foreground/[0.04] rounded-lg p-0.5'\n        >\n          {MANAGERS.map((option) => (\n            <ToggleGroupItem\n              key={option.value}\n              value={option.value}\n              className={cn(\n                'h-6 rounded-md px-2.5 font-mono text-xs',\n                pressedQuietOf(pressed === `pm-${option.value}`)\n              )}\n            >\n              {option.label}\n            </ToggleGroupItem>\n          ))}\n        </ToggleGroup>\n      </div>\n\n      <TabsPanel value='cli' className='flex flex-col gap-3'>\n        <div\n          className={cn(\n            CODE_TRAY,\n            'relative flex items-center gap-2 py-1.5 ps-3 pe-1.5 font-mono text-[13px]'\n          )}\n        >\n          <span aria-hidden='true' className='text-muted-foreground'>\n            $\n          </span>\n          <code className='relative min-w-0 flex-1 overflow-x-auto py-1 whitespace-nowrap'>\n            <WordRoll words={initWords} />\n          </code>\n          <Button\n            type='button'\n            variant='ghost'\n            size='icon-sm'\n            aria-label={copyLabelOf(isCommandCopied)}\n            onClick={onCopyCommand}\n            className={cn(\n              'text-muted-foreground size-7',\n              pressedQuietOf(pressed === 'copy-command')\n            )}\n          >\n            <Swap swapKey={String(isCommandCopied)}>\n              {isCommandCopied && <CheckIcon className='size-3.5' />}\n              {!isCommandCopied && <CopyIcon className='size-3.5' />}\n            </Swap>\n          </Button>\n        </div>\n        <p className='bg-info/10 flex items-start gap-3 rounded-xl px-4 py-3 text-[13px] leading-5'>\n          <InfoIcon className='text-info-foreground mt-px size-4 shrink-0' />\n          <span>{CLI_NOTE}</span>\n        </p>\n      </TabsPanel>\n\n      <TabsPanel value='manual'>\n        <ol className='flex flex-col gap-5'>\n          {MANUAL_STEPS.map((step, index) => {\n            const isPackageStep = step.id === 'package';\n            return (\n              <li key={step.id} className='flex gap-3'>\n                <span className='keycap-3d text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-md text-xs font-medium tabular-nums'>\n                  {index + 1}\n                </span>\n                <div className='flex min-w-0 flex-1 flex-col gap-2'>\n                  <p className='pt-0.5 text-[13px] leading-5'>{step.title}</p>\n                  {isPackageStep && (\n                    <div className='relative'>\n                      <div\n                        className={cn(\n                          CODE_TRAY,\n                          'relative overflow-x-auto py-2.5 ps-3 pe-10 font-mono text-[12.5px] whitespace-nowrap'\n                        )}\n                      >\n                        <WordRoll words={addWords} />\n                      </div>\n                      <CopyButton\n                        text={addCommandOf(manager)}\n                        label='Copy the command'\n                        className='absolute end-1.5 top-1.5'\n                      />\n                    </div>\n                  )}\n                  {step.code && <CodeBlock code={step.code} />}\n                </div>\n              </li>\n            );\n          })}\n        </ol>\n      </TabsPanel>\n    </Tabs>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/install.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/on-this-page.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\nimport { useId } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { INSTANT, SPRING } from '@/registry/ndeko/lib/motion-presets';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport type { Section } from './pages';\n\nfunction travelOf(shouldReduceMotion: boolean): Transition {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return SPRING;\n}\n\nfunction currentOf(isActive: boolean): 'location' | undefined {\n  if (isActive) {\n    return 'location';\n  }\n  return undefined;\n}\n\ntype OnThisPageProps = {\n  sections: Section[];\n  activeId: string;\n  headingIdOf: (headingId: string) => string;\n  onJump: (headingId: string) => void;\n};\n\nexport function OnThisPage({\n  sections,\n  activeId,\n  headingIdOf,\n  onJump,\n}: OnThisPageProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const markerId = useId();\n\n  return (\n    <nav aria-label='On this page' className='flex flex-col gap-3'>\n      <p className='text-muted-foreground text-xs font-medium'>On this page</p>\n      <ol className='hairline-l border-border flex flex-col'>\n        {sections.map((section) => {\n          const isActive = section.id === activeId;\n\n          function jump(event: React.MouseEvent<HTMLAnchorElement>) {\n            event.preventDefault();\n            onJump(section.id);\n          }\n\n          return (\n            <li key={section.id} className='relative'>\n              {isActive && (\n                <motion.span\n                  layoutId={markerId}\n                  transition={travelOf(shouldReduceMotion)}\n                  className='bg-primary absolute inset-y-1.5 -start-px w-0.5 rounded-full'\n                />\n              )}\n              <a\n                href={`#${headingIdOf(section.id)}`}\n                aria-current={currentOf(isActive)}\n                onClick={jump}\n                className={cn(\n                  'text-muted-foreground hover:text-foreground block rounded-sm py-1.5 ps-3 text-[13px] transition-colors duration-150',\n                  isActive && 'text-foreground',\n                  FOCUS_RING\n                )}\n              >\n                {section.title}\n              </a>\n            </li>\n          );\n        })}\n      </ol>\n    </nav>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/on-this-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/page-footer.tsx",
      "content": "'use client';\n\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { ArrowLeftIcon, ArrowRightIcon } from '@/registry/ndeko/lib/icons';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { PAGE_ORDER, pageOf, type PageId } from './pages';\n\nconst CARD =\n  'bg-card hairline-ring ring-border dark:bg-foreground/[0.03] rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)]';\n\nfunction neighbourOf(pageId: PageId, offset: number) {\n  const index = PAGE_ORDER.indexOf(pageId);\n  return PAGE_ORDER[index + offset];\n}\n\ntype PageFooterProps = {\n  pageId: PageId;\n  pressed: string | null;\n  onOpen: (pageId: PageId) => void;\n};\n\nexport function PageFooter({ pageId, pressed, onOpen }: PageFooterProps) {\n  const previousId = neighbourOf(pageId, -1);\n  const nextId = neighbourOf(pageId, 1);\n  const hasPrevious = previousId !== undefined;\n  const hasNext = nextId !== undefined;\n\n  return (\n    <nav\n      aria-label='Previous and next pages'\n      className='grid gap-3 @lg:grid-cols-2'\n    >\n      {hasPrevious && (\n        <a\n          href={`#${previousId}`}\n          onClick={(event) => {\n            event.preventDefault();\n            onOpen(previousId);\n          }}\n          className={cn(\n            CARD,\n            'group hover:bg-foreground/[0.02] flex flex-col gap-1 p-4 transition-colors duration-100',\n            FOCUS_RING,\n            pressedQuietOf(pressed === 'previous-page')\n          )}\n        >\n          <span className='text-muted-foreground flex items-center gap-1 text-xs'>\n            <ArrowLeftIcon className='size-3.5 transition-transform duration-100 group-hover:-translate-x-0.5' />\n            Previous\n          </span>\n          <span className='text-sm font-medium'>\n            {pageOf(previousId).title}\n          </span>\n        </a>\n      )}\n      {hasNext && (\n        <a\n          href={`#${nextId}`}\n          onClick={(event) => {\n            event.preventDefault();\n            onOpen(nextId);\n          }}\n          className={cn(\n            CARD,\n            'group hover:bg-foreground/[0.02] flex flex-col gap-1 p-4 transition-colors duration-100 @lg:col-start-2 @lg:items-end @lg:text-end',\n            FOCUS_RING,\n            pressedQuietOf(pressed === 'next-page')\n          )}\n        >\n          <span className='text-muted-foreground flex items-center gap-1 text-xs'>\n            Next\n            <ArrowRightIcon className='size-3.5 transition-transform duration-100 group-hover:translate-x-0.5' />\n          </span>\n          <span className='text-sm font-medium'>{pageOf(nextId).title}</span>\n        </a>\n      )}\n    </nav>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/page-footer.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/pages.ts",
      "content": "export type Tone = 'info' | 'warning' | 'tip';\n\nexport type PageLink = {\n  pageId: PageId;\n  label: string;\n};\n\nexport type Block =\n  | { kind: 'text'; text: string }\n  | { kind: 'list'; items: string[] }\n  | { kind: 'code'; code: string }\n  | { kind: 'callout'; tone: Tone; text: string }\n  | { kind: 'install' }\n  | { kind: 'table'; head: string[]; rows: string[][] }\n  | { kind: 'links'; links: PageLink[] };\n\nexport type PageId = 'installation' | 'approvals' | 'events';\n\nexport type Section = {\n  id: string;\n  title: string;\n  blocks: Block[];\n};\n\nexport type DocPage = {\n  id: PageId;\n  category: string;\n  title: string;\n  lead: string;\n  sections: Section[];\n};\n\n/** An invented SDK: its names, keys and addresses are illustrative. */\nexport const PAGES: DocPage[] = [\n  {\n    id: 'installation',\n    category: 'Get started',\n    title: 'Installation',\n    lead: 'Add Wickerline to a Node app in a few minutes. Let the command line write the setup, or follow the steps by hand.',\n    sections: [\n      {\n        id: 'requirements',\n        title: 'Requirements',\n        blocks: [\n          {\n            kind: 'list',\n            items: [\n              'Node 20 or later',\n              'A Wickerline project and its project key, under Settings, then Keys',\n              'An agent that calls tools, written with any framework',\n            ],\n          },\n        ],\n      },\n      {\n        id: 'install',\n        title: 'Install',\n        blocks: [{ kind: 'install' }],\n      },\n      {\n        id: 'key',\n        title: 'Add your key',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Copy the project key from Settings, then Keys, and put it in your environment. The SDK reads it once, when your agent starts.',\n          },\n          { kind: 'code', code: 'WICKERLINE_KEY=wl_pk_live_4d1a' },\n          {\n            kind: 'callout',\n            tone: 'warning',\n            text: 'Only the project key belongs in your app. The admin key starts with wl_ak_ and stays on your server.',\n          },\n        ],\n      },\n      {\n        id: 'check',\n        title: 'Check that it works',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Wrap one run of your agent and start it. The run appears in your dashboard within a few seconds, with every step in order.',\n          },\n          {\n            kind: 'code',\n            code: \"import { record } from '@wickerline/sdk';\\n\\nconst run = await record('weekly-digest', agent);\\nconsole.log(run.url);\",\n          },\n          {\n            kind: 'callout',\n            tone: 'tip',\n            text: 'Start it twice. Each run keeps its own timeline, so you can compare two runs side by side.',\n          },\n        ],\n      },\n      {\n        id: 'next',\n        title: 'Next steps',\n        blocks: [\n          {\n            kind: 'links',\n            links: [\n              { pageId: 'approvals', label: 'Hold a step for a person' },\n              { pageId: 'events', label: 'Read the run events' },\n            ],\n          },\n        ],\n      },\n    ],\n  },\n  {\n    id: 'approvals',\n    category: 'Build',\n    title: 'Hold a step for a person',\n    lead: 'Some steps should wait for an answer: sending money, deleting data, writing to a customer. Mark them, and the run stops there until someone decides.',\n    sections: [\n      {\n        id: 'mark',\n        title: 'Mark a step',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Pass `approval: required` to a step. The step does not start until a person answers, and the rest of the run waits behind it.',\n          },\n          {\n            kind: 'code',\n            code: \"await run.step('refund', { approval: 'required' }, async () => {\\n  await payments.refund(order.id, order.total);\\n});\",\n          },\n          {\n            kind: 'callout',\n            tone: 'info',\n            text: 'A step that waits costs nothing. The run is saved and picks up where it stopped.',\n          },\n        ],\n      },\n      {\n        id: 'answer',\n        title: 'Answer from your app',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Wickerline sends an `approval.requested` event to your webhook. Show it to a person, then send their answer back with one call.',\n          },\n          {\n            kind: 'code',\n            code: \"await wickerline.approvals.answer(event.approvalId, {\\n  decision: 'approved',\\n  by: person.email,\\n});\",\n          },\n        ],\n      },\n      {\n        id: 'timeout',\n        title: 'Set a timeout',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'A request nobody answers should not hold a run forever. Set how long it waits, and what happens when the time is up.',\n          },\n          {\n            kind: 'list',\n            items: [\n              'deny: the step is skipped and the run goes on',\n              'fail: the run stops with the reason `approval_timeout`',\n              'extend: ask once more, then deny',\n            ],\n          },\n          {\n            kind: 'callout',\n            tone: 'warning',\n            text: 'Answers are final. A step that was denied does not run again unless you start the run again.',\n          },\n        ],\n      },\n      {\n        id: 'who',\n        title: 'Who can answer',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Any member with the Approver role. A request goes to the whole role, and the first answer wins.',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    id: 'events',\n    category: 'Reference',\n    title: 'Run events',\n    lead: 'Every run sends a stream of events. This page lists the ones you can receive at a webhook or read from the API.',\n    sections: [\n      {\n        id: 'shape',\n        title: 'Shape of an event',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Each event has a type, the run it belongs to, a time and the fields of its type.',\n          },\n          {\n            kind: 'code',\n            code: '{\\n  \"type\": \"call.finished\",\\n  \"runId\": \"run_8f2c\",\\n  \"at\": \"2026-03-09T09:41:07Z\",\\n  \"call\": { \"tool\": \"quickbooks\", \"status\": \"done\" }\\n}',\n          },\n        ],\n      },\n      {\n        id: 'types',\n        title: 'Event types',\n        blocks: [\n          {\n            kind: 'table',\n            head: ['Type', 'When it is sent'],\n            rows: [\n              ['run.started', 'A run begins'],\n              ['step.updated', 'A step starts, finishes or fails'],\n              ['call.started', 'An agent starts a tool call'],\n              ['call.finished', 'A tool call returns or fails'],\n              ['approval.requested', 'A step waits for a person'],\n              ['approval.answered', 'A person approves or denies'],\n              ['run.finished', 'A run ends, with its final status'],\n            ],\n          },\n        ],\n      },\n      {\n        id: 'delivery',\n        title: 'Delivery and retries',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Events are delivered at least once. Your endpoint answers with a 2xx status within ten seconds, or Wickerline tries again after 1, 5 and 30 minutes.',\n          },\n          {\n            kind: 'callout',\n            tone: 'info',\n            text: 'Keep the id of each event you handled, so a second delivery of the same event changes nothing.',\n          },\n        ],\n      },\n      {\n        id: 'verify',\n        title: 'Verify the signature',\n        blocks: [\n          {\n            kind: 'text',\n            text: 'Every delivery carries a signature header. Check it before you trust the body.',\n          },\n          {\n            kind: 'code',\n            code: \"const isValid = verify(body, request.headers['wickerline-signature']);\",\n          },\n        ],\n      },\n    ],\n  },\n];\n\nexport const PAGE_ORDER: PageId[] = PAGES.map((page) => page.id);\n\nexport function pageOf(pageId: PageId) {\n  const page = PAGES.find((candidate) => candidate.id === pageId);\n  return page ?? PAGES[0];\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/pages.ts"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/search-field.tsx",
      "content": "'use client';\n\nimport { useRef } from 'react';\n\nimport { SearchIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\n\ntype SearchFieldProps = {\n  id: string;\n  value: string;\n  label: string;\n  placeholder: string;\n  size?: 'default' | 'lg';\n  onChange: (query: string) => void;\n  onEnter: () => void;\n};\n\nexport function SearchField({\n  id,\n  value,\n  label,\n  placeholder,\n  size = 'default',\n  onChange,\n  onEnter,\n}: SearchFieldProps) {\n  const inputRef = useRef<HTMLInputElement>(null);\n  const hasQuery = value !== '';\n\n  function pressKey(event: React.KeyboardEvent<HTMLInputElement>) {\n    if (event.key === 'Enter') {\n      event.preventDefault();\n      onEnter();\n      return;\n    }\n    const clears = event.key === 'Escape' && hasQuery;\n    if (clears) {\n      event.preventDefault();\n      event.stopPropagation();\n      onChange('');\n    }\n  }\n\n  /** The cross leaves with the search it cleared, so its field takes the focus back. */\n  function clear() {\n    onChange('');\n    inputRef.current?.focus();\n  }\n\n  return (\n    <div className='relative'>\n      <label htmlFor={id} className='sr-only'>\n        {label}\n      </label>\n      <SearchIcon className='text-muted-foreground pointer-events-none absolute start-2.5 top-1/2 size-4 -translate-y-1/2' />\n      <Input\n        ref={inputRef}\n        id={id}\n        type='search'\n        size={size}\n        autoComplete='off'\n        spellCheck={false}\n        placeholder={placeholder}\n        value={value}\n        onChange={(event) => onChange(event.target.value)}\n        onKeyDown={pressKey}\n        className='ps-8 pe-8'\n      />\n      {hasQuery && (\n        <Button\n          type='button'\n          variant='ghost'\n          size='icon-sm'\n          aria-label='Clear the search'\n          onClick={clear}\n          className='text-muted-foreground absolute end-1 top-1/2 size-6 -translate-y-1/2'\n        >\n          <XIcon className='size-3.5' />\n        </Button>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/search-field.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/search-results.tsx",
      "content": "'use client';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { pressedQuietOf } from '@/registry/ndeko/lib/demonstration';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { nounOf } from '@/registry/ndeko/lib/words';\n\nimport { markedPartsOf, searchOf, wordsOf, type SearchResult } from './search';\n\nexport function Marked({ text, words }: { text: string; words: string[] }) {\n  const parts = markedPartsOf(text, words);\n\n  return (\n    <>\n      {parts.map((part) => {\n        if (part.isMatch) {\n          return (\n            <mark\n              key={part.key}\n              className='bg-primary/15 text-foreground rounded-[3px]'\n            >\n              {part.text}\n            </mark>\n          );\n        }\n        return <span key={part.key}>{part.text}</span>;\n      })}\n    </>\n  );\n}\n\nfunction hrefOf(result: SearchResult) {\n  const { entry } = result;\n  if (entry.headingId === null) {\n    return `#${entry.pageId}`;\n  }\n  return `#${entry.pageId}-${entry.headingId}`;\n}\n\ntype SearchResultsProps = {\n  query: string;\n  pressed: string | null;\n  onOpen: (result: SearchResult) => void;\n  onClear: () => void;\n};\n\nexport function SearchResults({\n  query,\n  pressed,\n  onOpen,\n  onClear,\n}: SearchResultsProps) {\n  const words = wordsOf(query);\n  const results = searchOf(query);\n  const hasResults = results.length > 0;\n  const hasWords = words.length > 0;\n  const noun = nounOf(results.length, 'result');\n\n  if (!hasWords) {\n    return null;\n  }\n  if (!hasResults) {\n    return (\n      <div className='flex flex-col items-start gap-2'>\n        <p className='text-muted-foreground text-[13px] text-pretty'>\n          No page holds “{query.trim()}”.\n        </p>\n        <button\n          type='button'\n          onClick={onClear}\n          className={cn(\n            'text-primary-ink rounded-sm text-xs font-medium underline-offset-4 hover:underline',\n            FOCUS_RING\n          )}\n        >\n          Clear the search\n        </button>\n      </div>\n    );\n  }\n\n  return (\n    <div className='flex flex-col gap-1.5'>\n      <p className='text-muted-foreground flex items-baseline gap-1 px-2 text-xs'>\n        <MotionNumber value={results.length} />\n        {noun}\n      </p>\n      <ul aria-label='Search results' className='flex flex-col'>\n        {results.map((result, index) => {\n          const { entry } = result;\n\n          function open(event: React.MouseEvent<HTMLAnchorElement>) {\n            event.preventDefault();\n            onOpen(result);\n          }\n\n          return (\n            <li key={entry.key}>\n              <a\n                href={hrefOf(result)}\n                onClick={open}\n                className={cn(\n                  'hover:bg-foreground/[0.04] flex flex-col gap-0.5 rounded-lg px-2 py-2 text-start transition-colors duration-100',\n                  FOCUS_RING,\n                  pressedQuietOf(pressed === `result-${index}`)\n                )}\n              >\n                <span className='text-[13px] leading-5 font-medium'>\n                  <Marked text={entry.title} words={words} />\n                </span>\n                <span className='text-muted-foreground text-xs'>\n                  {entry.crumb}\n                </span>\n                <span className='text-muted-foreground text-xs leading-5 text-pretty'>\n                  <Marked text={result.snippet} words={words} />\n                </span>\n              </a>\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/search-results.tsx"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/search.ts",
      "content": "import { INSTALL_SEARCH_TEXT } from './data';\nimport { PAGES, type Block, type DocPage, type PageId } from './pages';\n\nexport type SearchEntry = {\n  key: string;\n  pageId: PageId;\n  headingId: string | null;\n  title: string;\n  crumb: string;\n  text: string;\n};\n\nexport type SearchResult = {\n  entry: SearchEntry;\n  snippet: string;\n};\n\nexport type MarkedPart = {\n  key: string;\n  text: string;\n  isMatch: boolean;\n};\n\ntype Range = {\n  start: number;\n  end: number;\n};\n\n/** A single letter matches nearly every page, so a word counts from two letters. */\nconst MIN_WORD_LENGTH = 2;\n\nconst MAX_RESULTS = 6;\n\nconst SNIPPET_BEFORE = 36;\n\nconst SNIPPET_LENGTH = 116;\n\nfunction plainOf(text: string) {\n  return text.replaceAll('`', '');\n}\n\nfunction textOfBlock(block: Block) {\n  switch (block.kind) {\n    case 'text':\n      return plainOf(block.text);\n    case 'list':\n      return plainOf(block.items.join('. '));\n    case 'code':\n      return plainOf(block.code);\n    case 'callout':\n      return plainOf(block.text);\n    case 'install':\n      return INSTALL_SEARCH_TEXT;\n    case 'table': {\n      const rows = block.rows.map((row) => row.join(', '));\n      return rows.join('. ');\n    }\n    case 'links': {\n      const labels = block.links.map((link) => link.label);\n      return labels.join('. ');\n    }\n  }\n}\n\nfunction entriesOfPage(page: DocPage): SearchEntry[] {\n  const pageEntry: SearchEntry = {\n    key: page.id,\n    pageId: page.id,\n    headingId: null,\n    title: page.title,\n    crumb: page.category,\n    text: page.lead,\n  };\n  const sectionEntries = page.sections.map((section) => {\n    const texts = section.blocks.map(textOfBlock);\n    const entry: SearchEntry = {\n      key: `${page.id}:${section.id}`,\n      pageId: page.id,\n      headingId: section.id,\n      title: section.title,\n      crumb: `${page.category} / ${page.title}`,\n      text: texts.join(' '),\n    };\n    return entry;\n  });\n  return [pageEntry, ...sectionEntries];\n}\n\nconst ENTRIES = PAGES.flatMap(entriesOfPage);\n\nexport function wordsOf(query: string) {\n  const lowered = query.toLowerCase();\n  const pieces = lowered.split(/\\s+/);\n  return pieces.filter((piece) => piece.length >= MIN_WORD_LENGTH);\n}\n\nfunction scoreOf(entry: SearchEntry, words: string[]) {\n  const title = entry.title.toLowerCase();\n  const text = entry.text.toLowerCase();\n  let score = 0;\n  for (const word of words) {\n    const isInTitle = title.includes(word);\n    const isInText = text.includes(word);\n    if (!isInTitle && !isInText) {\n      return 0;\n    }\n    if (isInTitle) {\n      score += 3;\n    }\n    if (isInText) {\n      score += 1;\n    }\n  }\n  return score;\n}\n\nfunction firstMatchOf(lowered: string, words: string[]) {\n  let first = -1;\n  for (const word of words) {\n    const at = lowered.indexOf(word);\n    const isFound = at !== -1;\n    const isEarlier = first === -1 || at < first;\n    if (isFound && isEarlier) {\n      first = at;\n    }\n  }\n  return first;\n}\n\nfunction ellipsisIf(isCut: boolean) {\n  if (isCut) {\n    return '…';\n  }\n  return '';\n}\n\nfunction snippetOf(text: string, words: string[]) {\n  const first = firstMatchOf(text.toLowerCase(), words);\n  const wanted = first - SNIPPET_BEFORE;\n  const start = Math.max(0, wanted);\n  const end = Math.min(text.length, start + SNIPPET_LENGTH);\n  const slice = text.slice(start, end).trim();\n  const before = ellipsisIf(start > 0);\n  const after = ellipsisIf(end < text.length);\n  return `${before}${slice}${after}`;\n}\n\ntype Scored = {\n  entry: SearchEntry;\n  score: number;\n};\n\nfunction hasScore(scored: Scored) {\n  return scored.score > 0;\n}\n\nfunction byScore(first: Scored, second: Scored) {\n  return second.score - first.score;\n}\n\nexport function searchOf(query: string): SearchResult[] {\n  const words = wordsOf(query);\n  if (words.length === 0) {\n    return [];\n  }\n  const scored = ENTRIES.map((entry) => ({\n    entry,\n    score: scoreOf(entry, words),\n  }));\n  const matching = scored.filter(hasScore).sort(byScore);\n  return matching.slice(0, MAX_RESULTS).map(({ entry }) => ({\n    entry,\n    snippet: snippetOf(entry.text, words),\n  }));\n}\n\nfunction rangesOfWord(lowered: string, word: string) {\n  const ranges: Range[] = [];\n  let start = lowered.indexOf(word);\n  while (start !== -1) {\n    const end = start + word.length;\n    ranges.push({ start, end });\n    start = lowered.indexOf(word, end);\n  }\n  return ranges;\n}\n\nfunction byStart(first: Range, second: Range) {\n  return first.start - second.start;\n}\n\nfunction mergedRanges(ranges: Range[]) {\n  const sorted = [...ranges].sort(byStart);\n  const merged: Range[] = [];\n  for (const range of sorted) {\n    const last = merged.at(-1);\n    const overlaps = last !== undefined && range.start <= last.end;\n    if (overlaps) {\n      last.end = Math.max(last.end, range.end);\n      continue;\n    }\n    merged.push({ ...range });\n  }\n  return merged;\n}\n\nexport function markedPartsOf(text: string, words: string[]) {\n  const lowered = text.toLowerCase();\n  const ranges = words.flatMap((word) => rangesOfWord(lowered, word));\n  const parts: MarkedPart[] = [];\n  let cursor = 0;\n  for (const range of mergedRanges(ranges)) {\n    if (range.start > cursor) {\n      const plain = text.slice(cursor, range.start);\n      parts.push({ key: String(cursor), text: plain, isMatch: false });\n    }\n    const match = text.slice(range.start, range.end);\n    parts.push({ key: String(range.start), text: match, isMatch: true });\n    cursor = range.end;\n  }\n  if (cursor < text.length) {\n    const rest = text.slice(cursor);\n    parts.push({ key: String(cursor), text: rest, isMatch: false });\n  }\n  return parts;\n}\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/search.ts"
    },
    {
      "path": "registry/ndeko/templates/docs/marketing-06/session.ts",
      "content": "import type { SessionStep } from '@/registry/ndeko/hooks/use-session';\nimport { keyDelayOf, prefixesOf } from '@/registry/ndeko/lib/demonstration';\nimport { countOf } from '@/registry/ndeko/lib/words';\n\nimport type { InstallTab, Manager } from './data';\nimport { pageOf, type PageId } from './pages';\nimport { searchOf } from './search';\n\nexport type Route = 'home' | PageId;\n\nexport type DocsState = {\n  route: Route;\n  query: string;\n  manager: Manager;\n  installTab: InstallTab;\n  isCommandCopied: boolean;\n  /** The heading the frame scrolls to, or the top of the page. */\n  readTo: string;\n  /** Counts the requests, so asking twice for the same place still scrolls. */\n  readRequest: number;\n  isNavOpen: boolean;\n  spoken: string;\n};\n\nexport type DocsAction =\n  | { type: 'searched'; query: string }\n  | { type: 'opened'; route: Route; heading?: string }\n  | { type: 'managerPicked'; manager: Manager }\n  | { type: 'tabPicked'; tab: InstallTab }\n  | { type: 'commandCopied' }\n  | { type: 'commandReset' }\n  | { type: 'readTo'; heading: string }\n  | { type: 'nav'; isOpen: boolean };\n\ntype Step = SessionStep<DocsState, DocsAction>;\n\nexport const TOP = 'top';\n\nexport const INITIAL: DocsState = {\n  route: 'home',\n  query: '',\n  manager: 'pnpm',\n  installTab: 'cli',\n  isCommandCopied: false,\n  readTo: TOP,\n  readRequest: 0,\n  isNavOpen: false,\n  spoken: '',\n};\n\nfunction resultsLineOf(query: string) {\n  const results = searchOf(query);\n  if (query.trim() === '') {\n    return '';\n  }\n  if (results.length === 0) {\n    return 'No page matches';\n  }\n  return countOf(results.length, 'result');\n}\n\nfunction openedLineOf(route: Route) {\n  if (route === 'home') {\n    return 'Docs home';\n  }\n  return pageOf(route).title;\n}\n\nfunction opened(\n  state: DocsState,\n  route: Route,\n  heading: string | undefined\n): DocsState {\n  const readTo = heading ?? TOP;\n  return {\n    ...state,\n    route,\n    query: '',\n    readTo,\n    readRequest: state.readRequest + 1,\n    isNavOpen: false,\n    spoken: openedLineOf(route),\n  };\n}\n\nexport function reducer(state: DocsState, action: DocsAction): DocsState {\n  switch (action.type) {\n    case 'searched':\n      return {\n        ...state,\n        query: action.query,\n        spoken: resultsLineOf(action.query),\n      };\n    case 'opened':\n      return opened(state, action.route, action.heading);\n    case 'managerPicked':\n      return { ...state, manager: action.manager, isCommandCopied: false };\n    case 'tabPicked':\n      return { ...state, installTab: action.tab };\n    case 'commandCopied':\n      return { ...state, isCommandCopied: true, spoken: 'Command copied' };\n    case 'commandReset':\n      return { ...state, isCommandCopied: false };\n    case 'readTo':\n      return {\n        ...state,\n        readTo: action.heading,\n        readRequest: state.readRequest + 1,\n      };\n    case 'nav':\n      return { ...state, isNavOpen: action.isOpen };\n  }\n}\n\nconst KEY_MS = 110;\n\nfunction typing(text: string, startAfter: number): Step[] {\n  const prefixes = prefixesOf(text);\n  return prefixes.map((query, index) => ({\n    after: keyDelayOf(index, startAfter, KEY_MS),\n    by: 'demo',\n    action: { type: 'searched', query },\n  }));\n}\n\nfunction open(\n  after: number,\n  press: string,\n  route: Route,\n  heading?: string\n): Step {\n  return {\n    after,\n    by: 'demo',\n    press,\n    action: { type: 'opened', route, heading },\n  };\n}\n\nfunction manager(after: number, value: Manager): Step {\n  return {\n    after,\n    by: 'demo',\n    press: `pm-${value}`,\n    action: { type: 'managerPicked', manager: value },\n  };\n}\n\nfunction tab(after: number, value: InstallTab): Step {\n  return {\n    after,\n    by: 'demo',\n    press: `tab-${value}`,\n    action: { type: 'tabPicked', tab: value },\n  };\n}\n\nfunction readTo(after: number, heading: string): Step {\n  return { after, by: 'demo', action: { type: 'readTo', heading } };\n}\n\nfunction nav(after: number, isOpen: boolean): Step {\n  return { after, by: 'demo', action: { type: 'nav', isOpen } };\n}\n\n/**\n * A developer searches the home page for install, opens the page, switches to bun and copies the\n * command, reads the manual steps, goes on to the next page, finds the timeout of an approval in\n * the sidebar and goes back home. On a phone the sidebar is the sheet the demonstration opens.\n */\nexport const SCRIPT: Step[] = [\n  ...typing('install', 1500),\n  open(1700, 'result-0', 'installation'),\n  manager(1700, 'bun'),\n  {\n    after: 1200,\n    by: 'demo',\n    press: 'copy-command',\n    action: { type: 'commandCopied' },\n  },\n  tab(1700, 'manual'),\n  readTo(1600, 'key'),\n  open(1800, 'next-page', 'approvals'),\n  nav(1400, true),\n  ...typing('timeout', 600),\n  open(1700, 'result-0', 'approvals', 'timeout'),\n  open(3000, 'brand', 'home'),\n];\n\n/** Under reduced motion the docs rest on the installation page, with every part of a page in view. */\nexport const RESTING: DocsState = { ...INITIAL, route: 'installation' };\n\nexport const LOOP_AFTER_MS = 2400;\n",
      "type": "registry:component",
      "target": "components/templates/marketing-06/session.ts"
    }
  ],
  "categories": [
    "templates",
    "docs"
  ],
  "type": "registry:block"
}