/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
let ts_morph = require("ts-morph");

//#region src/purger/optimized/ast/jsx.ts
/**
* Find all JSX usages of a component from its identifier
*/
const findJsxReferences = (identifier) => {
	try {
		return identifier.findReferencesAsNodes().map((reference) => reference.getFirstAncestor((n) => ts_morph.Node.isJsxOpeningElement(n) || ts_morph.Node.isJsxSelfClosingElement(n))).filter((node) => Boolean(node) && (ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node)));
	} catch {
		return [];
	}
};

//#endregion
exports.findJsxReferences = findJsxReferences;