import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { forwardRef } from 'react';
import { Item as $d08ef79370b62062$export$6d08773d2e66f8f2, RadioItem as $d08ef79370b62062$export$371ab307eab489c0, RadioGroup as $d08ef79370b62062$export$a98f0dcb43a68a25 } from '../../node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.0.5_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@1_e7gmnqwdc4f4ybjj7qkfdho6zy/node_modules/@radix-ui/react-dropdown-menu/dist/index.js';
import { Cell } from './cell.js';
import { useDropdownContext, useMenuLevel } from './dropdown-menu-root.js';
import { ComboboxItem } from '../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/JMHAJKUZ.js';
import { getMatch, getValue } from './utils.js';

const DropdownMenuItem = forwardRef(({ children, value, ...props }, ref) => {
    const { autocomplete, searchValue } = useDropdownContext();
    const menuLevel = useMenuLevel();
    const item = (jsxRuntimeExports.jsx($d08ef79370b62062$export$6d08773d2e66f8f2, { ref: ref, ...props, asChild: true, children: jsxRuntimeExports.jsx(Cell, { isComboboxCell: autocomplete, children: children }) }));
    if (menuLevel >= 2)
        return item;
    const computedValue = getValue(value, children);
    if (autocomplete && !getMatch(computedValue, searchValue))
        return null;
    if (autocomplete)
        return jsxRuntimeExports.jsx(ComboboxItem, { render: item, value: value });
    return item;
});
const DropdownMenuRadioItem = forwardRef(({ children, ...props }, ref) => (jsxRuntimeExports.jsx($d08ef79370b62062$export$371ab307eab489c0, { ref: ref, ...props, asChild: true, children: jsxRuntimeExports.jsx(Cell, { type: "select", children: children }) })));
DropdownMenuRadioItem.displayName = $d08ef79370b62062$export$371ab307eab489c0.displayName;
const DropdownMenuRadioGroup = $d08ef79370b62062$export$a98f0dcb43a68a25;

export { DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem };
//# sourceMappingURL=dropdown-menu-item.js.map
