//#region ../../node_modules/chevrotain/lib/src/scan/tokens.js
function e(e, t) {
	let n = e.tokenTypeIdx;
	return n === t.tokenTypeIdx ? !0 : t.isParent === !0 && t.categoryMatchesMap[n] === !0;
}
function t(e, t) {
	return e.tokenTypeIdx === t.tokenTypeIdx;
}
var n = 1, r = {};
function i(e) {
	let t = a(e);
	o(t), c(t), s(t), t.forEach((e) => {
		e.isParent = e.categoryMatches.length > 0;
	});
}
function a(e) {
	let t = [...e], n = e, r = !0;
	for (; r;) {
		n = n.map((e) => e.CATEGORIES).flat().filter(Boolean);
		let e = n.filter((e) => !t.includes(e));
		t = t.concat(e), e.length === 0 ? r = !1 : n = e;
	}
	return t;
}
function o(e) {
	e.forEach((e) => {
		u(e) || (r[n] = e, e.tokenTypeIdx = n++), d(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), d(e) || (e.CATEGORIES = []), f(e) || (e.categoryMatches = []), p(e) || (e.categoryMatchesMap = {});
	});
}
function s(e) {
	e.forEach((e) => {
		e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((t) => {
			e.categoryMatches.push(r[t].tokenTypeIdx);
		});
	});
}
function c(e) {
	e.forEach((e) => {
		l([], e);
	});
}
function l(e, t) {
	e.forEach((e) => {
		t.categoryMatchesMap[e.tokenTypeIdx] = !0;
	}), t.CATEGORIES.forEach((n) => {
		let r = e.concat(t);
		r.includes(n) || l(r, n);
	});
}
function u(e) {
	return Object.hasOwn(e ?? {}, "tokenTypeIdx");
}
function d(e) {
	return Object.hasOwn(e ?? {}, "CATEGORIES");
}
function f(e) {
	return Object.hasOwn(e ?? {}, "categoryMatches");
}
function p(e) {
	return Object.hasOwn(e ?? {}, "categoryMatchesMap");
}
function m(e) {
	return Object.hasOwn(e ?? {}, "tokenTypeIdx");
}
//#endregion
export { i as augmentTokenTypes, u as hasShortKeyProperty, m as isTokenType, e as tokenStructuredMatcher, t as tokenStructuredMatcherNoCategories };
