{"version":3,"sources":["../../src/scripts/build-intl.ts","../../src/scripts/cli-args.ts","../../src/scripts/collect-translations.ts","../../src/scripts/placeholder-type.ts","../../src/compile-to-code.ts","../../src/lex.ts","../../src/parse.ts","../../src/compile-to-string.ts","../../src/icu.ts","../../src/scripts/compile-typescript.ts","../../src/scripts/intl-config.ts","../../src/scripts/output-diff.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'fs'\nimport path from 'path'\nimport { parseBuildIntlArgs, resolveExportName } from './cli-args'\nimport { collectTranslations, type IntlDiagnostic } from './collect-translations'\nimport { compileTranslations } from './compile-typescript'\nimport { defaultIntlConfig, loadIntlConfig, type IntlConfig } from './intl-config'\nimport { describeOutputChange } from './output-diff'\n\nfunction printHelp(): void {\n  console.info(`\nUsage: build-intl [options] [location ...]\n\nCollects .arb files from the given files and directories and compiles them.\nRepeat location to pass more than one file or directory.\nWhen no locations are given, translationFiles from the config is used.\n\nOptions:\n  -c, --config <path>   JSON configuration file (optional)\n  -o, --out <file>      Output file (overrides config outputFile)\n  -n, --name <name>     Exported translation name (overrides config name)\n  --dry-run             Print the output diff without writing the file\n  -h, --help            Show this help message\n\nConfiguration file:\n  {\n    \"supportedLocales\": [\"en-US\", \"de-DE\"],\n    \"compileTo\": \"typescript\",\n    \"name\": \"appTranslation\",\n    \"outputFile\": \"./i18n/translations.ts\",\n    \"translationFiles\": []\n  }\n\n--config is optional. Without a config file, and for any omitted field, those defaults are used.\nList one or more paths in translationFiles, or pass them after the options.\nExisting output files are overwritten.\nEach .arb file must set @@locale to a supported locale.\n@@prefix optionally prefixes every key in that file (prefix \"test\" exposes \"name\" as \"test.name\").\nEvery placeholder must declare a type of string, int, or float. A missing type is a warning and is read as string. Any other type is an error. The output file is not written when the build reports an error.\nint and float are number parameters. int values are rounded before they are inserted into the string. float values are inserted as given.\nKeys or placeholder types that differ between locales are reported as warnings.\n`)\n}\n\nfunction reportDiagnostics(diagnostics: readonly IntlDiagnostic[]): void {\n  for (const diagnostic of diagnostics) {\n    const line = `${diagnostic.level}: ${diagnostic.message}`\n    if (diagnostic.level === 'error') console.error(line)\n    else console.warn(line)\n  }\n}\n\nfunction resolveLocations(cliLocations: readonly string[], configLocations: readonly string[]): string[] {\n  if (cliLocations.length > 0) return [...cliLocations]\n  return [...configLocations]\n}\n\nfunction main(): void {\n  const args = parseBuildIntlArgs(process.argv.slice(2))\n  if (args.help) {\n    printHelp()\n    process.exit(0)\n  }\n  if (args.errors.length > 0) {\n    for (const message of args.errors) console.error(`error: ${message}`)\n    process.exit(1)\n  }\n  let config: IntlConfig\n  try {\n    config = args.configPath === undefined ? defaultIntlConfig() : loadIntlConfig(args.configPath)\n  } catch (error) {\n    const reason = error instanceof Error ? error.message : String(error)\n    console.error(`error: ${reason}`)\n    process.exit(1)\n  }\n\n  const exportName = resolveExportName(args.name ?? config.name)\n  if (exportName.error) {\n    console.error(`error: ${exportName.error}`)\n    process.exit(1)\n  }\n  if (exportName.warning) console.warn(`warning: ${exportName.warning}`)\n\n  const locations = resolveLocations(args.locations, config.translationFiles)\n  if (locations.length === 0) {\n    console.error('error: Provide at least one .arb file or directory, or set translationFiles in the config.')\n    process.exit(1)\n  }\n\n  const collected = collectTranslations(locations, config)\n  const compiled = compileTranslations(collected.catalog, config, exportName.name)\n  reportDiagnostics(collected.diagnostics)\n  for (const message of compiled.errors) console.error(`error: ${message}`)\n\n  const errorCount = collected.diagnostics.filter(diagnostic => diagnostic.level === 'error').length\n    + compiled.errors.length\n  if (errorCount > 0) {\n    console.error(`Build failed with ${errorCount} error(s). The output file was not written.`)\n    process.exit(1)\n  }\n\n  const outputFile = path.resolve(args.outputFile ?? config.outputFile)\n  if (args.dryRun) {\n    const previous = fs.existsSync(outputFile) ? fs.readFileSync(outputFile, 'utf-8') : undefined\n    console.info(describeOutputChange(outputFile, previous, compiled.source))\n    return\n  }\n\n  fs.mkdirSync(path.dirname(outputFile), { recursive: true })\n  fs.writeFileSync(outputFile, compiled.source)\n\n  const warningCount = collected.diagnostics.filter(diagnostic => diagnostic.level === 'warning').length\n  if (warningCount > 0) {\n    console.warn(`Compiled with ${warningCount} warning(s).`)\n  }\n  console.info(`Translations compiled to ${outputFile}`)\n}\n\ntry {\n  main()\n} catch (error) {\n  const reason = error instanceof Error ? error.message : String(error)\n  console.error(`error: ${reason}`)\n  process.exit(1)\n}\n","export interface BuildIntlArgs {\n  configPath?: string,\n  outputFile?: string,\n  dryRun: boolean,\n  help: boolean,\n  name?: string,\n  locations: string[],\n  errors: string[],\n}\n\nexport interface ExportName {\n  name: string,\n  warning?: string,\n  error?: string,\n}\n\nexport function resolveExportName(raw: string): ExportName {\n  const name = raw.replace(/[^a-zA-Z0-9]/g, '_').replace(/^[0-9]/, '')\n  if (!/^[a-z][a-zA-Z0-9_]*$/.test(name)) {\n    return {\n      name,\n      error: `The name \"${raw}\" is invalid. Use [a-z][a-zA-Z0-9_]+.`,\n    }\n  }\n  if (name !== raw) {\n    return {\n      name,\n      warning: `The name \"${raw}\" was changed to \"${name}\".`,\n    }\n  }\n  return { name }\n}\n\nfunction readOptionValue(\n  args: BuildIntlArgs,\n  argv: readonly string[],\n  index: number,\n  flag: string\n): string | undefined {\n  const value = argv[index + 1]\n  if (value === undefined || value.startsWith('-')) {\n    args.errors.push(`Option ${flag} requires a value.`)\n    return undefined\n  }\n  return value\n}\n\nexport function parseBuildIntlArgs(argv: readonly string[]): BuildIntlArgs {\n  const args: BuildIntlArgs = {\n    dryRun: false,\n    help: false,\n    locations: [],\n    errors: [],\n  }\n\n  for (let index = 0; index < argv.length; index++) {\n    const arg = argv[index]\n\n    if (arg === '--') {\n      args.locations.push(...argv.slice(index + 1))\n      break\n    }\n    if (arg === '--help' || arg === '-h') {\n      args.help = true\n      continue\n    }\n    if (arg === '--dry-run') {\n      args.dryRun = true\n      continue\n    }\n    if (arg === '--config' || arg === '-c') {\n      const value = readOptionValue(args, argv, index, arg)\n      if (value !== undefined) {\n        args.configPath = value\n        index++\n      }\n      continue\n    }\n    if (arg.startsWith('--config=')) {\n      const value = arg.slice('--config='.length)\n      if (value.length === 0) args.errors.push('Option --config requires a value.')\n      else args.configPath = value\n      continue\n    }\n    if (arg === '--out' || arg === '-o') {\n      const value = readOptionValue(args, argv, index, arg)\n      if (value !== undefined) {\n        args.outputFile = value\n        index++\n      }\n      continue\n    }\n    if (arg.startsWith('--out=')) {\n      const value = arg.slice('--out='.length)\n      if (value.length === 0) args.errors.push('Option --out requires a value.')\n      else args.outputFile = value\n      continue\n    }\n    if (arg === '--name' || arg === '-n') {\n      const value = readOptionValue(args, argv, index, arg)\n      if (value !== undefined) {\n        args.name = value\n        index++\n      }\n      continue\n    }\n    if (arg.startsWith('--name=')) {\n      const value = arg.slice('--name='.length)\n      if (value.length === 0) args.errors.push('Option --name requires a value.')\n      else args.name = value\n      continue\n    }\n    if (arg.startsWith('-')) {\n      args.errors.push(`Unknown option \"${arg}\".`)\n      continue\n    }\n\n    args.locations.push(arg)\n  }\n\n  return args\n}\n","import fs from 'fs'\nimport path from 'path'\nimport type { IntlConfig } from './intl-config'\nimport {\n  resolvePlaceholderType,\n  type DiagnosticLevel,\n  type DiagnosticReporter,\n  type NumericKind\n} from './placeholder-type'\n\nexport interface IntlDiagnostic {\n  level: DiagnosticLevel,\n  message: string,\n}\n\nexport interface FuncParam {\n  name: string,\n  typing: string,\n  numeric?: NumericKind,\n}\n\nexport type TranslationEntry =\n  { type: 'text', value: string }\n  | { type: 'func', params: FuncParam[], value: string }\n\nexport type LocaleCatalog = Record<string, Record<string, TranslationEntry>>\n\nexport interface CollectedTranslations {\n  catalog: LocaleCatalog,\n  diagnostics: IntlDiagnostic[],\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n  return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction errorMessage(error: unknown): string {\n  return error instanceof Error ? error.message : String(error)\n}\n\nfunction isPrefix(value: string): boolean {\n  return value.split('.').every(part => /^[A-Za-z_][A-Za-z0-9_]*$/.test(part))\n}\n\nexport function describeTranslationEntry(entry: TranslationEntry): string {\n  if (entry.type === 'text') return 'string'\n  const params = entry.params.map(param => `${param.name}: ${param.typing}`).join(', ')\n  return `(${params}) => string`\n}\n\nfunction collectArbPaths(locations: readonly string[], diagnostics: IntlDiagnostic[]): string[] {\n  const files: string[] = []\n  const seenFiles = new Set<string>()\n  const seenDirectories = new Set<string>()\n\n  const addFile = (filePath: string): void => {\n    try {\n      const real = fs.realpathSync(filePath)\n      if (seenFiles.has(real)) return\n      seenFiles.add(real)\n      files.push(real)\n    } catch (error) {\n      diagnostics.push({\n        level: 'error',\n        message: `Failed to read ${filePath}: ${errorMessage(error)}`,\n      })\n    }\n  }\n\n  const walk = (directory: string): void => {\n    let realDirectory = directory\n    try {\n      realDirectory = fs.realpathSync(directory)\n    } catch (error) {\n      diagnostics.push({\n        level: 'error',\n        message: `Failed to read ${directory}: ${errorMessage(error)}`,\n      })\n      return\n    }\n    if (seenDirectories.has(realDirectory)) return\n    seenDirectories.add(realDirectory)\n\n    let entries: fs.Dirent[]\n    try {\n      entries = fs.readdirSync(realDirectory, { withFileTypes: true })\n    } catch (error) {\n      diagnostics.push({\n        level: 'error',\n        message: `Failed to read ${directory}: ${errorMessage(error)}`,\n      })\n      return\n    }\n\n    for (const entry of entries) {\n      const fullPath = path.join(realDirectory, entry.name)\n      let stat: fs.Stats\n      try {\n        stat = fs.statSync(fullPath)\n      } catch (error) {\n        diagnostics.push({\n          level: 'error',\n          message: `Failed to read ${fullPath}: ${errorMessage(error)}`,\n        })\n        continue\n      }\n      if (stat.isDirectory()) {\n        walk(fullPath)\n      } else if (stat.isFile() && entry.name.endsWith('.arb')) {\n        addFile(fullPath)\n      }\n    }\n  }\n\n  for (const location of locations) {\n    const resolved = path.resolve(location)\n    if (!fs.existsSync(resolved)) {\n      diagnostics.push({\n        level: 'error',\n        message: `Path does not exist: ${location}`,\n      })\n      continue\n    }\n\n    const stat = fs.statSync(resolved)\n    if (stat.isDirectory()) {\n      walk(resolved)\n    } else if (stat.isFile()) {\n      if (!resolved.endsWith('.arb')) {\n        diagnostics.push({\n          level: 'error',\n          message: `Expected an .arb file: ${location}`,\n        })\n        continue\n      }\n      addFile(resolved)\n    } else {\n      diagnostics.push({\n        level: 'error',\n        message: `Unsupported path: ${location}`,\n      })\n    }\n  }\n\n  files.sort((left, right) => left.localeCompare(right))\n  return files\n}\n\nfunction readArbObject(filePath: string, diagnostics: IntlDiagnostic[]): Record<string, unknown> | undefined {\n  try {\n    const parsed: unknown = JSON.parse(fs.readFileSync(filePath, 'utf-8'))\n    if (!isRecord(parsed)) {\n      diagnostics.push({\n        level: 'error',\n        message: `File ${filePath} must contain a JSON object.`,\n      })\n      return undefined\n    }\n    return parsed\n  } catch (error) {\n    diagnostics.push({\n      level: 'error',\n      message: `Failed to read ${filePath}: ${errorMessage(error)}`,\n    })\n    return undefined\n  }\n}\n\nfunction buildEntry(\n  key: string,\n  value: string,\n  meta: unknown,\n  filePath: string,\n  diagnostics: IntlDiagnostic[]\n): TranslationEntry | undefined {\n  const report: DiagnosticReporter = (level, message) => {\n    diagnostics.push({ level, message })\n  }\n\n  if (meta !== undefined && !isRecord(meta)) {\n    diagnostics.push({\n      level: 'error',\n      message: `Metadata for \"${key}\" in ${filePath} must be an object.`,\n    })\n    return undefined\n  }\n\n  if (meta === undefined || meta.placeholders === undefined) {\n    return { type: 'text', value }\n  }\n\n  if (!isRecord(meta.placeholders)) {\n    diagnostics.push({\n      level: 'error',\n      message: `Placeholders for \"${key}\" in ${filePath} must be an object.`,\n    })\n    return undefined\n  }\n\n  const params: FuncParam[] = []\n  for (const [name, definition] of Object.entries(meta.placeholders)) {\n    if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n      diagnostics.push({\n        level: 'error',\n        message: `Placeholder \"${name}\" of \"${key}\" in ${filePath} is not a valid identifier.`,\n      })\n      return undefined\n    }\n\n    if (definition !== undefined && !isRecord(definition)) {\n      diagnostics.push({\n        level: 'warning',\n        message: `Placeholder \"${name}\" of \"${key}\" in ${filePath} must be an object. Interpreting its type as string.`,\n      })\n      params.push({ name, typing: 'string' })\n      continue\n    }\n\n    if (isRecord(definition) && definition.type !== undefined && typeof definition.type !== 'string') {\n      diagnostics.push({\n        level: 'warning',\n        message: `Type of placeholder \"${name}\" of \"${key}\" in ${filePath} must be a string. Interpreting it as string.`,\n      })\n      params.push({ name, typing: 'string' })\n      continue\n    }\n\n    const rawType = isRecord(definition) && typeof definition.type === 'string'\n      ? definition.type\n      : undefined\n\n    params.push({\n      name,\n      ...resolvePlaceholderType(rawType, name, report, { key, filePath }),\n    })\n  }\n\n  return { type: 'func', params, value }\n}\n\nfunction readTranslationFile(\n  filePath: string,\n  config: Pick<IntlConfig, 'supportedLocales'>,\n  catalog: LocaleCatalog,\n  diagnostics: IntlDiagnostic[]\n): void {\n  const content = readArbObject(filePath, diagnostics)\n  if (!content) return\n\n  const localeValue = content['@@locale']\n  if (typeof localeValue !== 'string' || localeValue.length === 0) {\n    diagnostics.push({\n      level: 'error',\n      message: `File ${filePath} must set @@locale to one of: ${config.supportedLocales.join(', ')}.`,\n    })\n    return\n  }\n  if (!config.supportedLocales.includes(localeValue)) {\n    diagnostics.push({\n      level: 'error',\n      message: `Locale \"${localeValue}\" in ${filePath} is not listed in supportedLocales.`,\n    })\n    return\n  }\n\n  let prefix = ''\n  if (Object.prototype.hasOwnProperty.call(content, '@@prefix')) {\n    const prefixValue = content['@@prefix']\n    if (typeof prefixValue !== 'string' || !isPrefix(prefixValue)) {\n      diagnostics.push({\n        level: 'error',\n        message: `File ${filePath} has an invalid @@prefix. Use a dotted identifier such as \"test\" or \"time.relative\".`,\n      })\n      return\n    }\n    prefix = prefixValue\n  }\n\n  if (!catalog[localeValue]) catalog[localeValue] = {}\n\n  for (const [key, value] of Object.entries(content)) {\n    if (key.startsWith('@')) continue\n    if (typeof value !== 'string') {\n      diagnostics.push({\n        level: 'error',\n        message: `Key \"${key}\" in ${filePath} must be a string.`,\n      })\n      continue\n    }\n\n    const flatKey = prefix ? `${prefix}.${key}` : key\n    if (catalog[localeValue][flatKey]) {\n      diagnostics.push({\n        level: 'warning',\n        message: `Key \"${flatKey}\" for locale \"${localeValue}\" is defined more than once. The definition in ${filePath} was ignored.`,\n      })\n      continue\n    }\n\n    const entry = buildEntry(key, value, content[`@${key}`], filePath, diagnostics)\n    if (entry) catalog[localeValue][flatKey] = entry\n  }\n}\n\nfunction flagInconsistencies(\n  catalog: LocaleCatalog,\n  supportedLocales: readonly string[],\n  diagnostics: IntlDiagnostic[]\n): void {\n  const presentLocales = supportedLocales.filter(locale => catalog[locale] !== undefined)\n\n  for (const locale of supportedLocales) {\n    if (catalog[locale] === undefined) {\n      diagnostics.push({\n        level: 'warning',\n        message: `Supported locale \"${locale}\" has no .arb file.`,\n      })\n    }\n  }\n\n  const keys = new Set<string>()\n  for (const locale of presentLocales) {\n    for (const key of Object.keys(catalog[locale])) keys.add(key)\n  }\n\n  for (const key of [...keys].sort((left, right) => left.localeCompare(right))) {\n    const defined = presentLocales.filter(locale => catalog[locale][key] !== undefined)\n    const missing = presentLocales.filter(locale => catalog[locale][key] === undefined)\n    if (missing.length > 0) {\n      diagnostics.push({\n        level: 'warning',\n        message: `Key \"${key}\" is missing for ${missing.map(locale => `\"${locale}\"`).join(', ')}. It is defined for ${defined.map(locale => `\"${locale}\"`).join(', ')}.`,\n      })\n    }\n\n    const baseLocale = defined[0]\n    const baseSignature = describeTranslationEntry(catalog[baseLocale][key])\n    for (const locale of defined.slice(1)) {\n      const signature = describeTranslationEntry(catalog[locale][key])\n      if (signature === baseSignature) continue\n      diagnostics.push({\n        level: 'warning',\n        message: `Key \"${key}\" has inconsistent typing. \"${baseLocale}\" is ${baseSignature}, \"${locale}\" is ${signature}.`,\n      })\n    }\n  }\n}\n\nexport function collectTranslations(\n  locations: readonly string[],\n  config: Pick<IntlConfig, 'supportedLocales'>\n): CollectedTranslations {\n  const diagnostics: IntlDiagnostic[] = []\n  const catalog: LocaleCatalog = {}\n\n  if (locations.length === 0) {\n    diagnostics.push({\n      level: 'error',\n      message: 'Provide at least one .arb file or directory.',\n    })\n    return { catalog, diagnostics }\n  }\n\n  const files = collectArbPaths(locations, diagnostics)\n  if (files.length === 0 && !diagnostics.some(item => item.level === 'error')) {\n    diagnostics.push({\n      level: 'error',\n      message: 'No .arb files were found in the given paths.',\n    })\n  }\n\n  for (const filePath of files) {\n    readTranslationFile(filePath, config, catalog, diagnostics)\n  }\n\n  flagInconsistencies(catalog, config.supportedLocales, diagnostics)\n\n  return { catalog, diagnostics }\n}\n","export type DiagnosticLevel = 'warning' | 'error'\n\nexport type DiagnosticReporter = (level: DiagnosticLevel, message: string) => void\n\nexport type NumericKind = 'int' | 'float'\n\nexport interface ResolvedPlaceholderType {\n  typing: string,\n  numeric?: NumericKind,\n}\n\nconst SUPPORTED_TYPES = ['string', 'int', 'float'] as const\n\ntype SupportedType = typeof SUPPORTED_TYPES[number]\n\nfunction toFunctionType(typeName: SupportedType): ResolvedPlaceholderType {\n  if (typeName === 'int') return { typing: 'number', numeric: 'int' }\n  if (typeName === 'float') return { typing: 'number', numeric: 'float' }\n  return { typing: 'string' }\n}\n\nfunction isSupportedType(typeName: string): typeName is SupportedType {\n  return (SUPPORTED_TYPES as readonly string[]).includes(typeName)\n}\n\nexport interface PlaceholderTypeContext {\n  key: string,\n  filePath: string,\n}\n\nexport function resolvePlaceholderType(\n  rawType: string | undefined,\n  variableName: string,\n  report: DiagnosticReporter,\n  context: PlaceholderTypeContext\n): ResolvedPlaceholderType {\n  const location = `variable [${variableName}] of [${context.key}] in file ${context.filePath}`\n  const typing = rawType?.trim() ?? ''\n\n  if (!typing) {\n    report('warning', `Placeholder [${variableName}] of [${context.key}] in file ${context.filePath} has no type. Interpreting it as string.`)\n    return { typing: 'string' }\n  }\n\n  if (!isSupportedType(typing)) {\n    report('error', `Type \"${typing}\" for ${location} is not supported. Only string, int, and float are supported.`)\n    return { typing: 'string' }\n  }\n\n  return toFunctionType(typing)\n}\n","import type { ICUASTNode } from './parse'\n\nfunction escapeForTemplateJS(s: string): string {\n  return s\n    .replace(/\\\\/g, `\\\\\\\\`)\n    .replace(/`/g, `\\\\\\``)\n    .replace(/\\$/g, `\\\\$`)\n}\n\ntype CompileContextResult = {\n  numberParam?: string,\n  numericFormats?: Record<string, 'int' | 'float'>,\n  inNode: boolean,\n  indentLevel: number,\n  isOnlyText: boolean,\n}\n\ntype CompileContext = Partial<CompileContextResult>\n\nconst defaultCompileContext: CompileContextResult = {\n  indentLevel: 0,\n  inNode: false,\n  isOnlyText: false,\n}\n\nexport function compileToCode(\n  node: ICUASTNode,\n  initialContext?: CompileContext\n): string[] {\n  const context: CompileContextResult = { ...defaultCompileContext, ...initialContext }\n  const lines: string[] = []\n  let currentLine = ''\n\n  function indent(level: number = context.indentLevel) {\n    return ' '.repeat(level * 2)\n  }\n\n  function formatValue(name: string): string {\n    const kind = context.numericFormats?.[name]\n    if (kind === 'int') return `TranslationGen.round(${name})`\n    return name\n  }\n\n  function flushCurrent() {\n    if (currentLine) {\n      if (context.inNode) {\n        lines.push(currentLine)\n      } else {\n        const nextLine = `${indent()}\\`${currentLine}\\``\n        lines.push(nextLine)\n      }\n    }\n    currentLine = ''\n  }\n\n  switch (node.type) {\n    case 'Text':\n      currentLine += escapeForTemplateJS(node.value)\n      break\n    case 'NumberField':\n      if (context.numberParam) {\n        currentLine += `$\\{${formatValue(context.numberParam)}}`\n      } else {\n        currentLine += `{${context.numberParam}}`\n      }\n      break\n    case 'SimpleReplace':\n      currentLine += `$\\{${formatValue(node.variableName)}}`\n      break\n    case 'Node': {\n      for (const partNode of node.parts) {\n        const compiled = compileToCode(partNode, { ...context, inNode: true })\n        if (partNode.type === 'OptionReplace' || partNode.type === 'Node') {\n          flushCurrent()\n          lines.push(...compiled)\n        } else {\n          currentLine += compiled[0]\n        }\n      }\n      break\n    }\n    case 'OptionReplace': {\n      if (context.isOnlyText) {\n        currentLine += `{${node.variableName}, ${node.operatorName}, {options}}`\n        break\n      }\n      flushCurrent()\n      const resolver = node.operatorName === 'plural' ?\n        'TranslationGen.resolvePlural': 'TranslationGen.resolveSelect'\n      lines.push(`${resolver}(${node.variableName}, {`)\n\n      const entries = Object.entries(node.options)\n\n      for (const [key, entryNode] of entries) {\n        const expr = compileToCode(entryNode, {\n          ...context,\n          numberParam:  node.operatorName === 'plural' ? node.variableName : context.numberParam,\n          indentLevel: context.indentLevel + 1,\n          inNode: false,\n        })\n        if (expr.length === 0) continue\n        lines.push(indent(context.indentLevel + 1) + `'${key}': ${expr[0].trimStart()}`, ...expr.slice(1))\n        lines[lines.length - 1] += ','\n      }\n\n      lines.push(indent() + `})`)\n      return lines\n    }\n  }\n  flushCurrent()\n  return lines\n}","import { escapeCharacter } from './icu'\n\nexport type ICUToken =\n  | { type: 'LBRACE' }\n  | { type: 'RBRACE' }\n  | { type: 'COMMA' }\n  | { type: 'HASHTAG' }\n  | { type: 'ESCAPE' }\n  | { type: 'WHITESPACE', value: string }\n  | { type: 'TEXT', value: string }\n\n/**\n * Takes in a sting and converts it to a list of ICUToken's\n * ICU uses single quotes to quote literal text. This means:\n * '' -> '\n * '...anything...' -> literal anything (but two single quotes inside become one)\n *  @param input The string to tokenize\n */\nexport function lex(input: string): ICUToken[] {\n  const tokens: ICUToken[] = []\n\n  function pushAppend(text: string, type: 'TEXT' | 'WHITESPACE') {\n    if (tokens.length > 0) {\n      const last = tokens[tokens.length - 1]\n      if (last.type === type) {\n        last.value += text\n        return\n      }\n    }\n    tokens.push({ type, value: text })\n  }\n\n  for (let index = 0; index < input.length; index++) {\n    const character = input[index]\n    switch (character) {\n      case '{':\n        tokens.push({ type: 'LBRACE' })\n        break\n      case '}':\n        tokens.push({ type: 'RBRACE' })\n        break\n      case '#':\n        tokens.push({ type: 'HASHTAG' })\n        break\n      case ',':\n        tokens.push({ type: 'COMMA' })\n        break\n      case escapeCharacter:\n        tokens.push({ type: 'ESCAPE' })\n        break\n      case ' ':\n        pushAppend(character, 'WHITESPACE')\n        break\n      default:\n        pushAppend(character, 'TEXT')\n        break\n    }\n  }\n\n  return tokens\n}","import type { ICUToken } from './lex'\nimport { escapeCharacter } from './icu'\nconst replaceOperations = ['plural', 'select'] as const\ntype ReplaceOperation = typeof replaceOperations[number]\n\nexport type ICUASTNode =\n  | { type: 'Node', parts: ICUASTNode[] }\n  | { type: 'Text', value: string }\n  | { type: 'NumberField' }\n  | { type: 'SimpleReplace', variableName: string } // {name}\n  | { type: 'OptionReplace', variableName: string, operatorName: ReplaceOperation, options: Record<string, ICUASTNode> } // {var, select, key{msg} ...}\n\ntype ParserState = { name: 'escape' } |\n  { name: 'normal' } |\n  {\n    name: 'replaceFunction',\n    expect: ReplaceExpectState,\n    variableName: string,\n    subtree: ICUASTNode[],\n    operatorName?: ReplaceOperation,\n    optionName: string,\n    options: Record<string, ICUASTNode>,\n  }\n\ntype ReplaceExpectState =\n  'variableName'\n  | 'variableNameCommaOrSimpleReplaceClose'\n  | 'operatorName'\n  | 'operatorNameComma'\n  | 'optionNameOrReplaceClose'\n  | 'optionOpen'\n  | 'optionContentOrClose'\n\ntype ParserContext = {\n  state: ParserState[],\n  last?: ICUToken,\n}\n\n/**\n * Converts a list of ICUToken's to a tree of ICUSAstNode's\n * @param tokens\n */\nexport function parse(tokens: ICUToken[]): ICUASTNode {\n  const result: ICUASTNode[] = []\n\n  const context: ParserContext = {\n    state: [{ name: 'normal' }],\n  }\n\n  function getState() {\n    const state = context.state[context.state.length - 1]\n    if (!state) {\n      throw new Error('ICU Parser: Reached invalid state')\n    }\n    return state\n  }\n\n  function getStateName() {\n    return getState().name\n  }\n\n  function pushText(text: string, target: ICUASTNode[] = result) {\n    if (target.length > 0) {\n      const last = target[target.length - 1]\n      if (last.type === 'Text') {\n        last.value += text\n        return\n      }\n    }\n    target.push({ type: 'Text', value: text })\n  }\n\n  function inNormal(token: ICUToken) {\n    switch (token.type) {\n      case 'RBRACE':\n        throw Error('ICU Parser: Read an unescaped \"}\" before reading a \"{\"')\n      case 'LBRACE':\n        context.state.push({\n          name: 'replaceFunction',\n          expect: 'variableName',\n          variableName: '',\n          optionName: '',\n          options: {},\n          subtree: [],\n        })\n        break\n      case 'ESCAPE':\n        context.state.push({ name: 'escape' })\n        break\n      case 'COMMA':\n        pushText(',')\n        break\n      case 'HASHTAG':\n        pushText('#')\n        break\n      case 'TEXT':\n        pushText(token.value)\n        break\n      case 'WHITESPACE':\n        pushText(token.value)\n        break\n    }\n  }\n\n  function inEscape(token: ICUToken) {\n    const prevState = context.state[context.state.length - 1]\n    let pushFunction: (value: string) => void = pushText\n    if (prevState && prevState.name === 'replaceFunction' && prevState.expect === 'operatorName') {\n      pushFunction = (value: string) => pushText(value, prevState.subtree)\n    }\n\n    switch (token.type) {\n      case 'ESCAPE':\n        if (context.last?.type === 'ESCAPE') {\n          pushFunction(escapeCharacter)\n        }\n        context.state.pop()\n        break\n      case 'COMMA':\n        pushFunction(',')\n        break\n      case 'HASHTAG':\n        pushFunction('#')\n        break\n      case 'LBRACE':\n        pushFunction('{')\n        break\n      case 'RBRACE':\n        pushFunction('}')\n        break\n      default:\n        pushFunction(token.value)\n    }\n  }\n\n  // Closing and opening brackets are already removed\n  function inReplaceFunction(token: ICUToken) {\n    const state = getState()\n    if (state.name !== 'replaceFunction') {\n      throw Error(`ICU Parser: Invalid State of Parser. Contact Package developer.`)\n    }\n    switch (token.type) {\n      case 'ESCAPE':\n        if (state.expect !== 'optionContentOrClose') {\n          throw Error(`ICU Parser: Invalid Escape character \"'\". Escape characters are only valid outside of replacement functions or in the option content.`)\n        }\n        context.state.push({ name: 'escape' })\n        break\n      case 'LBRACE':\n        if (state.expect === 'optionOpen') {\n          state.expect = 'optionContentOrClose'\n        } else if (state.expect === 'optionContentOrClose') {\n          context.state.push({\n            name: 'replaceFunction',\n            expect: 'variableName',\n            variableName: '',\n            optionName: '',\n            options: {},\n            subtree: []\n          })\n        } else {\n          throw Error(`ICU Parser: Invalid placement of \"{\" in replacement function.`)\n        }\n        break\n      case 'RBRACE':\n        if (state.expect === 'variableNameCommaOrSimpleReplaceClose') {\n          context.state.pop()\n          const prevState = getState()\n          const node: ICUASTNode = {\n            type: 'SimpleReplace',\n            variableName: state.variableName\n          }\n          if (prevState.name === 'replaceFunction') {\n            prevState.subtree.push(node)\n          } else {\n            result.push(node)\n          }\n        } else if (state.expect === 'optionContentOrClose') {\n          const subTree =  state.subtree\n          state.options[state.optionName] = subTree.length === 1 ? subTree[0] : { type: 'Node', parts: subTree }\n          state.expect = 'optionNameOrReplaceClose'\n          state.subtree = []\n        } else if (state.expect === 'optionNameOrReplaceClose') {\n          context.state.pop()\n          const prevState = getState()\n          if(!state.operatorName) {\n            throw Error(`ICU Parser: Internal Parser Error. Operator name undefined in state.`)\n          }\n          const node: ICUASTNode = {\n            type: 'OptionReplace',\n            variableName: state.variableName,\n            operatorName: state.operatorName,\n            options: state.options,\n          }\n          if (prevState.name === 'replaceFunction') {\n            prevState.subtree.push(node)\n          } else {\n            result.push(node)\n          }\n        } else {\n          throw Error(`ICU Parser: Invalid placement of \"}\" in replacement function.`)\n        }\n        break\n      case 'HASHTAG': {\n        if (state.expect === 'optionContentOrClose') {\n          if (state.operatorName === 'plural') {\n            state.subtree.push({ type: 'NumberField' })\n          } else {\n            pushText('#', state.subtree)\n          }\n        } else {\n          throw Error(`ICU Parser: Invalid placement of \"#\". \"#\" are only valid outside of replacement functions or in the option content.`)\n        }\n        break\n      }\n      case 'COMMA':\n        if (state.expect === 'operatorNameComma') {\n          state.expect = 'optionNameOrReplaceClose'\n        } else if (state.expect === 'variableNameCommaOrSimpleReplaceClose') {\n          state.expect = 'operatorName'\n        } else if (state.expect === 'optionContentOrClose') {\n          pushText(',', state.subtree)\n        } else {\n          throw Error(`ICU Parser: Invalid placement of \",\" in replacement function.`)\n        }\n        break\n      case 'WHITESPACE':\n        if (state.expect === 'optionContentOrClose') {\n          pushText(token.value, state.subtree)\n        }\n        break\n      case 'TEXT':\n        if (state.expect === 'variableName') {\n          state.variableName = token.value\n          state.expect = 'variableNameCommaOrSimpleReplaceClose'\n        } else if (state.expect === 'operatorName') {\n          if (replaceOperations.some(value => value === token.value)) {\n            state.operatorName = token.value as ReplaceOperation\n          } else {\n            throw Error(`ICU Parser: ${token.value} is an invalid replacement function operator. Allowed are ${replaceOperations.map(value => `\"${value}\"`).join(', ')}`)\n          }\n          state.expect = 'operatorNameComma'\n        } else if (state.expect === 'optionNameOrReplaceClose') {\n          state.optionName = token.value\n          state.expect = 'optionOpen'\n        } else if (state.expect === 'optionContentOrClose') {\n          pushText(token.value, state.subtree)\n        } else {\n          throw Error('ICU Parser: Invalid position of a Text block in a replacement function.')\n        }\n        break\n    }\n  }\n\n  for (let index = 0; index < tokens.length; index++) {\n    const token = tokens[index]\n    const state = getStateName()\n\n    if (state === 'normal') {\n      inNormal(token)\n    } else if (state === 'replaceFunction') {\n      inReplaceFunction(token)\n    } else if (state === 'escape') {\n      inEscape(token)\n    }\n    context.last = token\n  }\n\n  const state = getStateName()\n\n  if (state === 'replaceFunction') {\n    throw Error(`ICU Parse: Encountered unclosed \"{\"`)\n  } else if (state === 'escape') {\n    throw Error(`ICU Parse: Encountered unclosed escape \"'\"`)\n  }\n  return result.length !== 1 ? { type: 'Node', parts: result } : result[0]\n}","import type { ICUASTNode } from '@/src/parse'\n\nexport function getPluralKey(num: number)  {\n  return num === 0 ? '=0' :\n      num === 1 ? '=1' :\n        num === 2 ? '=2' :\n          num > 2 && num < 5 ? 'few' :\n            num >= 5 ? 'many' : 'other'\n}\n\ntype CompilerContext = {\n  hashtagReplacer?: number,\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ICUCompilerValues = Record<string, any>\n\n/**\n * Compiles a ICUASTNode tree to a string\n * @param node Tree to compile\n * @param values The values that replace the variable in the tree\n * @param context The context values of previous compile iterations\n */\nexport function compileToString(node: ICUASTNode, values: ICUCompilerValues, context: CompilerContext = {}): string {\n  switch (node.type) {\n    case 'Node': {\n      return node.parts.map(p => compileToString(p, values, context)).join('')\n    }\n    case 'Text':\n      return node.value\n    case 'SimpleReplace': {\n      const name = node.variableName\n      if (values && values[name] !== undefined) return String(values[name])\n      console.warn(`ICU Compile: missing value for ${name}`)\n      return `{${name}}`\n    }\n    case 'OptionReplace': {\n      const name = node.variableName\n      const operation = node.operatorName\n      const val = values ? values[name] : undefined\n      switch (operation) {\n        case 'plural': {\n          const num = Number(val)\n          if (isNaN(num)) {\n            console.warn(`ICU Compile: plural expected numeric value for ${name}, got ${val}`)\n            return `{${name}}`\n          }\n          const pluralKey = getPluralKey(num)\n\n          const chosen = node.options[pluralKey] ?? node.options['other']\n          if (!chosen) {\n            console.warn(`ICU Compile: plural for ${name} could not find key ${pluralKey} and no other`)\n            return `{${name}}`\n          }\n          return compileToString(chosen, values, { ...context, hashtagReplacer: num })\n        }\n        case 'select': {\n          if (val === undefined) {\n            console.warn(`ICU Compile: missing value for select ${name}`)\n            const other = node.options['other']\n            return other ? compileToString(other, values, context) : `{${name}}`\n          }\n          const chosen = node.options[String(val)] ?? node.options['other']\n          if (!chosen) {\n            console.warn(`ICU Compile: select ${name} chose undefined option \"${val}\" and no \"other\" provided`)\n            return `{${name}}`\n          }\n          return compileToString(chosen, values, context)\n        }\n        default: {\n          return `{${name}, ${operation}}`\n        }\n      }\n    }\n    case 'NumberField': {\n      if (context.hashtagReplacer !== undefined) {\n        return `${context.hashtagReplacer}`\n      } else {\n        return '{#}'\n      }\n    }\n  }\n}","import { lex } from './lex'\nimport { parse } from './parse'\nimport { compileToString } from './compile-to-string'\nimport type { ICUCompilerValues } from './compile-to-string'\n\nexport const escapeCharacter = \"'\"\n\nfunction interpret(message: string, values: ICUCompilerValues): string {\n  try {\n    return compileToString(parse(lex(message)), values)\n  } catch (e) {\n    console.error(`Failed to interpret message: ${message}`, e)\n    return message\n  }\n}\n\nexport const ICUUtil = {\n  lex,\n  parse,\n  compile: compileToString,\n  interpret,\n  escapeCharacter\n}\n","import { compileToCode } from '../compile-to-code'\nimport { ICUUtil } from '../icu'\nimport type { FuncParam, LocaleCatalog, TranslationEntry } from './collect-translations'\nimport type { IntlConfig } from './intl-config'\n\ntype GeneratedEntry =\n  TranslationEntry\n  | { type: 'nested', value: Record<string, GeneratedEntry> }\n\nexport interface CompileResult {\n  source: string,\n  errors: string[],\n}\n\nfunction capitalize(value: string): string {\n  if (value.length === 0) return value\n  return value.charAt(0).toUpperCase() + value.slice(1)\n}\n\nfunction quoteKey(key: string): string {\n  const escaped = key\n    .replace(/\\\\/g, '\\\\\\\\')\n    .replace(/'/g, '\\\\\\'')\n    .replace(/\\r/g, '\\\\r')\n    .replace(/\\n/g, '\\\\n')\n  return `'${escaped}'`\n}\n\nfunction errorMessage(error: unknown): string {\n  return error instanceof Error ? error.message : String(error)\n}\n\nfunction numericFormats(params: readonly FuncParam[]): Record<string, 'int' | 'float'> | undefined {\n  const formats: Record<string, 'int' | 'float'> = {}\n  for (const param of params) {\n    if (param.numeric) formats[param.name] = param.numeric\n  }\n  if (Object.keys(formats).length === 0) return undefined\n  return formats\n}\n\nfunction generateCode(\n  obj: Record<string, GeneratedEntry>,\n  errors: string[],\n  indentLevel = 1\n): string {\n  const indent = '  '.repeat(indentLevel)\n  const entries = Object.entries(obj).sort((left, right) => left[0].localeCompare(right[0]))\n  let source = ''\n\n  for (const [key, entry] of entries) {\n    const quotedKey = quoteKey(key)\n    const isLast = entries[entries.length - 1][0] === key\n    const comma = isLast ? '' : ','\n\n    try {\n      if (entry.type === 'func') {\n        const ast = ICUUtil.parse(ICUUtil.lex(entry.value))\n        let compiled = compileToCode(ast, { numericFormats: numericFormats(entry.params) }).map((value, index, array) => {\n          if (value.startsWith(' ')) return value\n          if (index - 1 < 0 || !array[index - 1].startsWith(' ')) {\n            return `_out += ${value}`\n          }\n          return value\n        })\n        if (compiled.filter(value => value.startsWith('_out +=')).length === 1) {\n          const first = compiled.findIndex(value => value.startsWith('_out +='))\n          compiled[first] = 'return ' + compiled[first].slice(8)\n        } else {\n          compiled = [\n            'let _out: string = \\'\\'',\n            ...compiled,\n            'return _out',\n          ]\n        }\n        const functionLines: string[] = [\n          `({ ${entry.params.map(value => value.name).join(', ')} }): string => {`,\n          ...compiled.map(value => `  ${value}`),\n          '}',\n        ]\n        source += `${indent}${quotedKey}: ${functionLines.join(`\\n${indent}`)}${comma}\\n`\n      } else if (entry.type === 'text') {\n        const ast = ICUUtil.parse(ICUUtil.lex(entry.value))\n        const compiled = compileToCode(ast, { isOnlyText: true })\n        const text = compiled.length === 1 ? compiled[0] : `\\`${entry.value}\\``\n        source += `${indent}${quotedKey}: ${text}${comma}\\n`\n      } else {\n        source += `${indent}${quotedKey}: {\\n`\n        source += generateCode(entry.value, errors, indentLevel + 1)\n        source += `${indent}}${comma}\\n`\n      }\n    } catch (error) {\n      const shown = entry.type === 'nested' ? key : entry.value\n      errors.push(`Failed to compile key [${key}] with value \"${shown}\": ${errorMessage(error)}`)\n    }\n  }\n\n  return source\n}\n\nfunction generateType(catalog: LocaleCatalog, locales: readonly string[]): string {\n  const indent = '  '\n  const fullObject: Record<string, TranslationEntry> = {}\n\n  for (const locale of locales) {\n    const localizedEntries = Object.entries(catalog[locale] ?? {}).sort((left, right) => {\n      return left[0].localeCompare(right[0])\n    })\n    for (const [name, entry] of localizedEntries) {\n      if (!fullObject[name]) fullObject[name] = entry\n    }\n  }\n\n  let source = ''\n  for (const [key, entry] of Object.entries(fullObject)) {\n    const quotedKey = quoteKey(key)\n    if (entry.type === 'func') {\n      const params = entry.params.map(param => `${param.name}: ${param.typing}`).join(', ')\n      source += `${indent}${quotedKey}: (values: { ${params} }) => string,\\n`\n    } else {\n      source += `${indent}${quotedKey}: string,\\n`\n    }\n  }\n\n  return source\n}\n\nexport function compileToTypescript(\n  catalog: LocaleCatalog,\n  supportedLocales: readonly string[],\n  exportName: string\n): CompileResult {\n  const errors: string[] = []\n  const localesVarName = `${exportName}Locales`\n  const localesTypeName = `${capitalize(exportName)}Locales`\n  const typeName = `${capitalize(exportName)}Entries`\n  const value: Record<string, GeneratedEntry> = {}\n\n  for (const locale of supportedLocales) {\n    value[locale] = { type: 'nested', value: catalog[locale] ?? {} }\n  }\n\n  let source = '// AUTO-GENERATED. DO NOT EDIT.\\n'\n  source += '/* eslint-disable @stylistic/quote-props */\\n'\n  source += '/* eslint-disable no-useless-escape */\\n'\n  source += '/* eslint-disable @typescript-eslint/no-unused-vars */\\n'\n  source += 'import type { Translation } from \\'@helpwave/internationalization\\'\\n'\n  source += 'import { TranslationGen } from \\'@helpwave/internationalization\\'\\n\\n'\n  source += `export const ${localesVarName} = [${supportedLocales.map(locale => quoteKey(locale)).join(', ')}] as const\\n\\n`\n  source += `export type ${localesTypeName} = typeof ${localesVarName}[number]\\n\\n`\n  source += `export type ${typeName} = {\\n${generateType(catalog, supportedLocales)}}\\n\\n`\n  source += `export const ${exportName}: Translation<${localesTypeName}, Partial<${typeName}>> = {\\n${generateCode(value, errors)}}\\n\\n`\n\n  return { source, errors }\n}\n\nexport function compileTranslations(\n  catalog: LocaleCatalog,\n  config: IntlConfig,\n  exportName: string\n): CompileResult {\n  switch (config.compileTo) {\n    case 'typescript':\n      return compileToTypescript(catalog, config.supportedLocales, exportName)\n    default: {\n      const target: never = config.compileTo\n      return {\n        source: '',\n        errors: [`Compile target \"${String(target)}\" is not supported.`],\n      }\n    }\n  }\n}\n","import fs from 'fs'\nimport path from 'path'\n\nexport const COMPILE_TARGETS = ['typescript'] as const\n\nexport type CompileTarget = typeof COMPILE_TARGETS[number]\n\nexport const DEFAULT_SUPPORTED_LOCALES = ['en-US', 'de-DE']\n\nexport const DEFAULT_COMPILE_TARGET: CompileTarget = 'typescript'\n\nexport const DEFAULT_EXPORT_NAME = 'appTranslation'\n\nexport const DEFAULT_OUTPUT_FILE = './i18n/translations.ts'\n\nexport interface IntlConfig {\n  supportedLocales: string[],\n  compileTo: CompileTarget,\n  name: string,\n  outputFile: string,\n  translationFiles: string[],\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n  return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction readLocaleList(value: unknown): string[] {\n  if (!Array.isArray(value)) {\n    throw new Error('Config field \"supportedLocales\" must be an array of strings.')\n  }\n  if (value.length === 0) {\n    throw new Error('Config field \"supportedLocales\" must list at least one locale.')\n  }\n\n  const locales: string[] = []\n  for (const entry of value) {\n    if (typeof entry !== 'string' || !/^[A-Za-z0-9_-]+$/.test(entry)) {\n      throw new Error(`Locale ${JSON.stringify(entry)} in supportedLocales may only contain letters, numbers, hyphens, and underscores.`)\n    }\n    locales.push(entry)\n  }\n\n  if (new Set(locales).size !== locales.length) {\n    throw new Error('Config field \"supportedLocales\" contains duplicates.')\n  }\n\n  return locales\n}\n\nfunction readCompileTarget(value: unknown): CompileTarget {\n  if (value === 'typescript') return 'typescript'\n  throw new Error(`Config field \"compileTo\" must be \"typescript\". Received ${JSON.stringify(value)}.`)\n}\n\nfunction readStringSetting(value: unknown, field: string, fallback: string): string {\n  if (value === undefined) return fallback\n  if (typeof value !== 'string' || value.trim().length === 0) {\n    throw new Error(`Config field \"${field}\" must be a non-empty string.`)\n  }\n  return value\n}\n\nfunction readTranslationFiles(value: unknown): string[] {\n  if (value === undefined) return []\n  if (!Array.isArray(value)) {\n    throw new Error('Config field \"translationFiles\" must be an array of paths.')\n  }\n\n  const files: string[] = []\n  for (const entry of value) {\n    if (typeof entry !== 'string' || entry.trim().length === 0) {\n      throw new Error('Config field \"translationFiles\" must contain non-empty path strings.')\n    }\n    files.push(entry)\n  }\n  return files\n}\n\nexport function defaultIntlConfig(): IntlConfig {\n  return {\n    supportedLocales: [...DEFAULT_SUPPORTED_LOCALES],\n    compileTo: DEFAULT_COMPILE_TARGET,\n    name: DEFAULT_EXPORT_NAME,\n    outputFile: DEFAULT_OUTPUT_FILE,\n    translationFiles: [],\n  }\n}\n\nexport function loadIntlConfig(configPath: string): IntlConfig {\n  const resolved = path.resolve(configPath)\n  if (!fs.existsSync(resolved)) {\n    throw new Error(`Configuration file not found: ${configPath}`)\n  }\n\n  let parsed: unknown\n  try {\n    parsed = JSON.parse(fs.readFileSync(resolved, 'utf-8'))\n  } catch (error) {\n    const reason = error instanceof Error ? error.message : String(error)\n    throw new Error(`Configuration file is not valid JSON: ${configPath} (${reason})`)\n  }\n\n  if (!isRecord(parsed)) {\n    throw new Error('Configuration file must contain a JSON object.')\n  }\n\n  const defaults = defaultIntlConfig()\n  return {\n    supportedLocales: parsed.supportedLocales === undefined\n      ? defaults.supportedLocales\n      : readLocaleList(parsed.supportedLocales),\n    compileTo: parsed.compileTo === undefined\n      ? defaults.compileTo\n      : readCompileTarget(parsed.compileTo),\n    name: readStringSetting(parsed.name, 'name', defaults.name),\n    outputFile: readStringSetting(parsed.outputFile, 'outputFile', defaults.outputFile),\n    translationFiles: readTranslationFiles(parsed.translationFiles),\n  }\n}\n","interface LineChange {\n  kind: 'context' | 'add' | 'remove',\n  text: string,\n  oldLine?: number,\n  newLine?: number,\n}\n\nfunction splitLines(value: string): string[] {\n  if (value.length === 0) return []\n  const lines = value.split('\\n')\n  if (value.endsWith('\\n')) lines.pop()\n  return lines\n}\n\nfunction lineChanges(before: readonly string[], after: readonly string[]): LineChange[] {\n  const beforeCount = before.length\n  const afterCount = after.length\n  const scores: number[][] = Array.from({ length: beforeCount + 1 }, () => Array<number>(afterCount + 1).fill(0))\n\n  for (let beforeIndex = beforeCount - 1; beforeIndex >= 0; beforeIndex--) {\n    for (let afterIndex = afterCount - 1; afterIndex >= 0; afterIndex--) {\n      scores[beforeIndex][afterIndex] = before[beforeIndex] === after[afterIndex]\n        ? scores[beforeIndex + 1][afterIndex + 1] + 1\n        : Math.max(scores[beforeIndex + 1][afterIndex], scores[beforeIndex][afterIndex + 1])\n    }\n  }\n\n  const changes: LineChange[] = []\n  let beforeIndex = 0\n  let afterIndex = 0\n  let oldLine = 1\n  let newLine = 1\n\n  while (beforeIndex < beforeCount && afterIndex < afterCount) {\n    if (before[beforeIndex] === after[afterIndex]) {\n      changes.push({ kind: 'context', text: before[beforeIndex], oldLine, newLine })\n      beforeIndex++\n      afterIndex++\n      oldLine++\n      newLine++\n      continue\n    }\n    if (scores[beforeIndex + 1][afterIndex] >= scores[beforeIndex][afterIndex + 1]) {\n      changes.push({ kind: 'remove', text: before[beforeIndex], oldLine })\n      beforeIndex++\n      oldLine++\n      continue\n    }\n    changes.push({ kind: 'add', text: after[afterIndex], newLine })\n    afterIndex++\n    newLine++\n  }\n\n  while (beforeIndex < beforeCount) {\n    changes.push({ kind: 'remove', text: before[beforeIndex], oldLine })\n    beforeIndex++\n    oldLine++\n  }\n  while (afterIndex < afterCount) {\n    changes.push({ kind: 'add', text: after[afterIndex], newLine })\n    afterIndex++\n    newLine++\n  }\n\n  return changes\n}\n\nfunction groupChanges(changes: readonly LineChange[], context: number): LineChange[][] {\n  const changedIndexes = changes\n    .map((change, index) => ({ change, index }))\n    .filter(item => item.change.kind !== 'context')\n    .map(item => item.index)\n  if (changedIndexes.length === 0) return []\n\n  const groups: LineChange[][] = []\n  let groupStart = changedIndexes[0]\n  let groupEnd = changedIndexes[0]\n\n  for (const index of changedIndexes.slice(1)) {\n    if (index - groupEnd <= context * 2) {\n      groupEnd = index\n      continue\n    }\n    groups.push(changes.slice(Math.max(0, groupStart - context), Math.min(changes.length, groupEnd + context + 1)))\n    groupStart = index\n    groupEnd = index\n  }\n\n  groups.push(changes.slice(Math.max(0, groupStart - context), Math.min(changes.length, groupEnd + context + 1)))\n  return groups\n}\n\nfunction formatHunk(lines: readonly LineChange[]): string {\n  const oldStart = lines.find(line => line.oldLine !== undefined)?.oldLine ?? 0\n  const newStart = lines.find(line => line.newLine !== undefined)?.newLine ?? 0\n  const oldCount = lines.filter(line => line.kind !== 'add').length\n  const newCount = lines.filter(line => line.kind !== 'remove').length\n  const body = lines.map(line => {\n    const prefix = line.kind === 'add' ? '+' : line.kind === 'remove' ? '-' : ' '\n    return `${prefix}${line.text}`\n  })\n  return [`@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`, ...body].join('\\n')\n}\n\nexport function formatUnifiedDiff(filePath: string, before: string, after: string): string {\n  const groups = groupChanges(lineChanges(splitLines(before), splitLines(after)), 3)\n  if (groups.length === 0) return ''\n  return [`--- ${filePath}`, `+++ ${filePath}`, ...groups.map(group => formatHunk(group))].join('\\n')\n}\n\nexport function describeOutputChange(filePath: string, previous: string | undefined, next: string): string {\n  if (previous === next) return `No changes to ${filePath}`\n  const diff = formatUnifiedDiff(filePath, previous ?? '', next)\n  if (previous === undefined) return `Would create ${filePath}\\n${diff}`\n  return `Would update ${filePath}\\n${diff}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,aAAe;AACf,IAAAC,eAAiB;;;ACcV,SAAS,kBAAkB,KAAyB;AACzD,QAAM,OAAO,IAAI,QAAQ,iBAAiB,GAAG,EAAE,QAAQ,UAAU,EAAE;AACnE,MAAI,CAAC,uBAAuB,KAAK,IAAI,GAAG;AACtC,WAAO;AAAA,MACL;AAAA,MACA,OAAO,aAAa,GAAG;AAAA,IACzB;AAAA,EACF;AACA,MAAI,SAAS,KAAK;AAChB,WAAO;AAAA,MACL;AAAA,MACA,SAAS,aAAa,GAAG,qBAAqB,IAAI;AAAA,IACpD;AAAA,EACF;AACA,SAAO,EAAE,KAAK;AAChB;AAEA,SAAS,gBACP,MACA,MACA,OACA,MACoB;AACpB,QAAM,QAAQ,KAAK,QAAQ,CAAC;AAC5B,MAAI,UAAU,UAAa,MAAM,WAAW,GAAG,GAAG;AAChD,SAAK,OAAO,KAAK,UAAU,IAAI,oBAAoB;AACnD,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,SAAS,mBAAmB,MAAwC;AACzE,QAAM,OAAsB;AAAA,IAC1B,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,WAAW,CAAC;AAAA,IACZ,QAAQ,CAAC;AAAA,EACX;AAEA,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,MAAM,KAAK,KAAK;AAEtB,QAAI,QAAQ,MAAM;AACh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,YAAY,SAAS,MAAM;AAE5C,QAAM,eAAe,UAAU,YAAY,OAAO,gBAAc,WAAW,UAAU,SAAS,EAAE;AAChG,MAAI,eAAe,GAAG;AACpB,YAAQ,KAAK,iBAAiB,YAAY,cAAc;AAAA,EAC1D;AACA,UAAQ,KAAK,4BAA4B,UAAU,EAAE;AACvD;AAEA,IAAI;AACF,OAAK;AACP,SAAS,OAAO;AACd,QAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACpE,UAAQ,MAAM,UAAU,MAAM,EAAE;AAChC,UAAQ,KAAK,CAAC;AAChB;","names":["import_fs","import_path","fs","path","state","errorMessage","import_fs","import_path","isRecord","path","fs","beforeIndex","afterIndex","path","fs"]}