{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "application-02",
  "title": "Analytics",
  "description": "Tidewell Studio reports in the sidebar shell: an overview whose figures pick what the chart draws, a weekly report with day bars and ranked projects, and project health against the sprint goal, each with a CSV export.",
  "dependencies": [
    "@base-ui/react",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/breadcrumb.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/chip.json",
    "https://ui.ndekocode.dev/r/command.json",
    "https://ui.ndekocode.dev/r/company-mark.json",
    "https://ui.ndekocode.dev/r/dropdown-menu.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/kbd.json",
    "https://ui.ndekocode.dev/r/mesh-tile.json",
    "https://ui.ndekocode.dev/r/motion-number.json",
    "https://ui.ndekocode.dev/r/recipes.json",
    "https://ui.ndekocode.dev/r/select.json",
    "https://ui.ndekocode.dev/r/sheet.json",
    "https://ui.ndekocode.dev/r/skeleton.json",
    "https://ui.ndekocode.dev/r/tabs.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json",
    "https://ui.ndekocode.dev/r/wash.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/templates/dashboards/application-02/index.tsx",
      "content": "'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Sheet, SheetContent, SheetTitle } from '@/registry/ndeko/ui/sheet';\n\nimport { AppSidebar } from './app-sidebar';\nimport {\n  CURRENT_USER_ID,\n  NAV_GROUPS,\n  PEOPLE,\n  WORKSPACES,\n  personOf,\n  type NavItem,\n  type PageId,\n} from './data';\nimport { OverviewPage } from './overview-page';\nimport { ProjectHealthPage } from './project-health-page';\nimport { CommandPalette } from './search-palette';\nimport { TopBar } from './top-bar';\nimport { WeeklyReportPage } from './weekly-report-page';\n\nconst NAV_ITEMS = NAV_GROUPS.flatMap((group) => group.items);\n\nconst NO_COUNTS = {};\n\nfunction navItemOf(pageId: PageId): NavItem {\n  const item = NAV_ITEMS.find((candidate) => candidate.id === pageId);\n  if (item) {\n    return item;\n  }\n  return NAV_ITEMS[0];\n}\n\nfunction ancestorOf(pageId: PageId, workspaceName: string) {\n  const group = NAV_GROUPS.find((candidate) =>\n    candidate.items.some((item) => item.id === pageId)\n  );\n  if (group?.team) {\n    return group.team.name;\n  }\n  if (group?.label) {\n    return workspaceName;\n  }\n  return undefined;\n}\n\nfunction isPaletteShortcut(event: KeyboardEvent) {\n  const isKKey = event.key.toLowerCase() === 'k';\n  const hasModifier = event.metaKey || event.ctrlKey;\n  return isKKey && hasModifier;\n}\n\nfunction keepWorkspace() {\n  return undefined;\n}\n\nexport default function Application02() {\n  const [activePageId, setActivePageId] = useState<PageId>('overview');\n  const [isSidebarHidden, setIsSidebarHidden] = useState(false);\n  const [isNavigationOpen, setIsNavigationOpen] = useState(false);\n  const [isPaletteOpen, setIsPaletteOpen] = useState(false);\n\n  const workspace = WORKSPACES[0];\n  const activePage = navItemOf(activePageId);\n  const ancestor = ancestorOf(activePageId, workspace.name);\n  const currentUser = personOf(CURRENT_USER_ID);\n\n  useEffect(() => {\n    function handleKeyDown(event: KeyboardEvent) {\n      if (isPaletteShortcut(event)) {\n        event.preventDefault();\n        setIsPaletteOpen((isOpen) => !isOpen);\n      }\n    }\n\n    document.addEventListener('keydown', handleKeyDown);\n    return () => document.removeEventListener('keydown', handleKeyDown);\n  }, []);\n\n  function navigate(pageId: PageId) {\n    setActivePageId(pageId);\n    setIsNavigationOpen(false);\n  }\n\n  function openSearch() {\n    setIsNavigationOpen(false);\n    setIsPaletteOpen(true);\n  }\n\n  function hideSidebar() {\n    setIsSidebarHidden(true);\n  }\n\n  function showSidebar() {\n    setIsSidebarHidden(false);\n  }\n\n  function openNavigation() {\n    setIsNavigationOpen(true);\n  }\n\n  const sidebarProps = {\n    workspaces: WORKSPACES,\n    workspace,\n    onWorkspaceChange: keepWorkspace,\n    groups: NAV_GROUPS,\n    activePageId,\n    counts: NO_COUNTS,\n    person: currentUser,\n    onNavigate: navigate,\n    onOpenSearch: openSearch,\n  };\n\n  return (\n    <div className='bg-sidebar text-foreground flex h-dvh min-h-0 w-full md:p-2'>\n      <aside aria-label='Sidebar' className='hidden shrink-0 md:block'>\n        <AnimatedSize\n          axis='width'\n          inert={isSidebarHidden}\n          className='m-0 h-full'\n          contentClassName={cn('h-full p-0', isSidebarHidden && 'w-0')}\n        >\n          <div className='h-full w-60 pr-2'>\n            <AppSidebar {...sidebarProps} onHide={hideSidebar} />\n          </div>\n        </AnimatedSize>\n      </aside>\n      <Sheet open={isNavigationOpen} onOpenChange={setIsNavigationOpen}>\n        <SheetContent\n          side='left'\n          showCloseButton={false}\n          className='bg-sidebar w-72 gap-0 p-2'\n        >\n          <SheetTitle className='sr-only'>Navigation</SheetTitle>\n          <AppSidebar {...sidebarProps} />\n        </SheetContent>\n      </Sheet>\n      <main className='bg-background md:hairline-ring md:ring-border flex min-w-0 flex-1 flex-col overflow-clip md:rounded-xl md:shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n        <TopBar\n          page={activePage}\n          ancestor={ancestor}\n          people={PEOPLE}\n          isSidebarHidden={isSidebarHidden}\n          onShowSidebar={showSidebar}\n          onOpenNavigation={openNavigation}\n        />\n        {activePageId === 'overview' && <OverviewPage />}\n        {activePageId === 'weekly-report' && <WeeklyReportPage />}\n        {activePageId === 'project-health' && <ProjectHealthPage />}\n      </main>\n      <CommandPalette\n        open={isPaletteOpen}\n        onOpenChange={setIsPaletteOpen}\n        groups={NAV_GROUPS}\n        onNavigate={navigate}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/index.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/app-sidebar.tsx",
      "content": "'use client';\n\nimport { useId } from 'react';\n\nimport { LayoutIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { AccountMenu } from './account-menu';\nimport type { NavGroup, NavItem, PageId, Person, Workspace } from './data';\nimport { SearchTrigger } from './search-palette';\nimport { EntityTile, NavRow } from './sidebar-parts';\nimport { WorkspaceSwitcher } from './workspace-switcher';\n\nexport type PageCounts = Partial<Record<PageId, number>>;\n\ntype AppSidebarProps = {\n  workspaces: Workspace[];\n  workspace: Workspace;\n  onWorkspaceChange: (workspaceId: string) => void;\n  groups: NavGroup[];\n  activePageId: PageId;\n  counts: PageCounts;\n  person: Person;\n  onNavigate: (pageId: PageId) => void;\n  onOpenSearch: () => void;\n  onHide?: () => void;\n};\n\nfunction GroupLabel({ group }: { group: NavGroup }) {\n  if (group.team) {\n    return (\n      <p className='text-muted-foreground flex h-6 items-center gap-2 px-2 text-xs font-medium'>\n        <EntityTile entity={group.team} size='xs' />\n        {group.team.name}\n      </p>\n    );\n  }\n  if (group.label) {\n    return (\n      <p className='text-muted-foreground flex h-6 items-center px-2 text-xs font-medium'>\n        {group.label}\n      </p>\n    );\n  }\n  return null;\n}\n\nexport function AppSidebar({\n  workspaces,\n  workspace,\n  onWorkspaceChange,\n  groups,\n  activePageId,\n  counts,\n  person,\n  onNavigate,\n  onOpenSearch,\n  onHide,\n}: AppSidebarProps) {\n  const indicatorId = useId();\n  const canHide = Boolean(onHide);\n\n  function selectItem(item: NavItem) {\n    onNavigate(item.id);\n  }\n\n  return (\n    <div className='flex h-full min-h-0 flex-col gap-3'>\n      <div className='flex flex-col gap-2'>\n        <div className='flex items-center gap-1'>\n          <WorkspaceSwitcher\n            workspaces={workspaces}\n            current={workspace}\n            onSelect={onWorkspaceChange}\n          />\n          {canHide && (\n            <Button\n              variant='ghost'\n              size='icon-sm'\n              aria-label='Hide sidebar'\n              onClick={onHide}\n              className='text-muted-foreground'\n            >\n              <LayoutIcon />\n            </Button>\n          )}\n        </div>\n        <div className='flex items-center'>\n          <SearchTrigger onOpen={onOpenSearch} />\n        </div>\n      </div>\n      <nav\n        aria-label='Main'\n        className='-mx-2 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-2'\n      >\n        {groups.map((group) => (\n          <div key={group.id} className='flex flex-col gap-0.5'>\n            <GroupLabel group={group} />\n            <ul className='flex flex-col gap-px'>\n              {group.items.map((item) => (\n                <NavRow\n                  key={item.id}\n                  item={item}\n                  isActive={item.id === activePageId}\n                  indicatorId={indicatorId}\n                  count={counts[item.id]}\n                  onSelect={selectItem}\n                />\n              ))}\n            </ul>\n          </div>\n        ))}\n      </nav>\n      <AccountMenu person={person} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/app-sidebar.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/sidebar-parts.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { MeshTile } from '@/registry/ndeko/ui/mesh-tile';\n\nimport type { Entity, NavItem, Person } from './data';\n\nexport const NAV_ROW = [\n  'relative flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-[13px] font-medium text-foreground outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n  \"[&_svg]:pointer-events-none [&_svg]:relative [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n].join(' ');\n\nconst INDICATOR_TRAVEL: Transition = {\n  duration: 0.25,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nfunction travelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return INDICATOR_TRAVEL;\n}\n\n/** The one highlight of the active row. It travels from the old row to the new one. */\nexport function ActiveRowIndicator({ layoutId }: { layoutId: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n\n  return (\n    <motion.span\n      aria-hidden='true'\n      layoutId={layoutId}\n      transition={travelOf(shouldReduceMotion)}\n      className='bg-foreground/[0.07] absolute inset-0 rounded-md'\n    />\n  );\n}\n\nconst TILE_SIZE = {\n  xs: 'size-4 rounded-[4px]',\n  sm: 'size-5 rounded-[5px]',\n  md: 'size-6 rounded-md',\n} as const;\n\n/** The picture of a team: a gradient drawn from its name, in its colour. */\nexport function EntityTile({\n  entity,\n  size = 'md',\n  className,\n}: {\n  entity: Entity;\n  size?: keyof typeof TILE_SIZE;\n  className?: string;\n}) {\n  return (\n    <MeshTile\n      seed={entity.name}\n      color={entity.color}\n      className={cn(TILE_SIZE[size], className)}\n    />\n  );\n}\n\nexport function PersonAvatar({\n  person,\n  className,\n}: {\n  person: Person;\n  className?: string;\n}) {\n  return <Avatar className={className} seed={person.name} />;\n}\n\nexport function ariaCurrentOf(isActive: boolean) {\n  if (isActive) {\n    return 'page' as const;\n  }\n  return undefined;\n}\n\ntype NavRowProps = {\n  item: NavItem;\n  isActive: boolean;\n  indicatorId: string;\n  count?: number;\n  onSelect: (item: NavItem) => void;\n};\n\nexport function NavRow({\n  item,\n  isActive,\n  indicatorId,\n  count = 0,\n  onSelect,\n}: NavRowProps) {\n  const hasCount = count > 0;\n  const ItemIcon = item.icon;\n  const ariaCurrent = ariaCurrentOf(isActive);\n\n  function selectItem() {\n    onSelect(item);\n  }\n\n  return (\n    <li>\n      <button\n        type='button'\n        aria-current={ariaCurrent}\n        onClick={selectItem}\n        className={NAV_ROW}\n      >\n        {isActive && <ActiveRowIndicator layoutId={indicatorId} />}\n        <ItemIcon />\n        <span className='relative min-w-0 flex-1 truncate'>{item.label}</span>\n        {hasCount && (\n          <MotionNumber\n            value={count}\n            className='text-muted-foreground text-xs font-normal'\n          />\n        )}\n      </button>\n    </li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/sidebar-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/workspace-switcher.tsx",
      "content": "'use client';\n\nimport {\n  ChevronsUpDownIcon,\n  PlusIcon,\n  SettingsIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { Workspace } from './data';\n\nconst TRIGGER = [\n  'flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nfunction memberCountLabelOf(count: number) {\n  if (count === 1) {\n    return '1 member';\n  }\n  return `${count} members`;\n}\n\ntype WorkspaceSwitcherProps = {\n  workspaces: Workspace[];\n  current: Workspace;\n  onSelect: (workspaceId: string) => void;\n};\n\nexport function WorkspaceSwitcher({\n  workspaces,\n  current,\n  onSelect,\n}: WorkspaceSwitcherProps) {\n  function selectWorkspace(value: unknown) {\n    if (typeof value === 'string') {\n      onSelect(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Workspace: ${current.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <CompanyMark seed={current.name} className='size-6 rounded-md' />\n        <span className='min-w-0 flex-1 truncate text-[13px] font-semibold'>\n          {current.name}\n        </span>\n        <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-64'>\n        <DropdownMenuLabel>Workspaces</DropdownMenuLabel>\n        <DropdownMenuRadioGroup\n          value={current.id}\n          onValueChange={selectWorkspace}\n        >\n          {workspaces.map((workspace) => (\n            <DropdownMenuRadioItem\n              key={workspace.id}\n              value={workspace.id}\n              closeOnClick\n              className='h-9'\n            >\n              <CompanyMark seed={workspace.name} />\n              <span className='min-w-0 flex-1 truncate'>{workspace.name}</span>\n              <Kbd aria-hidden='true'>{workspace.memberCount}</Kbd>\n              <span className='sr-only'>\n                {memberCountLabelOf(workspace.memberCount)}\n              </span>\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n        <DropdownMenuSeparator />\n        <DropdownMenuItem>\n          <SettingsIcon />\n          Workspace settings\n        </DropdownMenuItem>\n        <DropdownMenuItem>\n          <PlusIcon />\n          Add workspace\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/workspace-switcher.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/search-palette.tsx",
      "content": "'use client';\n\nimport { SearchIcon } from '@/registry/ndeko/lib/icons';\nimport { CONTROL_RECIPE } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  CommandDialog,\n  CommandEmpty,\n  CommandGroup,\n  CommandInput,\n  CommandItem,\n  CommandList,\n} from '@/registry/ndeko/ui/command';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { NavGroup, PageId } from './data';\n\nfunction headingOf(group: NavGroup) {\n  if (group.team) {\n    return group.team.name;\n  }\n  if (group.label) {\n    return group.label;\n  }\n  return 'Personal';\n}\n\nexport function SearchTrigger({ onOpen }: { onOpen: () => void }) {\n  return (\n    <button\n      type='button'\n      onClick={onOpen}\n      className={cn(\n        CONTROL_RECIPE,\n        'text-muted-foreground flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2.5 text-left'\n      )}\n    >\n      <SearchIcon className='size-4 shrink-0' />\n      <span className='min-w-0 flex-1 truncate'>Search</span>\n      <Kbd>⌘K</Kbd>\n    </button>\n  );\n}\n\ntype CommandPaletteProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  groups: NavGroup[];\n  onNavigate: (pageId: PageId) => void;\n};\n\nexport function CommandPalette({\n  open,\n  onOpenChange,\n  groups,\n  onNavigate,\n}: CommandPaletteProps) {\n  function closePalette() {\n    onOpenChange(false);\n  }\n\n  return (\n    <CommandDialog\n      open={open}\n      onOpenChange={onOpenChange}\n      title='Search'\n      description='Go to a report'\n    >\n      <CommandInput placeholder='Go to a report' />\n      <CommandList>\n        <CommandEmpty>Nothing matches. Try the name of a report.</CommandEmpty>\n        {groups.map((group) => (\n          <CommandGroup key={group.id} heading={headingOf(group)}>\n            {group.items.map((item) => {\n              const ItemIcon = item.icon;\n\n              function goToPage() {\n                closePalette();\n                onNavigate(item.id);\n              }\n\n              return (\n                <CommandItem\n                  key={item.id}\n                  value={`${group.id} ${item.label}`}\n                  onSelect={goToPage}\n                >\n                  <ItemIcon />\n                  {item.label}\n                </CommandItem>\n              );\n            })}\n          </CommandGroup>\n        ))}\n      </CommandList>\n    </CommandDialog>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/search-palette.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/account-menu.tsx",
      "content": "'use client';\n\nimport {\n  ChevronsUpDownIcon,\n  CommandIcon,\n  LifeBuoyIcon,\n  LogOutIcon,\n  SettingsIcon,\n  UserIcon,\n} from '@/registry/ndeko/lib/icons';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst TRIGGER = [\n  'flex h-9 w-full min-w-0 items-center gap-2 rounded-md px-1.5 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nexport function AccountMenuItems({ person }: { person: Person }) {\n  return (\n    <>\n      <div className='flex items-center gap-2.5 px-2 py-2'>\n        <PersonAvatar person={person} />\n        <div className='min-w-0'>\n          <p className='truncate text-[13px] font-medium'>{person.name}</p>\n          <p className='text-muted-foreground truncate text-xs'>\n            {person.role}\n          </p>\n        </div>\n      </div>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem>\n        <UserIcon />\n        Profile\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <SettingsIcon />\n        Preferences\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <CommandIcon />\n        Keyboard shortcuts\n        <Kbd className='ml-auto'>?</Kbd>\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <LifeBuoyIcon />\n        Help and docs\n      </DropdownMenuItem>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem variant='destructive'>\n        <LogOutIcon />\n        Log out\n      </DropdownMenuItem>\n    </>\n  );\n}\n\nexport function AccountMenu({ person }: { person: Person }) {\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Account: ${person.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <PersonAvatar person={person} className='size-6 text-[10px]' />\n        <span className='min-w-0 flex-1 truncate text-[13px] font-medium'>\n          {person.name}\n        </span>\n        <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent side='top' align='start' className='w-60'>\n        <AccountMenuItems person={person} />\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/account-menu.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/top-bar.tsx",
      "content": "'use client';\n\nimport { LayoutIcon, MenuIcon } from '@/registry/ndeko/lib/icons';\nimport {\n  Breadcrumb,\n  BreadcrumbItem,\n  BreadcrumbList,\n  BreadcrumbPage,\n  BreadcrumbSeparator,\n} from '@/registry/ndeko/ui/breadcrumb';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport type { NavItem, Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst STACK_LIMIT = 4;\n\nfunction AvatarStack({ people }: { people: Person[] }) {\n  const shown = people.slice(0, STACK_LIMIT);\n  const hiddenCount = people.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n\n  return (\n    <div\n      role='group'\n      aria-label='Team members'\n      className='hidden items-center sm:flex'\n    >\n      {shown.map((person) => (\n        <PersonAvatar\n          key={person.id}\n          person={person}\n          className='ring-background -ml-1.5 size-6 text-[10px] ring-2 first:ml-0'\n        />\n      ))}\n      {hasHidden && (\n        <span className='bg-muted text-muted-foreground ring-background -ml-1.5 inline-flex size-6 items-center justify-center rounded-full text-[10px] font-medium tabular-nums ring-2'>\n          +{hiddenCount}\n        </span>\n      )}\n    </div>\n  );\n}\n\ntype TopBarProps = {\n  page: NavItem;\n  ancestor?: string;\n  people: Person[];\n  isSidebarHidden: boolean;\n  onShowSidebar: () => void;\n  onOpenNavigation: () => void;\n};\n\nexport function TopBar({\n  page,\n  ancestor,\n  people,\n  isSidebarHidden,\n  onShowSidebar,\n  onOpenNavigation,\n}: TopBarProps) {\n  const PageIcon = page.icon;\n  const hasAncestor = Boolean(ancestor);\n\n  return (\n    <header className='hairline-b border-border flex h-11 shrink-0 items-center gap-2 px-3 md:px-4'>\n      <Button\n        variant='ghost'\n        size='icon-sm'\n        aria-label='Open navigation'\n        onClick={onOpenNavigation}\n        className='text-muted-foreground md:hidden'\n      >\n        <MenuIcon />\n      </Button>\n      {isSidebarHidden && (\n        <Button\n          variant='ghost'\n          size='icon-sm'\n          aria-label='Show sidebar'\n          onClick={onShowSidebar}\n          className='text-muted-foreground hidden md:inline-flex'\n        >\n          <LayoutIcon />\n        </Button>\n      )}\n      <Breadcrumb className='min-w-0'>\n        <BreadcrumbList className='flex-nowrap'>\n          <li aria-hidden='true' className='flex'>\n            <PageIcon className='text-muted-foreground size-4 shrink-0' />\n          </li>\n          {hasAncestor && (\n            <>\n              <BreadcrumbItem className='hidden sm:inline-flex'>\n                {ancestor}\n              </BreadcrumbItem>\n              <BreadcrumbSeparator className='hidden sm:block' />\n            </>\n          )}\n          <BreadcrumbItem className='min-w-0'>\n            <BreadcrumbPage className='truncate'>{page.label}</BreadcrumbPage>\n          </BreadcrumbItem>\n        </BreadcrumbList>\n      </Breadcrumb>\n      <div className='ml-auto flex items-center gap-2'>\n        <AvatarStack people={people} />\n      </div>\n    </header>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/top-bar.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/overview-page.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Skeleton } from '@/registry/ndeko/ui/skeleton';\n\nimport {\n  PERIODS,\n  WORKSPACE,\n  type MetricDefinition,\n  type MetricId,\n  type PeriodId,\n} from './data';\nimport {\n  chartPointsOf,\n  csvRowsOf,\n  figuresOf,\n  formatMetric,\n  metricOf,\n  periodOf,\n} from './overview-figures';\nimport { MetricStrip } from './metric-strip';\nimport {\n  ExportButton,\n  PeriodSwitch,\n  REPORT_SURFACE,\n  ReportToolbar,\n  downloadCsv,\n  useSimulatedLoad,\n  type PeriodOption,\n} from './report-frame';\nimport { TrendChart } from './trend-chart';\n\nconst PERIOD_OPTIONS: PeriodOption<PeriodId>[] = PERIODS.map((period) => ({\n  id: period.id,\n  label: period.switchLabel,\n}));\n\nconst SKELETON_CELLS = ['tracked', 'closed', 'billable', 'review'];\n\nfunction periodKeyOf(periodId: PeriodId) {\n  return periodId;\n}\n\nfunction peopleLabelOf(count: number) {\n  if (count === 1) {\n    return '1 person';\n  }\n  return `${count} people`;\n}\n\nfunction formatterOf(metric: MetricDefinition) {\n  return (value: number) => formatMetric(metric, value);\n}\n\nfunction OverviewSkeleton() {\n  return (\n    <div\n      aria-hidden='true'\n      className={cn(REPORT_SURFACE, 'flex flex-col gap-6 p-2 pb-5')}\n    >\n      <div className='grid grid-cols-2 gap-1 lg:grid-cols-4'>\n        {SKELETON_CELLS.map((cell) => (\n          <div\n            key={cell}\n            className='flex flex-col gap-2 px-3 pt-2.5 pb-3.5 sm:px-4'\n          >\n            <Skeleton className='h-3 w-20' />\n            <Skeleton className='h-5 w-16' />\n            <Skeleton className='h-3 w-32' />\n          </div>\n        ))}\n      </div>\n      <div className='flex flex-col gap-3 px-3 sm:px-4'>\n        <Skeleton className='h-3.5 w-40' />\n        <Skeleton className='h-[224px] w-full rounded-lg' />\n      </div>\n    </div>\n  );\n}\n\nexport function OverviewPage() {\n  const load = useSimulatedLoad<PeriodId>('weeks', periodKeyOf);\n  const [metricId, setMetricId] = useState<MetricId>('tracked');\n  const shownPeriodId = load.loaded ?? load.requested;\n  const shownPeriod = periodOf(shownPeriodId);\n  const metric = metricOf(metricId);\n  const figures = figuresOf(shownPeriodId);\n  const points = chartPointsOf(shownPeriodId, metricId);\n  const formatValue = formatterOf(metric);\n  const chartTitle = `${metric.chartTitle} ${shownPeriod.perUnit}`;\n  const peopleLabel = peopleLabelOf(WORKSPACE.peopleCount);\n  const meta = `${shownPeriod.label} · ${peopleLabel}`;\n\n  function exportOverview() {\n    const rows = csvRowsOf(shownPeriodId);\n    const fileName = `tidewell-overview-${shownPeriod.fileSlug}.csv`;\n    downloadCsv(fileName, rows);\n  }\n\n  return (\n    <div className='min-h-0 w-full flex-1 overflow-y-auto'>\n      <ReportToolbar title={WORKSPACE.name} meta={meta}>\n        <ExportButton disabled={load.isFirstLoad} onExport={exportOverview} />\n      </ReportToolbar>\n      <div className='mx-auto flex w-full max-w-5xl flex-col gap-4 px-4 py-5 md:px-6'>\n        <PeriodSwitch\n          label='Period'\n          options={PERIOD_OPTIONS}\n          value={load.requested}\n          isUpdating={load.isUpdating}\n          onValueChange={load.request}\n        />\n        {load.isFirstLoad && <OverviewSkeleton />}\n        {!load.isFirstLoad && (\n          <section\n            aria-label='Overview'\n            aria-busy={load.isUpdating}\n            className={cn(REPORT_SURFACE, 'flex flex-col gap-5 p-2 pb-5')}\n          >\n            <MetricStrip\n              figures={figures}\n              value={metricId}\n              onValueChange={setMetricId}\n            />\n            <div className='flex flex-col gap-4 px-3 sm:px-4'>\n              <div className='flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1'>\n                <h2 className='text-sm font-medium'>{chartTitle}</h2>\n                <span className='text-muted-foreground text-xs'>\n                  Illustrative figures\n                </span>\n              </div>\n              <TrendChart\n                title={chartTitle}\n                valueHeading={metric.label}\n                points={points}\n                formatValue={formatValue}\n              />\n            </div>\n          </section>\n        )}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/overview-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/metric-strip.tsx",
      "content": "'use client';\n\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { MotionNumber } from '@/components/core/motion-number';\n\nimport type { MetricId } from './data';\nimport type { MetricFigure } from './overview-figures';\n\ntype MetricStripProps = {\n  figures: MetricFigure[];\n  value: MetricId;\n  onValueChange: (metricId: MetricId) => void;\n};\n\n/** The figures band. Each cell is a tab that picks the figure the chart below draws. */\nexport function MetricStrip({\n  figures,\n  value,\n  onValueChange,\n}: MetricStripProps) {\n  function changeValue(nextValue: unknown) {\n    const figure = figures.find(\n      (candidate) => candidate.metric.id === nextValue\n    );\n    if (figure) {\n      onValueChange(figure.metric.id);\n    }\n  }\n\n  return (\n    <TabsPrimitive.Root value={value} onValueChange={changeValue}>\n      <TabsPrimitive.List\n        aria-label='Figure drawn in the chart'\n        className='relative grid grid-cols-2 gap-1 lg:grid-cols-4'\n      >\n        {figures.map((figure) => (\n          <TabsPrimitive.Tab\n            key={figure.metric.id}\n            value={figure.metric.id}\n            className='group/metric hover:bg-foreground/[0.03] focus-visible:ring-ring/25 flex min-w-0 cursor-pointer flex-col items-start gap-1 rounded-lg px-3 pt-2.5 pb-3.5 text-left transition-colors duration-150 outline-none focus-visible:ring-[3px] sm:px-4'\n          >\n            <span className='text-muted-foreground group-data-active/metric:text-foreground text-xs font-medium transition-colors duration-150'>\n              {figure.metric.label}\n            </span>\n            <MotionNumber\n              value={figure.total}\n              suffix={figure.metric.suffix}\n              className='text-lg leading-7 font-semibold'\n            />\n            <span className='text-muted-foreground text-xs text-pretty'>\n              {figure.hint}\n            </span>\n          </TabsPrimitive.Tab>\n        ))}\n        <TabsPrimitive.Indicator className='bg-primary pointer-events-none absolute top-0 left-0 h-0.5 w-[calc(var(--active-tab-width)-1.5rem)] translate-x-[calc(var(--active-tab-left)+0.75rem)] translate-y-[calc(var(--active-tab-top)+var(--active-tab-height)-2px)] rounded-full transition-[translate,width] duration-300 ease-(--ease-out-quint) sm:w-[calc(var(--active-tab-width)-2rem)] sm:translate-x-[calc(var(--active-tab-left)+1rem)]' />\n      </TabsPrimitive.List>\n    </TabsPrimitive.Root>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/metric-strip.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/trend-chart.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport {\n  ChartBubble,\n  bubbleAlignOf,\n  columnCenterOf,\n  niceScale,\n  percentOf,\n  useActiveIndex,\n} from './chart-kit';\n\nconst PLOT_HEIGHT = 200;\n\nconst VIEW_WIDTH = 1000;\n\nconst MAX_LINES = 4;\n\nconst PHONE_LABEL_STEP = 3;\n\nconst BUBBLE_GAP_PX = 10;\n\nconst MOVE_TRANSITION: Transition = {\n  duration: 0.3,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nexport type TrendPoint = {\n  axisLabel: string;\n  label: string;\n  value: number;\n};\n\ntype Coordinate = { x: number; y: number };\n\nfunction moveTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MOVE_TRANSITION;\n}\n\nfunction yOf(value: number, top: number) {\n  const ratio = value / top;\n  const height = ratio * PLOT_HEIGHT;\n  return PLOT_HEIGHT - height;\n}\n\nfunction coordinatesOf(points: TrendPoint[], top: number): Coordinate[] {\n  return points.map((point, index) => {\n    const share = columnCenterOf(index, points.length);\n    const x = share * VIEW_WIDTH;\n    const y = yOf(point.value, top);\n    return { x, y };\n  });\n}\n\nfunction commandOf(coordinate: Coordinate, index: number) {\n  const x = coordinate.x.toFixed(1);\n  const y = coordinate.y.toFixed(1);\n  if (index === 0) {\n    return `M${x} ${y}`;\n  }\n  return `L${x} ${y}`;\n}\n\nfunction linePathOf(coordinates: Coordinate[]) {\n  const commands = coordinates.map((coordinate, index) =>\n    commandOf(coordinate, index)\n  );\n  return commands.join(' ');\n}\n\nfunction areaPathOf(coordinates: Coordinate[]) {\n  const line = linePathOf(coordinates);\n  const lastIndex = coordinates.length - 1;\n  const first = coordinates[0];\n  const last = coordinates[lastIndex];\n  const firstX = first.x.toFixed(1);\n  const lastX = last.x.toFixed(1);\n  return `${line} L${lastX} ${PLOT_HEIGHT} L${firstX} ${PLOT_HEIGHT} Z`;\n}\n\nfunction leftOf(index: number, count: number) {\n  const share = columnCenterOf(index, count);\n  return percentOf(share);\n}\n\nfunction isPhoneLabel(index: number, count: number) {\n  const isLast = index === count - 1;\n  const isOnStep = index % PHONE_LABEL_STEP === 0;\n  return isLast || isOnStep;\n}\n\ntype TrendChartProps = {\n  title: string;\n  valueHeading: string;\n  points: TrendPoint[];\n  formatValue: (value: number) => string;\n};\n\n/** One series as a line over twelve columns. The line moves to its new shape when the data changes. */\nexport function TrendChart({\n  title,\n  valueHeading,\n  points,\n  formatValue,\n}: TrendChartProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const transition = moveTransitionOf(shouldReduceMotion);\n  const count = points.length;\n  const lastIndex = count - 1;\n  const values = points.map((point) => point.value);\n  const maxValue = Math.max(...values);\n  const scale = niceScale(maxValue, MAX_LINES);\n  const coordinates = coordinatesOf(points, scale.top);\n  const linePath = linePathOf(coordinates);\n  const areaPath = areaPathOf(coordinates);\n  const lastLeft = leftOf(lastIndex, count);\n  const lastY = coordinates[lastIndex].y;\n  const reading = useActiveIndex(count, lastIndex);\n  const shownPoint = points[reading.shownIndex];\n  const shownY = coordinates[reading.shownIndex].y;\n  const shownLeft = leftOf(reading.shownIndex, count);\n  const shownValue = formatValue(shownPoint.value);\n  const readingText = `${shownPoint.label}: ${shownValue}`;\n  const bubbleTop = shownY - BUBBLE_GAP_PX;\n  const bubbleAlign = bubbleAlignOf(reading.shownIndex, count);\n  const plotHeight = { height: PLOT_HEIGHT };\n\n  return (\n    <div className='flex flex-col'>\n      <div className='grid grid-cols-[2.75rem_minmax(0,1fr)]'>\n        <div aria-hidden='true' className='relative' style={plotHeight}>\n          {scale.ticks.map((tick) => {\n            const top = yOf(tick, scale.top);\n\n            return (\n              <span\n                key={tick}\n                className='text-muted-foreground absolute right-2.5 -translate-y-1/2 text-[11px] tabular-nums'\n                style={{ top }}\n              >\n                {formatValue(tick)}\n              </span>\n            );\n          })}\n        </div>\n        <div\n          role='group'\n          tabIndex={0}\n          aria-label={`${title}. Use the arrow keys to read each value.`}\n          className='focus-visible:ring-ring/25 relative touch-pan-y rounded-md outline-none focus-visible:ring-[3px]'\n          style={plotHeight}\n          {...reading.handlers}\n        >\n          <svg\n            aria-hidden='true'\n            viewBox={`0 0 ${VIEW_WIDTH} ${PLOT_HEIGHT}`}\n            preserveAspectRatio='none'\n            className='absolute inset-0 size-full overflow-visible'\n          >\n            {scale.ticks.map((tick) => {\n              const y = yOf(tick, scale.top);\n\n              return (\n                <line\n                  key={tick}\n                  x1={0}\n                  x2={VIEW_WIDTH}\n                  y1={y}\n                  y2={y}\n                  strokeWidth={1}\n                  vectorEffect='non-scaling-stroke'\n                  className='stroke-border'\n                />\n              );\n            })}\n            <motion.path\n              initial={false}\n              animate={{ d: areaPath }}\n              transition={transition}\n              className='fill-primary/[0.08]'\n            />\n            <motion.path\n              initial={false}\n              animate={{ d: linePath }}\n              transition={transition}\n              fill='none'\n              strokeWidth={2}\n              strokeLinecap='round'\n              strokeLinejoin='round'\n              vectorEffect='non-scaling-stroke'\n              className='stroke-primary'\n            />\n          </svg>\n          {reading.isActive && (\n            <span\n              aria-hidden='true'\n              className='bg-foreground/15 pointer-events-none absolute inset-y-0 w-px'\n              style={{ left: shownLeft }}\n            />\n          )}\n          <motion.span\n            aria-hidden='true'\n            initial={false}\n            animate={{ y: lastY }}\n            transition={transition}\n            className='bg-primary ring-card pointer-events-none absolute top-0 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2'\n            style={{ left: lastLeft }}\n          />\n          {reading.isActive && (\n            <span\n              aria-hidden='true'\n              className='bg-card ring-primary pointer-events-none absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2'\n              style={{ left: shownLeft, top: shownY }}\n            />\n          )}\n          <ChartBubble\n            left={shownLeft}\n            top={bubbleTop}\n            align={bubbleAlign}\n            isVisible={reading.isActive}\n          >\n            <span className='text-muted-foreground'>{shownPoint.label}</span>\n            <span className='text-[13px] font-medium tabular-nums'>\n              {shownValue}\n            </span>\n          </ChartBubble>\n        </div>\n        <span aria-hidden='true' />\n        <div aria-hidden='true' className='relative mt-2 h-4'>\n          {points.map((point, index) => {\n            const left = leftOf(index, count);\n            const isShownOnPhone = isPhoneLabel(index, count);\n            const isLast = index === lastIndex;\n\n            return (\n              <span\n                key={point.label}\n                className={cn(\n                  'text-muted-foreground absolute top-0 -translate-x-1/2 text-[11px] whitespace-nowrap tabular-nums',\n                  !isShownOnPhone && 'hidden sm:block',\n                  isLast && 'text-foreground font-medium'\n                )}\n                style={{ left }}\n              >\n                {point.axisLabel}\n              </span>\n            );\n          })}\n        </div>\n      </div>\n      <span aria-live='polite' className='sr-only'>\n        {reading.isReadingByKeys && readingText}\n      </span>\n      <div className='sr-only'>\n        <table>\n          <caption>{title}</caption>\n          <thead>\n            <tr>\n              <th scope='col'>Period</th>\n              <th scope='col'>{valueHeading}</th>\n            </tr>\n          </thead>\n          <tbody>\n            {points.map((point) => (\n              <tr key={point.label}>\n                <th scope='row'>{point.label}</th>\n                <td>{formatValue(point.value)}</td>\n              </tr>\n            ))}\n          </tbody>\n        </table>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/trend-chart.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/chart-kit.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nconst NICE_FACTORS = [1, 2, 5, 10];\n\nexport function niceScale(maxValue: number, maxLines: number) {\n  const safeMax = Math.max(maxValue, 1);\n  const roughStep = safeMax / maxLines;\n  const logarithm = Math.log10(roughStep);\n  const exponent = Math.floor(logarithm);\n  const magnitude = 10 ** exponent;\n  const factor = NICE_FACTORS.find((candidate) => {\n    const candidateStep = candidate * magnitude;\n    return candidateStep >= roughStep;\n  });\n  const safeFactor = factor ?? 10;\n  const step = safeFactor * magnitude;\n  const lineCount = Math.ceil(safeMax / step);\n  const top = lineCount * step;\n  const tickCount = lineCount + 1;\n  const ticks = Array.from({ length: tickCount }, (_, index) => {\n    return index * step;\n  });\n  return { top, ticks };\n}\n\nexport function columnCenterOf(index: number, count: number) {\n  const center = index + 0.5;\n  return center / count;\n}\n\nexport function percentOf(share: number) {\n  const percent = share * 100;\n  return `${percent}%`;\n}\n\nfunction columnIndexAt(event: React.PointerEvent<HTMLElement>, count: number) {\n  const box = event.currentTarget.getBoundingClientRect();\n  const offset = event.clientX - box.left;\n  const share = offset / box.width;\n  const rawIndex = Math.floor(share * count);\n  const lastIndex = count - 1;\n  const clampedHigh = Math.min(rawIndex, lastIndex);\n  return Math.max(clampedHigh, 0);\n}\n\nfunction steppedIndexOf(key: string, current: number, count: number) {\n  const lastIndex = count - 1;\n  if (key === 'ArrowRight') {\n    const next = current + 1;\n    return Math.min(next, lastIndex);\n  }\n  if (key === 'ArrowLeft') {\n    const previous = current - 1;\n    return Math.max(previous, 0);\n  }\n  if (key === 'Home') {\n    return 0;\n  }\n  if (key === 'End') {\n    return lastIndex;\n  }\n  return null;\n}\n\n/**\n * One reading position for a chart: the pointer column wins while it is over the plot,\n * the arrow keys move it while the plot has keyboard focus.\n */\nexport function useActiveIndex(count: number, defaultIndex: number) {\n  const [pointerIndex, setPointerIndex] = useState<number | null>(null);\n  const [keyIndex, setKeyIndex] = useState<number | null>(null);\n  const [lastIndex, setLastIndex] = useState(defaultIndex);\n  const activeIndex = pointerIndex ?? keyIndex;\n  const isActive = activeIndex !== null;\n  const isReadingByKeys = keyIndex !== null;\n  const wantedIndex = activeIndex ?? lastIndex;\n  const lastColumn = count - 1;\n  const highestIndex = Math.max(lastColumn, 0);\n  const shownIndex = Math.min(wantedIndex, highestIndex);\n\n  function pointAt(event: React.PointerEvent<HTMLElement>) {\n    const index = columnIndexAt(event, count);\n    setPointerIndex(index);\n    setLastIndex(index);\n  }\n\n  function leave(event: React.PointerEvent<HTMLElement>) {\n    if (event.pointerType === 'mouse') {\n      setPointerIndex(null);\n    }\n  }\n\n  function focus(event: React.FocusEvent<HTMLElement>) {\n    const isKeyboardFocus = event.currentTarget.matches(':focus-visible');\n    if (isKeyboardFocus) {\n      setKeyIndex(lastIndex);\n    }\n  }\n\n  function blur() {\n    setKeyIndex(null);\n    setPointerIndex(null);\n  }\n\n  function step(event: React.KeyboardEvent<HTMLElement>) {\n    if (event.key === 'Escape') {\n      setKeyIndex(null);\n      return;\n    }\n    const current = keyIndex ?? lastIndex;\n    const next = steppedIndexOf(event.key, current, count);\n    if (next === null) {\n      return;\n    }\n    event.preventDefault();\n    setPointerIndex(null);\n    setKeyIndex(next);\n    setLastIndex(next);\n  }\n\n  const handlers = {\n    onPointerMove: pointAt,\n    onPointerDown: pointAt,\n    onPointerLeave: leave,\n    onFocus: focus,\n    onBlur: blur,\n    onKeyDown: step,\n  };\n\n  return { shownIndex, isActive, isReadingByKeys, handlers };\n}\n\ntype BubbleAlign = 'start' | 'center' | 'end';\n\nconst BUBBLE_ALIGN: Record<BubbleAlign, string> = {\n  start: '-translate-x-3',\n  center: '-translate-x-1/2',\n  end: '-translate-x-[calc(100%-0.75rem)]',\n};\n\n/** A point in the first or last third of the plot keeps its bubble inside the plot on a phone. */\nconst START_SHARE = 1 / 3;\nconst END_SHARE = 2 / 3;\n\nexport function bubbleAlignOf(index: number, count: number): BubbleAlign {\n  const lastIndex = Math.max(count - 1, 1);\n  const share = index / lastIndex;\n  if (share < START_SHARE) {\n    return 'start';\n  }\n  if (share > END_SHARE) {\n    return 'end';\n  }\n  return 'center';\n}\n\ntype ChartBubbleProps = {\n  left: string;\n  top: number;\n  align: BubbleAlign;\n  isVisible: boolean;\n  children: React.ReactNode;\n};\n\n/** The one value bubble of a chart. It stays mounted so it can fade out where it was. */\nexport function ChartBubble({\n  left,\n  top,\n  align,\n  isVisible,\n  children,\n}: ChartBubbleProps) {\n  const position = { left, top };\n\n  return (\n    <div\n      aria-hidden='true'\n      className='pointer-events-none absolute z-10 w-0'\n      style={position}\n    >\n      <div\n        className={cn(\n          'surface-raised flex w-max -translate-y-full flex-col gap-0.5 rounded-lg px-2.5 py-1.5 text-xs whitespace-nowrap',\n          'origin-bottom transition-[opacity,scale] duration-[125ms] ease-(--ease-out-strong)',\n          BUBBLE_ALIGN[align],\n          !isVisible && 'scale-[0.97] opacity-0'\n        )}\n      >\n        {children}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/chart-kit.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/overview-figures.ts",
      "content": "import {\n  METRICS,\n  PERIODS,\n  SERIES,\n  type MetricDefinition,\n  type MetricId,\n  type Period,\n  type PeriodId,\n} from './data';\n\nconst NUMBER_FORMAT = new Intl.NumberFormat('en');\n\nexport type MetricFigure = {\n  metric: MetricDefinition;\n  total: number;\n  hint: string;\n};\n\nexport function periodOf(periodId: PeriodId) {\n  const period = PERIODS.find((candidate) => candidate.id === periodId);\n  if (period) {\n    return period;\n  }\n  return PERIODS[0];\n}\n\nexport function metricOf(metricId: MetricId) {\n  const metric = METRICS.find((candidate) => candidate.id === metricId);\n  if (metric) {\n    return metric;\n  }\n  return METRICS[0];\n}\n\nfunction sumOf(values: number[]) {\n  return values.reduce((total, value) => total + value, 0);\n}\n\nfunction totalOf(metric: MetricDefinition, values: number[]) {\n  const sum = sumOf(values);\n  if (metric.aggregate === 'sum') {\n    return sum;\n  }\n  const average = sum / values.length;\n  return Math.round(average);\n}\n\nexport function formatMetric(metric: MetricDefinition, value: number) {\n  const digits = NUMBER_FORMAT.format(value);\n  return `${digits}${metric.suffix}`;\n}\n\nfunction aggregateLineOf(metric: MetricDefinition, period: Period) {\n  const count = period.points.length;\n  if (metric.aggregate === 'sum') {\n    return `Sum of ${count} ${period.unitPlural}`;\n  }\n  return `Average of ${count} ${period.unitPlural}`;\n}\n\nfunction percentChangeOf(total: number, previousTotal: number) {\n  const difference = total - previousTotal;\n  const ratio = difference / previousTotal;\n  const percent = ratio * 100;\n  return Math.round(percent);\n}\n\nfunction percentLineOf(percent: number, previous: string) {\n  if (percent === 0) {\n    return `same as ${previous}`;\n  }\n  if (percent > 0) {\n    return `up ${percent}% on ${previous}`;\n  }\n  const drop = Math.abs(percent);\n  return `down ${drop}% on ${previous}`;\n}\n\nfunction pointsWordOf(points: number) {\n  if (points === 1) {\n    return 'point';\n  }\n  return 'points';\n}\n\nfunction pointsLineOf(difference: number, previous: string) {\n  if (difference === 0) {\n    return `same as ${previous}`;\n  }\n  const points = Math.abs(difference);\n  const word = pointsWordOf(points);\n  if (difference > 0) {\n    return `up ${points} ${word} on ${previous}`;\n  }\n  return `down ${points} ${word} on ${previous}`;\n}\n\nfunction reviewLineOf(difference: number, previous: string) {\n  if (difference === 0) {\n    return `as fast as ${previous}`;\n  }\n  const hours = Math.abs(difference);\n  if (difference < 0) {\n    return `${hours}h faster than ${previous}`;\n  }\n  return `${hours}h slower than ${previous}`;\n}\n\nfunction changeLineOf(\n  metric: MetricDefinition,\n  total: number,\n  previousTotal: number,\n  period: Period\n) {\n  const count = period.points.length;\n  const previous = `the previous ${count}`;\n  if (metric.change === 'percent') {\n    const percent = percentChangeOf(total, previousTotal);\n    return percentLineOf(percent, previous);\n  }\n  const difference = total - previousTotal;\n  if (metric.change === 'points') {\n    return pointsLineOf(difference, previous);\n  }\n  return reviewLineOf(difference, previous);\n}\n\nexport function figuresOf(periodId: PeriodId): MetricFigure[] {\n  const period = periodOf(periodId);\n  return METRICS.map((metric) => {\n    const series = SERIES[periodId][metric.id];\n    const total = totalOf(metric, series.values);\n    const aggregateLine = aggregateLineOf(metric, period);\n    const changeLine = changeLineOf(\n      metric,\n      total,\n      series.previousTotal,\n      period\n    );\n    return {\n      metric,\n      total,\n      hint: `${aggregateLine}, ${changeLine}`,\n    };\n  });\n}\n\nexport function chartPointsOf(periodId: PeriodId, metricId: MetricId) {\n  const period = periodOf(periodId);\n  const series = SERIES[periodId][metricId];\n  return period.points.map((point, index) => ({\n    axisLabel: point.axisLabel,\n    label: point.label,\n    value: series.values[index],\n  }));\n}\n\nexport function csvRowsOf(periodId: PeriodId) {\n  const period = periodOf(periodId);\n  const headings = METRICS.map((metric) => metric.csvHeading);\n  const header = ['Period', ...headings];\n  const rows = period.points.map((point, index) => {\n    const cells = METRICS.map((metric) => {\n      const value = SERIES[periodId][metric.id].values[index];\n      return String(value);\n    });\n    return [point.label, ...cells];\n  });\n  return [header, ...rows];\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/overview-figures.ts"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/weekly-report-page.tsx",
      "content": "'use client';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from '@/registry/ndeko/ui/select';\nimport { Skeleton } from '@/registry/ndeko/ui/skeleton';\n\nimport { MEMBERS, TEAM_NAME, WEEKS, type Member, type Week } from './data';\nimport { DayBars } from './day-bars';\nimport { DurationFigure } from './duration-figure';\nimport {\n  averageWorkdayMinutesOf,\n  csvRowsOf,\n  dayBarsOf,\n  memberOf,\n  rankingOf,\n  totalMinutesOf,\n  weekOf,\n  workingDaysSoFarOf,\n  type Scope,\n  type WeekQuery,\n} from './weekly-figures';\nimport { ProjectRanking } from './project-ranking';\nimport {\n  ExportButton,\n  PeriodSwitch,\n  REPORT_SURFACE,\n  ReportToolbar,\n  downloadCsv,\n  useSimulatedLoad,\n  type PeriodOption,\n} from './report-frame';\n\ntype ScopeOption = { value: Scope; label: string; member: Member | null };\n\nconst WEEK_OPTIONS: PeriodOption<Week['id']>[] = WEEKS.map((week) => ({\n  id: week.id,\n  label: `Week ${week.number}`,\n}));\n\nconst SCOPE_OPTIONS: ScopeOption[] = [\n  { value: 'everyone', label: 'Everyone', member: null },\n  ...MEMBERS.map((member) => ({\n    value: member.id,\n    label: member.name,\n    member,\n  })),\n];\n\nconst INITIAL_QUERY: WeekQuery = { weekId: 'w45', scope: 'everyone' };\n\nconst SKELETON_ROWS = ['first', 'second', 'third', 'fourth'];\n\nfunction queryKeyOf(query: WeekQuery) {\n  return `${query.weekId}:${query.scope}`;\n}\n\nfunction dayCountLabelOf(count: number, singular: string, plural: string) {\n  if (count === 1) {\n    return `1 ${singular}`;\n  }\n  return `${count} ${plural}`;\n}\n\nfunction dayNoteOf(week: Week) {\n  if (week.todayIndex === null) {\n    return 'Monday to Sunday';\n  }\n  const today = week.days[week.todayIndex];\n  const lastIndex = week.days.length - 1;\n  const aheadCount = lastIndex - week.todayIndex;\n  const aheadLabel = dayCountLabelOf(aheadCount, 'day', 'days');\n  return `${today.name} so far, ${aheadLabel} ahead`;\n}\n\nfunction scopeLabelOf(member: Member | null) {\n  if (member) {\n    return member.name;\n  }\n  return TEAM_NAME;\n}\n\nfunction firstNameOf(member: Member | null) {\n  if (!member) {\n    return 'the team';\n  }\n  const [firstName] = member.name.split(' ');\n  return firstName;\n}\n\nfunction MemberFace({ member }: { member: Member }) {\n  return <Avatar className='size-5' seed={member.name} />;\n}\n\nfunction WeekSkeleton() {\n  return (\n    <div\n      aria-hidden='true'\n      className='grid gap-4 lg:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]'\n    >\n      <div className={cn(REPORT_SURFACE, 'flex flex-col gap-5 p-5')}>\n        <Skeleton className='h-3.5 w-28' />\n        <div className='flex gap-8'>\n          <Skeleton className='h-9 w-24' />\n          <Skeleton className='h-9 w-24' />\n        </div>\n        <Skeleton className='h-[204px] w-full rounded-lg' />\n      </div>\n      <div className={cn(REPORT_SURFACE, 'flex flex-col gap-4 p-5')}>\n        <Skeleton className='h-3.5 w-36' />\n        {SKELETON_ROWS.map((row) => (\n          <div key={row} className='flex flex-col gap-2'>\n            <Skeleton className='h-3 w-full' />\n            <Skeleton className='h-1 w-3/4' />\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n\nexport function WeeklyReportPage() {\n  const load = useSimulatedLoad<WeekQuery>(INITIAL_QUERY, queryKeyOf);\n  const shownQuery = load.loaded ?? load.requested;\n  const week = weekOf(shownQuery.weekId);\n  const member = memberOf(shownQuery.scope);\n  const bars = dayBarsOf(shownQuery);\n  const totalMinutes = totalMinutesOf(bars);\n  const averageMinutes = averageWorkdayMinutesOf(bars, week);\n  const workingDays = workingDaysSoFarOf(week);\n  const ranking = rankingOf(shownQuery);\n  const isEmptyWeek = totalMinutes === 0;\n  const scopeLabel = scopeLabelOf(member);\n  const title = `Week ${week.number}`;\n  const meta = `${week.rangeLabel} · ${scopeLabel}`;\n  const dayNote = dayNoteOf(week);\n  const workingDaysLabel = dayCountLabelOf(\n    workingDays,\n    'working day',\n    'working days'\n  );\n  const projectCountLabel = dayCountLabelOf(\n    ranking.projectCount,\n    'project',\n    'projects'\n  );\n  const chartTitle = `Hours by day in week ${week.number}, ${scopeLabel}`;\n  const firstName = firstNameOf(member);\n  const emptyLine = `Nothing to rank for ${firstName} in week ${week.number}`;\n\n  function changeWeek(weekId: Week['id']) {\n    load.request((previous) => ({ ...previous, weekId }));\n  }\n\n  function changeScope(value: unknown) {\n    const option = SCOPE_OPTIONS.find((candidate) => candidate.value === value);\n    if (!option) {\n      return;\n    }\n    load.request((previous) => ({ ...previous, scope: option.value }));\n  }\n\n  function showEveryone() {\n    load.request((previous) => ({ ...previous, scope: 'everyone' }));\n  }\n\n  function exportWeek() {\n    const rows = csvRowsOf(bars);\n    const fileName = `tidewell-week-${week.number}-${shownQuery.scope}.csv`;\n    downloadCsv(fileName, rows);\n  }\n\n  return (\n    <div className='min-h-0 w-full flex-1 overflow-y-auto'>\n      <ReportToolbar title={title} meta={meta}>\n        <Select\n          items={SCOPE_OPTIONS}\n          value={load.requested.scope}\n          onValueChange={changeScope}\n        >\n          <SelectTrigger aria-label='Whose time' className='w-40 sm:w-44'>\n            <SelectValue />\n          </SelectTrigger>\n          <SelectContent align='end'>\n            {SCOPE_OPTIONS.map((option) => (\n              <SelectItem key={option.value} value={option.value}>\n                {option.member && <MemberFace member={option.member} />}\n                {option.label}\n              </SelectItem>\n            ))}\n          </SelectContent>\n        </Select>\n        <ExportButton disabled={load.isFirstLoad} onExport={exportWeek} />\n      </ReportToolbar>\n      <div className='mx-auto flex w-full max-w-5xl flex-col gap-4 px-4 py-5 md:px-6'>\n        <PeriodSwitch\n          label='Week'\n          options={WEEK_OPTIONS}\n          value={load.requested.weekId}\n          isUpdating={load.isUpdating}\n          onValueChange={changeWeek}\n        />\n        {load.isFirstLoad && <WeekSkeleton />}\n        {!load.isFirstLoad && (\n          <div\n            aria-busy={load.isUpdating}\n            className='grid items-start gap-4 lg:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]'\n          >\n            <section\n              aria-label='Hours by day'\n              className={cn(REPORT_SURFACE, 'flex flex-col gap-5 p-5')}\n            >\n              <div className='flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1'>\n                <div className='flex flex-col gap-0.5'>\n                  <h2 className='text-sm font-medium'>Hours by day</h2>\n                  <p className='text-muted-foreground text-xs'>{dayNote}</p>\n                </div>\n                <span className='text-muted-foreground text-xs'>\n                  Illustrative figures\n                </span>\n              </div>\n              <div className='flex flex-wrap gap-x-10 gap-y-3'>\n                <div className='flex flex-col gap-0.5'>\n                  <span className='text-muted-foreground text-xs'>Tracked</span>\n                  <DurationFigure\n                    minutes={totalMinutes}\n                    className='text-lg leading-7 font-semibold'\n                  />\n                </div>\n                <div className='flex flex-col gap-0.5'>\n                  <span className='text-muted-foreground text-xs'>\n                    Average a working day\n                  </span>\n                  <DurationFigure\n                    minutes={averageMinutes}\n                    className='text-lg leading-7 font-semibold'\n                  />\n                  <span className='text-muted-foreground text-xs'>\n                    {`Over ${workingDaysLabel}`}\n                  </span>\n                </div>\n              </div>\n              <DayBars\n                title={chartTitle}\n                bars={bars}\n                emptyState={\n                  isEmptyWeek && (\n                    <div className='bg-card flex flex-col items-center gap-3 rounded-lg px-3 py-2'>\n                      <p className='text-[13px] font-medium text-balance'>\n                        {`${scopeLabel} has no time in week ${week.number}`}\n                      </p>\n                      <Button\n                        variant='outline'\n                        size='sm'\n                        onClick={showEveryone}\n                      >\n                        Show everyone\n                      </Button>\n                    </div>\n                  )\n                }\n              />\n            </section>\n            <section\n              aria-label='Where the time went'\n              className={cn(REPORT_SURFACE, 'flex flex-col gap-3 p-5')}\n            >\n              <div className='flex items-baseline justify-between gap-3'>\n                <h2 className='text-sm font-medium'>Where the time went</h2>\n                <span className='text-muted-foreground text-xs tabular-nums'>\n                  {projectCountLabel}\n                </span>\n              </div>\n              <ProjectRanking\n                rows={ranking.rows}\n                other={ranking.other}\n                emptyLine={emptyLine}\n              />\n            </section>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/weekly-report-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/day-bars.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport {\n  ChartBubble,\n  bubbleAlignOf,\n  columnCenterOf,\n  niceScale,\n  percentOf,\n  useActiveIndex,\n} from './chart-kit';\nimport { formatDuration, type DayBar } from './weekly-figures';\n\nconst PLOT_HEIGHT = 180;\n\nconst MAX_LINES = 4;\n\nconst EMPTY_SCALE_HOURS = 8;\n\nconst STUB_PX = 3;\n\nconst BUBBLE_GAP_PX = 8;\n\nconst MOVE_TRANSITION: Transition = {\n  duration: 0.3,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nfunction moveTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MOVE_TRANSITION;\n}\n\nfunction scaleHoursOf(bars: DayBar[]) {\n  const minutes = bars.map((bar) => bar.minutes);\n  const maxMinutes = Math.max(...minutes);\n  if (maxMinutes === 0) {\n    return EMPTY_SCALE_HOURS;\n  }\n  return maxMinutes / 60;\n}\n\nfunction filledRatioOf(bar: DayBar, topMinutes: number) {\n  if (bar.minutes === 0) {\n    return STUB_PX / PLOT_HEIGHT;\n  }\n  return bar.minutes / topMinutes;\n}\n\nfunction hiddenShareOf(ratio: number) {\n  const hidden = 1 - ratio;\n  return percentOf(hidden);\n}\n\nfunction tickTopOf(tickHours: number, topHours: number) {\n  const ratio = tickHours / topHours;\n  const fromBottom = ratio * PLOT_HEIGHT;\n  return PLOT_HEIGHT - fromBottom;\n}\n\nfunction bubbleTopOf(bar: DayBar, topMinutes: number) {\n  if (bar.isAhead) {\n    const middle = PLOT_HEIGHT / 2;\n    return middle - BUBBLE_GAP_PX;\n  }\n  const ratio = filledRatioOf(bar, topMinutes);\n  const barHeight = ratio * PLOT_HEIGHT;\n  const barTop = PLOT_HEIGHT - barHeight;\n  return barTop - BUBBLE_GAP_PX;\n}\n\nfunction bubbleValueOf(bar: DayBar) {\n  if (bar.isAhead) {\n    return 'Day ahead';\n  }\n  return formatDuration(bar.minutes);\n}\n\nfunction bubbleLabelOf(bar: DayBar) {\n  if (bar.isToday) {\n    return `${bar.label}, so far`;\n  }\n  return bar.label;\n}\n\nfunction tableValueOf(bar: DayBar) {\n  if (bar.isAhead) {\n    return 'Day ahead';\n  }\n  return formatDuration(bar.minutes);\n}\n\ntype DayBarsProps = {\n  title: string;\n  bars: DayBar[];\n  /** Shown over the empty plot, which keeps its hour lines and day slots. */\n  emptyState?: React.ReactNode;\n};\n\n/** Hours per day as rounded bars. Bars move to their new height when the data changes, never on mount. */\nexport function DayBars({ title, bars, emptyState }: DayBarsProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const transition = moveTransitionOf(shouldReduceMotion);\n  const count = bars.length;\n  const scaleHours = scaleHoursOf(bars);\n  const scale = niceScale(scaleHours, MAX_LINES);\n  const topMinutes = scale.top * 60;\n  const defaultIndex = defaultIndexOf(bars);\n  const reading = useActiveIndex(count, defaultIndex);\n  const shownBar = bars[reading.shownIndex];\n  const shownCenter = columnCenterOf(reading.shownIndex, count);\n  const shownLeft = percentOf(shownCenter);\n  const bubbleTop = bubbleTopOf(shownBar, topMinutes);\n  const bubbleAlign = bubbleAlignOf(reading.shownIndex, count);\n  const bubbleLabel = bubbleLabelOf(shownBar);\n  const bubbleValue = bubbleValueOf(shownBar);\n  const readingText = `${bubbleLabel}: ${bubbleValue}`;\n  const plotHeight = { height: PLOT_HEIGHT };\n\n  return (\n    <div className='flex flex-col'>\n      <div className='grid grid-cols-[2.5rem_minmax(0,1fr)]'>\n        <div aria-hidden='true' className='relative' style={plotHeight}>\n          {scale.ticks.map((tick) => {\n            const top = tickTopOf(tick, scale.top);\n\n            return (\n              <span\n                key={tick}\n                className='text-muted-foreground absolute right-2.5 -translate-y-1/2 text-[11px] tabular-nums'\n                style={{ top }}\n              >\n                {`${tick}h`}\n              </span>\n            );\n          })}\n        </div>\n        <div\n          role='group'\n          tabIndex={0}\n          aria-label={`${title}. Use the arrow keys to read each day.`}\n          className='focus-visible:ring-ring/25 relative touch-pan-y rounded-md outline-none focus-visible:ring-[3px]'\n          style={plotHeight}\n          {...reading.handlers}\n        >\n          {scale.ticks.map((tick) => {\n            const top = tickTopOf(tick, scale.top);\n\n            return (\n              <span\n                key={tick}\n                aria-hidden='true'\n                className='hairline-t border-border absolute inset-x-0'\n                style={{ top }}\n              />\n            );\n          })}\n          <div aria-hidden='true' className='absolute inset-0 flex'>\n            {bars.map((bar, index) => {\n              const isShown = index === reading.shownIndex;\n              const isDimmed = reading.isActive && !isShown;\n              const isEmptyDay = bar.minutes === 0;\n              const ratio = filledRatioOf(bar, topMinutes);\n              const offset = hiddenShareOf(ratio);\n\n              return (\n                <div key={bar.label} className='flex flex-1 justify-center'>\n                  {bar.isAhead && (\n                    <span className='hairline-border border-foreground/15 h-full w-[56%] max-w-10 rounded-md border-dashed' />\n                  )}\n                  {!bar.isAhead && (\n                    <span className='relative h-full w-[56%] max-w-10 overflow-hidden'>\n                      <motion.span\n                        initial={false}\n                        animate={{ y: offset }}\n                        transition={transition}\n                        className={cn(\n                          'absolute inset-0 rounded-t-[5px] transition-opacity duration-150',\n                          isEmptyDay && 'bg-foreground/15',\n                          !isEmptyDay && 'bg-primary',\n                          isDimmed && 'opacity-55'\n                        )}\n                      />\n                    </span>\n                  )}\n                </div>\n              );\n            })}\n          </div>\n          {emptyState && (\n            <div className='pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center *:pointer-events-auto'>\n              {emptyState}\n            </div>\n          )}\n          <ChartBubble\n            left={shownLeft}\n            top={bubbleTop}\n            align={bubbleAlign}\n            isVisible={reading.isActive}\n          >\n            <span className='text-muted-foreground'>{bubbleLabel}</span>\n            <span className='text-[13px] font-medium tabular-nums'>\n              {bubbleValue}\n            </span>\n          </ChartBubble>\n        </div>\n        <span aria-hidden='true' />\n        <div aria-hidden='true' className='mt-2 flex'>\n          {bars.map((bar) => (\n            <span\n              key={bar.label}\n              className={cn(\n                'text-muted-foreground flex-1 text-center text-[11px] whitespace-nowrap tabular-nums',\n                bar.isToday && 'text-foreground font-medium'\n              )}\n            >\n              {bar.axisLabel}\n            </span>\n          ))}\n        </div>\n      </div>\n      <span aria-live='polite' className='sr-only'>\n        {reading.isReadingByKeys && readingText}\n      </span>\n      <div className='sr-only'>\n        <table>\n          <caption>{title}</caption>\n          <thead>\n            <tr>\n              <th scope='col'>Day</th>\n              <th scope='col'>Tracked time</th>\n            </tr>\n          </thead>\n          <tbody>\n            {bars.map((bar) => (\n              <tr key={bar.label}>\n                <th scope='row'>{bubbleLabelOf(bar)}</th>\n                <td>{tableValueOf(bar)}</td>\n              </tr>\n            ))}\n          </tbody>\n        </table>\n      </div>\n    </div>\n  );\n}\n\n/** The bubble opens on today, or on the last day with time when the week is over. */\nfunction defaultIndexOf(bars: DayBar[]) {\n  const todayIndex = bars.findIndex((bar) => bar.isToday);\n  if (todayIndex >= 0) {\n    return todayIndex;\n  }\n  let lastWorkedIndex = 0;\n  bars.forEach((bar, index) => {\n    if (bar.minutes > 0) {\n      lastWorkedIndex = index;\n    }\n  });\n  return lastWorkedIndex;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/day-bars.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/project-ranking.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { DurationFigure } from './duration-figure';\nimport type { OtherProjects, RankedProject } from './weekly-figures';\n\nconst ROW_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst ROW_OUT: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst MOVE_TRANSITION: Transition = {\n  duration: 0.3,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst ROW_VARIANTS: Variants = {\n  hidden: {\n    height: 0,\n    opacity: 0,\n    overflow: 'hidden',\n    transition: ROW_OUT,\n  },\n  shown: {\n    height: 'auto',\n    opacity: 1,\n    transition: ROW_IN,\n    transitionEnd: { overflow: 'visible' },\n  },\n};\n\nconst ROW_FADE: Variants = {\n  hidden: { opacity: 0, transition: ROW_OUT },\n  shown: { opacity: 1, transition: ROW_IN },\n};\n\nfunction rowVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return ROW_FADE;\n  }\n  return ROW_VARIANTS;\n}\n\nfunction moveTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MOVE_TRANSITION;\n}\n\nfunction meterToneOf(rank: number) {\n  if (rank === 0) {\n    return 'bg-primary';\n  }\n  return 'bg-foreground/25';\n}\n\nfunction otherLabelOf(count: number) {\n  if (count === 1) {\n    return '1 other project';\n  }\n  return `${count} other projects`;\n}\n\nfunction percentAmountOf(share: number) {\n  const percent = share * 100;\n  return Math.round(percent);\n}\n\ntype ShareMeterProps = {\n  share: number;\n  tone: string;\n  transition: Transition;\n};\n\n/** A thin meter whose fill slides into place, so its rounded end never stretches. */\nfunction ShareMeter({ share, tone, transition }: ShareMeterProps) {\n  const hiddenShare = 1 - share;\n  const hiddenPercent = hiddenShare * 100;\n  const offset = `-${hiddenPercent}%`;\n\n  return (\n    <span className='bg-foreground/[0.06] relative block h-1 overflow-hidden rounded-full'>\n      <motion.span\n        initial={false}\n        animate={{ x: offset }}\n        transition={transition}\n        className={cn('absolute inset-0 rounded-full', tone)}\n      />\n    </span>\n  );\n}\n\ntype RankRowProps = {\n  label: string;\n  minutes: number;\n  share: number;\n  tone: string;\n  transition: Transition;\n  isMuted?: boolean;\n};\n\nfunction RankRow({\n  label,\n  minutes,\n  share,\n  tone,\n  transition,\n  isMuted,\n}: RankRowProps) {\n  const shareAmount = percentAmountOf(share);\n\n  return (\n    <div className='grid grid-cols-[2.5rem_minmax(0,1fr)_auto] items-baseline gap-x-2 gap-y-1.5 py-2'>\n      <MotionNumber\n        value={shareAmount}\n        suffix='%'\n        className='text-muted-foreground text-xs'\n      />\n      <span\n        className={cn(\n          'truncate text-[13px] font-medium',\n          isMuted && 'text-muted-foreground font-normal'\n        )}\n      >\n        {label}\n      </span>\n      <DurationFigure minutes={minutes} className='text-[13px]' />\n      <span className='col-start-2 col-end-4'>\n        <ShareMeter share={share} tone={tone} transition={transition} />\n      </span>\n    </div>\n  );\n}\n\ntype ProjectRankingProps = {\n  rows: RankedProject[];\n  other: OtherProjects | null;\n  emptyLine: string;\n};\n\n/** Shares read as text first: percentage, name, a thin meter, the time. Rows travel when the ranking changes. */\nexport function ProjectRanking({\n  rows,\n  other,\n  emptyLine,\n}: ProjectRankingProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const rowVariants = rowVariantsOf(shouldReduceMotion);\n  const moveTransition = moveTransitionOf(shouldReduceMotion);\n  const isEmpty = rows.length === 0;\n  const rowTransition = { layout: moveTransition };\n\n  return (\n    <div className='flex flex-col'>\n      {isEmpty && (\n        <p className='text-muted-foreground py-6 text-center text-[13px] text-balance'>\n          {emptyLine}\n        </p>\n      )}\n      <ol className='flex flex-col'>\n        <AnimatePresence initial={false}>\n          {rows.map((row, rank) => (\n            <motion.li\n              key={row.id}\n              layout='position'\n              variants={rowVariants}\n              initial='hidden'\n              animate='shown'\n              exit='hidden'\n              transition={rowTransition}\n            >\n              <RankRow\n                label={row.name}\n                minutes={row.minutes}\n                share={row.share}\n                tone={meterToneOf(rank)}\n                transition={moveTransition}\n              />\n            </motion.li>\n          ))}\n        </AnimatePresence>\n      </ol>\n      <AnimatePresence initial={false}>\n        {other && (\n          <motion.div\n            key='other'\n            layout='position'\n            variants={rowVariants}\n            initial='hidden'\n            animate='shown'\n            exit='hidden'\n            transition={rowTransition}\n          >\n            <RankRow\n              label={otherLabelOf(other.count)}\n              minutes={other.minutes}\n              share={other.share}\n              tone='bg-foreground/15'\n              transition={moveTransition}\n              isMuted\n            />\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/project-ranking.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/duration-figure.tsx",
      "content": "import { MotionNumber } from '@/components/core/motion-number';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { durationPartsOf, formatDuration } from './weekly-figures';\n\nconst TWO_DIGITS: Intl.NumberFormatOptions = { minimumIntegerDigits: 2 };\n\ntype DurationFigureProps = {\n  minutes: number;\n  className?: string;\n};\n\n/** Hours and minutes roll as two numbers, but a screen reader hears the duration once. */\nexport function DurationFigure({ minutes, className }: DurationFigureProps) {\n  const parts = durationPartsOf(minutes);\n  const text = formatDuration(minutes);\n\n  return (\n    <span\n      className={cn(\n        'inline-flex items-baseline whitespace-nowrap tabular-nums',\n        className\n      )}\n    >\n      <span className='sr-only'>{text}</span>\n      <span aria-hidden='true'>\n        <MotionNumber value={parts.hours} suffix='h' />{' '}\n        <MotionNumber value={parts.minutes} format={TWO_DIGITS} suffix='m' />\n      </span>\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/duration-figure.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/weekly-figures.ts",
      "content": "import {\n  MEMBERS,\n  MEMBER_WEEKS,\n  PROJECTS,\n  WEEKS,\n  type Member,\n  type MemberId,\n  type ProjectId,\n  type Week,\n  type WeekId,\n} from './data';\n\nexport type Scope = 'everyone' | MemberId;\n\nexport type WeekQuery = { weekId: WeekId; scope: Scope };\n\nexport type DayBar = {\n  axisLabel: string;\n  label: string;\n  minutes: number;\n  isToday: boolean;\n  isAhead: boolean;\n};\n\nexport type RankedProject = {\n  id: ProjectId;\n  name: string;\n  minutes: number;\n  share: number;\n};\n\nexport type OtherProjects = {\n  count: number;\n  minutes: number;\n  share: number;\n};\n\nconst RANKED_ROWS = 4;\n\nconst WORKING_DAYS = 5;\n\nexport function weekOf(weekId: WeekId) {\n  const week = WEEKS.find((candidate) => candidate.id === weekId);\n  if (week) {\n    return week;\n  }\n  return WEEKS[0];\n}\n\nexport function memberOf(scope: Scope): Member | null {\n  const member = MEMBERS.find((candidate) => candidate.id === scope);\n  if (member) {\n    return member;\n  }\n  return null;\n}\n\nfunction membersIn(scope: Scope): MemberId[] {\n  if (scope === 'everyone') {\n    return MEMBERS.map((member) => member.id);\n  }\n  return [scope];\n}\n\nfunction sumOf(values: number[]) {\n  return values.reduce((total, value) => total + value, 0);\n}\n\nfunction isAheadOf(week: Week, index: number) {\n  if (week.todayIndex === null) {\n    return false;\n  }\n  return index > week.todayIndex;\n}\n\nexport function dayBarsOf(query: WeekQuery): DayBar[] {\n  const week = weekOf(query.weekId);\n  const memberIds = membersIn(query.scope);\n  return week.days.map((day, index) => {\n    const dayMinutes = memberIds.map(\n      (memberId) => MEMBER_WEEKS[memberId][query.weekId].days[index]\n    );\n    const minutes = sumOf(dayMinutes);\n    const isToday = week.todayIndex === index;\n    const isAhead = isAheadOf(week, index);\n    return {\n      axisLabel: `${day.short} ${day.date}`,\n      label: `${day.name} ${day.date} ${day.month}`,\n      minutes,\n      isToday,\n      isAhead,\n    };\n  });\n}\n\nexport function totalMinutesOf(bars: DayBar[]) {\n  const minutes = bars.map((bar) => bar.minutes);\n  return sumOf(minutes);\n}\n\n/** Monday to Friday, counted up to today while the week is running. */\nexport function workingDaysSoFarOf(week: Week) {\n  if (week.todayIndex === null) {\n    return WORKING_DAYS;\n  }\n  const daysSoFar = week.todayIndex + 1;\n  return Math.min(daysSoFar, WORKING_DAYS);\n}\n\n/** Weekend time stays in the total but not in the average of a working day. */\nexport function averageWorkdayMinutesOf(bars: DayBar[], week: Week) {\n  const workingDays = workingDaysSoFarOf(week);\n  const weekdayBars = bars.slice(0, WORKING_DAYS);\n  const weekdayMinutes = totalMinutesOf(weekdayBars);\n  const average = weekdayMinutes / workingDays;\n  return Math.round(average);\n}\n\nfunction addMinutes(\n  totals: Map<ProjectId, number>,\n  projectId: ProjectId,\n  minutes: number\n) {\n  const current = totals.get(projectId) ?? 0;\n  const next = current + minutes;\n  totals.set(projectId, next);\n}\n\nfunction addMemberWeek(\n  totals: Map<ProjectId, number>,\n  memberId: MemberId,\n  weekId: WeekId\n) {\n  const memberWeek = MEMBER_WEEKS[memberId][weekId];\n  const weekTotal = sumOf(memberWeek.days);\n  const lastMixIndex = memberWeek.mix.length - 1;\n  let allocated = 0;\n  memberWeek.mix.forEach((entry, index) => {\n    const isLast = index === lastMixIndex;\n    if (isLast) {\n      const remainder = weekTotal - allocated;\n      addMinutes(totals, entry.projectId, remainder);\n      return;\n    }\n    const rawMinutes = weekTotal * entry.share;\n    const minutes = Math.round(rawMinutes);\n    allocated += minutes;\n    addMinutes(totals, entry.projectId, minutes);\n  });\n}\n\nfunction projectNameOf(projectId: ProjectId) {\n  const project = PROJECTS.find((candidate) => candidate.id === projectId);\n  if (project) {\n    return project.name;\n  }\n  return projectId;\n}\n\nfunction shareOf(minutes: number, totalMinutes: number) {\n  if (totalMinutes === 0) {\n    return 0;\n  }\n  return minutes / totalMinutes;\n}\n\nfunction byMinutesThenName(first: RankedProject, second: RankedProject) {\n  const difference = second.minutes - first.minutes;\n  if (difference !== 0) {\n    return difference;\n  }\n  return first.name.localeCompare(second.name);\n}\n\nexport function rankingOf(query: WeekQuery) {\n  const totals = new Map<ProjectId, number>();\n  const memberIds = membersIn(query.scope);\n  memberIds.forEach((memberId) =>\n    addMemberWeek(totals, memberId, query.weekId)\n  );\n  const allMinutes = Array.from(totals.values());\n  const totalMinutes = sumOf(allMinutes);\n  const entries = Array.from(totals.entries());\n  const projects = entries.map(([projectId, minutes]) => ({\n    id: projectId,\n    name: projectNameOf(projectId),\n    minutes,\n    share: shareOf(minutes, totalMinutes),\n  }));\n  const sorted = [...projects].sort(byMinutesThenName);\n  const rows = sorted.slice(0, RANKED_ROWS);\n  const rest = sorted.slice(RANKED_ROWS);\n  const restEach = rest.map((project) => project.minutes);\n  const restMinutes = sumOf(restEach);\n  const other = otherOf(rest.length, restMinutes, totalMinutes);\n  return { rows, other, projectCount: sorted.length };\n}\n\nfunction otherOf(\n  count: number,\n  minutes: number,\n  totalMinutes: number\n): OtherProjects | null {\n  if (count === 0) {\n    return null;\n  }\n  const share = shareOf(minutes, totalMinutes);\n  return { count, minutes, share };\n}\n\nexport function durationPartsOf(totalMinutes: number) {\n  const rawHours = totalMinutes / 60;\n  const hours = Math.floor(rawHours);\n  const minutes = totalMinutes % 60;\n  return { hours, minutes };\n}\n\nexport function formatDuration(totalMinutes: number) {\n  const { hours, minutes } = durationPartsOf(totalMinutes);\n  const paddedMinutes = String(minutes).padStart(2, '0');\n  return `${hours}h ${paddedMinutes}m`;\n}\n\nexport function csvRowsOf(bars: DayBar[]) {\n  const header = ['Day', 'Tracked time', 'Minutes'];\n  const rows = bars.map((bar) => {\n    const duration = formatDuration(bar.minutes);\n    const minutes = String(bar.minutes);\n    return [bar.label, duration, minutes];\n  });\n  return [header, ...rows];\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/weekly-figures.ts"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/project-health-page.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { CircleCheckIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Skeleton } from '@/registry/ndeko/ui/skeleton';\nimport { Tabs, TabsList, TabsTab } from '@/registry/ndeko/ui/tabs';\n\nimport { PROJECT, SPRINTS, type Sprint, type SprintId } from './data';\nimport {\n  csvRowsOf,\n  goalOf,\n  needsAttention,\n  rowsOf,\n  sprintOf,\n  totalsOf,\n} from './health-figures';\nimport { GoalCard } from './goal-card';\nimport {\n  ExportButton,\n  PeriodSwitch,\n  REPORT_SURFACE,\n  ReportToolbar,\n  downloadCsv,\n  useSimulatedLoad,\n  type PeriodOption,\n} from './report-frame';\nimport { WorkstreamTable } from './workstream-table';\n\ntype RowFilter = 'all' | 'attention';\n\nconst SPRINT_OPTIONS: PeriodOption<SprintId>[] = SPRINTS.map((sprint) => ({\n  id: sprint.id,\n  label: `Sprint ${sprint.number}`,\n}));\n\nconst CURRENT_SPRINT: SprintId = 's23';\n\nconst SKELETON_ROWS = ['first', 'second', 'third', 'fourth', 'fifth'];\n\nfunction sprintKeyOf(sprintId: SprintId) {\n  return sprintId;\n}\n\nfunction isRowFilter(value: unknown): value is RowFilter {\n  const isAll = value === 'all';\n  const isAttention = value === 'attention';\n  return isAll || isAttention;\n}\n\nfunction peopleLabelOf(count: number) {\n  if (count === 1) {\n    return '1 person';\n  }\n  return `${count} people`;\n}\n\nfunction blockedLabelOf(count: number) {\n  if (count === 0) {\n    return 'nothing blocked';\n  }\n  if (count === 1) {\n    return '1 task blocked';\n  }\n  return `${count} tasks blocked`;\n}\n\nfunction workstreamCountOf(count: number) {\n  if (count === 1) {\n    return '1 workstream';\n  }\n  return `${count} workstreams`;\n}\n\nfunction calmLineOf(sprint: Sprint) {\n  const isRunning = sprint.daysElapsed < sprint.workingDays;\n  if (isRunning) {\n    return `Every workstream is on track in sprint ${sprint.number}`;\n  }\n  return `Every workstream was on track in sprint ${sprint.number}`;\n}\n\nfunction visibleRowsOf<Row>(\n  isAttentionView: boolean,\n  rows: Row[],\n  attentionRows: Row[]\n) {\n  if (isAttentionView) {\n    return attentionRows;\n  }\n  return rows;\n}\n\nfunction totalsWhen<Value>(isShown: boolean, value: Value) {\n  if (isShown) {\n    return value;\n  }\n  return null;\n}\n\nfunction HealthSkeleton() {\n  return (\n    <div aria-hidden='true' className='flex flex-col gap-4'>\n      <div className={cn(REPORT_SURFACE, 'flex flex-col gap-4 p-5')}>\n        <Skeleton className='h-3 w-24' />\n        <Skeleton className='h-4 w-64 max-w-full' />\n        <Skeleton className='h-7 w-40' />\n        <Skeleton className='h-2 w-full rounded-full' />\n        <Skeleton className='h-3 w-56 max-w-full' />\n      </div>\n      <div className={cn(REPORT_SURFACE, 'flex flex-col gap-3 p-5')}>\n        <Skeleton className='h-3.5 w-28' />\n        {SKELETON_ROWS.map((row) => (\n          <Skeleton key={row} className='h-8 w-full' />\n        ))}\n      </div>\n    </div>\n  );\n}\n\nexport function ProjectHealthPage() {\n  const load = useSimulatedLoad<SprintId>(CURRENT_SPRINT, sprintKeyOf);\n  const [filter, setFilter] = useState<RowFilter>('all');\n  const shownSprintId = load.loaded ?? load.requested;\n  const sprint = sprintOf(shownSprintId);\n  const rows = rowsOf(sprint);\n  const totals = totalsOf(rows);\n  const goal = goalOf(sprint, totals);\n  const attentionRows = rows.filter(needsAttention);\n  const isAttentionView = filter === 'attention';\n  const visibleRows = visibleRowsOf(isAttentionView, rows, attentionRows);\n  const isCalm = attentionRows.length === 0;\n  const showsCalmState = isAttentionView && isCalm;\n  const showsTotals = !isAttentionView;\n  const shownTotals = totalsWhen(showsTotals, totals);\n  const peopleLabel = peopleLabelOf(PROJECT.peopleCount);\n  const meta = `${PROJECT.release} · ${sprint.rangeLabel} · ${peopleLabel}`;\n  const workstreamLabel = workstreamCountOf(rows.length);\n  const blockedLabel = blockedLabelOf(totals.blocked);\n  const calmLine = calmLineOf(sprint);\n\n  function changeFilter(value: unknown) {\n    if (isRowFilter(value)) {\n      setFilter(value);\n    }\n  }\n\n  function showAll() {\n    setFilter('all');\n  }\n\n  function exportHealth() {\n    const csvRows = csvRowsOf(rows);\n    const fileName = `${PROJECT.fileSlug}-sprint-${sprint.number}.csv`;\n    downloadCsv(fileName, csvRows);\n  }\n\n  return (\n    <div className='min-h-0 w-full flex-1 overflow-y-auto'>\n      <ReportToolbar title={PROJECT.name} meta={meta}>\n        <ExportButton disabled={load.isFirstLoad} onExport={exportHealth} />\n      </ReportToolbar>\n      <div className='mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-5 md:px-6'>\n        <PeriodSwitch\n          label='Sprint'\n          options={SPRINT_OPTIONS}\n          value={load.requested}\n          isUpdating={load.isUpdating}\n          onValueChange={load.request}\n        />\n        {load.isFirstLoad && <HealthSkeleton />}\n        {!load.isFirstLoad && (\n          <div aria-busy={load.isUpdating} className='flex flex-col gap-4'>\n            <GoalCard sprint={sprint} goal={goal} />\n            <section\n              aria-label='Workstreams'\n              className={cn(REPORT_SURFACE, 'flex flex-col gap-3 pt-4 pb-1')}\n            >\n              <div className='flex flex-wrap items-center justify-between gap-x-3 gap-y-2 px-4'>\n                <div className='flex flex-col gap-0.5'>\n                  <h2 className='text-sm font-medium'>Workstreams</h2>\n                  <p className='text-muted-foreground text-xs tabular-nums'>\n                    {`${workstreamLabel}, ${blockedLabel}`}\n                  </p>\n                </div>\n                <Tabs value={filter} onValueChange={changeFilter}>\n                  <TabsList\n                    variant='segmented'\n                    aria-label='Workstreams to show'\n                  >\n                    <TabsTab value='all'>All</TabsTab>\n                    <TabsTab value='attention'>\n                      Needs attention\n                      <span className='text-muted-foreground text-xs tabular-nums'>\n                        {attentionRows.length}\n                      </span>\n                    </TabsTab>\n                  </TabsList>\n                </Tabs>\n              </div>\n              <WorkstreamTable\n                rows={visibleRows}\n                totals={shownTotals}\n                emptyState={\n                  showsCalmState && (\n                    <div className='flex flex-col items-center gap-3 px-4 py-10 text-center'>\n                      <span className='keycap-3d text-success-foreground flex size-9 items-center justify-center rounded-lg'>\n                        <CircleCheckIcon />\n                      </span>\n                      <p className='text-[13px] font-medium text-balance'>\n                        {calmLine}\n                      </p>\n                      <Button variant='outline' size='sm' onClick={showAll}>\n                        Show all workstreams\n                      </Button>\n                    </div>\n                  )\n                }\n              />\n            </section>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/project-health-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/goal-card.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion, type Transition } from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Wash } from '@/registry/ndeko/ui/wash';\n\nimport type { Sprint } from './data';\nimport { percentAmountOf, type Goal, type GoalTone } from './health-figures';\n\nconst MOVE_TRANSITION: Transition = {\n  duration: 0.3,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst MARKER_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst MARKER_OUT: Transition = { duration: 0.12, ease: [0.23, 1, 0.32, 1] };\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst VERDICT_TONE: Record<GoalTone, string> = {\n  good: 'text-success-foreground',\n  behind: 'text-warning-foreground',\n  neutral: 'text-foreground',\n};\n\nfunction moveTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MOVE_TRANSITION;\n}\n\nfunction taskWordOf(count: number) {\n  if (count === 1) {\n    return 'task';\n  }\n  return 'tasks';\n}\n\nfunction percentTextOf(share: number) {\n  const percent = share * 100;\n  return `${percent}%`;\n}\n\ntype GoalMeterProps = {\n  goal: Goal;\n  transition: Transition;\n};\n\n/** Done against planned, with a marker where the team should be by today. Both slide into place. */\nfunction GoalMeter({ goal, transition }: GoalMeterProps) {\n  const hiddenShare = 1 - goal.share;\n  const hiddenText = percentTextOf(hiddenShare);\n  const fillOffset = `-${hiddenText}`;\n  const taskWord = taskWordOf(goal.planned);\n  const valueText = `${goal.done} of ${goal.planned} ${taskWord} done`;\n  const hasMarker = goal.expectedShare !== null;\n  const markerShare = goal.expectedShare ?? 0;\n  const markerOffset = percentTextOf(markerShare);\n\n  return (\n    <div\n      role='progressbar'\n      aria-label='Sprint progress'\n      aria-valuemin={0}\n      aria-valuemax={goal.planned}\n      aria-valuenow={goal.done}\n      aria-valuetext={valueText}\n      className='bg-foreground/[0.08] relative h-2 rounded-full'\n    >\n      <span className='absolute inset-0 overflow-hidden rounded-full'>\n        <motion.span\n          initial={false}\n          animate={{ x: fillOffset }}\n          transition={transition}\n          className='bg-primary absolute inset-0 rounded-full'\n        />\n      </span>\n      <AnimatePresence initial={false}>\n        {hasMarker && (\n          <motion.span\n            key='marker'\n            aria-hidden='true'\n            initial={{ opacity: 0, x: markerOffset }}\n            animate={{\n              opacity: 1,\n              x: markerOffset,\n              transition: { opacity: MARKER_IN, x: transition },\n            }}\n            exit={{ opacity: 0, transition: MARKER_OUT }}\n            className='pointer-events-none absolute -inset-y-1 left-0 w-full'\n          >\n            <span className='bg-foreground ring-card absolute inset-y-0 left-0 w-0.5 -translate-x-1/2 rounded-full ring-2' />\n          </motion.span>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n\ntype GoalCardProps = {\n  sprint: Sprint;\n  goal: Goal;\n};\n\nexport function GoalCard({ sprint, goal }: GoalCardProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const transition = moveTransitionOf(shouldReduceMotion);\n  const shareAmount = percentAmountOf(goal.share);\n  const hasMarker = goal.expectedShare !== null;\n  const taskWord = taskWordOf(goal.planned);\n\n  return (\n    <section\n      aria-label={`Sprint ${sprint.number} goal`}\n      className='surface-brand relative isolate flex flex-col gap-4 rounded-xl p-5'\n    >\n      <Wash />\n      <div className='flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1'>\n        <p className='text-muted-foreground text-xs font-medium'>\n          {`Sprint ${sprint.number} goal`}\n        </p>\n        <span className='text-muted-foreground text-xs'>\n          Illustrative figures\n        </span>\n      </div>\n      <p className='text-base font-semibold text-balance'>{sprint.goal}</p>\n      <div className='flex flex-wrap items-baseline justify-between gap-x-6 gap-y-1'>\n        <p className='flex items-baseline gap-1.5'>\n          <MotionNumber value={goal.done} className='text-2xl font-semibold' />\n          <span className='text-muted-foreground text-[13px]'>of</span>\n          <MotionNumber\n            value={goal.planned}\n            className='text-[13px] font-medium'\n          />\n          <span className='text-muted-foreground text-[13px]'>\n            {`${taskWord} done`}\n          </span>\n        </p>\n        <MotionNumber\n          value={shareAmount}\n          suffix='%'\n          className='text-lg font-semibold'\n        />\n      </div>\n      <GoalMeter goal={goal} transition={transition} />\n      <div className='flex flex-wrap items-center justify-between gap-x-4 gap-y-1 text-xs'>\n        <span className={cn('font-medium', VERDICT_TONE[goal.tone])}>\n          {goal.verdict}\n        </span>\n        <span className='text-muted-foreground flex items-center gap-1.5'>\n          {hasMarker && (\n            <span\n              aria-hidden='true'\n              className='bg-foreground inline-block h-2.5 w-0.5 rounded-full'\n            />\n          )}\n          {goal.timeLine}\n        </span>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/goal-card.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/workstream-table.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Chip } from '@/registry/ndeko/ui/chip';\n\nimport { HEALTH_META, type Lead } from './data';\nimport {\n  percentAmountOf,\n  type Totals,\n  type WorkstreamRow,\n} from './health-figures';\n\nconst TABLE_GRID =\n  'grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 px-4 sm:grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)_2.75rem_2.75rem_3.5rem_minmax(5.5rem,1fr)_6rem]';\n\nconst WIDE_CELL = 'hidden sm:flex';\n\nconst FIGURE_CELL = 'hidden justify-end text-[13px] sm:flex';\n\nconst ROW_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst ROW_OUT: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst MOVE_TRANSITION: Transition = {\n  duration: 0.3,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst ROW_VARIANTS: Variants = {\n  hidden: {\n    height: 0,\n    opacity: 0,\n    overflow: 'hidden',\n    transition: ROW_OUT,\n  },\n  shown: {\n    height: 'auto',\n    opacity: 1,\n    transition: ROW_IN,\n    transitionEnd: { overflow: 'visible' },\n  },\n};\n\nconst ROW_FADE: Variants = {\n  hidden: { opacity: 0, transition: ROW_OUT },\n  shown: { opacity: 1, transition: ROW_IN },\n};\n\nfunction rowVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return ROW_FADE;\n  }\n  return ROW_VARIANTS;\n}\n\nfunction moveTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MOVE_TRANSITION;\n}\n\nfunction firstNameOf(lead: Lead) {\n  const [firstName] = lead.name.split(' ');\n  return firstName;\n}\n\ntype FigureProps = {\n  value: number;\n  isQuiet?: boolean;\n};\n\nfunction Figure({ value, isQuiet }: FigureProps) {\n  return (\n    <MotionNumber\n      value={value}\n      className={cn(isQuiet && 'text-muted-foreground')}\n    />\n  );\n}\n\ntype ProgressCellProps = {\n  share: number;\n  transition: Transition;\n};\n\nfunction ProgressCell({ share, transition }: ProgressCellProps) {\n  const hiddenShare = 1 - share;\n  const hiddenPercent = hiddenShare * 100;\n  const offset = `-${hiddenPercent}%`;\n  const shareAmount = percentAmountOf(share);\n\n  return (\n    <div role='cell' className={cn(WIDE_CELL, 'items-center gap-2')}>\n      <span className='bg-foreground/[0.08] relative block h-1 min-w-0 flex-1 overflow-hidden rounded-full'>\n        <motion.span\n          initial={false}\n          animate={{ x: offset }}\n          transition={transition}\n          className='bg-primary absolute inset-0 rounded-full'\n        />\n      </span>\n      <MotionNumber\n        value={shareAmount}\n        suffix='%'\n        className='text-muted-foreground w-9 justify-end text-xs'\n      />\n    </div>\n  );\n}\n\nfunction LeadCell({ lead }: { lead: Lead }) {\n  return (\n    <div role='cell' className={cn(WIDE_CELL, 'min-w-0 items-center gap-2')}>\n      <Avatar className='size-6' seed={lead.name} />\n      <span className='truncate text-[13px]'>{firstNameOf(lead)}</span>\n    </div>\n  );\n}\n\nfunction HealthChip({ row }: { row: WorkstreamRow }) {\n  const meta = HEALTH_META[row.health];\n\n  return (\n    <Chip color={meta.color}>\n      <span aria-hidden='true' className='size-1.5 rounded-full bg-(--chip)' />\n      {meta.label}\n    </Chip>\n  );\n}\n\ntype WorkstreamTableProps = {\n  rows: WorkstreamRow[];\n  totals: Totals | null;\n  emptyState?: React.ReactNode;\n};\n\n/** One grid for the header, the rows and the totals, so the figures line up. Rows enter and leave in place. */\nexport function WorkstreamTable({\n  rows,\n  totals,\n  emptyState,\n}: WorkstreamTableProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const rowVariants = rowVariantsOf(shouldReduceMotion);\n  const transition = moveTransitionOf(shouldReduceMotion);\n\n  return (\n    <div role='table' aria-label='Workstreams' className='flex flex-col'>\n      <div role='rowgroup'>\n        <div\n          role='row'\n          className={cn(\n            TABLE_GRID,\n            'hairline-b border-border text-muted-foreground h-9 text-xs font-medium'\n          )}\n        >\n          <span role='columnheader'>Workstream</span>\n          <span role='columnheader' className={WIDE_CELL}>\n            Lead\n          </span>\n          <span role='columnheader' className={FIGURE_CELL}>\n            Done\n          </span>\n          <span role='columnheader' className={FIGURE_CELL}>\n            Open\n          </span>\n          <span role='columnheader' className={FIGURE_CELL}>\n            Blocked\n          </span>\n          <span role='columnheader' className={WIDE_CELL}>\n            Progress\n          </span>\n          <span\n            role='columnheader'\n            className='flex justify-end sm:justify-start'\n          >\n            Health\n          </span>\n        </div>\n      </div>\n      <div role='rowgroup' className='hairline-divide-y divide-border'>\n        <AnimatePresence initial={false}>\n          {rows.map((row) => {\n            const isBlockFree = row.blocked === 0;\n            const leadFirstName = firstNameOf(row.lead);\n            const phoneLine = `${row.done} of ${row.planned} done · ${leadFirstName}`;\n\n            return (\n              <motion.div\n                key={row.id}\n                variants={rowVariants}\n                initial='hidden'\n                animate='shown'\n                exit='hidden'\n              >\n                <div role='row' className={cn(TABLE_GRID, 'min-h-12 py-2.5')}>\n                  <div role='cell' className='flex min-w-0 flex-col gap-0.5'>\n                    <span className='truncate text-[13px] font-medium'>\n                      {row.name}\n                    </span>\n                    <span className='text-muted-foreground text-xs tabular-nums sm:hidden'>\n                      {phoneLine}\n                    </span>\n                  </div>\n                  <LeadCell lead={row.lead} />\n                  <div role='cell' className={FIGURE_CELL}>\n                    <Figure value={row.done} />\n                  </div>\n                  <div role='cell' className={FIGURE_CELL}>\n                    <Figure value={row.open} />\n                  </div>\n                  <div role='cell' className={FIGURE_CELL}>\n                    <Figure value={row.blocked} isQuiet={isBlockFree} />\n                  </div>\n                  <ProgressCell share={row.share} transition={transition} />\n                  <div\n                    role='cell'\n                    className='flex justify-end sm:justify-start'\n                  >\n                    <HealthChip row={row} />\n                  </div>\n                </div>\n              </motion.div>\n            );\n          })}\n        </AnimatePresence>\n      </div>\n      {emptyState}\n      {totals && (\n        <div role='rowgroup'>\n          <div\n            role='row'\n            className={cn(\n              TABLE_GRID,\n              'hairline-t border-border min-h-11 py-2.5 font-medium'\n            )}\n          >\n            <span role='rowheader' className='text-[13px]'>\n              All workstreams\n            </span>\n            <span role='cell' className={WIDE_CELL} />\n            <div role='cell' className={FIGURE_CELL}>\n              <Figure value={totals.done} />\n            </div>\n            <div role='cell' className={FIGURE_CELL}>\n              <Figure value={totals.open} />\n            </div>\n            <div role='cell' className={FIGURE_CELL}>\n              <Figure value={totals.blocked} />\n            </div>\n            <ProgressCell share={totals.share} transition={transition} />\n            <span\n              role='cell'\n              className='text-muted-foreground flex justify-end text-xs tabular-nums sm:justify-start'\n            >\n              {`${totals.done} of ${totals.planned}`}\n            </span>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/workstream-table.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/health-figures.ts",
      "content": "import {\n  HEALTH_META,\n  LEADS,\n  SPRINTS,\n  WORKSTREAMS,\n  type Health,\n  type Lead,\n  type Sprint,\n  type SprintId,\n} from './data';\n\nexport type WorkstreamRow = {\n  id: string;\n  name: string;\n  lead: Lead;\n  done: number;\n  open: number;\n  blocked: number;\n  planned: number;\n  share: number;\n  health: Health;\n};\n\nexport type Totals = {\n  done: number;\n  open: number;\n  blocked: number;\n  planned: number;\n  share: number;\n};\n\nexport type GoalTone = 'good' | 'behind' | 'neutral';\n\nexport type Goal = {\n  tone: GoalTone;\n  done: number;\n  planned: number;\n  share: number;\n  isFinished: boolean;\n  /** Where the team should be by today, as a share of the plan. Null once the sprint is over. */\n  expectedShare: number | null;\n  verdict: string;\n  timeLine: string;\n};\n\nexport function sprintOf(sprintId: SprintId) {\n  const sprint = SPRINTS.find((candidate) => candidate.id === sprintId);\n  if (sprint) {\n    return sprint;\n  }\n  return SPRINTS[0];\n}\n\nfunction leadOf(leadId: Lead['id']) {\n  const lead = LEADS.find((candidate) => candidate.id === leadId);\n  if (lead) {\n    return lead;\n  }\n  return LEADS[0];\n}\n\nfunction shareOf(part: number, whole: number) {\n  if (whole === 0) {\n    return 0;\n  }\n  return part / whole;\n}\n\nfunction sumOf(values: number[]) {\n  return values.reduce((total, value) => total + value, 0);\n}\n\nexport function rowsOf(sprint: Sprint): WorkstreamRow[] {\n  return WORKSTREAMS.map((workstream) => {\n    const figures = sprint.workstreams.find(\n      (candidate) => candidate.workstreamId === workstream.id\n    );\n    const done = figures?.done ?? 0;\n    const open = figures?.open ?? 0;\n    const blocked = figures?.blocked ?? 0;\n    const health = figures?.health ?? 'on-track';\n    const planned = done + open;\n    return {\n      id: workstream.id,\n      name: workstream.name,\n      lead: leadOf(workstream.leadId),\n      done,\n      open,\n      blocked,\n      planned,\n      share: shareOf(done, planned),\n      health,\n    };\n  });\n}\n\nexport function totalsOf(rows: WorkstreamRow[]): Totals {\n  const doneEach = rows.map((row) => row.done);\n  const openEach = rows.map((row) => row.open);\n  const blockedEach = rows.map((row) => row.blocked);\n  const done = sumOf(doneEach);\n  const open = sumOf(openEach);\n  const blocked = sumOf(blockedEach);\n  const planned = done + open;\n  const share = shareOf(done, planned);\n  return { done, open, blocked, planned, share };\n}\n\nfunction taskCountOf(count: number) {\n  if (count === 1) {\n    return '1 task';\n  }\n  return `${count} tasks`;\n}\n\nfunction dayCountOf(count: number) {\n  if (count === 1) {\n    return '1 working day';\n  }\n  return `${count} working days`;\n}\n\nfunction paceVerdictOf(gap: number) {\n  if (gap === 0) {\n    return 'On pace';\n  }\n  if (gap > 0) {\n    const ahead = taskCountOf(gap);\n    return `${ahead} ahead of pace`;\n  }\n  const missing = Math.abs(gap);\n  const behind = taskCountOf(missing);\n  return `${behind} behind pace`;\n}\n\nfunction paceToneOf(gap: number): GoalTone {\n  if (gap < 0) {\n    return 'behind';\n  }\n  return 'good';\n}\n\nfunction finishedToneOf(totals: Totals): GoalTone {\n  if (totals.done === totals.planned) {\n    return 'good';\n  }\n  return 'neutral';\n}\n\nfunction finishedVerdictOf(totals: Totals, sprint: Sprint) {\n  const moved = totals.planned - totals.done;\n  if (moved === 0) {\n    return 'Every planned task was done';\n  }\n  const movedTasks = taskCountOf(moved);\n  const nextSprint = sprint.number + 1;\n  return `${movedTasks} moved to sprint ${nextSprint}`;\n}\n\nexport function goalOf(sprint: Sprint, totals: Totals): Goal {\n  const isFinished = sprint.daysElapsed >= sprint.workingDays;\n  if (isFinished) {\n    return {\n      tone: finishedToneOf(totals),\n      done: totals.done,\n      planned: totals.planned,\n      share: totals.share,\n      isFinished,\n      expectedShare: null,\n      verdict: finishedVerdictOf(totals, sprint),\n      timeLine: sprint.rangeLabel,\n    };\n  }\n  const elapsedShare = shareOf(sprint.daysElapsed, sprint.workingDays);\n  const rawExpected = totals.planned * elapsedShare;\n  const expected = Math.round(rawExpected);\n  const gap = totals.done - expected;\n  const daysLeft = sprint.workingDays - sprint.daysElapsed;\n  const daysLeftLabel = dayCountOf(daysLeft);\n  return {\n    tone: paceToneOf(gap),\n    done: totals.done,\n    planned: totals.planned,\n    share: totals.share,\n    isFinished,\n    expectedShare: shareOf(expected, totals.planned),\n    verdict: paceVerdictOf(gap),\n    timeLine: `${daysLeftLabel} left, ${expected} expected done by today`,\n  };\n}\n\nexport function needsAttention(row: WorkstreamRow) {\n  return row.health !== 'on-track';\n}\n\nexport function formatShare(share: number) {\n  const percent = share * 100;\n  const rounded = Math.round(percent);\n  return `${rounded}%`;\n}\n\nexport function percentAmountOf(share: number) {\n  const percent = share * 100;\n  return Math.round(percent);\n}\n\nexport function csvRowsOf(rows: WorkstreamRow[]) {\n  const header = [\n    'Workstream',\n    'Lead',\n    'Done',\n    'Open',\n    'Blocked',\n    'Progress',\n    'Health',\n  ];\n  const lines = rows.map((row) => [\n    row.name,\n    row.lead.name,\n    String(row.done),\n    String(row.open),\n    String(row.blocked),\n    formatShare(row.share),\n    HEALTH_META[row.health].label,\n  ]);\n  return [header, ...lines];\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/health-figures.ts"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/report-frame.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useEffect, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  CheckIcon,\n  DownloadIcon,\n  LoaderCircleIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Tabs, TabsList, TabsTab } from '@/registry/ndeko/ui/tabs';\n\nexport const REPORT_SURFACE =\n  'bg-card hairline-ring ring-border rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:bg-foreground/[0.03]';\n\nconst FIRST_LOAD_MS = 900;\n\nconst UPDATE_MS = 450;\n\nconst EXPORTED_NOTICE_MS = 1600;\n\nconst FORMULA_PREFIXES = ['=', '+', '-', '@'];\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst NOTE_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst NOTE_OUT: Transition = { duration: 0.12, ease: [0.23, 1, 0.32, 1] };\n\nconst SWAP_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n};\n\nconst NOTE_VARIANTS: Variants = {\n  enter: { opacity: 0, x: -4 },\n  visible: { opacity: 1, x: 0, transition: NOTE_IN },\n  exit: { opacity: 0, transition: NOTE_OUT },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1, transition: NOTE_IN },\n  exit: { opacity: 0, transition: NOTE_OUT },\n};\n\nfunction swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\nfunction noteVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return NOTE_VARIANTS;\n}\n\nfunction loadDelayOf(isFirstLoad: boolean) {\n  if (isFirstLoad) {\n    return FIRST_LOAD_MS;\n  }\n  return UPDATE_MS;\n}\n\nfunction loadedKeyOf<Query>(\n  loaded: Query | null,\n  keyOf: (query: Query) => string\n) {\n  if (loaded === null) {\n    return null;\n  }\n  return keyOf(loaded);\n}\n\n/**\n * Stands in for a request: the first load shows a skeleton, a later change keeps the\n * previous result on screen until the next one arrives.\n */\nexport function useSimulatedLoad<Query>(\n  initialQuery: Query,\n  keyOf: (query: Query) => string\n) {\n  const [requested, setRequested] = useState(initialQuery);\n  const [loaded, setLoaded] = useState<Query | null>(null);\n  const isFirstLoad = loaded === null;\n  const delay = loadDelayOf(isFirstLoad);\n  const requestedKey = keyOf(requested);\n  const loadedKey = loadedKeyOf(loaded, keyOf);\n  const isUpdating = loadedKey !== null && loadedKey !== requestedKey;\n\n  useEffect(() => {\n    const timer = window.setTimeout(() => setLoaded(requested), delay);\n    return () => window.clearTimeout(timer);\n  }, [requested, delay]);\n\n  return { requested, loaded, isFirstLoad, isUpdating, request: setRequested };\n}\n\nexport type PeriodOption<Id extends string> = { id: Id; label: string };\n\ntype ReportToolbarProps = {\n  title: string;\n  meta: string;\n  children?: React.ReactNode;\n};\n\nexport function ReportToolbar({ title, meta, children }: ReportToolbarProps) {\n  return (\n    <div className='hairline-b border-border flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-3 md:px-6'>\n      <div className='flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5'>\n        <h1 className='truncate text-lg font-semibold text-balance'>{title}</h1>\n        <span className='text-muted-foreground text-xs tabular-nums'>\n          {meta}\n        </span>\n      </div>\n      <div className='ml-auto flex items-center gap-2'>{children}</div>\n    </div>\n  );\n}\n\nfunction UpdatingNote({ isUpdating }: { isUpdating: boolean }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = noteVariantsOf(shouldReduceMotion);\n\n  return (\n    <span role='status' className='text-muted-foreground flex text-xs'>\n      <AnimatePresence initial={false}>\n        {isUpdating && (\n          <motion.span\n            key='updating'\n            variants={variants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            className='flex items-center gap-1.5'\n          >\n            <LoaderCircleIcon className='size-3.5 animate-spin' />\n            Updating\n          </motion.span>\n        )}\n      </AnimatePresence>\n    </span>\n  );\n}\n\ntype PeriodSwitchProps<Id extends string> = {\n  label: string;\n  options: PeriodOption<Id>[];\n  value: Id;\n  isUpdating: boolean;\n  onValueChange: (id: Id) => void;\n};\n\nexport function PeriodSwitch<Id extends string>({\n  label,\n  options,\n  value,\n  isUpdating,\n  onValueChange,\n}: PeriodSwitchProps<Id>) {\n  function changeValue(nextValue: unknown) {\n    const option = options.find((candidate) => candidate.id === nextValue);\n    if (option) {\n      onValueChange(option.id);\n    }\n  }\n\n  return (\n    <div className='flex flex-wrap items-center gap-x-3 gap-y-2'>\n      <Tabs value={value} onValueChange={changeValue}>\n        <TabsList variant='segmented' aria-label={label}>\n          {options.map((option) => (\n            <TabsTab key={option.id} value={option.id}>\n              {option.label}\n            </TabsTab>\n          ))}\n        </TabsList>\n      </Tabs>\n      <UpdatingNote isUpdating={isUpdating} />\n    </div>\n  );\n}\n\nfunction exportGlyphOf(isExported: boolean) {\n  if (isExported) {\n    return { key: 'exported', icon: <CheckIcon /> };\n  }\n  return { key: 'export', icon: <DownloadIcon /> };\n}\n\nfunction exportLabelOf(isExported: boolean) {\n  if (isExported) {\n    return 'Downloaded';\n  }\n  return 'Export CSV';\n}\n\ntype ExportButtonProps = {\n  disabled?: boolean;\n  onExport: () => void;\n};\n\nexport function ExportButton({ disabled, onExport }: ExportButtonProps) {\n  const [isExported, setIsExported] = useState(false);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n  const glyph = exportGlyphOf(isExported);\n  const label = exportLabelOf(isExported);\n\n  useEffect(() => {\n    if (!isExported) {\n      return;\n    }\n    const timer = window.setTimeout(\n      () => setIsExported(false),\n      EXPORTED_NOTICE_MS\n    );\n    return () => window.clearTimeout(timer);\n  }, [isExported]);\n\n  function exportReport() {\n    onExport();\n    setIsExported(true);\n  }\n\n  return (\n    <Button variant='outline' disabled={disabled} onClick={exportReport}>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={glyph.key}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n          className='flex'\n        >\n          {glyph.icon}\n        </motion.span>\n      </AnimatePresence>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={label}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n        >\n          {label}\n        </motion.span>\n      </AnimatePresence>\n    </Button>\n  );\n}\n\n/** Spreadsheet apps run a cell that starts with these characters as a formula. */\nfunction neutralizedCellOf(value: string) {\n  const startsLikeFormula = FORMULA_PREFIXES.some((prefix) =>\n    value.startsWith(prefix)\n  );\n  if (startsLikeFormula) {\n    return `'${value}`;\n  }\n  return value;\n}\n\nfunction csvCellOf(value: string) {\n  const neutralized = neutralizedCellOf(value);\n  const escaped = neutralized.replaceAll('\"', '\"\"');\n  return `\"${escaped}\"`;\n}\n\nfunction csvLineOf(row: string[]) {\n  const cells = row.map(csvCellOf);\n  return cells.join(',');\n}\n\n/** Builds the file in the browser and hands it to the download bar: nothing leaves the page. */\nexport function downloadCsv(fileName: string, rows: string[][]) {\n  const lines = rows.map(csvLineOf);\n  const text = lines.join('\\n');\n  const file = new Blob([text], { type: 'text/csv;charset=utf-8' });\n  const url = URL.createObjectURL(file);\n  const link = document.createElement('a');\n  link.href = url;\n  link.download = fileName;\n  link.click();\n  window.setTimeout(() => URL.revokeObjectURL(url), 0);\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-02/report-frame.tsx"
    },
    {
      "path": "registry/ndeko/templates/dashboards/application-02/data.ts",
      "content": "import {\n  ChartLineIcon,\n  ClockIcon,\n  GaugeIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\n\nexport type PageId = 'overview' | 'weekly-report' | 'project-health';\n\nexport type Entity = {\n  id: string;\n  name: string;\n  color: string;\n};\n\nexport type Workspace = {\n  id: string;\n  name: string;\n  memberCount: number;\n};\n\nexport type NavItem = {\n  id: PageId;\n  label: string;\n  icon: Icon;\n};\n\nexport type NavGroup = {\n  id: string;\n  label?: string;\n  team?: Entity;\n  items: NavItem[];\n};\n\nexport type Person = {\n  id: string;\n  name: string;\n  role: string;\n};\n\nexport const WORKSPACES: Workspace[] = [\n  {\n    id: 'tidewell',\n    name: 'Tidewell Studio',\n    memberCount: 14,\n  },\n];\n\nexport const PRODUCT_TEAM: Entity = {\n  id: 'product',\n  name: 'Product team',\n  color: 'var(--info)',\n};\n\nexport const CURRENT_USER_ID = 'amara';\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    role: 'Product designer',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n    role: 'Engineering lead',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n    role: 'Frontend engineer',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n    role: 'Backend engineer',\n  },\n  {\n    id: 'hana',\n    name: 'Hana Kobayashi',\n    role: 'Product manager',\n  },\n  {\n    id: 'jonas',\n    name: 'Jonas Weber',\n    role: 'QA engineer',\n  },\n];\n\nexport const NAV_GROUPS: NavGroup[] = [\n  {\n    id: 'workspace',\n    label: 'Workspace',\n    items: [{ id: 'overview', label: 'Overview', icon: ChartLineIcon }],\n  },\n  {\n    id: 'team',\n    team: PRODUCT_TEAM,\n    items: [\n      { id: 'weekly-report', label: 'Weekly report', icon: ClockIcon },\n      { id: 'project-health', label: 'Project health', icon: GaugeIcon },\n    ],\n  },\n];\n\nexport function personOf(personId: string) {\n  const person = PEOPLE.find((candidate) => candidate.id === personId);\n  if (person) {\n    return person;\n  }\n  return PEOPLE[0];\n}\n\nexport type PeriodId = 'days' | 'weeks' | 'months';\n\nexport type MetricId = 'tracked' | 'closed' | 'billable' | 'review';\n\nexport type PeriodPoint = {\n  axisLabel: string;\n  label: string;\n};\n\nexport type Period = {\n  id: PeriodId;\n  switchLabel: string;\n  label: string;\n  unitPlural: string;\n  perUnit: string;\n  fileSlug: string;\n  points: PeriodPoint[];\n};\n\nexport type MetricDefinition = {\n  id: MetricId;\n  label: string;\n  chartTitle: string;\n  csvHeading: string;\n  aggregate: 'sum' | 'average';\n  change: 'percent' | 'points' | 'hours-lower-is-better';\n  suffix: string;\n};\n\nexport type MetricSeries = {\n  values: number[];\n  previousTotal: number;\n};\n\nexport const WORKSPACE = {\n  name: WORKSPACES[0].name,\n  peopleCount: WORKSPACES[0].memberCount,\n};\n\nexport const PERIODS: Period[] = [\n  {\n    id: 'days',\n    switchLabel: 'Days',\n    label: 'Last 12 working days',\n    unitPlural: 'working days',\n    perUnit: 'per working day',\n    fileSlug: 'last-12-working-days',\n    points: [\n      { axisLabel: '20 Oct', label: 'Tuesday 20 October' },\n      { axisLabel: '21 Oct', label: 'Wednesday 21 October' },\n      { axisLabel: '22 Oct', label: 'Thursday 22 October' },\n      { axisLabel: '23 Oct', label: 'Friday 23 October' },\n      { axisLabel: '26 Oct', label: 'Monday 26 October' },\n      { axisLabel: '27 Oct', label: 'Tuesday 27 October' },\n      { axisLabel: '28 Oct', label: 'Wednesday 28 October' },\n      { axisLabel: '29 Oct', label: 'Thursday 29 October' },\n      { axisLabel: '30 Oct', label: 'Friday 30 October' },\n      { axisLabel: '2 Nov', label: 'Monday 2 November' },\n      { axisLabel: '3 Nov', label: 'Tuesday 3 November' },\n      { axisLabel: '4 Nov', label: 'Wednesday 4 November' },\n    ],\n  },\n  {\n    id: 'weeks',\n    switchLabel: 'Weeks',\n    label: 'Last 12 weeks',\n    unitPlural: 'weeks',\n    perUnit: 'per week',\n    fileSlug: 'last-12-weeks',\n    points: [\n      { axisLabel: 'W33', label: 'Week 33, 10 to 16 August' },\n      { axisLabel: 'W34', label: 'Week 34, 17 to 23 August' },\n      { axisLabel: 'W35', label: 'Week 35, 24 to 30 August' },\n      { axisLabel: 'W36', label: 'Week 36, 31 August to 6 September' },\n      { axisLabel: 'W37', label: 'Week 37, 7 to 13 September' },\n      { axisLabel: 'W38', label: 'Week 38, 14 to 20 September' },\n      { axisLabel: 'W39', label: 'Week 39, 21 to 27 September' },\n      { axisLabel: 'W40', label: 'Week 40, 28 September to 4 October' },\n      { axisLabel: 'W41', label: 'Week 41, 5 to 11 October' },\n      { axisLabel: 'W42', label: 'Week 42, 12 to 18 October' },\n      { axisLabel: 'W43', label: 'Week 43, 19 to 25 October' },\n      { axisLabel: 'W44', label: 'Week 44, 26 October to 1 November' },\n    ],\n  },\n  {\n    id: 'months',\n    switchLabel: 'Months',\n    label: 'Last 12 months',\n    unitPlural: 'months',\n    perUnit: 'per month',\n    fileSlug: 'last-12-months',\n    points: [\n      { axisLabel: 'Nov', label: 'November 2025' },\n      { axisLabel: 'Dec', label: 'December 2025' },\n      { axisLabel: 'Jan', label: 'January 2026' },\n      { axisLabel: 'Feb', label: 'February 2026' },\n      { axisLabel: 'Mar', label: 'March 2026' },\n      { axisLabel: 'Apr', label: 'April 2026' },\n      { axisLabel: 'May', label: 'May 2026' },\n      { axisLabel: 'Jun', label: 'June 2026' },\n      { axisLabel: 'Jul', label: 'July 2026' },\n      { axisLabel: 'Aug', label: 'August 2026' },\n      { axisLabel: 'Sep', label: 'September 2026' },\n      { axisLabel: 'Oct', label: 'October 2026' },\n    ],\n  },\n];\n\nexport const METRICS: MetricDefinition[] = [\n  {\n    id: 'tracked',\n    label: 'Tracked time',\n    chartTitle: 'Hours tracked',\n    csvHeading: 'Tracked time (hours)',\n    aggregate: 'sum',\n    change: 'percent',\n    suffix: 'h',\n  },\n  {\n    id: 'closed',\n    label: 'Tasks closed',\n    chartTitle: 'Tasks closed',\n    csvHeading: 'Tasks closed',\n    aggregate: 'sum',\n    change: 'percent',\n    suffix: '',\n  },\n  {\n    id: 'billable',\n    label: 'Billable share',\n    chartTitle: 'Billable share of tracked time',\n    csvHeading: 'Billable share (%)',\n    aggregate: 'average',\n    change: 'points',\n    suffix: '%',\n  },\n  {\n    id: 'review',\n    label: 'Time in review',\n    chartTitle: 'Average time in review',\n    csvHeading: 'Time in review (hours)',\n    aggregate: 'average',\n    change: 'hours-lower-is-better',\n    suffix: 'h',\n  },\n];\n\nexport const SERIES: Record<PeriodId, Record<MetricId, MetricSeries>> = {\n  days: {\n    tracked: {\n      values: [78, 84, 81, 69, 88, 91, 86, 72, 80, 93, 89, 85],\n      previousTotal: 948,\n    },\n    closed: {\n      values: [14, 17, 12, 9, 19, 21, 16, 11, 15, 22, 18, 17],\n      previousTotal: 176,\n    },\n    billable: {\n      values: [66, 71, 69, 64, 72, 74, 70, 65, 68, 75, 73, 71],\n      previousTotal: 67,\n    },\n    review: {\n      values: [9, 7, 11, 14, 8, 6, 9, 12, 10, 7, 8, 9],\n      previousTotal: 11,\n    },\n  },\n  weeks: {\n    tracked: {\n      values: [402, 418, 436, 391, 447, 452, 438, 429, 461, 455, 470, 444],\n      previousTotal: 5120,\n    },\n    closed: {\n      values: [71, 78, 84, 66, 90, 88, 79, 83, 95, 87, 102, 91],\n      previousTotal: 1046,\n    },\n    billable: {\n      values: [63, 65, 68, 61, 70, 69, 67, 66, 71, 70, 72, 69],\n      previousTotal: 66,\n    },\n    review: {\n      values: [16, 14, 13, 18, 12, 11, 13, 12, 10, 11, 9, 10],\n      previousTotal: 15,\n    },\n  },\n  months: {\n    tracked: {\n      values: [\n        1710, 1520, 1880, 1840, 1795, 1905, 1870, 1610, 1490, 1930, 1985, 2010,\n      ],\n      previousTotal: 20180,\n    },\n    closed: {\n      values: [312, 268, 344, 351, 330, 372, 365, 290, 274, 381, 398, 412],\n      previousTotal: 3720,\n    },\n    billable: {\n      values: [61, 58, 64, 63, 62, 66, 65, 59, 57, 67, 68, 69],\n      previousTotal: 61,\n    },\n    review: {\n      values: [22, 25, 19, 18, 17, 16, 15, 19, 21, 14, 12, 11],\n      previousTotal: 21,\n    },\n  },\n};\n\nexport type WeekId = 'w43' | 'w44' | 'w45';\n\nexport type MemberId = 'amara' | 'lucas' | 'priya' | 'mateo' | 'jonas';\n\nexport type ProjectId =\n  'harbor' | 'billing' | 'design' | 'support' | 'research' | 'hiring';\n\nexport type WeekDay = {\n  name: string;\n  short: string;\n  date: number;\n  month: string;\n};\n\nexport type Week = {\n  id: WeekId;\n  number: number;\n  rangeLabel: string;\n  days: WeekDay[];\n  /** Index of today in `days`, or null when the week is over. Days after it are ahead. */\n  todayIndex: number | null;\n};\n\nexport type Member = {\n  id: MemberId;\n  name: string;\n};\n\nexport type Project = { id: ProjectId; name: string };\n\nexport type ProjectShare = { projectId: ProjectId; share: number };\n\nexport type MemberWeek = {\n  /** Minutes tracked from Monday to Sunday. */\n  days: number[];\n  mix: ProjectShare[];\n};\n\nexport const TEAM_NAME = PRODUCT_TEAM.name;\n\nconst DAY_NAMES = [\n  { name: 'Monday', short: 'Mon' },\n  { name: 'Tuesday', short: 'Tue' },\n  { name: 'Wednesday', short: 'Wed' },\n  { name: 'Thursday', short: 'Thu' },\n  { name: 'Friday', short: 'Fri' },\n  { name: 'Saturday', short: 'Sat' },\n  { name: 'Sunday', short: 'Sun' },\n];\n\n/** The seven days of a week that stays inside one month. */\nfunction weekDays(month: string, firstDate: number): WeekDay[] {\n  return DAY_NAMES.map((day, index) => {\n    const date = firstDate + index;\n    return { name: day.name, short: day.short, date, month };\n  });\n}\n\nexport const WEEKS: Week[] = [\n  {\n    id: 'w43',\n    number: 43,\n    rangeLabel: '19 to 25 October 2026',\n    days: weekDays('October', 19),\n    todayIndex: null,\n  },\n  {\n    id: 'w44',\n    number: 44,\n    rangeLabel: '26 October to 1 November 2026',\n    days: [\n      { name: 'Monday', short: 'Mon', date: 26, month: 'October' },\n      { name: 'Tuesday', short: 'Tue', date: 27, month: 'October' },\n      { name: 'Wednesday', short: 'Wed', date: 28, month: 'October' },\n      { name: 'Thursday', short: 'Thu', date: 29, month: 'October' },\n      { name: 'Friday', short: 'Fri', date: 30, month: 'October' },\n      { name: 'Saturday', short: 'Sat', date: 31, month: 'October' },\n      { name: 'Sunday', short: 'Sun', date: 1, month: 'November' },\n    ],\n    todayIndex: null,\n  },\n  {\n    id: 'w45',\n    number: 45,\n    rangeLabel: '2 to 8 November 2026',\n    days: weekDays('November', 2),\n    todayIndex: 3,\n  },\n];\n\nexport const MEMBERS: Member[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n  },\n  { id: 'jonas', name: 'Jonas Weber' },\n];\n\nexport const PROJECTS: Project[] = [\n  { id: 'harbor', name: 'Harbor mobile app' },\n  { id: 'billing', name: 'Billing revamp' },\n  { id: 'design', name: 'Design system' },\n  { id: 'support', name: 'Support rotation' },\n  { id: 'research', name: 'Customer interviews' },\n  { id: 'hiring', name: 'Hiring loop' },\n];\n\nexport const MEMBER_WEEKS: Record<MemberId, Record<WeekId, MemberWeek>> = {\n  amara: {\n    w43: {\n      days: [450, 480, 420, 510, 390, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.45 },\n        { projectId: 'design', share: 0.35 },\n        { projectId: 'research', share: 0.2 },\n      ],\n    },\n    w44: {\n      days: [465, 500, 480, 455, 420, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.5 },\n        { projectId: 'design', share: 0.3 },\n        { projectId: 'research', share: 0.2 },\n      ],\n    },\n    w45: {\n      days: [470, 455, 490, 245, 0, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.55 },\n        { projectId: 'design', share: 0.3 },\n        { projectId: 'hiring', share: 0.15 },\n      ],\n    },\n  },\n  lucas: {\n    w43: {\n      days: [480, 465, 500, 440, 360, 60, 0],\n      mix: [\n        { projectId: 'billing', share: 0.4 },\n        { projectId: 'harbor', share: 0.3 },\n        { projectId: 'hiring', share: 0.2 },\n        { projectId: 'support', share: 0.1 },\n      ],\n    },\n    w44: {\n      days: [500, 470, 485, 510, 390, 0, 0],\n      mix: [\n        { projectId: 'billing', share: 0.45 },\n        { projectId: 'harbor', share: 0.3 },\n        { projectId: 'hiring', share: 0.15 },\n        { projectId: 'support', share: 0.1 },\n      ],\n    },\n    w45: {\n      days: [485, 500, 470, 260, 0, 0, 0],\n      mix: [\n        { projectId: 'billing', share: 0.5 },\n        { projectId: 'harbor', share: 0.25 },\n        { projectId: 'hiring', share: 0.25 },\n      ],\n    },\n  },\n  priya: {\n    w43: {\n      days: [420, 450, 435, 480, 405, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.6 },\n        { projectId: 'design', share: 0.4 },\n      ],\n    },\n    w44: {\n      days: [440, 470, 455, 0, 0, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.7 },\n        { projectId: 'design', share: 0.3 },\n      ],\n    },\n    w45: {\n      days: [450, 465, 480, 230, 0, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.65 },\n        { projectId: 'design', share: 0.25 },\n        { projectId: 'support', share: 0.1 },\n      ],\n    },\n  },\n  mateo: {\n    w43: {\n      days: [390, 410, 0, 455, 430, 0, 0],\n      mix: [\n        { projectId: 'billing', share: 0.7 },\n        { projectId: 'support', share: 0.3 },\n      ],\n    },\n    w44: {\n      days: [420, 445, 430, 460, 410, 90, 0],\n      mix: [\n        { projectId: 'billing', share: 0.6 },\n        { projectId: 'support', share: 0.25 },\n        { projectId: 'harbor', share: 0.15 },\n      ],\n    },\n    w45: {\n      days: [430, 410, 445, 215, 0, 0, 0],\n      mix: [\n        { projectId: 'billing', share: 0.75 },\n        { projectId: 'support', share: 0.25 },\n      ],\n    },\n  },\n  jonas: {\n    w43: {\n      days: [400, 420, 410, 380, 300, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.5 },\n        { projectId: 'billing', share: 0.3 },\n        { projectId: 'support', share: 0.2 },\n      ],\n    },\n    w44: {\n      days: [380, 410, 395, 420, 280, 0, 0],\n      mix: [\n        { projectId: 'harbor', share: 0.55 },\n        { projectId: 'billing', share: 0.35 },\n        { projectId: 'support', share: 0.1 },\n      ],\n    },\n    w45: {\n      days: [0, 0, 0, 0, 0, 0, 0],\n      mix: [],\n    },\n  },\n};\n\nexport type SprintId = 's21' | 's22' | 's23';\n\nexport type Health = 'on-track' | 'at-risk' | 'off-track';\n\nexport type LeadId = 'amara' | 'lucas' | 'priya' | 'mateo' | 'hana';\n\nexport type Lead = {\n  id: LeadId;\n  name: string;\n};\n\nexport type WorkstreamFigures = {\n  workstreamId: string;\n  done: number;\n  open: number;\n  /** Blocked tasks are counted inside `open`. */\n  blocked: number;\n  health: Health;\n};\n\nexport type Workstream = {\n  id: string;\n  name: string;\n  leadId: LeadId;\n};\n\nexport type Sprint = {\n  id: SprintId;\n  number: number;\n  rangeLabel: string;\n  goal: string;\n  workingDays: number;\n  /** Working days already behind the team. Equal to `workingDays` once the sprint is over. */\n  daysElapsed: number;\n  workstreams: WorkstreamFigures[];\n};\n\nexport const PROJECT = {\n  name: 'Harbor mobile app',\n  release: 'Release 2.4',\n  peopleCount: 6,\n  fileSlug: 'harbor-mobile-app',\n};\n\nexport const HEALTH_META: Record<Health, { label: string; color: string }> = {\n  'on-track': { label: 'On track', color: 'var(--success)' },\n  'at-risk': { label: 'At risk', color: 'var(--warning)' },\n  'off-track': { label: 'Off track', color: 'var(--destructive)' },\n};\n\nexport const LEADS: Lead[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n  },\n  {\n    id: 'hana',\n    name: 'Hana Kobayashi',\n  },\n];\n\nexport const WORKSTREAMS: Workstream[] = [\n  { id: 'offline', name: 'Offline drafts', leadId: 'priya' },\n  { id: 'sync', name: 'Sync engine', leadId: 'mateo' },\n  { id: 'push', name: 'Push notifications', leadId: 'lucas' },\n  { id: 'a11y', name: 'Accessibility pass', leadId: 'amara' },\n  { id: 'release', name: 'Release checklist', leadId: 'hana' },\n];\n\nexport const SPRINTS: Sprint[] = [\n  {\n    id: 's21',\n    number: 21,\n    rangeLabel: '28 September to 9 October 2026',\n    goal: 'Offline drafts open without a connection',\n    workingDays: 10,\n    daysElapsed: 10,\n    workstreams: [\n      {\n        workstreamId: 'offline',\n        done: 8,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'sync',\n        done: 6,\n        open: 1,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'push',\n        done: 4,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'a11y',\n        done: 4,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'release',\n        done: 3,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n    ],\n  },\n  {\n    id: 's22',\n    number: 22,\n    rangeLabel: '12 to 23 October 2026',\n    goal: 'Drafts sync back when the phone reconnects',\n    workingDays: 10,\n    daysElapsed: 10,\n    workstreams: [\n      {\n        workstreamId: 'offline',\n        done: 9,\n        open: 1,\n        blocked: 0,\n        health: 'on-track',\n      },\n      { workstreamId: 'sync', done: 5, open: 2, blocked: 1, health: 'at-risk' },\n      {\n        workstreamId: 'push',\n        done: 6,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'a11y',\n        done: 4,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'release',\n        done: 3,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n    ],\n  },\n  {\n    id: 's23',\n    number: 23,\n    rangeLabel: '26 October to 6 November 2026',\n    goal: 'Offline drafts reach the beta group',\n    workingDays: 10,\n    daysElapsed: 8,\n    workstreams: [\n      {\n        workstreamId: 'offline',\n        done: 7,\n        open: 2,\n        blocked: 0,\n        health: 'on-track',\n      },\n      {\n        workstreamId: 'sync',\n        done: 4,\n        open: 4,\n        blocked: 2,\n        health: 'off-track',\n      },\n      {\n        workstreamId: 'push',\n        done: 5,\n        open: 1,\n        blocked: 0,\n        health: 'on-track',\n      },\n      { workstreamId: 'a11y', done: 3, open: 2, blocked: 1, health: 'at-risk' },\n      {\n        workstreamId: 'release',\n        done: 3,\n        open: 0,\n        blocked: 0,\n        health: 'on-track',\n      },\n    ],\n  },\n];\n",
      "type": "registry:component",
      "target": "components/templates/application-02/data.ts"
    }
  ],
  "categories": [
    "templates",
    "dashboards"
  ],
  "type": "registry:block"
}