// Thin wrapper around `vega-color-token-contrast-checker/core`. The
// runtime package is theme-system-agnostic; this file wires it up to vega-stencil's
// concrete inputs:
//   • `LightModeColorTokens` (the static surface-token table generated by vega-design)
//   • `VegaColorSchemaOverridingController.generateOverrideThemes(...)` (the
//     actionColor-derived override list)
//
// The checker encapsulates everything actionColor-related (hex validation,
// suggestion search, contrast-cap patching) — wiring is just the two consumer-
// supplied dependencies above.
//
// LAZY-LOADING CONTRACT: This module is dynamic-imported by
// `internal-theme-manager.ts` so the contrast-check code path is split out of the
// main bundle. Keep the import graph below light — anything that bloats the bundle
// should live behind another dynamic import or in the runtime package itself.
import { VegaColorTokenContrastChecker } from 'vega-color-token-contrast-checker/core';
import { LightModeColorTokens } from '../../../constants/tokens/themes/v2-new-brand/light-mode-color-tokens';
import { VegaColorSchemaOverridingController } from './color-schema-overriding-controller';
/**
 * Process-lifetime singleton: a {@link VegaColorTokenContrastChecker} pre-bound
 * to vega-stencil's design-token table and override-themes generator. Consumers
 * call `.validate(overrideColors)` and `.computeContrastCapPatches(overrideColors)`
 * directly — no per-call configuration needed.
 */
export const vegaAccessibilityValidator = new VegaColorTokenContrastChecker({
  fixedSurfaceTokens: LightModeColorTokens,
  /**
   * Generate override theme arrays from the supplied override colors.
   *
   * @param {VegaThemeOverrideColors} overrideColors The override colors input.
   * @returns {ReturnType<typeof VegaColorSchemaOverridingController.generateOverrideThemes>} The override theme arrays.
   */
  generateOverrideThemes: (overrideColors) => VegaColorSchemaOverridingController.generateOverrideThemes(overrideColors),
});
