'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.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$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var React = require('react');
var selectRoot = require('./select-root.cjs');
var select_module = require('./select.module.css.cjs');
var index = require('../../node_modules/.pnpm/@radix-ui_react-select@2.2.5_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs');
var index$2 = 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 SelectContent = React.forwardRef(({ className, children, position = 'popper', searchPlaceholder = 'Search...', sideOffset = 4, asChild, onEscapeKeyDown: providedOnEscapeKeyDown, onPointerDownOutside: providedOnPointerDownOutside, ...props }, ref) => {
    const { autocomplete, multiple, updateSelectionInProgress } = selectRoot.useSelectContext();
    const onPointerDownOutside = React.useCallback(event => {
        updateSelectionInProgress(false);
        providedOnPointerDownOutside?.(event);
    }, [updateSelectionInProgress, providedOnPointerDownOutside]);
    const onEscapeKeyDown = React.useCallback(event => {
        updateSelectionInProgress(false);
        providedOnEscapeKeyDown?.(event);
    }, [updateSelectionInProgress, providedOnEscapeKeyDown]);
    return (jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsx(index.Content, { ref: ref, position: position, sideOffset: sideOffset, className: index$1.cx(select_module.default.content, className), onEscapeKeyDown: multiple ? onEscapeKeyDown : providedOnEscapeKeyDown, onPointerDownOutside: multiple ? onPointerDownOutside : providedOnPointerDownOutside, role: autocomplete ? 'dialog' : 'listbox', "aria-multiselectable": !autocomplete && multiple ? true : undefined, "data-multiselectable": multiple ? true : undefined, ...props, children: jsxRuntime.jsxRuntimeExports.jsx(index.Viewport, { className: index$1.cx(select_module.default.viewport, autocomplete && select_module.default.comboboxViewport), asChild: !autocomplete ? asChild : undefined, children: autocomplete ? (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx(combobox.Combobox, { autoSelect: true, placeholder: searchPlaceholder, className: select_module.default.comboboxInput, onBlurCapture: event => {
                                event.preventDefault();
                                event.stopPropagation();
                            } }), jsxRuntime.jsxRuntimeExports.jsx(MAXQOH4L.ComboboxList, { className: select_module.default.comboboxContent, "aria-multiselectable": multiple ? true : undefined, render: asChild ? jsxRuntime.jsxRuntimeExports.jsx(index$2.Root, {}) : undefined, children: children })] })) : (children) }) }) }));
});
SelectContent.displayName = index.Content.displayName;

exports.SelectContent = SelectContent;
//# sourceMappingURL=select-content.cjs.map
