/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
const require_entryPoints = require("../../../../../tailwind-internal/dist/utils/entryPoints.cjs");
let fast_glob = require("fast-glob");
fast_glob = require_runtime.__toESM(fast_glob, 1);
//#region ../css/dist/purger/optimized/utils/files.mjs
/*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
/**
* Scan a directory for JSX/TSX files
*/
const scanForFiles = async (entry) => {
	const workspaceDir = process.env.PWD ?? process.cwd();
	try {
		const fileGroups = await Promise.all(require_entryPoints.resolveEntryPaths(entry, workspaceDir, require_entryPoints.DEFAULT_ENTRY).map((entryPath) => {
			if (entryPath.kind === "file") return [entryPath.absolutePath];
			return (0, fast_glob.default)("**/*.{jsx,tsx}", {
				cwd: entryPath.absolutePath,
				absolute: true,
				ignore: ["**/node_modules/**"]
			});
		}));
		return [...new Set(fileGroups.flat())];
	} catch (error) {
		throw error instanceof Error ? error : /* @__PURE__ */ new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);
	}
};
//#endregion
exports.scanForFiles = scanForFiles;
