import { markdownSpace } from "../micromark-util-character/index.js";
function factorySpace(t, n, r, i) {
	let a = i ? i - 1 : Infinity, o = 0;
	return s;
	function s(i) {
		return markdownSpace(i) ? (t.enter(r), c(i)) : n(i);
	}
	function c(i) {
		return markdownSpace(i) && o++ < a ? (t.consume(i), c) : (t.exit(r), n(i));
	}
}
export { factorySpace };
