'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from 'react';
import { Search } from 'lucide-react';
import { cn } from '../../lib/utils.js';
/**
 * Command — minimal combobox primitives for model/item selection.
 *
 * Intentionally avoids the `cmdk` dependency and builds on native React +
 * Tailwind instead. Filtering logic lives in the consumer component.
 */
const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
Command.displayName = 'Command';
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", children: [_jsx(Search, { className: "me-2 h-4 w-4 shrink-0 opacity-50" }), _jsx("input", { ref: ref, className: cn('placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
CommandInput.displayName = 'CommandInput';
const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
CommandList.displayName = 'CommandList';
const CommandEmpty = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('text-muted-foreground py-6 text-center text-sm', className), ...props })));
CommandEmpty.displayName = 'CommandEmpty';
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('text-foreground overflow-hidden p-1', className), ...props })));
CommandGroup.displayName = 'CommandGroup';
const CommandItem = React.forwardRef(({ className, selected, ...props }, ref) => (_jsx("button", { ref: ref, type: "button", "data-selected": selected, className: cn('relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none', 'hover:bg-accent hover:text-accent-foreground', 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground', 'disabled:pointer-events-none disabled:opacity-50', className), ...props })));
CommandItem.displayName = 'CommandItem';
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
CommandSeparator.displayName = 'CommandSeparator';
export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, };
