// <auto-generated>
// This file was automatically generated. Do not edit manually.


// src/defaults/PasswordGeneratorDefaults.ts
var DEFAULT_PASSWORD_LENGTH = 18;
var MIN_PASSWORD_LENGTH = 8;
var MAX_PASSWORD_LENGTH = 256;
var DEFAULT_WORD_COUNT = 5;
var MIN_WORD_COUNT = 3;
var MAX_WORD_COUNT = 10;

// src/defaults/Languages.ts
var DEFAULT_LANGUAGE_CODE = "en";
var LANGUAGES = [
  { code: "en", flag: "\u{1F1FA}\u{1F1F8}", label: "English", alternativeCodes: ["en-US", "en-GB", "en-CA", "en-AU", "en-NZ", "en-IE", "en-ZA", "en-SG", "en-IN"] },
  { code: "nl", flag: "\u{1F1F3}\u{1F1F1}", label: "Nederlands", alternativeCodes: ["nl-NL", "nl-BE"] },
  { code: "de", flag: "\u{1F1E9}\u{1F1EA}", label: "Deutsch", alternativeCodes: ["de-DE", "de-AT", "de-CH", "de-LU", "de-LI"] },
  { code: "fr", flag: "\u{1F1EB}\u{1F1F7}", label: "Fran\xE7ais", alternativeCodes: ["fr-FR", "fr-CA", "fr-BE", "fr-CH", "fr-LU", "fr-MC"] },
  { code: "es", flag: "\u{1F1EA}\u{1F1F8}", label: "Espa\xF1ol", alternativeCodes: ["es-ES", "es-MX", "es-AR", "es-CO", "es-CL", "es-PE", "es-VE", "es-EC", "es-GT", "es-CU", "es-BO", "es-DO", "es-HN", "es-PY", "es-SV", "es-NI", "es-CR", "es-PA", "es-UY", "es-PR"] },
  { code: "it", flag: "\u{1F1EE}\u{1F1F9}", label: "Italiano", alternativeCodes: ["it-IT", "it-CH", "it-SM", "it-VA"] },
  { code: "da", flag: "\u{1F1E9}\u{1F1F0}", label: "Dansk", alternativeCodes: ["da-DK"] },
  { code: "fi", flag: "\u{1F1EB}\u{1F1EE}", label: "Suomi", alternativeCodes: ["fi-FI"] },
  { code: "he", flag: "\u{1F1EE}\u{1F1F1}", label: "\u05E2\u05D1\u05E8\u05D9\u05EA", alternativeCodes: ["he-IL"] },
  { code: "pl", flag: "\u{1F1F5}\u{1F1F1}", label: "Polski", alternativeCodes: ["pl-PL"] },
  { code: "pt", flag: "\u{1F1E7}\u{1F1F7}", label: "Portugu\xEAs Brasileiro", alternativeCodes: ["pt-BR", "pt-PT"] },
  { code: "ro", flag: "\u{1F1F7}\u{1F1F4}", label: "Rom\xE2n\u0103", alternativeCodes: ["ro-RO", "ro-MD"] },
  { code: "ru", flag: "\u{1F1F7}\u{1F1FA}", label: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", alternativeCodes: ["ru-RU", "ru-BY", "ru-KZ", "ru-UA"] },
  { code: "sv", flag: "\u{1F1F8}\u{1F1EA}", label: "Svenska", alternativeCodes: ["sv-SE", "sv-FI"] },
  { code: "uk", flag: "\u{1F1FA}\u{1F1E6}", label: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", alternativeCodes: ["uk-UA"] },
  { code: "zh", flag: "\u{1F1E8}\u{1F1F3}", label: "\u7B80\u4F53\u4E2D\u6587", alternativeCodes: ["zh-CN", "zh-SG", "zh-Hans", "zh-TW", "zh-HK", "zh-MO", "zh-Hant"] },
  { code: "ur", flag: "\u{1F1F5}\u{1F1F0}", label: "\u0627\u0631\u062F\u0648", alternativeCodes: ["ur-PK", "ur-IN"] },
  { code: "fa", flag: "\u{1F1EE}\u{1F1F7}", label: "\u0641\u0627\u0631\u0633\u06CC", alternativeCodes: ["fa-IR", "fa-AF"] }
];
function normalizeLanguageCode(code) {
  return (code ?? "").slice(0, 2).toLowerCase();
}
function getLanguageInfo(code) {
  const iso = normalizeLanguageCode(code);
  const match = LANGUAGES.find((l) => l.code === iso);
  return match ?? { code, flag: "\u{1F310}", label: code };
}
function matchAvailableLanguage(appLanguage, availableCodes) {
  if (!appLanguage) {
    return null;
  }
  const lower = appLanguage.toLowerCase();
  const exact = availableCodes.find((c) => c.toLowerCase() === lower);
  if (exact) {
    return exact;
  }
  const altEntry = LANGUAGES.find((l) => l.alternativeCodes?.some((ac) => ac.toLowerCase() === lower));
  if (altEntry) {
    const altMatch = availableCodes.find((c) => c.toLowerCase() === altEntry.code.toLowerCase());
    if (altMatch) {
      return altMatch;
    }
  }
  const base = normalizeLanguageCode(appLanguage);
  const baseMatch = availableCodes.find((c) => c.toLowerCase() === base);
  if (baseMatch) {
    return baseMatch;
  }
  return null;
}
function resolveDefaultLanguage(appLanguage, availableCodes) {
  return matchAvailableLanguage(appLanguage, availableCodes) ?? availableCodes[0] ?? DEFAULT_LANGUAGE_CODE;
}

export { DEFAULT_LANGUAGE_CODE, DEFAULT_PASSWORD_LENGTH, DEFAULT_WORD_COUNT, LANGUAGES, MAX_PASSWORD_LENGTH, MAX_WORD_COUNT, MIN_PASSWORD_LENGTH, MIN_WORD_COUNT, getLanguageInfo, matchAvailableLanguage, normalizeLanguageCode, resolveDefaultLanguage };
