//#region common/test_utils/node_traversal.js
function e(t, n) {
	n(t), t.content && t.content.forEach((t) => e(t, n));
}
function t(t, n) {
	t && Array.isArray(t) && t.forEach((t) => e(t, n));
}
function n(e, n) {
	let r = null;
	return t(e, (e) => {
		!r && n(e) && (r = e);
	}), r;
}
function r(e, t) {
	return n(e, (e) => e.type === "variable" && e.attrs?.id === t);
}
function i(e, n) {
	let r = [];
	return t(e, (e) => {
		n(e) && r.push(e);
	}), r;
}
function a(e) {
	return i(e, (e) => e.type === "variable");
}
function o(e, n) {
	let r = 0;
	return t(e, (e) => {
		n(e) && r++;
	}), r;
}
function s(e) {
	return o(e, (e) => e.type === "variable");
}
function c(e, t) {
	return r(e, t) !== null;
}
//#endregion
export { o as countNodes, s as countVariables, i as findAllNodes, a as findAllVariables, n as findNode, r as findVariable, e as traverseNode, t as traverseNodes, c as variableExists };

//# sourceMappingURL=node-traversal.js.map