{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gemini",
  "title": "Gemini",
  "description": "A full recreation of the Gemini chat built from the Gemini components on shadcn Base UI.",
  "dependencies": [
    "cn",
    "lucide-react"
  ],
  "registryDependencies": [
    "avatar",
    "badge",
    "button",
    "card",
    "collapsible",
    "https://ui.usenotra.com/r/notra-dropdown-menu.json",
    "hover-card",
    "input-group",
    "scroll-area",
    "tooltip",
    "https://ui.usenotra.com/r/shimmer.json"
  ],
  "files": [
    {
      "path": "registry/notra/gemini/components/gemini-message.tsx",
      "content": "import { cn } from \"cn\";\n\nimport type { GeminiMessageProps } from \"../types/gemini\";\n\nexport const GeminiMessage = ({\n  actions,\n  children,\n  className,\n  from,\n  status,\n  thoughts,\n  ...props\n}: GeminiMessageProps) => {\n  if (from === \"user\") {\n    return (\n      <div\n        className={cn(\"font-gemini flex justify-end\", className)}\n        data-from=\"user\"\n        data-slot=\"gemini-message\"\n        {...props}\n      >\n        <div className=\"bg-gemini-bubble text-gemini-fg max-w-[70%] rounded-3xl rounded-se-sm px-4 py-2.5 text-[0.9375rem] leading-6 wrap-break-word\">\n          {children}\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div\n      className={cn(\n        \"group/gemini-message font-gemini flex w-full flex-col items-start gap-3\",\n        className\n      )}\n      data-from=\"assistant\"\n      data-slot=\"gemini-message\"\n      {...props}\n    >\n      {thoughts}\n      {status}\n      {children != null && children !== false ? (\n        <div className=\"text-gemini-fg max-w-full text-[0.9375rem] leading-[1.65] wrap-break-word\">\n          {children}\n        </div>\n      ) : null}\n      {actions ? (\n        <div className=\"-ms-1.5 opacity-0 transition-opacity duration-150 group-focus-within/gemini-message:opacity-100 motion-reduce:transition-none [@media(hover:hover)]:group-hover/gemini-message:opacity-100 [@media(hover:none)]:opacity-100\">\n          {actions}\n        </div>\n      ) : null}\n    </div>\n  );\n};\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-message.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-thinking.tsx",
      "content": "import { cn } from \"cn\";\n\nimport { Shimmer } from \"../../shimmer/components/shimmer\";\nimport { GEMINI_SEARCHING_LABEL } from \"../constants/gemini\";\nimport type { GeminiThinkingProps } from \"../types/gemini\";\nimport { GeminiSparkle } from \"./gemini-sparkle\";\n\nexport const GeminiThinking = ({\n  className,\n  label = GEMINI_SEARCHING_LABEL,\n  reducedMotion,\n  ...props\n}: GeminiThinkingProps) => (\n  <div\n    aria-live=\"polite\"\n    className={cn(\n      \"font-gemini text-gemini-fg flex items-center gap-2.5 text-[0.9375rem] leading-none\",\n      className\n    )}\n    data-slot=\"gemini-thinking\"\n    role=\"status\"\n    {...props}\n  >\n    <GeminiSparkle\n      animated\n      aria-hidden=\"true\"\n      aria-label={undefined}\n      reducedMotion={reducedMotion}\n      role=\"presentation\"\n      size={20}\n    />\n    <Shimmer\n      className=\"[--shimmer-highlight:var(--gemini-subtle)]\"\n      paused={reducedMotion}\n    >\n      {label}\n    </Shimmer>\n  </div>\n);\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-thinking.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-sparkle.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\nimport type { CSSProperties } from \"react\";\nimport { useEffect, useState } from \"react\";\n\nimport { GEMINI_SPARKLE_CYCLE_MS } from \"../constants/gemini\";\nimport { useGeminiReducedMotion } from \"../hooks/use-gemini-reduced-motion\";\nimport type { GeminiSparkleProps } from \"../types/gemini\";\n\nconst VIEW = 24;\nconst DOT_R = 2.15;\nconst BOUNCE_END = 0.4;\nconst MORPH_IN_END = 0.56;\nconst HOLD_END = 0.7;\nconst MORPH_OUT_END = 0.86;\nconst BOUNCE_HEIGHT = 2.4;\nconst BOUNCE_GROWTH = 0.08;\nconst BOUNCES_PER_CYCLE = 5;\n\ninterface Point {\n  x: number;\n  y: number;\n}\n\nconst LINE: readonly Point[] = [\n  { x: 6, y: 13.2 },\n  { x: 12, y: 13.2 },\n  { x: 18, y: 13.2 },\n];\n\nconst TRIANGLE: readonly Point[] = [\n  { x: 7.2, y: 15.8 },\n  { x: 12, y: 6.8 },\n  { x: 16.8, y: 15.8 },\n];\n\nconst lerp = (from: number, to: number, t: number) => from + (to - from) * t;\n\nconst easeInOut = (t: number) =>\n  t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;\n\nconst morphAmount = (progress: number) => {\n  if (progress < BOUNCE_END) {\n    return 0;\n  }\n  if (progress < MORPH_IN_END) {\n    return easeInOut((progress - BOUNCE_END) / (MORPH_IN_END - BOUNCE_END));\n  }\n  if (progress < HOLD_END) {\n    return 1;\n  }\n  if (progress < MORPH_OUT_END) {\n    return 1 - easeInOut((progress - HOLD_END) / (MORPH_OUT_END - HOLD_END));\n  }\n  return 0;\n};\n\nconst bounceLift = (progress: number, index: number, morph: number) => {\n  const wave = Math.max(\n    0,\n    Math.sin((progress * BOUNCES_PER_CYCLE - index / 3) * Math.PI * 2)\n  );\n  const rest = 1 - morph;\n  return wave * wave * rest * rest;\n};\n\nconst GeminiSparkleMark = ({ progress }: { progress: number }) => {\n  const morph = morphAmount(progress);\n\n  return (\n    <svg\n      aria-hidden=\"true\"\n      className=\"size-full\"\n      fill=\"currentColor\"\n      viewBox={`0 0 ${VIEW} ${VIEW}`}\n    >\n      {LINE.map((from, index) => {\n        const to = TRIANGLE[index] ?? from;\n        const bounce = bounceLift(progress, index, morph);\n        return (\n          <circle\n            cx={lerp(from.x, to.x, morph)}\n            cy={lerp(from.y, to.y, morph) - bounce * BOUNCE_HEIGHT}\n            key={from.x}\n            r={DOT_R * (1 + bounce * BOUNCE_GROWTH)}\n          />\n        );\n      })}\n    </svg>\n  );\n};\n\nexport const GeminiSparkle = ({\n  animated = false,\n  className,\n  reducedMotion,\n  size = 18,\n  style,\n  ...props\n}: GeminiSparkleProps) => {\n  const prefersReducedMotion = useGeminiReducedMotion();\n  const shouldAnimate = animated && !(reducedMotion ?? prefersReducedMotion);\n  const [progress, setProgress] = useState(0);\n\n  useEffect(() => {\n    if (!shouldAnimate) {\n      setProgress(0);\n      return;\n    }\n\n    const started = performance.now();\n    let frame = 0;\n\n    const tick = (now: number) => {\n      setProgress(\n        ((now - started) % GEMINI_SPARKLE_CYCLE_MS) / GEMINI_SPARKLE_CYCLE_MS\n      );\n      frame = window.requestAnimationFrame(tick);\n    };\n\n    frame = window.requestAnimationFrame(tick);\n    return () => {\n      window.cancelAnimationFrame(frame);\n    };\n  }, [shouldAnimate]);\n\n  return (\n    <span\n      className={cn(\n        \"text-gemini-fg inline-flex size-(--gemini-sparkle-size) shrink-0 items-center justify-center\",\n        className\n      )}\n      aria-hidden={animated ? undefined : true}\n      aria-label={animated ? \"Loading\" : undefined}\n      data-animated={shouldAnimate || undefined}\n      data-slot=\"gemini-sparkle\"\n      role={animated ? \"status\" : undefined}\n      style={\n        { \"--gemini-sparkle-size\": `${size}px`, ...style } as CSSProperties\n      }\n      {...props}\n    >\n      <GeminiSparkleMark progress={shouldAnimate ? progress : 0} />\n    </span>\n  );\n};\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-sparkle.tsx"
    },
    {
      "path": "registry/notra/gemini/constants/gemini.ts",
      "content": "export const GEMINI_SPARKLE_CYCLE_MS = 3400;\n\nexport const GEMINI_TOOLTIP_DELAY_MS = 200;\n\nexport const GEMINI_SEARCHING_LABEL = \"Searching the web\";\n\nexport const GEMINI_THINKING_LABEL = \"Thinking\";\n\nexport const GEMINI_HOVER_OPEN_DELAY_MS = 150;\n\nexport const GEMINI_HOVER_CLOSE_DELAY_MS = 120;\n\nexport const GEMINI_FAVICON_URL = \"https://www.google.com/s2/favicons\";\n\nexport const GEMINI_SHOW_THINKING_LABEL = \"Show thinking\";\n\nexport const GEMINI_HIDE_THINKING_LABEL = \"Hide thinking\";\n",
      "type": "registry:lib",
      "target": "components/gemini/constants/gemini.ts"
    },
    {
      "path": "registry/notra/gemini/hooks/use-gemini-reduced-motion.ts",
      "content": "\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nconst subscribe = (onChange: () => void) => {\n  const query = window.matchMedia(REDUCED_MOTION_QUERY);\n  query.addEventListener(\"change\", onChange);\n  return () => query.removeEventListener(\"change\", onChange);\n};\n\nconst getSnapshot = () => window.matchMedia(REDUCED_MOTION_QUERY).matches;\n\nconst getServerSnapshot = () => false;\n\nexport const useGeminiReducedMotion = (): boolean =>\n  useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n",
      "type": "registry:hook",
      "target": "components/gemini/hooks/use-gemini-reduced-motion.ts"
    },
    {
      "path": "registry/notra/gemini/types/gemini.ts",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\n\nimport type { Button } from \"@/components/ui/button\";\nimport type { Collapsible } from \"@/components/ui/collapsible\";\n\nexport type GeminiModelId = \"flash-lite\" | \"flash\" | \"pro\" | \"thinking\";\n\nexport type GeminiModelGroup = \"core\" | \"thinking\";\n\nexport interface GeminiModelOption {\n  badge?: string;\n  chip: string;\n  description: string;\n  group: GeminiModelGroup;\n  id: GeminiModelId;\n  label: string;\n}\n\nexport type GeminiMessageRole = \"user\" | \"assistant\";\n\nexport interface GeminiMessageProps extends ComponentProps<\"div\"> {\n  actions?: ReactNode;\n  from: GeminiMessageRole;\n  status?: ReactNode;\n  thoughts?: ReactNode;\n}\n\nexport interface GeminiActionButtonProps extends ComponentProps<typeof Button> {\n  label: string;\n}\n\nexport interface GeminiActionsProps extends ComponentProps<\"div\"> {\n  onBadResponse?: () => void;\n  onGoodResponse?: () => void;\n}\n\nexport interface GeminiSparkleProps extends ComponentProps<\"span\"> {\n  animated?: boolean;\n  reducedMotion?: boolean;\n  size?: number;\n}\n\nexport interface GeminiThinkingProps extends ComponentProps<\"div\"> {\n  label?: ReactNode;\n  reducedMotion?: boolean;\n}\n\nexport interface GeminiModelSelectorProps extends Omit<\n  ComponentProps<typeof Button>,\n  \"defaultValue\" | \"onChange\" | \"value\"\n> {\n  defaultModel?: GeminiModelId;\n  model?: GeminiModelId;\n  models?: readonly GeminiModelOption[];\n  onModelChange?: (model: GeminiModelId) => void;\n}\n\nexport interface GeminiComposerProps extends Omit<\n  ComponentProps<\"div\">,\n  \"onSubmit\"\n> {\n  busy?: boolean;\n  defaultModel?: GeminiModelId;\n  disclaimer?: ReactNode;\n  model?: GeminiModelId;\n  models?: readonly GeminiModelOption[];\n  onModelChange?: (model: GeminiModelId) => void;\n  onSend?: (text: string) => void;\n  onStop?: () => void;\n  placeholder?: string;\n  privacyHref?: string;\n  privacyLabel?: ReactNode;\n}\n\nexport interface GeminiSource {\n  description?: string;\n  domain: string;\n  favicon?: string;\n  href?: string;\n  id: string;\n  name: string;\n  title: string;\n}\n\nexport type GeminiThoughtStep =\n  | { kind: \"search\"; queries: readonly string[] }\n  | { kind: \"thought\"; text: string };\n\nexport interface GeminiSourceChipProps extends Omit<\n  ComponentProps<\"a\">,\n  \"children\" | \"href\"\n> {\n  source: GeminiSource;\n}\n\nexport interface GeminiThoughtsProps extends Omit<\n  ComponentProps<typeof Collapsible>,\n  \"children\"\n> {\n  hideLabel?: ReactNode;\n  showLabel?: ReactNode;\n  steps: readonly GeminiThoughtStep[];\n}\n\nexport interface GeminiStoryTextProps extends Omit<\n  ComponentProps<\"div\">,\n  \"children\"\n> {\n  sources?: readonly GeminiSource[];\n  text: string;\n}\n\nexport interface GeminiStoryMessage {\n  from: GeminiMessageRole;\n  id: string;\n  search?: boolean;\n  sources?: readonly GeminiSource[];\n  text: string;\n  thoughts?: readonly GeminiThoughtStep[];\n}\n\nexport interface GeminiTextSegment {\n  offset: number;\n  text: string;\n}\n\nexport type GeminiPlaybackPhase =\n  | { status: \"idle\" }\n  | { status: \"playing\"; source: \"script\" | \"send\"; thinking: boolean };\n",
      "type": "registry:lib",
      "target": "components/gemini/types/gemini.ts"
    },
    {
      "path": "registry/notra/gemini/components/gemini-actions.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\nimport { ThumbsDownIcon, ThumbsUpIcon } from \"lucide-react\";\n\nimport { TooltipProvider } from \"@/components/ui/tooltip\";\n\nimport { GEMINI_TOOLTIP_DELAY_MS } from \"../constants/gemini\";\nimport type { GeminiActionsProps } from \"../types/gemini\";\nimport { GeminiActionButton } from \"./gemini-action-button\";\n\nconst ICON_STROKE = 1.5;\n\nexport const GeminiActions = ({\n  className,\n  onBadResponse,\n  onGoodResponse,\n  ...props\n}: GeminiActionsProps) => (\n  <TooltipProvider delay={GEMINI_TOOLTIP_DELAY_MS}>\n    <div\n      className={cn(\"flex items-center gap-1\", className)}\n      data-slot=\"gemini-actions\"\n      {...props}\n    >\n      <GeminiActionButton label=\"Good response\" onClick={onGoodResponse}>\n        <ThumbsUpIcon strokeWidth={ICON_STROKE} />\n      </GeminiActionButton>\n      <GeminiActionButton label=\"Bad response\" onClick={onBadResponse}>\n        <ThumbsDownIcon strokeWidth={ICON_STROKE} />\n      </GeminiActionButton>\n    </div>\n  </TooltipProvider>\n);\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-actions.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-action-button.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nimport type { GeminiActionButtonProps } from \"../types/gemini\";\n\nexport const GeminiActionButton = ({\n  children,\n  className,\n  label,\n  ...props\n}: GeminiActionButtonProps) => (\n  <Tooltip>\n    <TooltipTrigger\n      render={\n        <Button\n          aria-label={label}\n          className={cn(\n            \"text-gemini-muted hover:bg-gemini-hover hover:text-gemini-muted aria-expanded:bg-gemini-hover aria-expanded:text-gemini-muted dark:hover:bg-gemini-hover focus-visible:ring-gemini-focus/30 size-7 rounded-full border-0 transition-colors duration-150 focus-visible:ring-2 motion-reduce:transition-none [&_svg:not([class*='size-'])]:size-4\",\n            className\n          )}\n          data-slot=\"gemini-action-button\"\n          size=\"icon\"\n          variant=\"ghost\"\n          {...props}\n        />\n      }\n    >\n      {children}\n    </TooltipTrigger>\n    <TooltipContent\n      className=\"bg-gemini-tooltip font-gemini text-gemini-tooltip-fg *:bg-gemini-tooltip *:fill-gemini-tooltip rounded-md border-0 bg-none px-3 py-1.5 shadow-none [corner-shape:round]\"\n      side=\"bottom\"\n      sideOffset={6}\n    >\n      {label}\n    </TooltipContent>\n  </Tooltip>\n);\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-action-button.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-composer.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\nimport { ArrowUpIcon, MicIcon, PlusIcon } from \"lucide-react\";\nimport type { FormEvent, MouseEvent, ReactNode } from \"react\";\nimport { useState } from \"react\";\n\nimport {\n  InputGroup,\n  InputGroupAddon,\n  InputGroupButton,\n  InputGroupInput,\n} from \"@/components/ui/input-group\";\n\nimport {\n  GEMINI_DEFAULT_MODEL,\n  GEMINI_MODELS,\n} from \"../constants/gemini-models\";\nimport type { GeminiComposerProps } from \"../types/gemini\";\nimport { GeminiModelSelector } from \"./gemini-model-selector\";\n\ntype SubmitState = \"idle\" | \"ready\" | \"busy\";\n\nconst SUBMIT_LABELS: Record<SubmitState, string> = {\n  busy: \"Stop\",\n  idle: \"Voice input\",\n  ready: \"Send\",\n};\n\nconst ICON_BUTTON =\n  \"focus-visible:ring-gemini-focus/30 size-9 shrink-0 rounded-full border-0 focus-visible:ring-2\";\n\nconst ActionGlyph = ({\n  children,\n  show,\n}: {\n  children: ReactNode;\n  show: boolean;\n}) => (\n  <span\n    aria-hidden=\"true\"\n    className={cn(\n      \"absolute inset-0 flex items-center justify-center transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-opacity\",\n      show\n        ? \"scale-100 opacity-100\"\n        : \"pointer-events-none scale-[0.92] opacity-0\"\n    )}\n  >\n    {children}\n  </span>\n);\n\nconst getSubmitState = (busy: boolean, canSend: boolean): SubmitState => {\n  if (busy) {\n    return \"busy\";\n  }\n  return canSend ? \"ready\" : \"idle\";\n};\n\nconst GeminiComposerSubmit = ({\n  busy,\n  canSend,\n  onStop,\n}: {\n  busy: boolean;\n  canSend: boolean;\n  onStop?: () => void;\n}) => {\n  const state = getSubmitState(busy, canSend);\n  const handleClick = busy\n    ? (event: MouseEvent<HTMLButtonElement>) => {\n        event.preventDefault();\n        onStop?.();\n      }\n    : undefined;\n\n  return (\n    <InputGroupButton\n      aria-label={SUBMIT_LABELS[state]}\n      className=\"focus-visible:ring-gemini-focus/30 text-gemini-fg hover:bg-gemini-hover hover:text-gemini-fg dark:hover:bg-gemini-hover data-[state=busy]:bg-gemini-stop data-[state=busy]:hover:bg-gemini-stop-hover dark:data-[state=busy]:hover:bg-gemini-stop-hover data-[state=ready]:bg-gemini-send data-[state=ready]:text-gemini-send-fg data-[state=ready]:hover:bg-gemini-send-hover data-[state=ready]:hover:text-gemini-send-fg dark:data-[state=ready]:hover:bg-gemini-send-hover relative size-9 shrink-0 rounded-full border-0 transition-[background-color,color] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] focus-visible:ring-2 motion-reduce:transition-none\"\n      data-slot=\"gemini-composer-submit\"\n      data-state={state}\n      onClick={handleClick}\n      size=\"icon-sm\"\n      type={state === \"ready\" ? \"submit\" : \"button\"}\n      variant=\"ghost\"\n    >\n      <ActionGlyph show={state === \"idle\"}>\n        <MicIcon className=\"size-5\" strokeWidth={1.5} />\n      </ActionGlyph>\n      <ActionGlyph show={state === \"ready\"}>\n        <ArrowUpIcon className=\"size-4.5\" strokeWidth={1.75} />\n      </ActionGlyph>\n      <ActionGlyph show={state === \"busy\"}>\n        <span className=\"block size-3.5 rounded-[0.1875rem] bg-current\" />\n      </ActionGlyph>\n    </InputGroupButton>\n  );\n};\n\nexport const GeminiComposer = ({\n  busy = false,\n  className,\n  defaultModel = GEMINI_DEFAULT_MODEL,\n  disclaimer = \"Gemini is AI and can make mistakes, including about people.\",\n  model,\n  models = GEMINI_MODELS,\n  onModelChange,\n  onSend,\n  onStop,\n  placeholder = \"Ask Gemini\",\n  privacyHref,\n  privacyLabel = \"Your privacy & Gemini\",\n  ...props\n}: GeminiComposerProps) => {\n  const [value, setValue] = useState(\"\");\n  const canSend = value.trim().length > 0;\n\n  const handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    const text = value.trim();\n    if (!text || busy) {\n      return;\n    }\n    onSend?.(text);\n    if (onSend) {\n      setValue(\"\");\n    }\n  };\n\n  return (\n    <div\n      className={cn(\"font-gemini w-full\", className)}\n      data-slot=\"gemini-composer\"\n      {...props}\n    >\n      <form onSubmit={handleSubmit}>\n        <InputGroup className=\"border-gemini-composer-border bg-gemini-composer shadow-gemini-composer dark:bg-gemini-composer has-[[data-slot=input-group-control]:focus-visible]:border-gemini-composer-border h-14 gap-1 rounded-full py-0 ps-3 pe-3 has-[[data-slot=input-group-control]:focus-visible]:ring-0 has-[>[data-align=inline-end]]:[&>input]:pr-2 has-[>[data-align=inline-start]]:[&>input]:pl-0\">\n          <InputGroupAddon\n            align=\"inline-start\"\n            className=\"text-gemini-fg p-0 has-[>button]:ml-0\"\n          >\n            <InputGroupButton\n              aria-label=\"Add files\"\n              className={cn(\n                ICON_BUTTON,\n                \"text-gemini-fg hover:bg-gemini-hover hover:text-gemini-fg dark:hover:bg-gemini-hover transition-colors duration-150 motion-reduce:transition-none\"\n              )}\n              size=\"icon-sm\"\n              variant=\"ghost\"\n            >\n              <PlusIcon className=\"size-5\" strokeWidth={1.5} />\n            </InputGroupButton>\n          </InputGroupAddon>\n          <InputGroupInput\n            aria-label=\"Message\"\n            className=\"text-gemini-fg placeholder:text-gemini-placeholder h-auto py-2 ps-1 pe-2 text-[0.9375rem] leading-6 md:text-[0.9375rem]\"\n            onChange={(event) => setValue(event.target.value)}\n            placeholder={placeholder}\n            type=\"text\"\n            value={value}\n          />\n          <InputGroupAddon\n            align=\"inline-end\"\n            className=\"text-gemini-fg gap-1 p-0 has-[>button]:mr-0\"\n          >\n            <GeminiModelSelector\n              defaultModel={defaultModel}\n              model={model}\n              models={models}\n              onModelChange={onModelChange}\n            />\n            <GeminiComposerSubmit\n              busy={busy}\n              canSend={canSend}\n              onStop={onStop}\n            />\n          </InputGroupAddon>\n        </InputGroup>\n      </form>\n      {disclaimer ? (\n        <p className=\"text-gemini-muted mt-2 text-center text-xs leading-4\">\n          {disclaimer}{\" \"}\n          {privacyHref ? (\n            <a\n              className=\"decoration-gemini-muted focus-visible:outline-gemini-focus rounded-sm underline underline-offset-2 focus-visible:outline-2\"\n              href={privacyHref}\n              rel=\"noopener noreferrer\"\n              target=\"_blank\"\n            >\n              {privacyLabel}\n            </a>\n          ) : (\n            <span className=\"decoration-gemini-muted underline underline-offset-2\">\n              {privacyLabel}\n            </span>\n          )}\n        </p>\n      ) : null}\n    </div>\n  );\n};\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-composer.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-model-selector.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\nimport { ChevronDownIcon } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\n\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from \"../../dropdown-menu/components/dropdown-menu\";\nimport {\n  GEMINI_DEFAULT_MODEL,\n  GEMINI_MODELS,\n} from \"../constants/gemini-models\";\nimport { getGeminiModel, getGeminiModelsByGroup } from \"../lib/gemini-model\";\nimport type {\n  GeminiModelId,\n  GeminiModelOption,\n  GeminiModelSelectorProps,\n} from \"../types/gemini\";\n\nconst GeminiModelRow = ({ option }: { option: GeminiModelOption }) => (\n  <DropdownMenuRadioItem\n    className=\"focus:bg-gemini-hover focus:text-gemini-fg data-highlighted:bg-gemini-hover focus:**:text-gemini-fg text-gemini-fg cursor-pointer items-start gap-3 rounded-[1.1rem] py-2.5 pr-2.5 pl-10.5 [&_[data-slot=dropdown-menu-radio-item-indicator]]:top-2.5 [&_[data-slot=dropdown-menu-radio-item-indicator]]:right-auto [&_[data-slot=dropdown-menu-radio-item-indicator]]:left-2.5 [&_[data-slot=dropdown-menu-radio-item-indicator]]:size-5\"\n    closeOnClick\n    data-slot=\"gemini-model-option\"\n    value={option.id}\n  >\n    <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n      <span className=\"flex min-w-0 items-center gap-2\">\n        <span className=\"text-gemini-fg truncate text-sm leading-5 font-medium\">\n          {option.label}\n        </span>\n        {option.badge ? (\n          <Badge className=\"bg-gemini-hover text-gemini-badge-fg! h-auto rounded-full border-0 px-2 py-0.5 text-[0.6875rem] leading-none font-medium\">\n            {option.badge}\n          </Badge>\n        ) : null}\n      </span>\n      <span className=\"text-gemini-muted! text-xs leading-4\">\n        {option.description}\n      </span>\n    </span>\n  </DropdownMenuRadioItem>\n);\n\nexport const GeminiModelSelector = ({\n  className,\n  defaultModel = GEMINI_DEFAULT_MODEL,\n  model: modelProp,\n  models = GEMINI_MODELS,\n  onModelChange,\n  ...props\n}: GeminiModelSelectorProps) => {\n  const [uncontrolledModel, setUncontrolledModel] = useState(defaultModel);\n  const model = modelProp ?? uncontrolledModel;\n  const selected = getGeminiModel(model, models);\n  const coreModels = getGeminiModelsByGroup(\"core\", models);\n  const thinkingModels = getGeminiModelsByGroup(\"thinking\", models);\n\n  const handleSelect = (next: GeminiModelId) => {\n    if (modelProp === undefined) {\n      setUncontrolledModel(next);\n    }\n    onModelChange?.(next);\n  };\n\n  const renderRow = (option: GeminiModelOption) => (\n    <GeminiModelRow key={option.id} option={option} />\n  );\n\n  return (\n    <DropdownMenu modal={false}>\n      <DropdownMenuTrigger\n        render={\n          <Button\n            aria-label={`Model: ${selected.label}`}\n            className={cn(\n              \"group/gemini-model text-gemini-chip-fg dark:text-gemini-muted hover:bg-gemini-hover hover:text-gemini-chip-fg dark:hover:text-gemini-muted aria-expanded:bg-gemini-hover aria-expanded:text-gemini-chip-fg dark:aria-expanded:text-gemini-muted data-popup-open:bg-gemini-hover dark:hover:bg-gemini-hover focus-visible:ring-gemini-focus/30 h-9 shrink-0 gap-1 rounded-full border-0 ps-3.5 pe-2.5 text-[0.8125rem] leading-5 font-medium transition-[background-color] duration-150 focus-visible:ring-2 motion-reduce:transition-none\",\n              className\n            )}\n            data-slot=\"gemini-model-selector\"\n            variant=\"ghost\"\n            {...props}\n          />\n        }\n      >\n        <span className=\"font-medium\">{selected.chip}</span>\n        <ChevronDownIcon\n          className=\"text-gemini-muted size-4 transition-transform duration-150 group-data-popup-open/gemini-model:rotate-180 motion-reduce:transition-none\"\n          strokeWidth={1.5}\n        />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent\n        align=\"end\"\n        className=\"bg-gemini-popover font-gemini text-gemini-fg shadow-gemini-popover w-72 rounded-[1.5rem] p-1.5 ring-0\"\n        side=\"top\"\n        sideOffset={10}\n      >\n        <DropdownMenuRadioGroup\n          onValueChange={(next) => {\n            const option = models.find((item) => item.id === next);\n            if (option) {\n              handleSelect(option.id);\n            }\n          }}\n          value={selected.id}\n        >\n          {coreModels.map(renderRow)}\n          {thinkingModels.length > 0 ? (\n            <DropdownMenuSeparator className=\"bg-gemini-separator mx-2 my-1\" />\n          ) : null}\n          {thinkingModels.map(renderRow)}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n};\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-model-selector.tsx"
    },
    {
      "path": "registry/notra/gemini/constants/gemini-models.ts",
      "content": "import type { GeminiModelId, GeminiModelOption } from \"../types/gemini\";\n\nexport const GEMINI_DEFAULT_MODEL: GeminiModelId = \"pro\";\n\nexport const GEMINI_PRO_MODEL: GeminiModelOption = {\n  chip: \"Pro\",\n  description: \"Reasoning\",\n  group: \"core\",\n  id: \"pro\",\n  label: \"3.1 Pro\",\n};\n\nexport const GEMINI_MODELS: readonly GeminiModelOption[] = [\n  {\n    chip: \"Flash-Lite\",\n    description: \"Fastest answers\",\n    group: \"core\",\n    id: \"flash-lite\",\n    label: \"3.5 Flash-Lite\",\n  },\n  {\n    badge: \"New\",\n    chip: \"Flash\",\n    description: \"Versatile help\",\n    group: \"core\",\n    id: \"flash\",\n    label: \"3.7 Flash\",\n  },\n  GEMINI_PRO_MODEL,\n  {\n    chip: \"Thinking\",\n    description: \"Complex problem solving\",\n    group: \"thinking\",\n    id: \"thinking\",\n    label: \"Thinking (extended)\",\n  },\n];\n",
      "type": "registry:lib",
      "target": "components/gemini/constants/gemini-models.ts"
    },
    {
      "path": "registry/notra/gemini/lib/gemini-model.ts",
      "content": "import { GEMINI_MODELS, GEMINI_PRO_MODEL } from \"../constants/gemini-models\";\nimport type {\n  GeminiModelGroup,\n  GeminiModelId,\n  GeminiModelOption,\n} from \"../types/gemini\";\n\nexport const getGeminiModel = (\n  id: GeminiModelId,\n  models: readonly GeminiModelOption[] = GEMINI_MODELS\n): GeminiModelOption =>\n  models.find((item) => item.id === id) ?? models[0] ?? GEMINI_PRO_MODEL;\n\nexport const getGeminiModelsByGroup = (\n  group: GeminiModelGroup,\n  models: readonly GeminiModelOption[] = GEMINI_MODELS\n): GeminiModelOption[] => models.filter((item) => item.group === group);\n",
      "type": "registry:lib",
      "target": "components/gemini/lib/gemini-model.ts"
    },
    {
      "path": "registry/notra/gemini/components/gemini-story-text.tsx",
      "content": "import { cn } from \"cn\";\n\nimport {\n  geminiCitationId,\n  splitGeminiBold,\n  splitGeminiCitations,\n  splitGeminiParagraphs,\n} from \"../lib/gemini-text\";\nimport type { GeminiSource, GeminiStoryTextProps } from \"../types/gemini\";\nimport { GeminiSourceChip } from \"./gemini-source-chip\";\n\nconst GeminiBoldText = ({ text }: { text: string }) => (\n  <>\n    {splitGeminiBold(text).map((part) =>\n      part.text.startsWith(\"**\") && part.text.endsWith(\"**\") ? (\n        <strong key={part.offset}>{part.text.slice(2, -2)}</strong>\n      ) : (\n        <span key={part.offset}>{part.text}</span>\n      )\n    )}\n  </>\n);\n\nconst GeminiInlineText = ({\n  sources,\n  text,\n}: {\n  sources: ReadonlyMap<string, GeminiSource>;\n  text: string;\n}) => (\n  <>\n    {splitGeminiCitations(text).map((piece) => {\n      const id = geminiCitationId(piece.text);\n      if (id === null) {\n        return <GeminiBoldText key={piece.offset} text={piece.text} />;\n      }\n      const source = sources.get(id);\n      return source ? (\n        <GeminiSourceChip key={piece.offset} source={source} />\n      ) : null;\n    })}\n  </>\n);\n\nexport const GeminiStoryText = ({\n  className,\n  sources = [],\n  text,\n  ...props\n}: GeminiStoryTextProps) => {\n  const lookup = new Map(sources.map((source) => [source.id, source]));\n\n  return (\n    <div\n      className={cn(\"flex flex-col gap-3\", className)}\n      data-slot=\"gemini-story-text\"\n      {...props}\n    >\n      {splitGeminiParagraphs(text).map((paragraph) => (\n        <p key={paragraph.offset}>\n          <GeminiInlineText sources={lookup} text={paragraph.text} />\n        </p>\n      ))}\n    </div>\n  );\n};\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-story-text.tsx"
    },
    {
      "path": "registry/notra/gemini/lib/gemini-text.ts",
      "content": "import type { GeminiTextSegment } from \"../types/gemini\";\n\nconst BOLD_PATTERN = /(\\*\\*[^*]+\\*\\*)/g;\n\nconst CITE_PATTERN = /(\\{\\{[a-z0-9-]+\\}\\})/g;\n\nconst PARAGRAPH_SEPARATOR = \"\\n\\n\";\n\nexport const splitWithOffsets = (\n  text: string,\n  separator: string | RegExp,\n  separatorLength: number\n): GeminiTextSegment[] => {\n  const segments: GeminiTextSegment[] = [];\n  let offset = 0;\n  for (const part of text.split(separator)) {\n    if (part.length > 0) {\n      segments.push({ offset, text: part });\n    }\n    offset += part.length + separatorLength;\n  }\n  return segments;\n};\n\nexport const splitGeminiParagraphs = (text: string): GeminiTextSegment[] =>\n  splitWithOffsets(text, PARAGRAPH_SEPARATOR, PARAGRAPH_SEPARATOR.length);\n\nexport const splitGeminiBold = (text: string): GeminiTextSegment[] =>\n  splitWithOffsets(text, BOLD_PATTERN, 0);\n\nexport const splitGeminiCitations = (text: string): GeminiTextSegment[] =>\n  splitWithOffsets(text, CITE_PATTERN, 0);\n\nexport const geminiCitationId = (text: string): string | null =>\n  text.match(/^\\{\\{([a-z0-9-]+)\\}\\}$/)?.[1] ?? null;\n",
      "type": "registry:lib",
      "target": "components/gemini/lib/gemini-text.ts"
    },
    {
      "path": "registry/notra/gemini/constants/gemini-story.ts",
      "content": "import type {\n  GeminiSource,\n  GeminiStoryMessage,\n  GeminiThoughtStep,\n} from \"../types/gemini\";\n\nexport const GEMINI_STORY_SOURCES: GeminiSource[] = [\n  {\n    description:\n      \"Cursor's cloud agents run on remote machines, so a task keeps going after you close the laptop, and you can pick it up from the editor again.\",\n    domain: \"cursor.com\",\n    href: \"https://cursor.com\",\n    id: \"cursor-blog\",\n    name: \"Cursor\",\n    title: \"Cloud agents: work that keeps running without your laptop\",\n  },\n  {\n    description:\n      \"Write-ahead log segments are shipped to object storage, so state stays durable and versioned while the hot path stays off the editor's thread.\",\n    domain: \"aws.amazon.com\",\n    href: \"https://aws.amazon.com/s3\",\n    id: \"s3-docs\",\n    name: \"AWS\",\n    title: \"Amazon S3 versioning and durable storage\",\n  },\n];\n\nexport const GEMINI_STORY_THOUGHTS: GeminiThoughtStep[] = [\n  {\n    kind: \"thought\",\n    text: \"The user asks about two terms. I should check what each one means before answering.\",\n  },\n  {\n    kind: \"search\",\n    queries: [\"cursor origin cloud workspace\", \"wal-on-s3 snapshots artifacts\"],\n  },\n  {\n    kind: \"thought\",\n    text: \"Both results agree: Origin is the remote workspace and wal-on-s3 is where its state is stored.\",\n  },\n];\n\nexport const GEMINI_STORY_THREAD: GeminiStoryMessage[] = [\n  {\n    from: \"user\",\n    id: \"u-1\",\n    text: \"what are cursor origin and wal-on-s3?\",\n  },\n  {\n    from: \"assistant\",\n    id: \"a-1\",\n    search: true,\n    sources: GEMINI_STORY_SOURCES,\n    text: \"**Cursor Origin** is Cursor's cloud workspace: the agent keeps working on your repo remotely, even with your laptop closed. {{cursor-blog}}\\n\\n**wal-on-s3** stores its snapshots and artifacts on S3, so files stay versioned and nothing blocks the editor. {{s3-docs}}\",\n    thoughts: GEMINI_STORY_THOUGHTS,\n  },\n];\n\nexport const GEMINI_STORY_REPLIES = [\n  \"Got it. Let me know when you want to keep going.\",\n  \"Sure. I'm here.\",\n  \"Noted. What's next?\",\n] as const;\n\nexport const GEMINI_STORY_ASSISTANT_MESSAGES = GEMINI_STORY_THREAD.filter(\n  (message) => message.from === \"assistant\"\n);\n",
      "type": "registry:lib",
      "target": "components/gemini/constants/gemini-story.ts"
    },
    {
      "path": "registry/notra/gemini/hooks/use-gemini-playback.ts",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport {\n  GEMINI_SEARCHING_LABEL,\n  GEMINI_THINKING_LABEL,\n} from \"../constants/gemini\";\nimport type { GeminiPlaybackPhase, GeminiStoryMessage } from \"../types/gemini\";\n\nconst TOKEN_SPLIT = /(\\s+)/;\nconst REDUCED_MOTION_MAX_DELAY_MS = 70;\nconst USER_TURN_DELAY_MS = 420;\nconst SEARCH_DELAY_MS = 1800;\nconst THINK_DELAY_MS = 1100;\nconst REDUCED_REPLY_DELAY_MS = 180;\nconst TOKEN_DELAY_MS = 28;\nconst TURN_END_DELAY_MS = 480;\n\nconst wait = (ms: number) =>\n  new Promise<void>((resolve) => {\n    window.setTimeout(resolve, ms);\n  });\n\nexport const useGeminiPlayback = (\n  script: readonly GeminiStoryMessage[],\n  reducedMotion: boolean\n) => {\n  const [messages, setMessages] = useState<GeminiStoryMessage[]>(() => [\n    ...script,\n  ]);\n  const [completeIds, setCompleteIds] = useState<ReadonlySet<string>>(\n    () => new Set(script.map((item) => item.id))\n  );\n  const [phase, setPhase] = useState<GeminiPlaybackPhase>({ status: \"idle\" });\n  const phaseRef = useRef(phase);\n  const enter = useCallback((next: GeminiPlaybackPhase) => {\n    phaseRef.current = next;\n    setPhase(next);\n  }, []);\n  const setThinking = useCallback(\n    (thinking: boolean) => {\n      const current = phaseRef.current;\n      if (current.status === \"playing\") {\n        enter({ ...current, thinking });\n      }\n    },\n    [enter]\n  );\n  const [thinkingLabel, setThinkingLabel] = useState(GEMINI_SEARCHING_LABEL);\n  const runRef = useRef(0);\n\n  const markComplete = useCallback((id: string) => {\n    setCompleteIds((current) => new Set(current).add(id));\n  }, []);\n\n  const resetToScript = useCallback(() => {\n    setMessages([...script]);\n    setCompleteIds(new Set(script.map((item) => item.id)));\n    setThinkingLabel(GEMINI_SEARCHING_LABEL);\n    enter({ status: \"idle\" });\n  }, [enter, script]);\n\n  const stop = useCallback(() => {\n    runRef.current += 1;\n    resetToScript();\n  }, [resetToScript]);\n\n  const playTurn = useCallback(\n    async (message: GeminiStoryMessage, alive: () => boolean) => {\n      const delay = (ms: number) =>\n        wait(reducedMotion ? Math.min(ms, REDUCED_MOTION_MAX_DELAY_MS) : ms);\n\n      if (message.from === \"user\") {\n        setMessages((current) => [...current, message]);\n        markComplete(message.id);\n        await delay(USER_TURN_DELAY_MS);\n        return;\n      }\n\n      setThinkingLabel(\n        message.search ? GEMINI_SEARCHING_LABEL : GEMINI_THINKING_LABEL\n      );\n      setThinking(true);\n      await delay(message.search ? SEARCH_DELAY_MS : THINK_DELAY_MS);\n      if (!alive()) {\n        return;\n      }\n      setThinking(false);\n\n      if (reducedMotion) {\n        setMessages((current) => [...current, message]);\n        markComplete(message.id);\n        await delay(REDUCED_REPLY_DELAY_MS);\n        return;\n      }\n\n      setMessages((current) => [...current, { ...message, text: \"\" }]);\n      let text = \"\";\n      for (const token of message.text.split(TOKEN_SPLIT)) {\n        if (!alive()) {\n          return;\n        }\n        text += token;\n        const snapshot = text;\n        setMessages((current) =>\n          current.map((item) =>\n            item.id === message.id ? { ...item, text: snapshot } : item\n          )\n        );\n        await delay(TOKEN_DELAY_MS);\n      }\n      if (!alive()) {\n        return;\n      }\n      markComplete(message.id);\n      await delay(TURN_END_DELAY_MS);\n    },\n    [markComplete, reducedMotion, setThinking]\n  );\n\n  const play = useCallback(async () => {\n    const run = runRef.current + 1;\n    runRef.current = run;\n    const alive = () => runRef.current === run;\n\n    enter({ status: \"playing\", source: \"script\", thinking: false });\n    setMessages([]);\n    setCompleteIds(new Set());\n\n    for (const message of script) {\n      if (!alive()) {\n        return;\n      }\n      // react-doctor-disable-next-line react-doctor/async-await-in-loop -- turns must play one after another\n      await playTurn(message, alive);\n    }\n\n    if (alive()) {\n      enter({ status: \"idle\" });\n    }\n  }, [enter, playTurn, script]);\n\n  const send = useCallback(\n    async (text: string, reply: string) => {\n      const current = phaseRef.current;\n      if (current.status === \"playing\" && current.source === \"send\") {\n        return;\n      }\n      const run = runRef.current + 1;\n      runRef.current = run;\n      const alive = () => runRef.current === run;\n      const now = Date.now();\n\n      enter({ status: \"playing\", source: \"send\", thinking: false });\n      await playTurn({ from: \"user\", id: `user-${now}`, text }, alive);\n      if (!alive()) {\n        return;\n      }\n      await playTurn(\n        { from: \"assistant\", id: `assistant-${now}`, text: reply },\n        alive\n      );\n      if (alive()) {\n        enter({ status: \"idle\" });\n      }\n    },\n    [enter, playTurn]\n  );\n\n  useEffect(\n    () => () => {\n      runRef.current += 1;\n    },\n    []\n  );\n\n  const playing = phase.status === \"playing\";\n  const thinking = phase.status === \"playing\" && phase.thinking;\n\n  return {\n    completeIds,\n    messages,\n    play,\n    playing,\n    send,\n    stop,\n    thinking,\n    thinkingLabel,\n  };\n};\n",
      "type": "registry:hook",
      "target": "components/gemini/hooks/use-gemini-playback.ts"
    },
    {
      "path": "registry/notra/gemini/examples/gemini-demo.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\n\nimport { GeminiActions } from \"../components/gemini-actions\";\nimport { GeminiComposer } from \"../components/gemini-composer\";\nimport { GeminiMessage } from \"../components/gemini-message\";\nimport { GeminiStoryText } from \"../components/gemini-story-text\";\nimport { GeminiThinking } from \"../components/gemini-thinking\";\nimport { GeminiThoughts } from \"../components/gemini-thoughts\";\nimport {\n  GEMINI_STORY_REPLIES,\n  GEMINI_STORY_THREAD,\n} from \"../constants/gemini-story\";\nimport { useGeminiPlayback } from \"../hooks/use-gemini-playback\";\nimport { useGeminiReducedMotion } from \"../hooks/use-gemini-reduced-motion\";\n\nexport default function GeminiDemo() {\n  const reducedMotion = useGeminiReducedMotion();\n  const playback = useGeminiPlayback(GEMINI_STORY_THREAD, reducedMotion);\n  const replyIndexRef = useRef(0);\n  const scrollRef = useRef<HTMLDivElement>(null);\n  const hasMountedRef = useRef(false);\n\n  useEffect(() => {\n    if (!hasMountedRef.current) {\n      hasMountedRef.current = true;\n      return;\n    }\n    const viewport = scrollRef.current?.querySelector(\n      '[data-slot=\"scroll-area-viewport\"]'\n    );\n    viewport?.scrollTo({\n      behavior: reducedMotion ? \"auto\" : \"smooth\",\n      top: viewport.scrollHeight,\n    });\n  }, [playback.messages, playback.thinking, reducedMotion]);\n\n  const handleSend = (text: string) => {\n    if (playback.playing) {\n      return;\n    }\n    const reply =\n      GEMINI_STORY_REPLIES[\n        replyIndexRef.current % GEMINI_STORY_REPLIES.length\n      ] ?? \"Sure.\";\n    replyIndexRef.current += 1;\n    playback.send(text, reply).catch(() => undefined);\n  };\n\n  return (\n    <Card\n      className=\"border-gemini-border bg-gemini-bg font-gemini text-gemini-fg h-150 w-full min-w-0 gap-0 overflow-hidden rounded-2xl border py-0 text-base ring-0\"\n      data-slot=\"gemini-demo\"\n    >\n      <CardHeader className=\"flex h-12 shrink-0 items-center justify-between gap-3 ps-5 pe-3\">\n        <CardTitle className=\"text-gemini-muted text-base leading-6 font-normal\">\n          Gemini\n        </CardTitle>\n      </CardHeader>\n      <ScrollArea className=\"min-h-0 flex-1\" ref={scrollRef}>\n        <CardContent\n          aria-live=\"polite\"\n          className=\"mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-8 px-5 pt-4 pb-8\"\n          role=\"log\"\n        >\n          {playback.messages.map((message) => (\n            <GeminiMessage\n              actions={\n                message.from === \"assistant\" ? (\n                  <div\n                    className={\n                      playback.completeIds.has(message.id)\n                        ? undefined\n                        : \"invisible\"\n                    }\n                  >\n                    <GeminiActions />\n                  </div>\n                ) : undefined\n              }\n              from={message.from}\n              key={message.id}\n              thoughts={\n                message.thoughts ? (\n                  <GeminiThoughts steps={message.thoughts} />\n                ) : undefined\n              }\n            >\n              {message.from === \"user\" ? (\n                message.text\n              ) : (\n                <GeminiStoryText\n                  sources={message.sources}\n                  text={message.text}\n                />\n              )}\n            </GeminiMessage>\n          ))}\n          {playback.thinking ? (\n            <GeminiThinking\n              label={playback.thinkingLabel}\n              reducedMotion={reducedMotion}\n            />\n          ) : null}\n        </CardContent>\n      </ScrollArea>\n      <CardContent className=\"mx-auto w-full max-w-3xl min-w-0 shrink-0 px-5 pb-5\">\n        <GeminiComposer\n          busy={playback.playing || playback.thinking}\n          onSend={handleSend}\n          onStop={playback.stop}\n        />\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/gemini/examples/gemini-demo.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-thoughts.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\nimport { ChevronDownIcon, SearchIcon } from \"lucide-react\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n  Collapsible,\n  CollapsibleContent,\n  CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\n\nimport {\n  GEMINI_HIDE_THINKING_LABEL,\n  GEMINI_SHOW_THINKING_LABEL,\n} from \"../constants/gemini\";\nimport type { GeminiThoughtsProps } from \"../types/gemini\";\n\nconst withOccurrenceKeys = <T,>(\n  items: readonly T[],\n  getKey: (item: T) => string\n) => {\n  const seen = new Map<string, number>();\n  return items.map((item) => {\n    const base = getKey(item);\n    const count = (seen.get(base) ?? 0) + 1;\n    seen.set(base, count);\n    return [item, `${base}#${count}`] as const;\n  });\n};\n\nexport const GeminiThoughts = ({\n  className,\n  hideLabel = GEMINI_HIDE_THINKING_LABEL,\n  showLabel = GEMINI_SHOW_THINKING_LABEL,\n  steps,\n  ...props\n}: GeminiThoughtsProps) => (\n  <Collapsible\n    className={cn(\"group/gemini-thoughts font-gemini w-full\", className)}\n    data-slot=\"gemini-thoughts\"\n    {...props}\n  >\n    <CollapsibleTrigger\n      render={\n        <Button\n          className=\"text-gemini-muted hover:bg-gemini-hover hover:text-gemini-fg focus-visible:ring-gemini-focus/30 aria-expanded:text-gemini-fg dark:hover:bg-gemini-hover -ms-2 h-8 gap-2 rounded-full border-0 px-2 text-[0.9375rem] leading-5 font-normal focus-visible:ring-2 [&[data-panel-open]>svg:last-child]:rotate-180\"\n          variant=\"ghost\"\n        />\n      }\n    >\n      <span className=\"group-data-open/gemini-thoughts:hidden\">\n        {showLabel}\n      </span>\n      <span className=\"hidden group-data-open/gemini-thoughts:inline\">\n        {hideLabel}\n      </span>\n      <ChevronDownIcon\n        aria-hidden=\"true\"\n        className=\"size-4 transition-transform duration-200 motion-reduce:transition-none\"\n        strokeWidth={1.5}\n      />\n    </CollapsibleTrigger>\n    <CollapsibleContent className=\"h-(--collapsible-panel-height) overflow-hidden transition-[height,opacity] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] data-ending-style:h-0 data-ending-style:opacity-0 data-starting-style:h-0 data-starting-style:opacity-0 motion-reduce:transition-none\">\n      <div className=\"border-gemini-separator text-gemini-muted mt-2 flex flex-col gap-3 border-s-2 ps-4 text-[0.875rem] leading-6\">\n        {withOccurrenceKeys(steps, (item) =>\n          item.kind === \"thought\" ? item.text : item.queries.join(\"|\")\n        ).map(([step, key]) =>\n          step.kind === \"thought\" ? (\n            <p key={key}>{step.text}</p>\n          ) : (\n            <div className=\"flex flex-col gap-2\" key={key}>\n              <span className=\"text-gemini-fg flex items-center gap-2 text-[0.8125rem] leading-5\">\n                <SearchIcon\n                  aria-hidden=\"true\"\n                  className=\"size-3.5\"\n                  strokeWidth={1.75}\n                />\n                Searching the web\n              </span>\n              <span className=\"flex flex-wrap gap-1.5\">\n                {withOccurrenceKeys(step.queries, (query) => query).map(\n                  ([query, queryKey]) => (\n                    <Badge\n                      className=\"border-gemini-separator text-gemini-muted h-auto rounded-full bg-transparent px-2.5 py-0.5 text-[0.8125rem] leading-5 font-normal\"\n                      key={queryKey}\n                      variant=\"outline\"\n                    >\n                      {query}\n                    </Badge>\n                  )\n                )}\n              </span>\n            </div>\n          )\n        )}\n      </div>\n    </CollapsibleContent>\n  </Collapsible>\n);\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-thoughts.tsx"
    },
    {
      "path": "registry/notra/gemini/components/gemini-source-chip.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"cn\";\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\";\nimport { badgeVariants } from \"@/components/ui/badge\";\nimport {\n  HoverCard,\n  HoverCardContent,\n  HoverCardTrigger,\n} from \"@/components/ui/hover-card\";\n\nimport {\n  GEMINI_FAVICON_URL,\n  GEMINI_HOVER_CLOSE_DELAY_MS,\n  GEMINI_HOVER_OPEN_DELAY_MS,\n} from \"../constants/gemini\";\nimport type { GeminiSourceChipProps } from \"../types/gemini\";\n\nexport const GeminiSourceChip = ({\n  className,\n  rel = \"noopener noreferrer\",\n  source,\n  target = \"_blank\",\n  ...props\n}: GeminiSourceChipProps) => (\n  <HoverCard>\n    <HoverCardTrigger\n      className={cn(\n        badgeVariants({ variant: \"secondary\" }),\n        \"bg-gemini-bubble text-gemini-muted hover:bg-gemini-hover hover:text-gemini-fg focus-visible:outline-gemini-focus mx-1 h-6 rounded-full border-0 px-2.5 align-baseline text-[0.8125rem] leading-none font-normal no-underline focus-visible:ring-0 focus-visible:outline-2 focus-visible:outline-solid motion-reduce:transition-none\",\n        className\n      )}\n      closeDelay={GEMINI_HOVER_CLOSE_DELAY_MS}\n      data-slot=\"gemini-source-chip\"\n      delay={GEMINI_HOVER_OPEN_DELAY_MS}\n      href={source.href}\n      rel={rel}\n      target={target}\n      {...props}\n    >\n      {source.name}\n    </HoverCardTrigger>\n    <HoverCardContent\n      align=\"start\"\n      className=\"bg-gemini-popover font-gemini text-gemini-fg shadow-gemini-popover ring-gemini-border w-80 max-w-[calc(100vw-2rem)] gap-0 rounded-2xl p-4\"\n      sideOffset={8}\n    >\n      <div className=\"text-gemini-muted flex items-center gap-2 text-sm leading-5\">\n        <Avatar className=\"size-4 rounded-sm after:hidden\">\n          <AvatarImage\n            alt=\"\"\n            className=\"rounded-sm\"\n            src={\n              source.favicon ??\n              `${GEMINI_FAVICON_URL}?domain=${encodeURIComponent(source.domain)}&sz=64`\n            }\n          />\n          <AvatarFallback className=\"bg-gemini-hover rounded-sm\" />\n        </Avatar>\n        {source.name}\n      </div>\n      <p className=\"mt-2 text-[0.9375rem] leading-5\">{source.title}</p>\n      {source.description ? (\n        <p className=\"text-gemini-muted mt-2 line-clamp-2 text-[0.8125rem] leading-[1.15rem]\">\n          {source.description}\n        </p>\n      ) : null}\n    </HoverCardContent>\n  </HoverCard>\n);\n",
      "type": "registry:component",
      "target": "components/gemini/components/gemini-source-chip.tsx"
    }
  ],
  "cssVars": {
    "theme": {
      "color-gemini-bg": "var(--gemini-bg)",
      "color-gemini-fg": "var(--gemini-fg)",
      "color-gemini-muted": "var(--gemini-muted)",
      "color-gemini-subtle": "var(--gemini-subtle)",
      "color-gemini-border": "var(--gemini-border)",
      "color-gemini-hover": "var(--gemini-hover)",
      "color-gemini-bubble": "var(--gemini-bubble)",
      "color-gemini-composer": "var(--gemini-composer)",
      "color-gemini-composer-border": "var(--gemini-composer-border)",
      "color-gemini-chip-fg": "var(--gemini-chip-fg)",
      "color-gemini-badge-fg": "var(--gemini-badge-fg)",
      "color-gemini-send": "var(--gemini-send)",
      "color-gemini-send-fg": "var(--gemini-send-fg)",
      "color-gemini-send-hover": "var(--gemini-send-hover)",
      "color-gemini-stop": "var(--gemini-stop)",
      "color-gemini-stop-hover": "var(--gemini-stop-hover)",
      "color-gemini-separator": "var(--gemini-separator)",
      "color-gemini-focus": "var(--gemini-focus)",
      "color-gemini-popover": "var(--gemini-popover)",
      "color-gemini-tooltip": "var(--gemini-tooltip)",
      "color-gemini-tooltip-fg": "var(--gemini-tooltip-fg)",
      "shadow-gemini-composer": "var(--gemini-composer-shadow)",
      "shadow-gemini-popover": "var(--gemini-popover-shadow)",
      "font-gemini": "\"Google Sans Flex\", \"Google Sans\", Roboto, Arial, sans-serif",
      "color-gemini-placeholder": "var(--gemini-placeholder)"
    },
    "light": {
      "gemini-bg": "#ffffff",
      "gemini-fg": "#1f1f1f",
      "gemini-muted": "#444746",
      "gemini-subtle": "#80868b",
      "gemini-border": "#00000014",
      "gemini-hover": "#f1f3f4",
      "gemini-bubble": "#f0f0f0",
      "gemini-composer": "#ffffff",
      "gemini-composer-border": "#0000000a",
      "gemini-composer-shadow": "0 1px 2px rgb(60 64 67 / 0.08), 0 2px 12px rgb(60 64 67 / 0.08)",
      "gemini-chip-fg": "#3c4043",
      "gemini-badge-fg": "#3c4043",
      "gemini-send": "#1f1f1f",
      "gemini-send-fg": "#ffffff",
      "gemini-send-hover": "#000000",
      "gemini-stop": "#e8eaed",
      "gemini-stop-hover": "#dadce0",
      "gemini-separator": "#e8eaed",
      "gemini-focus": "#1a73e8",
      "gemini-popover": "#ffffff",
      "gemini-popover-shadow": "0 8px 28px rgb(60 64 67 / 0.16)",
      "gemini-tooltip": "#171717",
      "gemini-tooltip-fg": "#fafafa",
      "gemini-placeholder": "#5f6368"
    },
    "dark": {
      "gemini-bg": "#1f1f1f",
      "gemini-fg": "#e3e3e3",
      "gemini-muted": "#c4c7c5",
      "gemini-subtle": "#80868b",
      "gemini-border": "#ffffff1a",
      "gemini-hover": "#ffffff1a",
      "gemini-bubble": "#ffffff1a",
      "gemini-composer": "#ffffff0f",
      "gemini-composer-border": "#ffffff1a",
      "gemini-composer-shadow": "0 1px 2px rgb(0 0 0 / 0.24)",
      "gemini-chip-fg": "#fafafa",
      "gemini-badge-fg": "#e8eaed",
      "gemini-send": "#ffffff",
      "gemini-send-fg": "#1f1f1f",
      "gemini-send-hover": "#ffffffe6",
      "gemini-stop": "#ffffff1f",
      "gemini-stop-hover": "#ffffff29",
      "gemini-separator": "#ffffff1a",
      "gemini-focus": "#1a73e8",
      "gemini-popover": "#131419",
      "gemini-popover-shadow": "0 8px 28px rgb(0 0 0 / 0.45)",
      "gemini-tooltip": "#fafafa",
      "gemini-tooltip-fg": "#171717",
      "gemini-placeholder": "#bdc1c6"
    }
  },
  "type": "registry:block"
}