"use client";
import { isOptionsGroup } from "../Combobox/OptionsDropdown/is-options-group.mjs";
//#region packages/@mantine/core/src/components/TagsInput/filter-picked-tags.ts
function filterPickedTags({ data, value }) {
	const normalizedValue = value.map((item) => item.trim().toLowerCase());
	return data.reduce((acc, item) => {
		if (isOptionsGroup(item)) acc.push({
			group: item.group,
			items: item.items.filter((option) => normalizedValue.indexOf(option.label.toLowerCase().trim()) === -1)
		});
		else if (normalizedValue.indexOf(item.label.toLowerCase().trim()) === -1) acc.push(item);
		return acc;
	}, []);
}
//#endregion
export { filterPickedTags };

//# sourceMappingURL=filter-picked-tags.mjs.map