/**
 * Currency Converter — Frontend entrypoint.
 *
 * Keeps runtime initialization minimal and delegates implementation
 * to modularized frontend code under src/frontend.
 */

import { initExchangeRatesFormatting } from './frontend/exchange/format-rates';
import { initConverters } from './frontend/converter/FxConverter';

function initFrontendWidgets(): void {
  initExchangeRatesFormatting();
  initConverters();
}

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', initFrontendWidgets);
} else {
  initFrontendWidgets();
}
