'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var VIIRIBF3 = require('../../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/VIIRIBF3.cjs');
var menu = require('../../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/menu/menu.cjs');
var combobox = require('../../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/combobox/combobox.cjs');
var MAXQOH4L = require('../../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/MAXQOH4L.cjs');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var React = require('react');
var dropdownMenuRoot = require('./dropdown-menu-root.cjs');
var dropdownMenu_module = require('./dropdown-menu.module.css.cjs');
var index$1 = require('../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs');

const DropdownMenuContent = React.forwardRef(({ className, children, asChild, searchPlaceholder = 'Search...', ...props }, ref) => {
    const menu$1 = VIIRIBF3.useMenuContext();
    const { autocomplete } = dropdownMenuRoot.useDropdownContext();
    const isSubMenu = !!menu$1?.parent;
    const comboboxRef = React.useRef(null);
    return (jsxRuntime.jsxRuntimeExports.jsx(menu.Menu, { ref: ref, modal: true, portal: true, portalElement: typeof window === 'undefined' ? null : window?.document?.body, unmountOnHide: true, gutter: isSubMenu ? 2 : 4, className: index.cx(dropdownMenu_module.default.content, autocomplete && dropdownMenu_module.default.comboboxContainer, className), render: asChild ? jsxRuntime.jsxRuntimeExports.jsx(index$1.Root, {}) : undefined, ...props, children: autocomplete ? (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx(combobox.Combobox, { ref: comboboxRef, placeholder: searchPlaceholder, className: dropdownMenu_module.default.comboboxInput, autoSelect: true, onPointerEnter: e => {
                        if (document && document.activeElement !== comboboxRef.current)
                            comboboxRef.current?.focus();
                    } }), jsxRuntime.jsxRuntimeExports.jsx(MAXQOH4L.ComboboxList, { className: dropdownMenu_module.default.comboboxContent, children: children })] })) : (children) }));
});

exports.DropdownMenuContent = DropdownMenuContent;
//# sourceMappingURL=dropdown-menu-content.cjs.map
