import type { LocaleConfig } from '../types';

export const sv: LocaleConfig = {
  locale: 'sv',
  name: 'Swedish',
  scripts: ['latn'],
  countries: ['SE', 'FI'],
  phoneContextKeywords: [
    'telefon',
    'mobilnummer',
    'mobil',
    'nummer',
    'tel.',
    'tel',
  ],
  cvcContextKeywords: ['säkerhetskod', 'cvc', 'cvv', 'cv2'],
  address: {
    forms: ['glued-suffix', 'standalone-suffix', 'po-box'],
    postcodeForm: 'continental',
    postcodeRegex: '\\d{3}\\s?\\d{2}',
    streetSuffixGlued: [
      'gatan',
      'vägen',
      'vagen',
      'torget',
      'stigen',
      'plan',
      'gränden',
      'branten',
      'kajen',
    ],
    streetKeywordsFreeSuffix: ['torget', 'plan', 'kajen'],
    poBoxKeywords: ['Box', 'Postbox'],
    floorKeywords: ['våning', 'vån.', 'vån', 'lägenhet', 'lgh.', 'lgh'],
    countryNames: ['Sverige', 'Sweden', 'Finland', 'SE', 'FI'],
    countryPostcodePrefixes: [],
    requireUppercase: true,
  },
  nationalIds: [
    {
      id: 'se-personnummer',
      name: 'Swedish Personal Identity Number',
      pattern: '\\b(?:\\d{8}|\\d{6})[-+]\\d{4}\\b',
      checksum: 'se-personnummer',
      replacement: '[PERSONNUMMER]',
    },
    {
      id: 'se-orgnr',
      name: 'Swedish Organization Number',
      pattern: '\\b\\d{6}-\\d{4}\\b',
      checksum: 'luhn',
      replacement: '[SE_ORGNR]',
    },
    {
      id: 'se-passport',
      name: 'Swedish Passport Number',
      pattern: '\\b\\d{8}\\b',
      replacement: '[PASSPORT]',
    },
  ],
  dateOfBirth: {
    monthsLong: [
      'januari',
      'februari',
      'mars',
      'april',
      'maj',
      'juni',
      'juli',
      'augusti',
      'september',
      'oktober',
      'november',
      'december',
    ],
    monthsShort: [
      'jan.',
      'feb.',
      'mars',
      'apr.',
      'maj',
      'juni',
      'juli',
      'aug.',
      'sep.',
      'okt.',
      'nov.',
      'dec.',
    ],
    contextKeywords: ['född den', 'född', 'födelsedag', 'födelsedatum'],
  },
};
