export { patchGlobalConsole } from './chunk-C5R5IRTK.js';
export { patchGlobalResponse } from './chunk-CWWKO23R.js';
export { patchGlobalServerResponse } from './chunk-KU6Z4QI2.js';
import { checkBunVersion } from './chunk-TZU7BNR4.js';
import { checkForConfigErrors } from './chunk-4MCNC4YY.js';
import { loadVarlockEnvGraph } from './chunk-5SI4EGRL.js';
import './chunk-7M6WZ65V.js';
import { loadEnvGraph } from './chunk-VT7SXRVK.js';
import { DotEnvFileDataSource, EnvGraph } from './chunk-LTYLEVHC.js';
import './chunk-7OJKCWSO.js';
import './chunk-TMF4AFL6.js';
import './chunk-223S32SW.js';
import './chunk-Y2ROUSC3.js';
import './chunk-JE2IMKMO.js';
import { ResolutionError, CoercionError, ValidationError, SchemaError, ConfigLoadError } from './chunk-DRL5U3PK.js';
export { createDebug } from './chunk-QGM3LRUO.js';
import './chunk-IQ226IPZ.js';
import { initVarlockEnv } from './chunk-PRASPAE4.js';
export { ENV } from './chunk-PRASPAE4.js';
import './chunk-UWUBFNLX.js';
import { __name } from './chunk-IBAHCH6O.js';

// src/index.ts
async function load() {
  checkBunVersion();
  const envGraph = await loadVarlockEnvGraph();
  await envGraph.resolveEnvValues();
  checkForConfigErrors(envGraph);
  process.env.__VARLOCK_ENV = JSON.stringify(envGraph.getSerializedGraph());
  initVarlockEnv();
}
__name(load, "load");
function getBuildTimeReplacements(opts) {
  if (!process.env.__VARLOCK_ENV) return {};
  const envInfo = JSON.parse(process.env.__VARLOCK_ENV);
  const replacements = {};
  for (const key in envInfo.config) {
    const itemInfo = envInfo.config[key];
    const replaceItem = !itemInfo.isSensitive || opts?.includeSensitive;
    if (!replaceItem) continue;
    replacements[`${opts?.objectKey || "ENV"}.${key}`] = JSON.stringify(envInfo.config[key].value);
  }
  return replacements;
}
__name(getBuildTimeReplacements, "getBuildTimeReplacements");
var internal = {
  // Core classes
  EnvGraph,
  DotEnvFileDataSource,
  // Loader function
  loadEnvGraph,
  // Error classes
  ConfigLoadError,
  SchemaError,
  ValidationError,
  CoercionError,
  ResolutionError,
  // Varlock-specific utilities
  loadVarlockEnvGraph,
  checkForConfigErrors,
  initVarlockEnv
};

export { getBuildTimeReplacements, internal, load };
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map