{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "attachment",
  "type": "registry:ui",
  "title": "Attachment",
  "description": "File cards, chips, upload states, and a drop zone.",
  "categories": [
    "data-display"
  ],
  "dependencies": [
    "@base-ui/react@1.9.0",
    "@hugeicons/core-free-icons@4.4.0",
    "@hugeicons/react@1.1.10",
    "shiki@4.6.0"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/button.json",
    "https://sprout.tulipfarm.ai/r/file-viewer.json",
    "https://sprout.tulipfarm.ai/r/hover-card.json",
    "https://sprout.tulipfarm.ai/r/spinner.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/attachment.tsx",
      "type": "registry:ui",
      "target": "components/ui/attachment.tsx",
      "content": "'use client';\n\nimport {\n  Children,\n  createContext,\n  useCallback,\n  useContext,\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n  type ComponentProps,\n  type DragEvent,\n  type KeyboardEvent,\n  type ReactElement,\n  type ReactNode,\n} from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { ChevronLeftIcon } from '@/lib/sprout/icons/chevron-left-icon';\nimport { ChevronRightIcon } from '@/lib/sprout/icons/chevron-right-icon';\nimport { CloseIcon } from '@/lib/sprout/icons/close-icon';\nimport { ImageIcon } from '@/lib/sprout/icons/image-icon';\nimport { UploadIcon } from '@/lib/sprout/icons/upload-icon';\nimport { cn } from '@/lib/sprout/classes';\nimport { defaultFileAccept, fileKind, formatFileSize, type FileKind } from '@/lib/sprout/file-kind';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { FilePreview, FileViewer, isPreviewableFile, type ViewableFile } from '@/components/ui/file-viewer';\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from '@/components/ui/hover-card';\nimport { Spinner } from '@/components/ui/spinner';\n\nexport const attachmentStateNames = ['idle', 'uploading', 'processing', 'error', 'done'] as const;\nexport const attachmentSizeNames = ['lg', 'md', 'sm'] as const;\nexport const attachmentOrientationNames = ['horizontal', 'vertical'] as const;\nexport const attachmentMediaVariantNames = ['icon', 'image'] as const;\nexport const attachmentGroupVariantNames = ['carousel', 'grid', 'inline', 'list'] as const;\nexport const fileAttachmentVariantNames = ['list', 'grid', 'inline', 'chip'] as const;\nexport const fileAttachmentStateNames = ['ready', 'uploading', 'processing', 'error'] as const;\nexport const fileTypeIconSizeNames = ['sm', 'lg'] as const;\n\nexport type AttachmentState = (typeof attachmentStateNames)[number];\nexport type AttachmentSize = (typeof attachmentSizeNames)[number];\nexport type AttachmentOrientation = (typeof attachmentOrientationNames)[number];\nexport type AttachmentMediaVariant = (typeof attachmentMediaVariantNames)[number];\nexport type AttachmentGroupVariant = (typeof attachmentGroupVariantNames)[number];\nexport type FileAttachmentVariant = (typeof fileAttachmentVariantNames)[number];\nexport type FileAttachmentState = (typeof fileAttachmentStateNames)[number];\nexport type FileTypeIconSize = (typeof fileTypeIconSizeNames)[number];\nexport type { FileKind };\n\nexport interface AttachmentProps extends ComponentProps<'div'> {\n  state?: AttachmentState | undefined;\n  size?: AttachmentSize | undefined;\n  orientation?: AttachmentOrientation | undefined;\n}\n\nexport function Attachment({\n  className,\n  state = 'done',\n  size = 'lg',\n  orientation = 'horizontal',\n  ...props\n}: AttachmentProps) {\n  return (\n    <div\n      data-slot=\"attachment\"\n      data-state={state}\n      data-size={size}\n      data-orientation={orientation}\n      className={cn(\n        'sprout-attachment',\n        `sprout-attachment-size-${size}`,\n        `sprout-attachment-${orientation}`,\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport interface AttachmentMediaProps extends ComponentProps<'div'> {\n  variant?: AttachmentMediaVariant | undefined;\n}\n\nexport function AttachmentMedia({ className, variant = 'icon', ...props }: AttachmentMediaProps) {\n  return (\n    <div\n      data-slot=\"attachment-media\"\n      data-variant={variant}\n      className={cn('sprout-attachment-media', className)}\n      {...props}\n    />\n  );\n}\n\nexport function AttachmentContent({ className, ...props }: ComponentProps<'div'>) {\n  return <div data-slot=\"attachment-content\" className={cn('sprout-attachment-content', className)} {...props} />;\n}\n\nexport function AttachmentTitle({ className, ...props }: ComponentProps<'span'>) {\n  return <span data-slot=\"attachment-title\" className={cn('sprout-attachment-title', className)} {...props} />;\n}\n\nexport function AttachmentDescription({ className, ...props }: ComponentProps<'span'>) {\n  return (\n    <span data-slot=\"attachment-description\" className={cn('sprout-attachment-description', className)} {...props} />\n  );\n}\n\nexport function AttachmentActions({ className, ...props }: ComponentProps<'div'>) {\n  return <div data-slot=\"attachment-actions\" className={cn('sprout-attachment-actions', className)} {...props} />;\n}\n\nexport function AttachmentAction({ variant, size = 'icon-xs', ...props }: ButtonProps) {\n  return <Button data-slot=\"attachment-action\" variant={variant ?? 'ghost'} size={size} {...props} />;\n}\n\nexport type AttachmentTriggerProps = useRender.ComponentProps<'button'>;\n\nexport function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerProps) {\n  return useRender({\n    defaultTagName: 'button',\n    render,\n    props: mergeProps<'button'>(\n      {\n        type: render ? type : (type ?? 'button'),\n        className: cn('sprout-attachment-trigger', className),\n      },\n      { 'data-slot': 'attachment-trigger' } as ComponentProps<'button'>,\n      props,\n    ),\n  });\n}\n\nexport interface AttachmentGroupProps extends ComponentProps<'div'> {\n  variant?: AttachmentGroupVariant | undefined;\n}\n\ninterface ViewerEntry {\n  file: () => ViewableFile | null;\n  node: () => HTMLElement | null;\n}\n\ninterface SharedViewer {\n  register: (id: string, entry: ViewerEntry) => () => void;\n  open: (id: string) => void;\n}\n\nconst SharedViewerContext = createContext<SharedViewer | null>(null);\n\ninterface OpenSet {\n  ids: string[];\n  files: ViewableFile[];\n  index: number;\n}\n\nconst byDocumentOrder = (a: { node: HTMLElement | null }, b: { node: HTMLElement | null }) =>\n  a.node && b.node && a.node.compareDocumentPosition(b.node) & Node.DOCUMENT_POSITION_PRECEDING ? 1 : -1;\n\nfunction SharedFileViewer({ children }: { children: ReactNode }) {\n  const entries = useRef(new Map<string, ViewerEntry>());\n  const [set, setSet] = useState<OpenSet | null>(null);\n  const [open, setOpen] = useState(false);\n  const shared = useMemo<SharedViewer>(\n    () => ({\n      register(id, entry) {\n        entries.current.set(id, entry);\n        return () => entries.current.delete(id);\n      },\n      open(id) {\n        const ordered = [...entries.current]\n          .map(([key, entry]) => ({\n            id: key,\n            file: entry.file(),\n            node: entry.node(),\n          }))\n          .filter((item): item is typeof item & { file: ViewableFile } => item.file !== null)\n          .sort(byDocumentOrder);\n        const index = ordered.findIndex(item => item.id === id);\n        if (index < 0) return;\n        setSet({\n          ids: ordered.map(item => item.id),\n          files: ordered.map(item => item.file),\n          index,\n        });\n        setOpen(true);\n      },\n    }),\n    [],\n  );\n  const current = set && entries.current.get(set.ids[set.index] ?? '');\n  return (\n    <SharedViewerContext.Provider value={shared}>\n      {children}\n      {set && (\n        <FileViewer\n          files={set.files}\n          index={set.index}\n          onIndexChange={index => setSet({ ...set, index })}\n          open={open}\n          onOpenChange={setOpen}\n          finalFocus={() => current?.node()?.querySelector<HTMLElement>('button.sprout-file-attachment-open') ?? true}\n        />\n      )}\n    </SharedViewerContext.Provider>\n  );\n}\n\nexport function AttachmentGroup(props: AttachmentGroupProps) {\n  return (\n    <SharedFileViewer>\n      <AttachmentGroupFrame {...props} />\n    </SharedFileViewer>\n  );\n}\n\nfunction AttachmentGroupFrame({ className, variant = 'carousel', children, ...props }: AttachmentGroupProps) {\n  if (variant === 'carousel')\n    return (\n      <AttachmentCarousel className={className} {...props}>\n        {children}\n      </AttachmentCarousel>\n    );\n  return (\n    <div\n      data-slot=\"attachment-group\"\n      data-variant={variant}\n      role={props['aria-label'] || props['aria-labelledby'] ? 'group' : undefined}\n      className={cn('sprout-attachment-group', `sprout-attachment-group-${variant}`, className)}\n      {...props}\n    >\n      {children}\n    </div>\n  );\n}\n\nconst typing = 'input, textarea, select, [contenteditable=\"true\"]';\n\nfunction AttachmentCarousel({ className, children, onKeyDownCapture, ...props }: ComponentProps<'div'>) {\n  const viewport = useRef<HTMLDivElement>(null);\n  const [edges, setEdges] = useState({ start: false, end: false });\n\n  const measure = useCallback(() => {\n    const node = viewport.current;\n    if (!node) return;\n    const max = node.scrollWidth - node.clientWidth;\n    const start = node.scrollLeft > 1;\n    const end = node.scrollLeft < max - 1;\n    setEdges(current => (current.start === start && current.end === end ? current : { start, end }));\n  }, []);\n\n  useEffect(() => {\n    const node = viewport.current;\n    if (!node) return;\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(node);\n    if (node.firstElementChild) observer.observe(node.firstElementChild);\n    return () => observer.disconnect();\n  }, [measure]);\n\n  const scroll = (direction: -1 | 1) => {\n    const node = viewport.current;\n    if (node) node.scrollBy({ left: direction * node.clientWidth * 0.8 });\n  };\n\n  const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    onKeyDownCapture?.(event);\n    if (event.defaultPrevented) return;\n    if ((event.target as Element).closest(typing)) return;\n    if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n      event.preventDefault();\n      scroll(event.key === 'ArrowLeft' ? -1 : 1);\n    }\n  };\n\n  return (\n    <div\n      data-slot=\"attachment-group\"\n      data-variant=\"carousel\"\n      role=\"region\"\n      aria-roledescription=\"carousel\"\n      className={cn('sprout-attachment-group', 'sprout-attachment-group-carousel', className)}\n      onKeyDownCapture={handleKeyDown}\n      {...props}\n    >\n      <div ref={viewport} className=\"sprout-attachment-carousel-viewport\" onScroll={measure}>\n        <div className=\"sprout-attachment-carousel-track\">\n          {Children.map(children, child =>\n            child == null || child === false ? null : (\n              <div role=\"group\" aria-roledescription=\"slide\" className=\"sprout-attachment-carousel-item\">\n                {child}\n              </div>\n            ),\n          )}\n        </div>\n      </div>\n      {edges.start && (\n        <span className=\"sprout-attachment-carousel-edge\" data-side=\"start\">\n          <Button\n            variant=\"outline\"\n            size=\"icon-xs\"\n            aria-label=\"Previous attachments\"\n            tabIndex={-1}\n            className=\"sprout-attachment-carousel-arrow\"\n            onClick={() => scroll(-1)}\n          >\n            <ChevronLeftIcon aria-hidden=\"true\" />\n          </Button>\n        </span>\n      )}\n      {edges.end && (\n        <span className=\"sprout-attachment-carousel-edge\" data-side=\"end\">\n          <Button\n            variant=\"outline\"\n            size=\"icon-xs\"\n            aria-label=\"Next attachments\"\n            tabIndex={-1}\n            className=\"sprout-attachment-carousel-arrow\"\n            onClick={() => scroll(1)}\n          >\n            <ChevronRightIcon aria-hidden=\"true\" />\n          </Button>\n        </span>\n      )}\n    </div>\n  );\n}\n\nexport interface FileTypeIconProps extends Omit<ComponentProps<'svg'>, 'children'> {\n  name: string;\n  mediaType: string;\n  size?: FileTypeIconSize | undefined;\n}\n\nexport function FileTypeIcon({ name, mediaType, size = 'sm', className, ...props }: FileTypeIconProps) {\n  const label = name.includes('.') ? (name.split('.').at(-1) ?? '').toUpperCase().slice(0, 4) : '';\n  const badgeWidth = label.length > 3 ? 13 : 11;\n  return (\n    <svg\n      viewBox=\"0 0 20 24\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      data-slot=\"file-type-icon\"\n      data-size={size}\n      data-kind={fileKind(name, mediaType)}\n      className={cn('sprout-file-type-icon', `sprout-file-type-icon-size-${size}`, className)}\n      {...props}\n    >\n      <path\n        d=\"M3.5 1.5h9l4.5 4.5v16a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-20a.5.5 0 0 1 .5-.5Z\"\n        className=\"sprout-file-type-icon-paper\"\n        strokeLinejoin=\"round\"\n      />\n      <path d=\"M12.5 1.5v4a.5.5 0 0 0 .5.5h4\" className=\"sprout-file-type-icon-fold\" strokeLinejoin=\"round\" />\n      <path d=\"M6 15h8M6 17.5h8M6 20h5\" className=\"sprout-file-type-icon-lines\" strokeLinecap=\"round\" />\n      {label && (\n        <>\n          <rect x=\"1\" y=\"6\" width={badgeWidth} height=\"6\" rx=\"1.5\" className=\"sprout-file-type-icon-badge\" />\n          <text\n            x={1 + badgeWidth / 2}\n            y=\"10.4\"\n            textAnchor=\"middle\"\n            fontSize=\"4.2\"\n            fontWeight=\"700\"\n            className=\"sprout-file-type-icon-label\"\n          >\n            {label}\n          </text>\n        </>\n      )}\n    </svg>\n  );\n}\n\nexport type AttachmentFileSource = { kind: 'local'; file: File } | { kind: 'remote'; url: string };\n\nexport interface AttachmentFile {\n  id: string;\n  name: string;\n  mediaType: string;\n  size: string;\n  url?: string | undefined;\n  source?: AttachmentFileSource | undefined;\n  state: FileAttachmentState;\n}\n\nexport interface FileAttachmentProps {\n  file: AttachmentFile;\n  variant?: FileAttachmentVariant | undefined;\n  onRemove?: (() => void) | undefined;\n  onRetry?: (() => void) | undefined;\n  onOpen?: (() => void) | undefined;\n  viewable?: boolean | undefined;\n  preview?: boolean | undefined;\n  actionLabel?: 'Inspect' | 'Download' | undefined;\n  className?: string | undefined;\n}\n\nfunction AttachmentImage({ src, name }: { src: string; name: string }) {\n  const [failed, setFailed] = useState(false);\n  return failed ? (\n    <span className=\"sprout-attachment-image-failed\">\n      <ImageIcon size=\"md\" aria-hidden=\"true\" />\n      Image unavailable\n    </span>\n  ) : (\n    <img src={src} alt={name} onError={() => setFailed(true)} className=\"sprout-attachment-image\" />\n  );\n}\n\nfunction viewableFile(file: AttachmentFile): ViewableFile | null {\n  const source = file.source ?? (file.url ? { kind: 'remote' as const, url: file.url } : null);\n  return source && { name: file.name, mediaType: file.mediaType, source };\n}\n\nfunction stateLabelFor(file: AttachmentFile) {\n  return file.state === 'ready'\n    ? file.size\n    : file.state === 'error'\n      ? 'Upload failed'\n      : file.state === 'uploading'\n        ? 'Uploading…'\n        : 'Processing…';\n}\n\nexport function FileAttachment({\n  file,\n  variant = 'list',\n  onRemove,\n  onRetry,\n  onOpen,\n  viewable = false,\n  preview = false,\n  actionLabel = 'Inspect',\n  className,\n}: FileAttachmentProps) {\n  const [open, setOpen] = useState(false);\n  const shared = useContext(SharedViewerContext);\n  const id = useId();\n  const root = useRef<HTMLDivElement>(null);\n  const image = fileKind(file.name, file.mediaType) === 'image';\n  const busy = file.state === 'uploading' || file.state === 'processing';\n  const stateLabel = stateLabelFor(file);\n  const target = viewable || preview ? viewableFile(file) : null;\n  const inViewer = !onOpen && viewable && target !== null;\n  const openable = !!onOpen || inViewer;\n  const peek = preview && target !== null && file.state !== 'error' && isPreviewableFile(target);\n  const latest = useRef(target);\n  latest.current = inViewer ? target : null;\n  useEffect(\n    () =>\n      shared && inViewer\n        ? shared.register(id, {\n            file: () => latest.current,\n            node: () => root.current,\n          })\n        : undefined,\n    [shared, inViewer, id],\n  );\n  const withPreview = (trigger: ReactElement) =>\n    peek ? (\n      <HoverCard>\n        <HoverCardTrigger delay={400} closeDelay={150} render={trigger} />\n        <HoverCardContent side=\"top\" align=\"start\" className=\"sprout-file-attachment-peek\">\n          <FilePreview file={target} />\n        </HoverCardContent>\n      </HoverCard>\n    ) : (\n      trigger\n    );\n  const openLabel = `${actionLabel} ${file.name}`;\n  const openProps = {\n    type: 'button' as const,\n    disabled: !!onOpen && busy,\n    onClick: () => (onOpen ? onOpen() : shared ? shared.open(id) : setOpen(true)),\n  };\n  const retry = file.state === 'error' && onRetry && (\n    <Button variant=\"ghost\" size=\"sm\" onClick={onRetry} aria-label={`Retry ${file.name}`}>\n      Retry\n    </Button>\n  );\n  const remove = (size: 'icon-xs' | 'icon-sm') =>\n    onRemove && (\n      <Button variant=\"ghost\" size={size} aria-label={`Remove ${file.name}`} onClick={onRemove}>\n        <CloseIcon size=\"sm\" aria-hidden=\"true\" />\n      </Button>\n    );\n  const viewer = inViewer && !shared && <FileViewer file={target} open={open} onOpenChange={setOpen} />;\n\n  if (variant === 'chip') {\n    const inner = (\n      <>\n        {image && file.url ? (\n          <span className=\"sprout-file-attachment-thumb\">\n            <AttachmentImage key={file.url} src={file.url} name={file.name} />\n          </span>\n        ) : (\n          <FileTypeIcon name={file.name} mediaType={file.mediaType} />\n        )}\n        <span className=\"sprout-file-attachment-name\">{file.name}</span>\n      </>\n    );\n    return (\n      <>\n        <div\n          ref={root}\n          data-slot=\"file-attachment\"\n          data-variant=\"chip\"\n          data-state={file.state}\n          data-removable={onRemove ? '' : undefined}\n          className={cn('sprout-file-attachment', className)}\n          title={openable ? undefined : `${file.name} · ${stateLabel}`}\n        >\n          {withPreview(\n            openable ? (\n              <button\n                {...openProps}\n                aria-label={openLabel}\n                title={peek ? undefined : `${file.name} · ${stateLabel}`}\n                className=\"sprout-file-attachment-open\"\n              >\n                {inner}\n              </button>\n            ) : (\n              <span className=\"sprout-file-attachment-open\">{inner}</span>\n            ),\n          )}\n          {busy && <Spinner aria-label={stateLabel} />}\n          {retry}\n          {remove('icon-xs')}\n        </div>\n        {viewer}\n      </>\n    );\n  }\n\n  const name = (\n    <>\n      <span className=\"sprout-file-attachment-name\" title={file.name}>\n        {file.name}\n      </span>\n      {variant !== 'inline' && (\n        <span className=\"sprout-file-attachment-status\">\n          {busy && <Spinner size=\"sm\" aria-hidden=\"true\" />}\n          {stateLabel}\n        </span>\n      )}\n    </>\n  );\n  const thumbnail =\n    image && file.url ? (\n      <AttachmentImage key={file.url} src={file.url} name={file.name} />\n    ) : (\n      <FileTypeIcon name={file.name} mediaType={file.mediaType} size=\"lg\" />\n    );\n\n  return (\n    <>\n      <div\n        ref={root}\n        data-slot=\"file-attachment\"\n        data-variant={variant}\n        data-state={file.state}\n        className={cn('sprout-file-attachment', className)}\n      >\n        {variant === 'grid' &&\n          (openable ? (\n            <button {...openProps} tabIndex={-1} aria-hidden=\"true\" className=\"sprout-file-attachment-preview\">\n              {thumbnail}\n            </button>\n          ) : (\n            <span className=\"sprout-file-attachment-preview\">{thumbnail}</span>\n          ))}\n        {variant !== 'grid' && (\n          <span className=\"sprout-file-attachment-media\">\n            {image && file.url && variant === 'list' ? (\n              <AttachmentImage key={file.url} src={file.url} name={file.name} />\n            ) : (\n              <FileTypeIcon name={file.name} mediaType={file.mediaType} />\n            )}\n          </span>\n        )}\n        {withPreview(\n          openable ? (\n            <button {...openProps} aria-label={openLabel} className=\"sprout-file-attachment-open\">\n              {name}\n            </button>\n          ) : (\n            <span className=\"sprout-file-attachment-open\">{name}</span>\n          ),\n        )}\n        {variant === 'inline' && busy && <Spinner aria-label={stateLabel} />}\n        {variant === 'inline' && file.state === 'error' && (\n          <span className=\"sprout-file-attachment-failed\">Failed</span>\n        )}\n        {(retry || onRemove) && (\n          <div className=\"sprout-file-attachment-actions\">\n            {retry}\n            {remove('icon-sm')}\n          </div>\n        )}\n      </div>\n      {viewer}\n    </>\n  );\n}\n\nexport interface AttachmentDropzoneProps {\n  onFiles: (files: File[]) => void;\n  disabled?: boolean | undefined;\n  accept?: string | undefined;\n  className?: string | undefined;\n}\n\nexport function AttachmentDropzone({\n  onFiles,\n  disabled = false,\n  accept = defaultFileAccept,\n  className,\n}: AttachmentDropzoneProps) {\n  const [dragging, setDragging] = useState(false);\n  const input = useRef<HTMLInputElement>(null);\n  const over = (event: DragEvent<HTMLDivElement>) => {\n    event.preventDefault();\n    event.dataTransfer.dropEffect = disabled ? 'none' : 'copy';\n    if (!disabled) setDragging(true);\n  };\n  return (\n    <div\n      data-slot=\"attachment-dropzone\"\n      data-dragging={dragging ? '' : undefined}\n      data-disabled={disabled ? '' : undefined}\n      className={cn('sprout-attachment-dropzone', className)}\n      onDragEnter={over}\n      onDragOver={over}\n      onDragLeave={event => {\n        if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setDragging(false);\n      }}\n      onDrop={event => {\n        event.preventDefault();\n        setDragging(false);\n        if (!disabled) onFiles(Array.from(event.dataTransfer.files));\n      }}\n    >\n      <input\n        ref={input}\n        type=\"file\"\n        accept={accept}\n        multiple\n        hidden\n        disabled={disabled}\n        onChange={event => {\n          onFiles(Array.from(event.target.files ?? []));\n          event.target.value = '';\n        }}\n      />\n      <UploadIcon size=\"xl\" aria-hidden=\"true\" className=\"sprout-attachment-dropzone-icon\" />\n      <p className=\"sprout-attachment-dropzone-text\">Drop files here, or choose them from your device.</p>\n      <Button variant=\"outline\" disabled={disabled} onClick={() => input.current?.click()}>\n        Choose files\n      </Button>\n    </div>\n  );\n}\n\nexport interface LocalFileAttachmentProps {\n  file: File;\n  onRemove?: (() => void) | undefined;\n  onOpen?: (() => void) | undefined;\n  viewable?: boolean | undefined;\n  preview?: boolean | undefined;\n}\n\nexport function LocalFileAttachment({ file, onRemove, onOpen, viewable, preview }: LocalFileAttachmentProps) {\n  const [url, setUrl] = useState<string>();\n  const source = useMemo<AttachmentFileSource>(() => ({ kind: 'local', file }), [file]);\n  useEffect(() => {\n    if (fileKind(file.name, file.type) !== 'image') return;\n    const next = URL.createObjectURL(file);\n    setUrl(next);\n    return () => URL.revokeObjectURL(next);\n  }, [file]);\n  return (\n    <FileAttachment\n      variant=\"chip\"\n      file={{\n        id: `${file.name}-${file.lastModified}`,\n        name: file.name,\n        mediaType: file.type,\n        size: formatFileSize(file.size),\n        state: 'ready',\n        source,\n        url,\n      }}\n      onRemove={onRemove}\n      onOpen={onOpen}\n      viewable={viewable}\n      preview={preview}\n    />\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/chevron-left-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/chevron-left-icon.tsx",
      "content": "import { ArrowLeft01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ChevronLeftIcon = /* @__PURE__ */ createIcon(glyph, 'ChevronLeftIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/chevron-right-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/chevron-right-icon.tsx",
      "content": "import { ArrowRight01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ChevronRightIcon = /* @__PURE__ */ createIcon(glyph, 'ChevronRightIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/close-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/close-icon.tsx",
      "content": "import { Cancel01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const CloseIcon = /* @__PURE__ */ createIcon(glyph, 'CloseIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/create-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/create-icon.tsx",
      "content": "import { HugeiconsIcon, type IconSvgElement } from '@hugeicons/react';\nimport type { ReactElement, Ref, SVGProps } from 'react';\n\nexport const iconSizes = {\n  xs: 12,\n  sm: 14,\n  md: 16,\n  lg: 18,\n  xl: 20,\n  '2xl': 24,\n} as const;\n\nexport type IconSize = keyof typeof iconSizes;\n\nexport const iconStrokeWidth = 1.5;\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {\n  size?: IconSize | number;\n  ref?: Ref<SVGSVGElement>;\n};\n\nexport type IconComponent = (props: IconProps) => ReactElement;\n\nexport function createIcon(glyph: IconSvgElement, name: string): IconComponent {\n  const Icon = ({ size = '2xl', strokeWidth = iconStrokeWidth, ...props }: IconProps) => (\n    <HugeiconsIcon\n      icon={glyph}\n      size={typeof size === 'number' ? size : iconSizes[size]}\n      strokeWidth={Number(strokeWidth)}\n      {...props}\n    />\n  );\n  Icon.displayName = name;\n  return Icon;\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/image-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/image-icon.tsx",
      "content": "import { Image01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ImageIcon = /* @__PURE__ */ createIcon(glyph, 'ImageIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/upload-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/upload-icon.tsx",
      "content": "import { UploadIcon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const UploadIcon = /* @__PURE__ */ createIcon(glyph, 'UploadIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/file-kind.ts",
      "type": "registry:lib",
      "target": "lib/sprout/file-kind.ts",
      "content": "import { languageForFilename } from '@/lib/sprout/syntax';\n\nexport type FileKind =\n  | 'image'\n  | 'pdf'\n  | 'json'\n  | 'text'\n  | 'markdown'\n  | 'code'\n  | 'sheet'\n  | 'document'\n  | 'slides'\n  | 'google'\n  | 'unsupported';\n\nexport const defaultFileAccept =\n  '.docx,.xlsx,.xls,.csv,.tsv,.pptx,.ppt,.pdf,.json,.txt,.md,.markdown,.gdoc,.gsheet,.gslides,image/*,' +\n  '.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.kt,.swift,.c,.h,.cpp,.cs,.php,.sh,.sql,.yaml,.yml,.toml,.xml,.html,.css,.scss,.log';\n\nconst imageExtensions = [\n  'png',\n  'jpg',\n  'jpeg',\n  'gif',\n  'webp',\n  'avif',\n  'svg',\n  'bmp',\n  'ico',\n  'heic',\n  'heif',\n  'tif',\n  'tiff',\n];\nconst sheetTypes = [\n  'application/vnd.ms-excel',\n  'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n  'text/csv',\n];\n\nexport function fileKind(name: string, mediaType: string): FileKind {\n  const extension = name.toLowerCase().split('.').at(-1) ?? '';\n  if (mediaType.startsWith('image/') || imageExtensions.includes(extension)) return 'image';\n  if (mediaType.startsWith('application/vnd.google-apps.') || ['gdoc', 'gsheet', 'gslides'].includes(extension))\n    return 'google';\n  if (extension === 'pdf' || mediaType === 'application/pdf') return 'pdf';\n  if (extension === 'json' || mediaType === 'application/json') return 'json';\n  if (['md', 'markdown'].includes(extension) || mediaType === 'text/markdown') return 'markdown';\n  if (['xls', 'xlsx', 'csv', 'tsv'].includes(extension) || sheetTypes.includes(mediaType)) return 'sheet';\n  if (extension === 'docx' || mediaType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')\n    return 'document';\n  if (extension === 'pptx' || mediaType === 'application/vnd.openxmlformats-officedocument.presentationml.presentation')\n    return 'slides';\n  if (languageForFilename(name)) return 'code';\n  if (mediaType.startsWith('text/') || extension === 'txt') return 'text';\n  return 'unsupported';\n}\n\nexport function formatFileSize(bytes: number) {\n  if (bytes === 0) return '0 bytes';\n  if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1).replace(/\\.0$/, '')} GB`;\n  return bytes < 1024 * 1024 ? `${Math.max(1, Math.round(bytes / 1024))} KB` : `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/languages.ts",
      "type": "registry:lib",
      "target": "lib/sprout/languages.ts",
      "content": "export const codeLanguageIds = [\n  'abap',\n  'actionscript-3',\n  'ada',\n  'ahk',\n  'ahk2',\n  'angular-html',\n  'angular-ts',\n  'apache',\n  'apex',\n  'apl',\n  'applescript',\n  'ara',\n  'asciidoc',\n  'asm',\n  'astro',\n  'awk',\n  'ballerina',\n  'bat',\n  'beancount',\n  'berry',\n  'bibtex',\n  'bicep',\n  'bird2',\n  'blade',\n  'bsl',\n  'c',\n  'c3',\n  'cadence',\n  'cairo',\n  'chapel',\n  'clarity',\n  'clojure',\n  'cmake',\n  'cobol',\n  'codeowners',\n  'codeql',\n  'coffee',\n  'common-lisp',\n  'coq',\n  'cpp',\n  'crystal',\n  'csharp',\n  'css',\n  'csv',\n  'cue',\n  'cypher',\n  'd',\n  'dart',\n  'dax',\n  'desktop',\n  'diff',\n  'docker',\n  'dotenv',\n  'dream-maker',\n  'edge',\n  'elixir',\n  'elm',\n  'emacs-lisp',\n  'erb',\n  'erlang',\n  'fennel',\n  'fish',\n  'fluent',\n  'fortran-fixed-form',\n  'fortran-free-form',\n  'fsharp',\n  'gdresource',\n  'gdscript',\n  'gdshader',\n  'genie',\n  'gherkin',\n  'git-commit',\n  'git-rebase',\n  'gleam',\n  'glimmer-js',\n  'glimmer-ts',\n  'glsl',\n  'gn',\n  'gnuplot',\n  'go',\n  'graphql',\n  'groovy',\n  'hack',\n  'haml',\n  'handlebars',\n  'haskell',\n  'haxe',\n  'hcl',\n  'hjson',\n  'hlsl',\n  'html',\n  'html-derivative',\n  'http',\n  'hurl',\n  'hxml',\n  'hy',\n  'imba',\n  'ini',\n  'java',\n  'javascript',\n  'jinja',\n  'jison',\n  'json',\n  'json5',\n  'jsonc',\n  'jsonl',\n  'jsonnet',\n  'jssm',\n  'jsx',\n  'julia',\n  'just',\n  'kdl',\n  'kotlin',\n  'kusto',\n  'latex',\n  'lean',\n  'less',\n  'liquid',\n  'llvm',\n  'log',\n  'logo',\n  'lua',\n  'luau',\n  'make',\n  'markdown',\n  'marko',\n  'matlab',\n  'mdc',\n  'mdx',\n  'mermaid',\n  'mipsasm',\n  'mojo',\n  'moonbit',\n  'move',\n  'narrat',\n  'nextflow',\n  'nextflow-groovy',\n  'nginx',\n  'nim',\n  'nix',\n  'nsis',\n  'nushell',\n  'objective-c',\n  'objective-cpp',\n  'ocaml',\n  'odin',\n  'openscad',\n  'org',\n  'pascal',\n  'perl',\n  'php',\n  'pkl',\n  'plsql',\n  'po',\n  'polar',\n  'postcss',\n  'powerquery',\n  'powershell',\n  'prisma',\n  'prolog',\n  'proto',\n  'pug',\n  'puppet',\n  'purescript',\n  'python',\n  'qml',\n  'qmldir',\n  'qss',\n  'r',\n  'racket',\n  'raku',\n  'razor',\n  'rbs',\n  'reg',\n  'regexp',\n  'rel',\n  'riscv',\n  'ron',\n  'rosmsg',\n  'rst',\n  'ruby',\n  'rust',\n  'sas',\n  'sass',\n  'scala',\n  'scheme',\n  'scss',\n  'sdbl',\n  'shaderlab',\n  'shellscript',\n  'shellsession',\n  'smalltalk',\n  'smithy',\n  'solidity',\n  'soy',\n  'sparql',\n  'splunk',\n  'sql',\n  'ssh-config',\n  'stata',\n  'stylus',\n  'surrealql',\n  'svelte',\n  'swift',\n  'system-verilog',\n  'systemd',\n  'talonscript',\n  'tasl',\n  'tcl',\n  'templ',\n  'terraform',\n  'tex',\n  'toml',\n  'ts-tags',\n  'tsv',\n  'tsx',\n  'turtle',\n  'twig',\n  'typescript',\n  'typespec',\n  'typst',\n  'v',\n  'vala',\n  'vb',\n  'verilog',\n  'vhdl',\n  'viml',\n  'vue',\n  'vue-html',\n  'vue-vine',\n  'vyper',\n  'wasm',\n  'wenyan',\n  'wgsl',\n  'wikitext',\n  'wit',\n  'wolfram',\n  'xml',\n  'xsl',\n  'yaml',\n  'zenscript',\n  'zig',\n] as const;\n\nexport type CodeLanguage = (typeof codeLanguageIds)[number];\n\nexport const codeLanguageNames: Record<CodeLanguage, string> = {\n  abap: 'ABAP',\n  'actionscript-3': 'ActionScript',\n  ada: 'Ada',\n  ahk: 'AutoHotkey',\n  ahk2: 'AutoHotkey2',\n  'angular-html': 'Angular HTML',\n  'angular-ts': 'Angular TypeScript',\n  apache: 'Apache Conf',\n  apex: 'Apex',\n  apl: 'APL',\n  applescript: 'AppleScript',\n  ara: 'Ara',\n  asciidoc: 'AsciiDoc',\n  asm: 'Assembly',\n  astro: 'Astro',\n  awk: 'AWK',\n  ballerina: 'Ballerina',\n  bat: 'Batch File',\n  beancount: 'Beancount',\n  berry: 'Berry',\n  bibtex: 'BibTeX',\n  bicep: 'Bicep',\n  bird2: 'BIRD2 Configuration',\n  blade: 'Blade',\n  bsl: '1C (Enterprise)',\n  c: 'C',\n  c3: 'C3',\n  cadence: 'Cadence',\n  cairo: 'Cairo',\n  chapel: 'Chapel',\n  clarity: 'Clarity',\n  clojure: 'Clojure',\n  cmake: 'CMake',\n  cobol: 'COBOL',\n  codeowners: 'CODEOWNERS',\n  codeql: 'CodeQL',\n  coffee: 'CoffeeScript',\n  'common-lisp': 'Common Lisp',\n  coq: 'Rocq',\n  cpp: 'C++',\n  crystal: 'Crystal',\n  csharp: 'C#',\n  css: 'CSS',\n  csv: 'CSV',\n  cue: 'CUE',\n  cypher: 'Cypher',\n  d: 'D',\n  dart: 'Dart',\n  dax: 'DAX',\n  desktop: 'Desktop',\n  diff: 'Diff',\n  docker: 'Dockerfile',\n  dotenv: 'dotEnv',\n  'dream-maker': 'Dream Maker',\n  edge: 'Edge',\n  elixir: 'Elixir',\n  elm: 'Elm',\n  'emacs-lisp': 'Emacs Lisp',\n  erb: 'ERB',\n  erlang: 'Erlang',\n  fennel: 'Fennel',\n  fish: 'Fish',\n  fluent: 'Fluent',\n  'fortran-fixed-form': 'Fortran (Fixed Form)',\n  'fortran-free-form': 'Fortran (Free Form)',\n  fsharp: 'F#',\n  gdresource: 'GDResource',\n  gdscript: 'GDScript',\n  gdshader: 'GDShader',\n  genie: 'Genie',\n  gherkin: 'Gherkin',\n  'git-commit': 'Git Commit Message',\n  'git-rebase': 'Git Rebase Message',\n  gleam: 'Gleam',\n  'glimmer-js': 'Glimmer JS',\n  'glimmer-ts': 'Glimmer TS',\n  glsl: 'GLSL',\n  gn: 'GN',\n  gnuplot: 'Gnuplot',\n  go: 'Go',\n  graphql: 'GraphQL',\n  groovy: 'Groovy',\n  hack: 'Hack',\n  haml: 'Ruby Haml',\n  handlebars: 'Handlebars',\n  haskell: 'Haskell',\n  haxe: 'Haxe',\n  hcl: 'HashiCorp HCL',\n  hjson: 'Hjson',\n  hlsl: 'HLSL',\n  html: 'HTML',\n  'html-derivative': 'HTML (Derivative)',\n  http: 'HTTP',\n  hurl: 'Hurl',\n  hxml: 'HXML',\n  hy: 'Hy',\n  imba: 'Imba',\n  ini: 'INI',\n  java: 'Java',\n  javascript: 'JavaScript',\n  jinja: 'Jinja',\n  jison: 'Jison',\n  json: 'JSON',\n  json5: 'JSON5',\n  jsonc: 'JSON with Comments',\n  jsonl: 'JSON Lines',\n  jsonnet: 'Jsonnet',\n  jssm: 'JSSM',\n  jsx: 'JSX',\n  julia: 'Julia',\n  just: 'Just',\n  kdl: 'KDL',\n  kotlin: 'Kotlin',\n  kusto: 'Kusto',\n  latex: 'LaTeX',\n  lean: 'Lean 4',\n  less: 'Less',\n  liquid: 'Liquid',\n  llvm: 'LLVM IR',\n  log: 'Log file',\n  logo: 'Logo',\n  lua: 'Lua',\n  luau: 'Luau',\n  make: 'Makefile',\n  markdown: 'Markdown',\n  marko: 'Marko',\n  matlab: 'MATLAB',\n  mdc: 'MDC',\n  mdx: 'MDX',\n  mermaid: 'Mermaid',\n  mipsasm: 'MIPS Assembly',\n  mojo: 'Mojo',\n  moonbit: 'MoonBit',\n  move: 'Move',\n  narrat: 'Narrat Language',\n  nextflow: 'Nextflow',\n  'nextflow-groovy': 'Nextflow Groovy',\n  nginx: 'Nginx',\n  nim: 'Nim',\n  nix: 'Nix',\n  nsis: 'NSIS',\n  nushell: 'nushell',\n  'objective-c': 'Objective-C',\n  'objective-cpp': 'Objective-C++',\n  ocaml: 'OCaml',\n  odin: 'Odin',\n  openscad: 'OpenSCAD',\n  org: 'Org Markup',\n  pascal: 'Pascal',\n  perl: 'Perl',\n  php: 'PHP',\n  pkl: 'Pkl',\n  plsql: 'PL/SQL',\n  po: 'Gettext PO',\n  polar: 'Polar',\n  postcss: 'PostCSS',\n  powerquery: 'PowerQuery',\n  powershell: 'PowerShell',\n  prisma: 'Prisma',\n  prolog: 'Prolog',\n  proto: 'Protocol Buffer 3',\n  pug: 'Pug',\n  puppet: 'Puppet',\n  purescript: 'PureScript',\n  python: 'Python',\n  qml: 'QML',\n  qmldir: 'QML Directory',\n  qss: 'Qt Style Sheets',\n  r: 'R',\n  racket: 'Racket',\n  raku: 'Raku',\n  razor: 'ASP.NET Razor',\n  rbs: 'RBS',\n  reg: 'Windows Registry Script',\n  regexp: 'RegExp',\n  rel: 'Rel',\n  riscv: 'RISC-V',\n  ron: 'RON',\n  rosmsg: 'ROS Interface',\n  rst: 'reStructuredText',\n  ruby: 'Ruby',\n  rust: 'Rust',\n  sas: 'SAS',\n  sass: 'Sass',\n  scala: 'Scala',\n  scheme: 'Scheme',\n  scss: 'SCSS',\n  sdbl: '1C (Query)',\n  shaderlab: 'ShaderLab',\n  shellscript: 'Shell',\n  shellsession: 'Shell Session',\n  smalltalk: 'GNU Smalltalk',\n  smithy: 'Smithy',\n  solidity: 'Solidity',\n  soy: 'Closure Templates',\n  sparql: 'SPARQL',\n  splunk: 'Splunk Query Language',\n  sql: 'SQL',\n  'ssh-config': 'SSH Config',\n  stata: 'Stata',\n  stylus: 'Stylus',\n  surrealql: 'SurrealQL',\n  svelte: 'Svelte',\n  swift: 'Swift',\n  'system-verilog': 'SystemVerilog',\n  systemd: 'Systemd Units',\n  talonscript: 'TalonScript',\n  tasl: 'Tasl',\n  tcl: 'Tcl',\n  templ: 'Templ',\n  terraform: 'Terraform',\n  tex: 'TeX',\n  toml: 'TOML',\n  'ts-tags': 'TypeScript with Tags',\n  tsv: 'TSV',\n  tsx: 'TSX',\n  turtle: 'Turtle',\n  twig: 'Twig',\n  typescript: 'TypeScript',\n  typespec: 'TypeSpec',\n  typst: 'Typst',\n  v: 'V',\n  vala: 'Vala',\n  vb: 'Visual Basic',\n  verilog: 'Verilog',\n  vhdl: 'VHDL',\n  viml: 'Vim Script',\n  vue: 'Vue',\n  'vue-html': 'Vue HTML',\n  'vue-vine': 'Vue Vine',\n  vyper: 'Vyper',\n  wasm: 'WebAssembly',\n  wenyan: 'Wenyan',\n  wgsl: 'WGSL',\n  wikitext: 'Wikitext',\n  wit: 'WebAssembly Interface Types',\n  wolfram: 'Wolfram',\n  xml: 'XML',\n  xsl: 'XSL',\n  yaml: 'YAML',\n  zenscript: 'ZenScript',\n  zig: 'Zig',\n};\n\nexport const codeLanguageAliases: Record<string, CodeLanguage> = {\n  abap: 'abap',\n  'actionscript-3': 'actionscript-3',\n  actionscript: 'actionscript-3',\n  as3: 'actionscript-3',\n  ada: 'ada',\n  ahk: 'ahk',\n  ahk1: 'ahk',\n  ahk2: 'ahk2',\n  'angular-html': 'angular-html',\n  'angular-ts': 'angular-ts',\n  apache: 'apache',\n  apex: 'apex',\n  apl: 'apl',\n  applescript: 'applescript',\n  ara: 'ara',\n  asciidoc: 'asciidoc',\n  adoc: 'asciidoc',\n  asm: 'asm',\n  astro: 'astro',\n  awk: 'awk',\n  ballerina: 'ballerina',\n  bat: 'bat',\n  batch: 'bat',\n  cmd: 'bat',\n  beancount: 'beancount',\n  berry: 'berry',\n  be: 'berry',\n  bibtex: 'bibtex',\n  bicep: 'bicep',\n  bird2: 'bird2',\n  bird: 'bird2',\n  blade: 'blade',\n  bsl: 'bsl',\n  '1c': 'bsl',\n  c: 'c',\n  c3: 'c3',\n  cadence: 'cadence',\n  cdc: 'cadence',\n  cairo: 'cairo',\n  chapel: 'chapel',\n  chpl: 'chapel',\n  clarity: 'clarity',\n  clojure: 'clojure',\n  clj: 'clojure',\n  cmake: 'cmake',\n  cobol: 'cobol',\n  codeowners: 'codeowners',\n  codeql: 'codeql',\n  ql: 'codeql',\n  coffee: 'coffee',\n  coffeescript: 'coffee',\n  'common-lisp': 'common-lisp',\n  lisp: 'common-lisp',\n  coq: 'coq',\n  cpp: 'cpp',\n  'c++': 'cpp',\n  crystal: 'crystal',\n  csharp: 'csharp',\n  'c#': 'csharp',\n  cs: 'csharp',\n  css: 'css',\n  csv: 'csv',\n  cue: 'cue',\n  cypher: 'cypher',\n  cql: 'cypher',\n  d: 'd',\n  dart: 'dart',\n  dax: 'dax',\n  desktop: 'desktop',\n  diff: 'diff',\n  docker: 'docker',\n  dockerfile: 'docker',\n  dotenv: 'dotenv',\n  'dream-maker': 'dream-maker',\n  edge: 'edge',\n  elixir: 'elixir',\n  elm: 'elm',\n  'emacs-lisp': 'emacs-lisp',\n  elisp: 'emacs-lisp',\n  erb: 'erb',\n  erlang: 'erlang',\n  erl: 'erlang',\n  fennel: 'fennel',\n  fish: 'fish',\n  fluent: 'fluent',\n  ftl: 'fluent',\n  'fortran-fixed-form': 'fortran-fixed-form',\n  f: 'fortran-fixed-form',\n  for: 'fortran-fixed-form',\n  f77: 'fortran-fixed-form',\n  'fortran-free-form': 'fortran-free-form',\n  f90: 'fortran-free-form',\n  f95: 'fortran-free-form',\n  f03: 'fortran-free-form',\n  f08: 'fortran-free-form',\n  f18: 'fortran-free-form',\n  fsharp: 'fsharp',\n  'f#': 'fsharp',\n  fs: 'fsharp',\n  gdresource: 'gdresource',\n  tscn: 'gdresource',\n  tres: 'gdresource',\n  gdscript: 'gdscript',\n  gd: 'gdscript',\n  gdshader: 'gdshader',\n  genie: 'genie',\n  gherkin: 'gherkin',\n  'git-commit': 'git-commit',\n  'git-rebase': 'git-rebase',\n  gleam: 'gleam',\n  'glimmer-js': 'glimmer-js',\n  gjs: 'glimmer-js',\n  'glimmer-ts': 'glimmer-ts',\n  gts: 'glimmer-ts',\n  glsl: 'glsl',\n  gn: 'gn',\n  gnuplot: 'gnuplot',\n  go: 'go',\n  graphql: 'graphql',\n  gql: 'graphql',\n  groovy: 'groovy',\n  hack: 'hack',\n  haml: 'haml',\n  handlebars: 'handlebars',\n  hbs: 'handlebars',\n  haskell: 'haskell',\n  hs: 'haskell',\n  haxe: 'haxe',\n  hcl: 'hcl',\n  hjson: 'hjson',\n  hlsl: 'hlsl',\n  html: 'html',\n  'html-derivative': 'html-derivative',\n  http: 'http',\n  hurl: 'hurl',\n  hxml: 'hxml',\n  hy: 'hy',\n  imba: 'imba',\n  ini: 'ini',\n  properties: 'ini',\n  java: 'java',\n  javascript: 'javascript',\n  js: 'javascript',\n  cjs: 'javascript',\n  mjs: 'javascript',\n  jinja: 'jinja',\n  jison: 'jison',\n  json: 'json',\n  json5: 'json5',\n  jsonc: 'jsonc',\n  jsonl: 'jsonl',\n  jsonnet: 'jsonnet',\n  jssm: 'jssm',\n  fsl: 'jssm',\n  jsx: 'jsx',\n  julia: 'julia',\n  jl: 'julia',\n  just: 'just',\n  justfile: 'just',\n  kdl: 'kdl',\n  kotlin: 'kotlin',\n  kt: 'kotlin',\n  kts: 'kotlin',\n  kusto: 'kusto',\n  kql: 'kusto',\n  latex: 'latex',\n  lean: 'lean',\n  lean4: 'lean',\n  less: 'less',\n  liquid: 'liquid',\n  llvm: 'llvm',\n  log: 'log',\n  logo: 'logo',\n  lua: 'lua',\n  luau: 'luau',\n  make: 'make',\n  makefile: 'make',\n  markdown: 'markdown',\n  md: 'markdown',\n  marko: 'marko',\n  matlab: 'matlab',\n  mdc: 'mdc',\n  mdx: 'mdx',\n  mermaid: 'mermaid',\n  mmd: 'mermaid',\n  mipsasm: 'mipsasm',\n  mips: 'mipsasm',\n  mojo: 'mojo',\n  moonbit: 'moonbit',\n  mbt: 'moonbit',\n  mbti: 'moonbit',\n  move: 'move',\n  narrat: 'narrat',\n  nar: 'narrat',\n  nextflow: 'nextflow',\n  nf: 'nextflow',\n  'nextflow-groovy': 'nextflow-groovy',\n  nginx: 'nginx',\n  nim: 'nim',\n  nix: 'nix',\n  nsis: 'nsis',\n  nushell: 'nushell',\n  nu: 'nushell',\n  'objective-c': 'objective-c',\n  objc: 'objective-c',\n  'objective-cpp': 'objective-cpp',\n  ocaml: 'ocaml',\n  odin: 'odin',\n  openscad: 'openscad',\n  scad: 'openscad',\n  org: 'org',\n  pascal: 'pascal',\n  perl: 'perl',\n  php: 'php',\n  pkl: 'pkl',\n  plsql: 'plsql',\n  po: 'po',\n  pot: 'po',\n  potx: 'po',\n  polar: 'polar',\n  postcss: 'postcss',\n  powerquery: 'powerquery',\n  powershell: 'powershell',\n  ps: 'powershell',\n  ps1: 'powershell',\n  pwsh: 'powershell',\n  prisma: 'prisma',\n  prolog: 'prolog',\n  proto: 'proto',\n  protobuf: 'proto',\n  pug: 'pug',\n  jade: 'pug',\n  puppet: 'puppet',\n  purescript: 'purescript',\n  python: 'python',\n  py: 'python',\n  qml: 'qml',\n  qmldir: 'qmldir',\n  qss: 'qss',\n  r: 'r',\n  racket: 'racket',\n  raku: 'raku',\n  perl6: 'raku',\n  razor: 'razor',\n  rbs: 'rbs',\n  'ruby-signature': 'rbs',\n  reg: 'reg',\n  regexp: 'regexp',\n  regex: 'regexp',\n  rel: 'rel',\n  riscv: 'riscv',\n  ron: 'ron',\n  rosmsg: 'rosmsg',\n  rst: 'rst',\n  ruby: 'ruby',\n  rb: 'ruby',\n  rust: 'rust',\n  rs: 'rust',\n  sas: 'sas',\n  sass: 'sass',\n  scala: 'scala',\n  scheme: 'scheme',\n  scss: 'scss',\n  sdbl: 'sdbl',\n  '1c-query': 'sdbl',\n  shaderlab: 'shaderlab',\n  shader: 'shaderlab',\n  shellscript: 'shellscript',\n  bash: 'shellscript',\n  sh: 'shellscript',\n  shell: 'shellscript',\n  zsh: 'shellscript',\n  shellsession: 'shellsession',\n  console: 'shellsession',\n  smalltalk: 'smalltalk',\n  smithy: 'smithy',\n  solidity: 'solidity',\n  soy: 'soy',\n  'closure-templates': 'soy',\n  sparql: 'sparql',\n  splunk: 'splunk',\n  spl: 'splunk',\n  sql: 'sql',\n  'ssh-config': 'ssh-config',\n  stata: 'stata',\n  stylus: 'stylus',\n  styl: 'stylus',\n  surrealql: 'surrealql',\n  surql: 'surrealql',\n  svelte: 'svelte',\n  swift: 'swift',\n  'system-verilog': 'system-verilog',\n  systemd: 'systemd',\n  talonscript: 'talonscript',\n  talon: 'talonscript',\n  tasl: 'tasl',\n  tcl: 'tcl',\n  templ: 'templ',\n  terraform: 'terraform',\n  tf: 'terraform',\n  tfvars: 'terraform',\n  tex: 'tex',\n  toml: 'toml',\n  'ts-tags': 'ts-tags',\n  lit: 'ts-tags',\n  tsv: 'tsv',\n  tsx: 'tsx',\n  turtle: 'turtle',\n  twig: 'twig',\n  typescript: 'typescript',\n  ts: 'typescript',\n  cts: 'typescript',\n  mts: 'typescript',\n  typespec: 'typespec',\n  tsp: 'typespec',\n  typst: 'typst',\n  typ: 'typst',\n  v: 'v',\n  vala: 'vala',\n  vb: 'vb',\n  verilog: 'verilog',\n  vhdl: 'vhdl',\n  viml: 'viml',\n  vim: 'viml',\n  vimscript: 'viml',\n  vue: 'vue',\n  'vue-html': 'vue-html',\n  'vue-vine': 'vue-vine',\n  vyper: 'vyper',\n  vy: 'vyper',\n  wasm: 'wasm',\n  wenyan: 'wenyan',\n  文言: 'wenyan',\n  wgsl: 'wgsl',\n  wikitext: 'wikitext',\n  mediawiki: 'wikitext',\n  wiki: 'wikitext',\n  wit: 'wit',\n  wolfram: 'wolfram',\n  wl: 'wolfram',\n  xml: 'xml',\n  xsl: 'xsl',\n  yaml: 'yaml',\n  yml: 'yaml',\n  zenscript: 'zenscript',\n  zig: 'zig',\n  h: 'c',\n  cc: 'cpp',\n  cxx: 'cpp',\n  hpp: 'cpp',\n  hh: 'cpp',\n  hxx: 'cpp',\n  ipp: 'cpp',\n  ino: 'cpp',\n  tpp: 'cpp',\n  csx: 'csharp',\n  cake: 'csharp',\n  m: 'objective-c',\n  mm: 'objective-cpp',\n  es6: 'javascript',\n  jsm: 'javascript',\n  pyw: 'python',\n  pyi: 'python',\n  gyp: 'python',\n  bzl: 'python',\n  gemspec: 'ruby',\n  rake: 'ruby',\n  ru: 'ruby',\n  podspec: 'ruby',\n  rbi: 'ruby',\n  thor: 'ruby',\n  pl: 'perl',\n  pm: 'perl',\n  t: 'perl',\n  pod: 'perl',\n  phtml: 'php',\n  php3: 'php',\n  php4: 'php',\n  php5: 'php',\n  phps: 'php',\n  ksh: 'shellscript',\n  command: 'shellscript',\n  htm: 'html',\n  xhtml: 'html',\n  shtml: 'html',\n  svg: 'xml',\n  xsd: 'xml',\n  xslt: 'xml',\n  plist: 'xml',\n  csproj: 'xml',\n  fsproj: 'xml',\n  vbproj: 'xml',\n  props: 'xml',\n  targets: 'xml',\n  xaml: 'xml',\n  rss: 'xml',\n  atom: 'xml',\n  wsdl: 'xml',\n  resx: 'xml',\n  kml: 'xml',\n  gpx: 'xml',\n  nuspec: 'xml',\n  mdown: 'markdown',\n  mkd: 'markdown',\n  mkdn: 'markdown',\n  mdwn: 'markdown',\n  ltx: 'latex',\n  sty: 'tex',\n  cls: 'tex',\n  ex: 'elixir',\n  exs: 'elixir',\n  hrl: 'erlang',\n  cljs: 'clojure',\n  cljc: 'clojure',\n  edn: 'clojure',\n  sc: 'scala',\n  sbt: 'scala',\n  gradle: 'groovy',\n  gvy: 'groovy',\n  nims: 'nim',\n  nimble: 'nim',\n  vbs: 'vb',\n  bas: 'vb',\n  fsi: 'fsharp',\n  fsx: 'fsharp',\n  ml: 'ocaml',\n  mli: 'ocaml',\n  rkt: 'racket',\n  scm: 'scheme',\n  ss: 'scheme',\n  lsp: 'common-lisp',\n  cl: 'common-lisp',\n  el: 'emacs-lisp',\n  mk: 'make',\n  mak: 'make',\n  cfg: 'ini',\n  editorconfig: 'ini',\n  gitconfig: 'ini',\n  webmanifest: 'json',\n  geojson: 'json',\n  topojson: 'json',\n  har: 'json',\n  ndjson: 'jsonl',\n  graphqls: 'graphql',\n  psm1: 'powershell',\n  psd1: 'powershell',\n  patch: 'diff',\n  sv: 'system-verilog',\n  svh: 'system-verilog',\n  vh: 'verilog',\n  vhd: 'vhdl',\n  s: 'asm',\n  nasm: 'asm',\n  wat: 'wasm',\n  wast: 'wasm',\n  sol: 'solidity',\n  purs: 'purescript',\n  j2: 'jinja',\n  jinja2: 'jinja',\n  bib: 'bibtex',\n  service: 'systemd',\n  socket: 'systemd',\n  timer: 'systemd',\n  mount: 'systemd',\n  target: 'systemd',\n  lhs: 'haskell',\n  ktm: 'kotlin',\n};\n\nexport const codeLanguageFilenames: Record<string, CodeLanguage> = {\n  dockerfile: 'docker',\n  containerfile: 'docker',\n  makefile: 'make',\n  gnumakefile: 'make',\n  'cmakelists.txt': 'cmake',\n  gemfile: 'ruby',\n  rakefile: 'ruby',\n  podfile: 'ruby',\n  vagrantfile: 'ruby',\n  brewfile: 'ruby',\n  fastfile: 'ruby',\n  guardfile: 'ruby',\n  appfile: 'ruby',\n  jenkinsfile: 'groovy',\n  justfile: 'just',\n  '.bashrc': 'shellscript',\n  '.bash_profile': 'shellscript',\n  '.bash_aliases': 'shellscript',\n  '.zshrc': 'shellscript',\n  '.zprofile': 'shellscript',\n  '.zshenv': 'shellscript',\n  '.profile': 'shellscript',\n  '.gitconfig': 'ini',\n  '.editorconfig': 'ini',\n  '.npmrc': 'ini',\n  '.yarnrc': 'ini',\n  '.pylintrc': 'ini',\n  'tsconfig.json': 'jsonc',\n  'jsconfig.json': 'jsonc',\n  '.eslintrc.json': 'jsonc',\n  'devcontainer.json': 'jsonc',\n  '.prettierrc': 'json',\n  '.babelrc': 'json',\n  'composer.lock': 'json',\n  'cargo.lock': 'toml',\n  pipfile: 'toml',\n  'poetry.lock': 'toml',\n  '.clang-format': 'yaml',\n  '.gemrc': 'yaml',\n  codeowners: 'codeowners',\n  commit_editmsg: 'git-commit',\n  'git-rebase-todo': 'git-rebase',\n  ssh_config: 'ssh-config',\n  sshd_config: 'ssh-config',\n  'nginx.conf': 'nginx',\n  '.htaccess': 'apache',\n  'httpd.conf': 'apache',\n  '.env': 'dotenv',\n};\n"
    },
    {
      "path": "registry/sprout/lib/sprout/syntax.ts",
      "type": "registry:lib",
      "target": "lib/sprout/syntax.ts",
      "content": "import type { HighlighterCore, ThemedToken } from 'shiki/core';\nimport { codeLanguageAliases, codeLanguageFilenames, type CodeLanguage } from '@/lib/sprout/languages';\n\nconst plain = new Set(['text', 'txt', 'plain', 'plaintext']);\n\nexport function languageForFilename(name: string): CodeLanguage | null {\n  const base = (name.split(/[\\\\/]/).at(-1) ?? '').toLowerCase();\n  const whole = codeLanguageFilenames[base];\n  if (whole) return whole;\n  if (base.startsWith('.env.')) return 'dotenv';\n  const dot = base.lastIndexOf('.');\n  return dot < 0 ? null : (codeLanguageAliases[base.slice(dot + 1)] ?? null);\n}\n\nexport function resolveCodeLanguage(language: string | undefined, filename?: string): CodeLanguage | null {\n  const key = language?.trim().toLowerCase();\n  if (key && plain.has(key)) return null;\n  const named = key ? codeLanguageAliases[key] : undefined;\n  return named ?? (filename ? languageForFilename(filename) : null);\n}\n\nexport const maxHighlightedLength = 200_000;\n\nconst role = (name: string) => `var(--sprout-syntax-token-${name})`;\n\nconst markupRules = [\n  {\n    scope: ['markup.heading', 'entity.name.section', 'punctuation.definition.heading'],\n    settings: { foreground: role('heading'), fontStyle: 'bold' },\n  },\n  {\n    scope: [\n      'punctuation.definition.list.begin',\n      'beginning.punctuation.definition.list',\n      'punctuation.definition.list',\n    ],\n    settings: { foreground: role('constant') },\n  },\n  {\n    scope: [\n      'punctuation.definition.bold',\n      'punctuation.definition.italic',\n      'punctuation.definition.strikethrough',\n      'punctuation.definition.quote.begin',\n      'meta.separator',\n    ],\n    settings: { foreground: role('punctuation') },\n  },\n  {\n    scope: ['markup.quote'],\n    settings: { foreground: role('comment'), fontStyle: 'italic' },\n  },\n  {\n    scope: ['markup.inline.raw', 'markup.fenced_code', 'markup.raw'],\n    settings: { foreground: role('string') },\n  },\n  {\n    scope: ['fenced_code.block.language'],\n    settings: { foreground: role('keyword') },\n  },\n  {\n    scope: ['markup.inserted', 'punctuation.definition.inserted'],\n    settings: { foreground: role('inserted') },\n  },\n  {\n    scope: ['markup.deleted', 'punctuation.definition.deleted'],\n    settings: { foreground: role('deleted') },\n  },\n  {\n    scope: ['meta.diff.range', 'punctuation.definition.range.diff', 'meta.diff.header'],\n    settings: { foreground: role('keyword') },\n  },\n];\n\nlet highlighter: HighlighterCore | undefined;\nlet starting: Promise<HighlighterCore> | undefined;\nconst loading = new Map<CodeLanguage, Promise<void>>();\n\nfunction start() {\n  starting ??= Promise.all([import('shiki/core'), import('shiki/engine/javascript')]).then(\n    async ([{ createHighlighterCore, createCssVariablesTheme }, { createJavaScriptRegexEngine }]) => {\n      const theme = createCssVariablesTheme({\n        name: 'sprout',\n        variablePrefix: '--sprout-syntax-',\n        fontStyle: true,\n      });\n      theme.tokenColors = [...(theme.tokenColors ?? []), ...markupRules];\n      highlighter = await createHighlighterCore({\n        themes: [theme],\n        langs: [],\n        engine: createJavaScriptRegexEngine({ forgiving: true }),\n      });\n      return highlighter;\n    },\n  );\n  return starting;\n}\n\nexport function loadCodeLanguage(language: CodeLanguage): Promise<void> {\n  let loaded = loading.get(language);\n  if (!loaded) {\n    loaded = Promise.all([start(), import('shiki/langs')]).then(([core, { bundledLanguages }]) =>\n      core.loadLanguage(bundledLanguages[language]),\n    );\n    loading.set(language, loaded);\n    loaded.catch(() => loading.delete(language));\n  }\n  return loaded;\n}\n\nexport function embeddedLanguages(code: string, language: CodeLanguage) {\n  if (language !== 'markdown' && language !== 'mdx') return [];\n  const found = new Set<CodeLanguage>();\n  for (const [, name] of code.matchAll(/^\\s*(?:```|~~~)\\s*([\\w#+.-]+)/gm)) {\n    const fence = resolveCodeLanguage(name);\n    if (fence) found.add(fence);\n  }\n  return [...found];\n}\n\nexport function isLanguageReady(language: CodeLanguage) {\n  return highlighter?.getLoadedLanguages().includes(language) ?? false;\n}\n\nexport function codeTokens(code: string, language: CodeLanguage): ThemedToken[][] | null {\n  if (!highlighter || !isLanguageReady(language)) return null;\n  return highlighter.codeToTokensBase(code, {\n    lang: language,\n    theme: 'sprout',\n  });\n}\n"
    }
  ],
  "css": {
    "@layer base": {
      ":root, .light": {
        "--sprout-file-paper": "oklch(100% 0 0)",
        "--sprout-file-edge": "oklch(87.17% .0082 286.23)",
        "--sprout-file-generic": "oklch(65.18% .0118 280.36)",
        "--sprout-file-pdf": "oklch(61.65% .1939 27.02)",
        "--sprout-file-sheet": "oklch(57.34% .1422 151.05)",
        "--sprout-file-document": "oklch(53.55% .1755 260.83)",
        "--sprout-file-slides": "oklch(63.49% .1638 42.8)",
        "--sprout-file-image": "oklch(85.06% .0674 242.56)",
        "--sprout-file-label": "oklch(100% 0 0)"
      },
      ".dark": {
        "--sprout-file-paper": "oklch(29.01% .0092 276.8)",
        "--sprout-file-edge": "oklch(41.45% .0116 279.39)",
        "--sprout-file-image": "oklch(57.61% .0841 245.81)"
      },
      "@media (prefers-color-scheme: dark)": {
        ":root:not(.light):not(.dark)": {
          "--sprout-file-paper": "oklch(29.01% .0092 276.8)",
          "--sprout-file-edge": "oklch(41.45% .0116 279.39)",
          "--sprout-file-image": "oklch(57.61% .0841 245.81)"
        }
      }
    },
    "@layer components": {
      ".sprout-attachment": {
        "box-sizing": "border-box",
        "border": "1px solid var(--sprout-line)",
        "background": "var(--sprout-surface)",
        "width": "fit-content",
        "min-width": "0",
        "max-width": "100%",
        "color": "var(--sprout-text)",
        "border-radius": "12px",
        "flex-wrap": "wrap",
        "flex-shrink": "0",
        "font-family": "inherit",
        "display": "flex",
        "position": "relative"
      },
      "@media (hover: hover)": {
        ".sprout-attachment:has( > a,  > button):hover": {
          "background": "color-mix(in oklab, var(--sprout-hover) 50%, var(--sprout-surface))"
        },
        ".sprout-file-attachment:has(button.sprout-file-attachment-open:not(:disabled)):hover": {
          "background": "color-mix(in oklab, var(--sprout-hover) 50%, var(--sprout-surface))"
        }
      },
      ".sprout-attachment:has( > .sprout-attachment-trigger:focus-visible)": {
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)",
        "outline-offset": "0"
      },
      ".sprout-attachment[data-state=\"idle\"]": {
        "border-style": "dashed"
      },
      ".sprout-attachment[data-state=\"error\"]": {
        "border-color": "color-mix(in oklab, var(--sprout-danger) 35%, transparent)"
      },
      ".sprout-attachment-size-lg": {
        "font-size": "var(--sprout-text-sm)",
        "gap": "8px"
      },
      ".sprout-attachment-size-lg:has([data-slot=\"attachment-content\"])": {
        "padding": "8px 10px"
      },
      ".sprout-attachment-size-lg:has([data-slot=\"attachment-media\"])": {
        "padding": "8px"
      },
      ".sprout-attachment-size-md": {
        "font-size": "var(--sprout-text-xs)",
        "gap": "10px"
      },
      ".sprout-attachment-size-md:has([data-slot=\"attachment-content\"])": {
        "padding": "6px 8px"
      },
      ".sprout-attachment-size-md:has([data-slot=\"attachment-media\"])": {
        "padding": "6px"
      },
      ".sprout-attachment-size-sm": {
        "font-size": "var(--sprout-text-xs)",
        "border-radius": "8px",
        "gap": "6px"
      },
      ".sprout-attachment-size-sm:has([data-slot=\"attachment-content\"])": {
        "padding": "4px 6px"
      },
      ".sprout-attachment-size-sm:has([data-slot=\"attachment-media\"])": {
        "padding": "4px"
      },
      ".sprout-attachment-horizontal": {
        "align-items": "center",
        "min-width": "10rem"
      },
      ".sprout-attachment-vertical": {
        "flex-direction": "column",
        "width": "6rem"
      },
      ".sprout-attachment-vertical:has([data-slot=\"attachment-content\"])": {
        "width": "7.5rem"
      },
      ".sprout-attachment-media": {
        "aspect-ratio": "1",
        "background": "var(--sprout-hover)",
        "width": "40px",
        "color": "var(--sprout-text)",
        "border-radius": "8px",
        "flex-shrink": "0",
        "justify-content": "center",
        "align-items": "center",
        "display": "flex",
        "position": "relative",
        "overflow": "hidden"
      },
      ".sprout-attachment-size-md .sprout-attachment-media": {
        "width": "32px"
      },
      ".sprout-attachment-size-sm .sprout-attachment-media": {
        "border-radius": "6px",
        "width": "28px"
      },
      ".sprout-attachment-vertical .sprout-attachment-media": {
        "width": "100%"
      },
      ".sprout-attachment[data-state=\"error\"] .sprout-attachment-media": {
        "background": "var(--sprout-danger-subtle)",
        "color": "var(--sprout-danger)"
      },
      ".sprout-attachment-media svg": {
        "pointer-events": "none"
      },
      ".sprout-attachment-media svg:not([class*=\"size-\"])": {
        "width": "16px",
        "height": "16px"
      },
      ".sprout-attachment-vertical .sprout-attachment-media svg:not([class*=\"size-\"]), .sprout-attachment-vertical .sprout-attachment-media > [data-slot=\"spinner\"]": {
        "width": "24px",
        "height": "24px"
      },
      ".sprout-attachment-size-sm .sprout-attachment-media svg:not([class*=\"size-\"])": {
        "width": "14px",
        "height": "14px"
      },
      ".sprout-attachment-media[data-variant=\"image\"]": {
        "opacity": ".6"
      },
      ".sprout-attachment:is([data-state=\"done\"], [data-state=\"idle\"]) .sprout-attachment-media[data-variant=\"image\"]": {
        "opacity": "1"
      },
      ".sprout-attachment-media[data-variant=\"image\"] > img": {
        "aspect-ratio": "1",
        "object-fit": "cover",
        "width": "100%"
      },
      ".sprout-attachment-content": {
        "flex": "1",
        "min-width": "0",
        "max-width": "100%",
        "line-height": "1.25"
      },
      ".sprout-attachment-vertical .sprout-attachment-content": {
        "padding-inline": "4px"
      },
      ".sprout-attachment-title": {
        "text-overflow": "ellipsis",
        "white-space": "nowrap",
        "min-width": "0",
        "max-width": "100%",
        "font-weight": "500",
        "display": "block",
        "overflow": "hidden"
      },
      ".sprout-attachment-description": {
        "min-width": "0",
        "max-width": "100%",
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "text-overflow": "ellipsis",
        "white-space": "nowrap",
        "margin-top": "2px",
        "display": "block",
        "overflow": "hidden"
      },
      ".sprout-attachment[data-state=\"error\"] .sprout-attachment-description": {
        "color": "var(--sprout-danger)"
      },
      ".sprout-attachment-actions": {
        "z-index": "2",
        "flex-shrink": "0",
        "align-items": "center",
        "display": "flex",
        "position": "relative"
      },
      ".sprout-attachment-vertical .sprout-attachment-actions": {
        "gap": "4px",
        "position": "absolute",
        "top": "12px",
        "right": "12px"
      },
      ".sprout-attachment-vertical .sprout-attachment-actions .sprout-button": {
        "background": "color-mix(in oklab, var(--sprout-surface) 88%, transparent)"
      },
      ".sprout-attachment-size-sm.sprout-attachment-vertical .sprout-attachment-actions": {
        "top": "6px",
        "right": "6px"
      },
      ".sprout-attachment-trigger": {
        "z-index": "1",
        "border-radius": "inherit",
        "cursor": "pointer",
        "background": "none",
        "border": "0",
        "outline": "none",
        "margin": "0",
        "padding": "0",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-attachment:is([data-state=\"uploading\"], [data-state=\"processing\"]) .sprout-attachment-title, .sprout-file-attachment:is([data-state=\"uploading\"], [data-state=\"processing\"]) .sprout-file-attachment-name": {
        "color": "var(--sprout-muted)"
      },
      ".sprout-attachment-group": {
        "min-width": "0"
      },
      ".sprout-attachment-group-grid": {
        "grid-template-columns": "repeat(2, minmax(0, 1fr))",
        "gap": "12px",
        "display": "grid"
      },
      "@media (width >= 40rem)": {
        ".sprout-attachment-group-grid": {
          "grid-template-columns": "repeat(3, minmax(0, 1fr))"
        }
      },
      ".sprout-attachment-group-list": {
        "flex-direction": "column",
        "gap": "8px",
        "display": "flex"
      },
      ".sprout-attachment-group-inline": {
        "flex-wrap": "wrap",
        "gap": "8px",
        "display": "flex"
      },
      ".sprout-attachment-group-carousel": {
        "--sprout-attachment-fade": "var(--sprout-surface)",
        "position": "relative"
      },
      ".sprout-attachment-carousel-viewport": {
        "overscroll-behavior-x": "contain",
        "scrollbar-width": "none",
        "scroll-padding-inline": "32px",
        "overflow": "auto hidden"
      },
      ".sprout-attachment-carousel-viewport::-webkit-scrollbar": {
        "display": "none"
      },
      ".sprout-attachment-carousel-track": {
        "gap": "8px",
        "width": "max-content",
        "padding": "4px 3px",
        "display": "flex"
      },
      ".sprout-attachment-carousel-item": {
        "flex-shrink": "0",
        "min-width": "0"
      },
      ".sprout-attachment-carousel-edge": {
        "pointer-events": "none",
        "align-items": "center",
        "display": "flex",
        "position": "absolute",
        "inset-block": "0"
      },
      ".sprout-attachment-carousel-edge[data-side=\"start\"]": {
        "background": "linear-gradient(to right, var(--sprout-attachment-fade), transparent)",
        "padding-right": "32px",
        "left": "0"
      },
      ".sprout-attachment-carousel-edge[data-side=\"end\"]": {
        "background": "linear-gradient(to left, var(--sprout-attachment-fade), transparent)",
        "padding-left": "32px",
        "right": "0"
      },
      ".sprout-attachment-carousel-arrow": {
        "opacity": "0",
        "pointer-events": "auto"
      },
      ".sprout-attachment-group-carousel:hover .sprout-attachment-carousel-arrow, .sprout-attachment-group-carousel:focus-within .sprout-attachment-carousel-arrow, .sprout-attachment-carousel-arrow:focus-visible": {
        "opacity": "1"
      },
      "@media (pointer: coarse)": {
        ".sprout-attachment-carousel-arrow": {
          "opacity": "1"
        }
      },
      ".sprout-file-type-icon": {
        "flex-shrink": "0"
      },
      ".sprout-file-type-icon-size-sm": {
        "width": "20px",
        "height": "24px"
      },
      ".sprout-file-type-icon-size-lg": {
        "width": "30px",
        "height": "36px"
      },
      ".sprout-file-type-icon-paper": {
        "fill": "var(--sprout-file-paper)",
        "stroke": "var(--sprout-file-edge)"
      },
      ".sprout-file-type-icon-fold": {
        "fill": "none",
        "stroke": "var(--sprout-file-edge)"
      },
      ".sprout-file-type-icon-lines": {
        "stroke": "var(--sprout-file-edge)"
      },
      ".sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-generic)"
      },
      ".sprout-file-type-icon[data-kind=\"pdf\"] .sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-pdf)"
      },
      ".sprout-file-type-icon[data-kind=\"sheet\"] .sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-sheet)"
      },
      ".sprout-file-type-icon:is([data-kind=\"document\"], [data-kind=\"google\"]) .sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-document)"
      },
      ".sprout-file-type-icon[data-kind=\"slides\"] .sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-slides)"
      },
      ".sprout-file-type-icon[data-kind=\"image\"] .sprout-file-type-icon-badge": {
        "fill": "var(--sprout-file-image)"
      },
      ".sprout-file-type-icon-label": {
        "fill": "var(--sprout-file-label)",
        "font-family": "inherit"
      },
      ".sprout-file-attachment": {
        "box-sizing": "border-box",
        "border": "1px solid var(--sprout-line)",
        "background": "var(--sprout-surface)",
        "min-width": "0",
        "color": "var(--sprout-text)",
        "border-radius": "12px",
        "font-family": "inherit",
        "position": "relative"
      },
      ".sprout-file-attachment[data-state=\"error\"]": {
        "border-color": "var(--sprout-danger)"
      },
      ".sprout-file-attachment[data-variant=\"list\"]": {
        "align-items": "center",
        "gap": "8px",
        "padding": "8px",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"inline\"]": {
        "align-items": "center",
        "gap": "4px",
        "max-width": "100%",
        "padding-left": "8px",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"inline\"]:not(:has(.sprout-file-attachment-actions))": {
        "padding-right": "10px"
      },
      ".sprout-file-attachment[data-variant=\"grid\"]": {
        "flex-direction": "column",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"chip\"]": {
        "max-width": "12rem",
        "height": "36px",
        "box-shadow": "var(--sprout-shadow-control)",
        "flex-shrink": "0",
        "align-items": "center",
        "gap": "4px",
        "padding": "0 12px 0 10px",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"chip\"][data-removable]": {
        "padding-right": "4px"
      },
      ".sprout-file-attachment-open": {
        "min-width": "0",
        "color": "inherit",
        "font": "inherit",
        "text-align": "left",
        "background": "none",
        "border": "0",
        "border-radius": "6px",
        "flex": "1",
        "margin": "0",
        "padding": "4px 0",
        "display": "block"
      },
      "button.sprout-file-attachment-open": {
        "cursor": "pointer"
      },
      "button.sprout-file-attachment-open:disabled": {
        "cursor": "default"
      },
      ".sprout-file-attachment[data-variant=\"grid\"] .sprout-file-attachment-open": {
        "padding": "12px"
      },
      ".sprout-file-attachment[data-variant=\"chip\"] .sprout-file-attachment-open": {
        "align-items": "center",
        "gap": "8px",
        "padding": "0",
        "display": "flex"
      },
      ".sprout-hover-card-content.sprout-file-attachment-peek": {
        "width": "22rem",
        "padding": "4px"
      },
      ".sprout-file-attachment-open:focus-visible, .sprout-file-attachment-preview:focus-visible": {
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)",
        "outline-offset": "0"
      },
      ".sprout-file-attachment[data-variant=\"chip\"] button.sprout-file-attachment-open:after": {
        "content": "\"\"",
        "border-radius": "inherit",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-file-attachment[data-variant=\"chip\"] > :not(.sprout-file-attachment-open)": {
        "z-index": "1",
        "position": "relative"
      },
      ".sprout-file-attachment[data-variant=\"chip\"] .sprout-file-attachment-open:focus-visible": {
        "outline": "none"
      },
      ".sprout-file-attachment[data-variant=\"chip\"]:has( > .sprout-file-attachment-open:focus-visible)": {
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)",
        "outline-offset": "0"
      },
      ".sprout-file-attachment-name": {
        "min-width": "0",
        "font-size": "var(--sprout-text-sm)",
        "text-overflow": "ellipsis",
        "white-space": "nowrap",
        "font-weight": "500",
        "line-height": "1.25rem",
        "display": "block",
        "overflow": "hidden"
      },
      ".sprout-file-attachment[data-variant=\"chip\"] .sprout-file-attachment-name": {
        "font-size": "var(--sprout-text-xs)",
        "line-height": "1rem"
      },
      ".sprout-file-attachment-status": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "align-items": "center",
        "gap": "4px",
        "margin-top": "2px",
        "line-height": "1rem",
        "display": "flex"
      },
      ".sprout-file-attachment[data-state=\"error\"] .sprout-file-attachment-status, .sprout-file-attachment-failed": {
        "color": "var(--sprout-danger)"
      },
      ".sprout-file-attachment-failed": {
        "font-size": "var(--sprout-text-xs)",
        "flex-shrink": "0"
      },
      ".sprout-file-attachment-media": {
        "color": "var(--sprout-muted)",
        "flex-shrink": "0",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"list\"] .sprout-file-attachment-media": {
        "background": "var(--sprout-hover)",
        "border-radius": "6px",
        "justify-content": "center",
        "align-items": "center",
        "width": "40px",
        "height": "40px",
        "overflow": "hidden"
      },
      ".sprout-file-attachment-media > .sprout-attachment-image": {
        "object-fit": "cover",
        "width": "100%",
        "height": "100%"
      },
      ".sprout-file-attachment-preview": {
        "aspect-ratio": "16 / 9",
        "background": "var(--sprout-hover)",
        "width": "100%",
        "color": "var(--sprout-muted)",
        "font": "inherit",
        "border": "0",
        "border-radius": "11px 11px 0 0",
        "justify-content": "center",
        "align-items": "center",
        "margin": "0",
        "padding": "0",
        "display": "flex",
        "overflow": "hidden"
      },
      "button.sprout-file-attachment-preview": {
        "cursor": "pointer"
      },
      ".sprout-file-attachment-preview > .sprout-attachment-image": {
        "object-fit": "cover",
        "width": "100%",
        "height": "100%"
      },
      ".sprout-file-attachment-thumb": {
        "background": "var(--sprout-file-image)",
        "border-radius": "6px",
        "flex-shrink": "0",
        "justify-content": "center",
        "align-items": "center",
        "width": "22px",
        "height": "22px",
        "display": "flex",
        "overflow": "hidden"
      },
      ".sprout-file-attachment-thumb > .sprout-attachment-image": {
        "object-fit": "cover",
        "width": "100%",
        "height": "100%"
      },
      ".sprout-file-attachment-thumb > .sprout-attachment-image-failed": {
        "padding": "0",
        "font-size": "0"
      },
      ".sprout-file-attachment-thumb > .sprout-attachment-image-failed svg": {
        "width": "12px",
        "height": "12px"
      },
      ".sprout-file-attachment-actions": {
        "flex-shrink": "0",
        "align-items": "center",
        "display": "flex"
      },
      ".sprout-file-attachment[data-variant=\"grid\"] .sprout-file-attachment-actions": {
        "background": "var(--sprout-surface)",
        "border-radius": "6px",
        "position": "absolute",
        "top": "4px",
        "right": "4px"
      },
      ".sprout-attachment-image-failed": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "align-items": "center",
        "gap": "8px",
        "padding": "8px",
        "display": "flex"
      },
      ".sprout-attachment-dropzone": {
        "box-sizing": "border-box",
        "border": "1px dashed var(--sprout-input)",
        "background": "color-mix(in oklab, var(--sprout-hover) 30%, var(--sprout-surface))",
        "color": "var(--sprout-text)",
        "text-align": "center",
        "border-radius": "12px",
        "padding": "20px"
      },
      ".sprout-attachment-dropzone[data-dragging]": {
        "border-color": "var(--sprout-focus)",
        "background": "var(--sprout-hover)"
      },
      ".sprout-attachment-dropzone[data-disabled]": {
        "cursor": "not-allowed"
      },
      ".sprout-attachment-dropzone[data-disabled] .sprout-attachment-dropzone-icon": {
        "opacity": ".5"
      },
      ".sprout-attachment-dropzone-icon": {
        "color": "var(--sprout-muted)",
        "margin": "0 auto 8px",
        "display": "block"
      },
      ".sprout-attachment-dropzone-text": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-sm)",
        "margin": "0 0 12px",
        "line-height": "1.25rem"
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-attachment, .sprout-file-attachment, .sprout-attachment-dropzone": {
          "transition": "background-color var(--sprout-motion-normal) var(--sprout-motion-ease),\n        border-color var(--sprout-motion-normal) var(--sprout-motion-ease)"
        },
        ".sprout-attachment-media[data-variant=\"image\"]": {
          "transition": "opacity var(--sprout-motion-normal) var(--sprout-motion-ease)"
        },
        ".sprout-attachment-carousel-arrow": {
          "transition": "opacity var(--sprout-motion-fast) var(--sprout-motion-ease),\n        background-color var(--sprout-motion-fast) var(--sprout-motion-ease),\n        color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-attachment-carousel-viewport": {
          "scroll-behavior": "smooth"
        },
        ".sprout-attachment:is([data-state=\"uploading\"], [data-state=\"processing\"]) .sprout-attachment-title, .sprout-file-attachment:is([data-state=\"uploading\"], [data-state=\"processing\"]) .sprout-file-attachment-name": {
          "background": "linear-gradient(90deg,\n          var(--sprout-muted) 0%,\n          var(--sprout-muted) 40%,\n          var(--sprout-text) 50%,\n          var(--sprout-muted) 60%,\n          var(--sprout-muted) 100%)\n        0 0 / 250% 100%",
          "-webkit-text-fill-color": "transparent",
          "-webkit-background-clip": "text",
          "background-clip": "text",
          "animation": "1.8s linear infinite sprout-attachment-shimmer"
        }
      },
      "@media (forced-colors: active)": {
        ".sprout-attachment-title, .sprout-file-attachment-name": {
          "-webkit-text-fill-color": "currentColor !important",
          "background": "none !important"
        }
      },
      "@keyframes sprout-attachment-shimmer": {
        "from": {
          "background-position": "100% 0"
        },
        "to": {
          "background-position": "0 0"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/attachment/",
  "meta": {
    "source": "packages/sprout/src/components/attachment.tsx"
  }
}
