"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const system_1 = require("@mui/system");
const SearchAutocomplete_1 = tslib_1.__importDefault(require("../SearchAutocomplete"));
const PREFIX = 'SCSearchDialog';
const classes = {
    root: `${PREFIX}-root`,
    search: `${PREFIX}-search`
};
const Root = (0, material_1.styled)(material_1.Dialog, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
})(({ theme }) => ({
    '& .MuiAutocomplete-popperDisablePortal .MuiPaper-root': {
        boxShadow: 'none',
        borderRadius: 0,
        '& .MuiAutocomplete-listbox': {
            maxHeight: 'none'
        }
    }
}));
function Search(inProps) {
    // PROPS
    const props = (0, system_1.useThemeProps)({
        props: inProps,
        name: PREFIX
    });
    const { className, SearchAutocompleteProps = { autoFocus: true } } = props, rest = tslib_1.__rest(props, ["className", "SearchAutocompleteProps"]);
    return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(SearchAutocomplete_1.default, Object.assign({ className: classes.search, blurOnSelect: false, open: true, disablePortal: true }, SearchAutocompleteProps)) }) })));
}
exports.default = Search;
