import { caseInsensitiveSearch } from "../searching/caseInsensitive.js";
import { defaultExtractor } from "../searching/utils.js";
/**
 * @since 6.0.0
 * @internal
 */ export const defaultAutocompleteExtractor = (item)=>{
    if (item && typeof item === "object" && "label" in item && typeof item.label === "string") {
        return item.label;
    }
    return defaultExtractor("Autocomplete")(item);
};
/**
 * @since 6.0.0
 * @internal
 */ const isProbablyMenuItemProps = (item)=>!!item && typeof item === "object";
/**
 * @since 6.0.0
 * @internal
 */ export const defaultAutocompleteOptionProps = (options)=>{
    const { option } = options;
    if (isProbablyMenuItemProps(option)) {
        const { leftAddon, rightAddon, className, disabled, height, textProps, textClassName, primaryText, secondaryText, secondaryTextClassName, multiline, disableTextChildren } = option;
        return {
            leftAddon,
            rightAddon,
            className,
            disabled,
            height,
            textProps,
            textClassName,
            primaryText,
            secondaryText,
            secondaryTextClassName,
            multiline,
            disableTextChildren
        };
    }
    return;
};
/**
 * This is just the {@link caseInsensitiveSearch} but requires
 * the options to start with the current query.
 *
 * @since 6.0.0
 */ export function defaultAutocompleteFilter(options) {
    return caseInsensitiveSearch({
        ...options,
        startsWith: true
    });
}

//# sourceMappingURL=defaults.js.map