"use client";
const require_use_props = require("../../../core/MantineProvider/use-props/use-props.cjs");
const require_factory = require("../../../core/factory/factory.cjs");
const require_Box = require("../../../core/Box/Box.cjs");
const require_Combobox_module = require("../Combobox.module.cjs");
const require_Combobox_context = require("../Combobox.context.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Combobox/ComboboxOption/ComboboxOption.tsx
const ComboboxOption = require_factory.factory((_props) => {
	const props = require_use_props.useProps("ComboboxOption", null, _props);
	const { classNames, className, style, styles, vars, onClick, id, active, onMouseDown, onMouseOver, disabled, selected, mod, ...others } = props;
	const ctx = require_Combobox_context.useComboboxContext();
	const uuid = (0, react.useId)();
	const _id = id || uuid;
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
		...ctx.getStyles("option", {
			className,
			classNames,
			styles,
			style
		}),
		...others,
		id: _id,
		mod: [
			"combobox-option",
			{
				"combobox-active": active,
				"combobox-disabled": disabled,
				"combobox-selected": selected
			},
			mod
		],
		role: "option",
		onClick: (event) => {
			if (!disabled) {
				ctx.onOptionSubmit?.(props.value, props);
				onClick?.(event);
			} else event.preventDefault();
		},
		onMouseDown: (event) => {
			event.preventDefault();
			onMouseDown?.(event);
		},
		onMouseOver: (event) => {
			if (ctx.resetSelectionOnOptionHover) ctx.store.resetSelectedOption();
			onMouseOver?.(event);
		}
	});
});
ComboboxOption.classes = require_Combobox_module.default;
ComboboxOption.displayName = "@mantine/core/ComboboxOption";
//#endregion
exports.ComboboxOption = ComboboxOption;

//# sourceMappingURL=ComboboxOption.cjs.map