import { computed as e } from "vue";
function t(e, t) {
	let n = /* @__PURE__ */ new Map();
	if (!e) return {
		grouped: n,
		rest: [],
		ordered: []
	};
	for (let r of e) {
		let e = r[t];
		e != null && (n.has(e) || n.set(e, []), n.get(e)?.push(r));
	}
	let r = e.filter((e) => e[t] == null);
	return {
		grouped: n,
		rest: r,
		ordered: [...Array.from(n.values()).flat(), ...r]
	};
}
function n(n, r) {
	let i = e(() => t(n.value, r));
	return {
		orderedRef: e(() => i.value.ordered),
		groupsRef: e(() => i.value.grouped),
		restRef: e(() => i.value.rest)
	};
}
export { n as useGroupBy };

//# sourceMappingURL=useGroupBy.js.map