globalThis.process ??= {}; globalThis.process.env ??= {};
import { c as createJsonResponse, b as createIndexKey } from '../../../../chunks/apiHelpers_DEg9ljrb.mjs';
import { f as fetchApiIndex } from '../../../../chunks/fetch_CoXtH9RF.mjs';
export { r as renderers } from '../../../../chunks/_@astro-renderers_OzpRq-hZ.mjs';

const prerender = false;
const GET = async ({ params, url }) => {
  const { version, section, page } = params;
  if (!version || !section || !page) {
    return createJsonResponse(
      { error: "Version, section, and page parameters are required" },
      400
    );
  }
  try {
    const index = await fetchApiIndex(url);
    const pageKey = createIndexKey(version, section, page);
    const tabs = index.tabs[pageKey];
    if (!tabs) {
      return createJsonResponse(
        {
          error: `Page '${page}' not found in section '${section}' for version '${version}'`
        },
        404
      );
    }
    return createJsonResponse(tabs);
  } catch (error) {
    return createJsonResponse(
      { error: "Failed to load API index", details: error },
      500
    );
  }
};

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

const page = () => _page;

export { page };
