#!/usr/bin/env node
import { createRequire as createRequire_BATI_CLI } from 'module';
const require = createRequire_BATI_CLI(import.meta.url);

import "../../../../chunk-DHZ7AZKP.js";

// ../../boilerplates/auth0/dist/files/$wrangler.toml.js
async function getEnv(props) {
  if (!props.meta.BATI.has("cloudflare")) return;
  const content = await props.readfile?.();
  if (!content) {
    throw new Error("wrangler.toml should not be empty");
  }
  const auth0ClientId = process.env.TEST_AUTH0_CLIENT_ID;
  const auth0ClientSecret = process.env.TEST_AUTH0_CLIENT_SECRET;
  const auth0BaseUrl = process.env.TEST_AUTH0_ISSUER_BASE_URL;
  const varsSnippet = `
# top level environment
[vars]
# Auth0 Client ID
AUTH0_CLIENT_ID = ${JSON.stringify(auth0ClientId ?? "")}
# Auth0 Client Secret
AUTH0_CLIENT_SECRET = ${JSON.stringify(auth0ClientSecret ?? "")}
# Auth0 base URL
AUTH0_ISSUER_BASE_URL = ${JSON.stringify(auth0BaseUrl ?? "")}
`;
  return `${content}
${varsSnippet}`;
}
export {
  getEnv as default
};
