globalThis.process ??= {}; globalThis.process.env ??= {};
import { c as createJsonResponse } from '../../../../chunks/apiHelpers_DEg9ljrb.mjs';
import { g as getConfig } from '../../../../chunks/getConfig_DO3RhTb7.mjs';
import { join } from 'node:path';
import { readFileSync } from 'node:fs';
export { r as renderers } from '../../../../chunks/_@astro-renderers_OzpRq-hZ.mjs';

const prerender = false;
const GET = async ({}) => {
  try {
    const config = await getConfig(`${process.cwd()}/pf-docs.config.mjs`);
    const outputDir = config?.outputDir || join(process.cwd(), "dist");
    const propsFilePath = join(outputDir, "props.json");
    const propsDataFile = readFileSync(propsFilePath);
    const props = JSON.parse(propsDataFile.toString());
    const propsKey = new RegExp("Props", "i");
    const names = Object.keys(props).filter((name) => !propsKey.test(name));
    return createJsonResponse(names);
  } catch (error) {
    const details = error instanceof Error ? error.message : String(error);
    return createJsonResponse(
      { error: "Component names data not found", details },
      500
    );
  }
};

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  GET,
  prerender
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
