import "../../chunks/chunk.QU3DSPNU.js";
import { configureLocalization } from "@lit/localize";
import { sourceLocale, targetLocales } from "../../generated/locale-codes.js";
import * as templates_da from "../../generated/locales/da.js";
import * as templates_de from "../../generated/locales/de.js";
import * as templates_fi from "../../generated/locales/fi.js";
import * as templates_fr from "../../generated/locales/fr.js";
import * as templates_it from "../../generated/locales/it.js";
import * as templates_nl from "../../generated/locales/nl.js";
import * as templates_no from "../../generated/locales/no.js";
import * as templates_sv from "../../generated/locales/sv.js";
const localizedTemplates = /* @__PURE__ */ new Map([
  ["sv", templates_sv],
  ["no", templates_no],
  ["nl", templates_nl],
  ["it", templates_it],
  ["fr", templates_fr],
  ["fi", templates_fi],
  ["de", templates_de],
  ["da", templates_da]
]);
const gdsInitLocalization = ({ extraLocales, extraTemplates } = {
  extraLocales: [],
  extraTemplates: /* @__PURE__ */ new Map()
}) => {
  const _targetLocales = [...targetLocales];
  for (const [locale, template] of extraTemplates) {
    localizedTemplates.set(locale, template);
  }
  for (const locale of extraLocales) {
    _targetLocales.push(locale);
  }
  return configureLocalization({
    sourceLocale,
    targetLocales: _targetLocales,
    loadLocale: async (locale) => {
      const localModule = localizedTemplates.get(locale);
      if (localModule) {
        return localModule;
      }
      return Promise.reject(new Error(`Locale ${locale} not found`));
    }
  });
};
export {
  gdsInitLocalization,
  targetLocales
};
