globalThis.process ??= {}; globalThis.process.env ??= {};
async function fetchApiIndex(url) {
  const apiIndexUrl = new URL("/apiIndex.json", url.origin);
  const response = await fetch(apiIndexUrl);
  if (!response.ok) {
    throw new Error(`Failed to load API index: ${response.status} ${response.statusText}`);
  }
  const data = await response.json();
  return data;
}

export { fetchApiIndex as f };
