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, tab } = params;
  if (!version || !section || !page || !tab) {
    return createJsonResponse(
      { error: "Version, section, page, and tab parameters are required" },
      400
    );
  }
  try {
    const index = await fetchApiIndex(url);
    const exampleKey = createIndexKey(version, section, page, tab);
    const examples = index.examples[exampleKey] || [];
    return createJsonResponse(examples);
  } catch (error) {
    const details = error instanceof Error ? error.message : String(error);
    return createJsonResponse(
      { error: "Failed to load API index", details },
      500
    );
  }
};

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

const page = () => _page;

export { page };
