{"version":3,"sources":["../src/utils/joinPath.ts","../src/defaults.ts","../src/IntlError.ts","../src/utils/convertFormatsToIntlMessageFormat.ts","../src/formatter/formatters.ts","../src/utils/createMessageFormatter.ts","../src/utils/resolvePath.ts","../src/utils/getMessagesOrError.ts","../src/utils/getPlainMessage.ts","../src/utils/prepareTranslationValues.ts","../src/createBaseTranslator.ts","../src/utils/resolveNamespace.ts","../src/createTranslatorImpl.ts","../src/createTranslator.ts","../src/formatter/createFormatter.ts"],"names":["IntlMessageFormat","isValidElement"],"mappings":";;;;;;;AAAO,SAAS,YAAY,KAAA,EAAkC;AAC5D,EAAA,OAAO,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AACvC;;;ACMO,SAAS,0BAA0B,KAAA,EAIvC;AACD,EAAA,OAAO,QAAA,CAAS,KAAA,CAAM,SAAA,EAAW,KAAA,CAAM,GAAG,CAAA;AAC5C;AAEO,SAAS,eAAe,KAAA,EAAkB;AAC/C,EAAA,OAAA,CAAQ,MAAM,KAAK,CAAA;AACrB;AAMO,SAAS,yBAAyB,OAAA,EAA0B;AACjE,EAAA,OAAO,CAAC,KAAA,CAAM,IAAA,CAAK,OAAO,CAAA;AAC5B;;;AChBO,IAAM,SAAA,GAAN,cAAwB,KAAA,CAAM;AAAA,EAInC,WAAA,CAAY,MAAqB,eAAA,EAA0B;AACzD,IAAA,IAAI,OAAA,GAAkB,IAAA;AACtB,IAAA,IAAI,eAAA,EAAiB;AACnB,MAAA,OAAA,IAAW,IAAA,GAAO,eAAA;AAAA,IACpB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAEb,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAI,eAAA,EAAiB;AACnB,MAAA,IAAA,CAAK,eAAA,GAAkB,eAAA;AAAA,IACzB;AAAA,EACF;AACF,CAAA;ACpBA,SAAS,oBAAA,CACP,SACA,QAAA,EACA;AACA,EAAA,IAAI,CAAC,SAAS,OAA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AAK,KAAK,CAAA,IAAK,IAAA,CAAK;AAAA,SACzC;AAEF,QAAA,IAAI,UAAA,CAAW,OAAO,CAAA,EAAG;AACvB,UAAA,OAAO,MAAA;AAAA,QACT,CAAA,MAAO;AACL,UAAA,OAAO,MAAA,CAAO,KAAK,EAAE,CAAA;AAAA,QACvB;AAAA,MACF,CAAA;AAAA,MACA,MAAM,OAAO,KAAK;AAAA,KACpB;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,MAAA,EAAQ,YAAA,EAAc,MAAM,aAAA,EAAc;AAC/D","file":"index.mjs","sourcesContent":["export function joinPath(...parts: Array<string | undefined>) {\n  return parts.filter(Boolean).join('.');\n}\n","import type { IntlError } from './IntlError.js';\nimport { joinPath } from './utils/joinPath.js';\n\n/**\n * Contains defaults that are used for all entry points into the core.\n * See also `InitializedIntlConfiguration`.\n */\n\nexport function defaultGetMessageFallback(props: {\n  error: IntlError;\n  key: string;\n  namespace?: string;\n}) {\n  return joinPath(props.namespace, props.key);\n}\n\nexport function defaultOnError(error: IntlError) {\n  console.error(error);\n}\n\n/**\n * Default function to check if a message is plain (has no placeholders).\n * Checks for '<' or '{' characters which indicate rich text or ICU placeholders.\n */\nexport function defaultPlainMessageCheck(message: string): boolean {\n  return !/<|{/.test(message);\n}\n","export enum IntlErrorCode {\n  MISSING_MESSAGE = 'MISSING_MESSAGE',\n  MISSING_FORMAT = 'MISSING_FORMAT',\n  ENVIRONMENT_FALLBACK = 'ENVIRONMENT_FALLBACK',\n  INSUFFICIENT_PATH = 'INSUFFICIENT_PATH',\n  INVALID_MESSAGE = 'INVALID_MESSAGE',\n  INVALID_KEY = 'INVALID_KEY',\n  FORMATTING_ERROR = 'FORMATTING_ERROR',\n}\n\nexport class IntlError extends Error {\n  public readonly code: IntlErrorCode;\n  public readonly originalMessage: string | undefined;\n\n  constructor(code: IntlErrorCode, originalMessage?: string) {\n    let message: string = code;\n    if (originalMessage) {\n      message += ': ' + originalMessage;\n    }\n    super(message);\n\n    this.code = code;\n    if (originalMessage) {\n      this.originalMessage = originalMessage;\n    }\n  }\n}\n","import type { Formats as IntlFormats } from 'intl-messageformat';\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport type { DateTimeFormatOptions } from '../types/DateTimeFormatOptions.js';\nimport type { Formats } from '../types/Formats.js';\nimport type { TimeZone } from '../types/TimeZone.js';\n\nfunction setTimeZoneInFormats(\n  formats: Record<string, DateTimeFormatOptions> | undefined,\n  timeZone: TimeZone\n) {\n  if (!formats) return formats;\n\n  // The only way to set a time zone with `intl-messageformat` is to merge it into the formats\n  // https://github.com/formatjs/formatjs/blob/8256c5271505cf2606e48e3c97ecdd16ede4f1b5/packages/intl/src/message.ts#L15\n  return Object.keys(formats).reduce(\n    (acc: Record<string, DateTimeFormatOptions>, key) => {\n      acc[key] = {\n        timeZone,\n        ...formats[key],\n      };\n      return acc;\n    },\n    {}\n  );\n}\n\n/**\n * `intl-messageformat` uses separate keys for `date` and `time`, but there's\n * only one native API: `Intl.DateTimeFormat`. Additionally you might want to\n * include both a time and a date in a value, therefore the separation doesn't\n * seem so useful. We offer a single `dateTime` namespace instead, but we have\n * to convert the format before `intl-messageformat` can be used.\n */\nexport function convertFormatsToIntlMessageFormat(\n  formats: Partial<Formats>,\n  timeZone?: TimeZone\n): Partial<IntlFormats> {\n  const formatsWithTimeZone = timeZone\n    ? { ...formats, dateTime: setTimeZoneInFormats(formats.dateTime, timeZone) }\n    : formats;\n\n  const mfDateDefaults = IntlMessageFormat.formats.date as Formats['dateTime'];\n  const defaultDateFormats = timeZone\n    ? setTimeZoneInFormats(mfDateDefaults, timeZone)\n    : mfDateDefaults;\n\n  const mfTimeDefaults = IntlMessageFormat.formats.time as Formats['dateTime'];\n  const defaultTimeFormats = timeZone\n    ? setTimeZoneInFormats(mfTimeDefaults, timeZone)\n    : mfTimeDefaults;\n\n  return {\n    ...formatsWithTimeZone,\n    date: {\n      ...defaultDateFormats,\n      ...formatsWithTimeZone?.dateTime,\n    },\n    time: {\n      ...defaultTimeFormats,\n      ...formatsWithTimeZone?.dateTime,\n    },\n  };\n}\n","import type { IntlMessageFormat } from 'intl-messageformat';\nimport type { Cache } from '@formatjs/fast-memoize';\nimport { memoize, strategies } from '@formatjs/fast-memoize';\n\nexport type IntlCache = {\n  dateTime: Record<string, Intl.DateTimeFormat>;\n  number: Record<string, Intl.NumberFormat>;\n  message: Record<string, IntlMessageFormat>;\n  relativeTime: Record<string, Intl.RelativeTimeFormat>;\n  pluralRules: Record<string, Intl.PluralRules>;\n  list: Record<string, Intl.ListFormat>;\n  displayNames: Record<string, Intl.DisplayNames>;\n};\n\nexport function createCache(): IntlCache {\n  return {\n    dateTime: {},\n    number: {},\n    message: {},\n    relativeTime: {},\n    pluralRules: {},\n    list: {},\n    displayNames: {},\n  };\n}\n\nfunction createMemoCache<Value>(\n  store: Record<string, Value | undefined>\n): Cache<string, Value> {\n  return {\n    create() {\n      return {\n        get(key) {\n          return store[key];\n        },\n        set(key, value) {\n          store[key] = value;\n        },\n      };\n    },\n  };\n}\n\nexport function memoFn<Fn extends (...args: Array<any>) => any>(\n  fn: Fn,\n  cache: Record<string, ReturnType<Fn> | undefined>\n) {\n  return memoize(fn, {\n    cache: createMemoCache(cache),\n    strategy: strategies.variadic,\n  }) as Fn;\n}\n\nfunction memoConstructor<Fn extends new (...args: Array<any>) => unknown>(\n  ConstructorFn: Fn,\n  cache: Record<string, InstanceType<Fn> | undefined>\n) {\n  return memoFn(\n    (...args: ConstructorParameters<Fn>) => new ConstructorFn(...args),\n    cache\n  ) as (...args: ConstructorParameters<Fn>) => InstanceType<Fn>;\n}\n\nexport type IntlFormatters = {\n  getDateTimeFormat(\n    ...args: ConstructorParameters<typeof Intl.DateTimeFormat>\n  ): Intl.DateTimeFormat;\n  getNumberFormat(\n    ...args: ConstructorParameters<typeof Intl.NumberFormat>\n  ): Intl.NumberFormat;\n  getPluralRules(\n    ...args: ConstructorParameters<typeof Intl.PluralRules>\n  ): Intl.PluralRules;\n  getRelativeTimeFormat(\n    ...args: ConstructorParameters<typeof Intl.RelativeTimeFormat>\n  ): Intl.RelativeTimeFormat;\n  getListFormat(\n    ...args: ConstructorParameters<typeof Intl.ListFormat>\n  ): Intl.ListFormat;\n  getDisplayNames(\n    ...args: ConstructorParameters<typeof Intl.DisplayNames>\n  ): Intl.DisplayNames;\n};\n\nexport function createIntlFormatters(cache: IntlCache): IntlFormatters {\n  const getDateTimeFormat = memoConstructor(\n    Intl.DateTimeFormat,\n    cache.dateTime\n  );\n  const getNumberFormat = memoConstructor(Intl.NumberFormat, cache.number);\n  const getPluralRules = memoConstructor(Intl.PluralRules, cache.pluralRules);\n  const getRelativeTimeFormat = memoConstructor(\n    Intl.RelativeTimeFormat,\n    cache.relativeTime\n  );\n  const getListFormat = memoConstructor(Intl.ListFormat, cache.list);\n  const getDisplayNames = memoConstructor(\n    Intl.DisplayNames,\n    cache.displayNames\n  );\n\n  return {\n    getDateTimeFormat,\n    getNumberFormat,\n    getPluralRules,\n    getRelativeTimeFormat,\n    getListFormat,\n    getDisplayNames,\n  };\n}\n\nexport type MessageFormatter = (\n  ...args: ConstructorParameters<typeof IntlMessageFormat>\n) => IntlMessageFormat;\n\nexport type Formatters = IntlFormatters & {\n  getMessageFormat?: MessageFormatter;\n};\n","// Placed here for improved tree shaking. Somehow when this is placed in\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport type {\n  IntlCache,\n  IntlFormatters,\n  MessageFormatter,\n} from '../formatter/formatters.js';\nimport { memoFn } from '../formatter/formatters.js';\n\n// `formatters.tsx`, then it can't be shaken off from `next-intl`.\nexport function createMessageFormatter(\n  cache: IntlCache,\n  intlFormatters: IntlFormatters\n): MessageFormatter {\n  const getMessageFormat = memoFn(\n    (...args: ConstructorParameters<typeof IntlMessageFormat>) =>\n      new IntlMessageFormat(args[0], args[1], args[2], {\n        formatters: intlFormatters,\n        ...args[3],\n      }),\n    cache.message\n  );\n\n  return getMessageFormat;\n}\n","import type { AbstractIntlMessages } from '../types/AbstractIntlMessages.js';\nimport { joinPath } from './joinPath.js';\n\nexport function resolvePath(\n  locale: string,\n  messages: AbstractIntlMessages | undefined,\n  key: string,\n  namespace?: string\n): AbstractIntlMessages {\n  const fullKey = joinPath(namespace, key);\n\n  if (!messages) {\n    throw new Error(`No messages available at \\`${namespace}\\`.`);\n  }\n\n  let message: AbstractIntlMessages | string = messages;\n\n  key.split('.').forEach((part) => {\n    const next = (message as any)[part];\n\n    if (part == null || next == null) {\n      throw new Error(\n        `Could not resolve \\`${fullKey}\\` in messages for locale \\`${locale}\\`.`\n      );\n    }\n\n    message = next;\n  });\n\n  return message;\n}\n","import { defaultOnError } from '../defaults.js';\nimport { IntlError, IntlErrorCode } from '../IntlError.js';\nimport type { AbstractIntlMessages } from '../types/AbstractIntlMessages.js';\nimport { resolvePath } from './resolvePath.js';\n\nexport function getMessagesOrError<Messages extends AbstractIntlMessages>(\n  locale: string,\n  messages?: Messages,\n  namespace?: string,\n  onError: (error: IntlError) => void = defaultOnError\n) {\n  try {\n    if (!messages) {\n      throw new Error(\n        process.env.NODE_ENV !== 'production'\n          ? `No messages were configured on the provider.`\n          : undefined\n      );\n    }\n\n    const retrievedMessages = namespace\n      ? resolvePath(locale, messages, namespace)\n      : messages;\n\n    if (!retrievedMessages) {\n      throw new Error(\n        process.env.NODE_ENV !== 'production'\n          ? `No messages for namespace \\`${namespace}\\` found.`\n          : namespace\n      );\n    }\n\n    return retrievedMessages;\n  } catch (error) {\n    const intlError = new IntlError(\n      IntlErrorCode.MISSING_MESSAGE,\n      (error as Error).message\n    );\n    onError(intlError);\n    return intlError;\n  }\n}\n","import type { PlainMessageCheck } from '../types/IntlConfig.js';\n\nexport function getPlainMessage(\n  candidate: string,\n  values?: unknown,\n  plainMessageCheck?: PlainMessageCheck\n) {\n  if (values) return undefined;\n\n  const unescapedMessage = candidate.replace(/'([{}])/gi, '$1');\n\n  // Use the provided check function or fall back to the default logic\n  const checkFunction =\n    plainMessageCheck || ((message: string) => !/<|{/.test(message));\n  const isPlain = checkFunction(unescapedMessage);\n\n  if (isPlain) {\n    return unescapedMessage;\n  }\n\n  return undefined;\n}\n","import type { ReactNode } from 'react';\nimport { cloneElement, isValidElement } from 'react';\nimport type { RichTranslationValues } from '../types/TranslationValues.js';\n\nexport function prepareTranslationValues(values: RichTranslationValues) {\n  if (Object.keys(values).length === 0) return undefined;\n\n  // Workaround for https://github.com/formatjs/formatjs/issues/1467\n  const transformedValues: RichTranslationValues = {};\n  Object.keys(values).forEach((key) => {\n    let index = 0;\n    const value = values[key];\n\n    let transformed;\n    if (typeof value === 'function') {\n      transformed = (chunks: ReactNode) => {\n        const result = value(chunks);\n\n        return isValidElement(result)\n          ? cloneElement(result, { key: key + index++ })\n          : result;\n      };\n    } else {\n      transformed = value;\n    }\n\n    transformedValues[key] = transformed;\n  });\n\n  return transformedValues;\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport { isValidElement } from 'react';\nimport type { Formats } from 'intl-messageformat';\nimport type { IntlMessageFormat } from 'intl-messageformat';\nimport { defaultGetMessageFallback } from './defaults.js';\nimport type { Formatters, IntlCache } from './formatter/formatters.js';\nimport { IntlError, IntlErrorCode } from './IntlError.js';\nimport type { AbstractIntlMessages } from './types/AbstractIntlMessages.js';\nimport type { InitializedIntlConfig } from './types/IntlConfig.js';\nimport type { MessageKeys } from './types/MessageKeys.js';\nimport type { NestedKeyOf } from './types/NestedKeyOf.js';\nimport type { NestedValueOf } from './types/NestedValueOf.js';\nimport type { RichTranslationValues } from './types/TranslationValues.js';\nimport { convertFormatsToIntlMessageFormat } from './utils/convertFormatsToIntlMessageFormat.js';\nimport { createMessageFormatter } from './utils/createMessageFormatter.js';\nimport { getMessagesOrError } from './utils/getMessagesOrError.js';\nimport { getPlainMessage } from './utils/getPlainMessage.js';\nimport { joinPath } from './utils/joinPath.js';\nimport { prepareTranslationValues } from './utils/prepareTranslationValues.js';\nimport { resolvePath } from './utils/resolvePath.js';\n\nexport type CreateBaseTranslatorProps<Messages> = InitializedIntlConfig & {\n  cache: IntlCache;\n  formatters: Formatters;\n  defaultTranslationValues?: RichTranslationValues;\n  namespace?: string;\n  messagesOrError: Messages | IntlError;\n};\n\nexport function createBaseTranslator<\n  Messages extends AbstractIntlMessages,\n  NestedKey extends NestedKeyOf<Messages>,\n>(config: Omit<CreateBaseTranslatorProps<Messages>, 'messagesOrError'>) {\n  const messagesOrError = getMessagesOrError(\n    config.locale,\n    config.messages,\n    config.namespace,\n    config.onError\n  ) as Messages | IntlError;\n  return createBaseTranslatorImpl<Messages, NestedKey>({\n    ...config,\n    messagesOrError,\n  });\n}\n\nexport function createBaseTranslatorImpl<\n  Messages extends AbstractIntlMessages,\n  NestedKey extends NestedKeyOf<Messages>,\n>({\n  cache,\n  defaultTranslationValues,\n  formats: globalFormats,\n  formatters,\n  getMessageFallback = defaultGetMessageFallback,\n  locale,\n  messagesOrError,\n  namespace,\n  onError,\n  plainMessageCheck,\n  timeZone,\n}: CreateBaseTranslatorProps<Messages>) {\n  function getFallbackFromErrorAndNotify(\n    key: string,\n    code: IntlErrorCode,\n    message?: string\n  ) {\n    const error = new IntlError(code, message);\n    onError(error);\n    return getMessageFallback({ error, key, namespace });\n  }\n\n  function translateBaseFn(\n    /** Use a dot to indicate a level of nesting (e.g. `namespace.nestedLabel`). */\n    key: string,\n    /** Key value pairs for values to interpolate into the message. */\n    values?: RichTranslationValues,\n    /** Provide custom formats for numbers, dates and times. */\n    formats?: Partial<Formats>\n  ): string | ReactElement | ReactNode[] {\n    if (messagesOrError instanceof IntlError) {\n      // We have already warned about this during render\n      return getMessageFallback({\n        error: messagesOrError,\n        key,\n        namespace,\n      });\n    }\n\n    const messages = messagesOrError;\n\n    let message;\n    try {\n      message = resolvePath(locale, messages, key, namespace);\n    } catch (error) {\n      return getFallbackFromErrorAndNotify(\n        key,\n        IntlErrorCode.MISSING_MESSAGE,\n        (error as Error).message\n      );\n    }\n\n    if (typeof message === 'object') {\n      let code, errorMessage;\n      if (Array.isArray(message)) {\n        code = IntlErrorCode.INVALID_MESSAGE;\n        if (process.env.NODE_ENV !== 'production') {\n          errorMessage = `Message at \\`${joinPath(\n            namespace,\n            key\n          )}\\` resolved to an array, but only strings are supported.`;\n        }\n      } else {\n        code = IntlErrorCode.INSUFFICIENT_PATH;\n        if (process.env.NODE_ENV !== 'production') {\n          errorMessage = `Message at \\`${joinPath(\n            namespace,\n            key\n          )}\\` resolved to an object, but only strings are supported. Use a \\`.\\` to retrieve nested messages.`;\n        }\n      }\n\n      return getFallbackFromErrorAndNotify(key, code, errorMessage);\n    }\n\n    let messageFormat: IntlMessageFormat;\n\n    // Hot path that avoids creating an `IntlMessageFormat` instance\n    const plainMessage = getPlainMessage(\n      message as string,\n      values,\n      plainMessageCheck\n    );\n    if (plainMessage) return plainMessage;\n\n    // Lazy init the message formatter for better tree\n    // shaking in case message formatting is not used.\n    if (!formatters.getMessageFormat) {\n      formatters.getMessageFormat = createMessageFormatter(cache, formatters);\n    }\n\n    try {\n      messageFormat = formatters.getMessageFormat(\n        message,\n        locale,\n        convertFormatsToIntlMessageFormat(\n          { ...globalFormats, ...formats },\n          timeZone\n        ),\n        {\n          formatters: {\n            ...formatters,\n            getDateTimeFormat(locales, options) {\n              // Workaround for https://github.com/formatjs/formatjs/issues/4279\n              return formatters.getDateTimeFormat(locales, {\n                timeZone,\n                ...options,\n              });\n            },\n          },\n        }\n      );\n    } catch (error) {\n      const thrownError = error as Error;\n      return getFallbackFromErrorAndNotify(\n        key,\n        IntlErrorCode.INVALID_MESSAGE,\n        process.env.NODE_ENV !== 'production'\n          ? thrownError.message +\n              ('originalMessage' in thrownError\n                ? ` (${thrownError.originalMessage})`\n                : '')\n          : thrownError.message\n      );\n    }\n\n    try {\n      const formattedMessage = messageFormat.format(\n        // @ts-expect-error `intl-messageformat` expects a different format\n        // for rich text elements since a recent minor update. This\n        // needs to be evaluated in detail, possibly also in regards\n        // to be able to format to parts.\n        prepareTranslationValues({ ...defaultTranslationValues, ...values })\n      );\n\n      if (formattedMessage == null) {\n        throw new Error(\n          process.env.NODE_ENV !== 'production'\n            ? `Unable to format \\`${key}\\` in ${\n                namespace ? `namespace \\`${namespace}\\`` : 'messages'\n              }`\n            : undefined\n        );\n      }\n\n      // Limit the function signature to return strings or React elements\n      return isValidElement(formattedMessage) ||\n        // Arrays of React elements\n        Array.isArray(formattedMessage) ||\n        typeof formattedMessage === 'string'\n        ? formattedMessage\n        : String(formattedMessage);\n    } catch (error) {\n      return getFallbackFromErrorAndNotify(\n        key,\n        IntlErrorCode.FORMATTING_ERROR,\n        (error as Error).message\n      );\n    }\n  }\n\n  function translateFn<\n    TargetKey extends MessageKeys<\n      NestedValueOf<Messages, NestedKey>,\n      NestedKeyOf<NestedValueOf<Messages, NestedKey>>\n    >,\n  >(\n    /** Use a dot to indicate a level of nesting (e.g. `namespace.nestedLabel`). */\n    key: TargetKey,\n    /** Key value pairs for values to interpolate into the message. */\n    values?: RichTranslationValues,\n    /** Provide custom formats for numbers, dates and times. */\n    formats?: Partial<Formats>\n  ): string {\n    const result = translateBaseFn(key, values, formats);\n\n    if (typeof result !== 'string') {\n      return getFallbackFromErrorAndNotify(\n        key,\n        IntlErrorCode.INVALID_MESSAGE,\n        `The message \\`${key}\\` in ${\n          namespace ? `namespace \\`${namespace}\\`` : 'messages'\n        } didn't resolve to a string.`\n      );\n    }\n\n    return result;\n  }\n  translateFn.rich = translateBaseFn;\n\n  return translateFn;\n}\n","export function resolveNamespace(namespace: string, namespacePrefix: string) {\n  return namespace === namespacePrefix\n    ? undefined\n    : namespace.slice((namespacePrefix + '.').length);\n}\n","import { createBaseTranslator } from './createBaseTranslator.js';\nimport type { Formatters, IntlCache } from './formatter/formatters.js';\nimport type { AbstractIntlMessages } from './types/AbstractIntlMessages.js';\nimport type { InitializedIntlConfig } from './types/IntlConfig.js';\nimport type { NestedKeyOf } from './types/NestedKeyOf.js';\nimport { resolveNamespace } from './utils/resolveNamespace.js';\n\nexport type CreateTranslatorImplProps<Messages> = Omit<\n  InitializedIntlConfig,\n  'messages'\n> & {\n  namespace: string;\n  messages: Messages;\n  formatters: Formatters;\n  cache: IntlCache;\n};\n\nexport function createTranslatorImpl<\n  Messages extends AbstractIntlMessages,\n  NestedKey extends NestedKeyOf<Messages>,\n>(\n  { messages, namespace, ...rest }: CreateTranslatorImplProps<Messages>,\n  namespacePrefix: string\n) {\n  // The `namespacePrefix` is part of the type system.\n  // See the comment in the function invocation.\n  messages = messages[namespacePrefix] as Messages;\n  namespace = resolveNamespace(namespace, namespacePrefix) as NestedKey;\n  const translator = createBaseTranslator<Messages, NestedKey>({\n    ...rest,\n    namespace,\n    messages,\n  });\n\n  function base(...args: Parameters<typeof translator>) {\n    return translator(...args);\n  }\n  base.rich = function (...args: Parameters<typeof translator>) {\n    return translator.rich(...args);\n  };\n  return base;\n}\n","import type { ReactElement, ReactNode } from 'react';\nimport type { Formats } from 'intl-messageformat';\nimport { createTranslatorImpl } from './createTranslatorImpl.js';\nimport {\n  defaultGetMessageFallback,\n  defaultOnError,\n  defaultPlainMessageCheck,\n} from './defaults.js';\nimport type { Formatters, IntlCache } from './formatter/formatters.js';\nimport { createCache, createIntlFormatters } from './formatter/formatters.js';\nimport type { AbstractIntlMessages } from './types/AbstractIntlMessages.js';\nimport type { IntlConfig } from './types/IntlConfig.js';\nimport type { MessageKeys } from './types/MessageKeys.js';\nimport type { NamespaceKeys } from './types/NamespaceKeys.js';\nimport type { NestedKeyOf } from './types/NestedKeyOf.js';\nimport type { NestedValueOf } from './types/NestedValueOf.js';\nimport type { RichTranslationValues } from './types/TranslationValues.js';\n\n/**\n * Translates messages from the given namespace by using the ICU syntax.\n * See https://formatjs.io/docs/core-concepts/icu-syntax.\n *\n * If no namespace is provided, all available messages are returned.\n * The namespace can also indicate nesting by using a dot\n * (e.g. `namespace.Component`).\n */\nexport function createTranslator<\n  IntlMessages extends AbstractIntlMessages,\n  NestedKey extends NamespaceKeys<IntlMessages, NestedKeyOf<IntlMessages>> =\n    never,\n>({\n  _cache = createCache(),\n  _formatters = createIntlFormatters(_cache),\n  messages,\n  namespace,\n  onError = defaultOnError,\n  getMessageFallback = defaultGetMessageFallback,\n  plainMessageCheck = defaultPlainMessageCheck,\n  ...rest\n}: Omit<IntlConfig<IntlMessages>, 'defaultTranslationValues' | 'messages'> & {\n  messages: IntlMessages;\n  namespace?: NestedKey;\n  /** @private */\n  _formatters?: Formatters;\n  /** @private */\n  _cache?: IntlCache;\n}): // Explicitly defining the return type is necessary as TypeScript would get it wrong\n{\n  // Default invocation\n  <\n    TargetKey extends MessageKeys<\n      NestedValueOf<\n        { '!': IntlMessages },\n        [NestedKey] extends [never] ? '!' : `!.${NestedKey}`\n      >,\n      NestedKeyOf<\n        NestedValueOf<\n          { '!': IntlMessages },\n          [NestedKey] extends [never] ? '!' : `!.${NestedKey}`\n        >\n      >\n    >,\n  >(\n    key: TargetKey,\n    values?: RichTranslationValues,\n    formats?: Partial<Formats>\n  ): string;\n  // `rich`\n  rich<\n    TargetKey extends MessageKeys<\n      NestedValueOf<\n        { '!': IntlMessages },\n        [NestedKey] extends [never] ? '!' : `!.${NestedKey}`\n      >,\n      NestedKeyOf<\n        NestedValueOf<\n          { '!': IntlMessages },\n          [NestedKey] extends [never] ? '!' : `!.${NestedKey}`\n        >\n      >\n    >,\n  >(\n    key: TargetKey,\n    values?: RichTranslationValues,\n    formats?: Partial<Formats>\n  ): string | ReactElement | ReactNode[];\n} {\n  // We have to wrap the actual function so the type inference for the optional\n  // namespace works correctly. See https://stackoverflow.com/a/71529575/343045\n  // The prefix (\"!\") is arbitrary.\n  return createTranslatorImpl<\n    { '!': IntlMessages },\n    [NestedKey] extends [never] ? '!' : `!.${NestedKey}`\n  >(\n    {\n      ...rest,\n      cache: _cache,\n      formatters: _formatters,\n      onError,\n      getMessageFallback,\n      plainMessageCheck,\n      messages: { '!': messages },\n      namespace: namespace ? `!.${namespace}` : '!',\n    },\n    '!'\n  );\n}\n","import type { ReactElement } from 'react';\nimport { defaultOnError } from '../defaults.js';\nimport { IntlError, IntlErrorCode } from '../IntlError.js';\nimport type { DateTimeFormatOptions } from '../types/DateTimeFormatOptions.js';\nimport type { Formats } from '../types/Formats.js';\nimport type { NumberFormatOptions } from '../types/NumberFormatOptions.js';\nimport type { RelativeTimeFormatOptions } from '../types/RelativeTimeFormatOptions.js';\nimport type { TimeZone } from '../types/TimeZone.js';\nimport type { Formatters, IntlCache } from './formatters.js';\nimport { createCache, createIntlFormatters } from './formatters.js';\n\nconst SECOND = 1;\nconst MINUTE = SECOND * 60;\nconst HOUR = MINUTE * 60;\nconst DAY = HOUR * 24;\nconst WEEK = DAY * 7;\nconst MONTH = DAY * (365 / 12); // Approximation\nconst QUARTER = MONTH * 3;\nconst YEAR = DAY * 365;\n\nconst UNIT_SECONDS: Record<Intl.RelativeTimeFormatUnit, number> = {\n  second: SECOND,\n  seconds: SECOND,\n  minute: MINUTE,\n  minutes: MINUTE,\n  hour: HOUR,\n  hours: HOUR,\n  day: DAY,\n  days: DAY,\n  week: WEEK,\n  weeks: WEEK,\n  month: MONTH,\n  months: MONTH,\n  quarter: QUARTER,\n  quarters: QUARTER,\n  year: YEAR,\n  years: YEAR,\n} as const;\n\nfunction resolveRelativeTimeUnit(seconds: number) {\n  const absValue = Math.abs(seconds);\n\n  if (absValue < MINUTE) {\n    return 'second';\n  } else if (absValue < HOUR) {\n    return 'minute';\n  } else if (absValue < DAY) {\n    return 'hour';\n  } else if (absValue < WEEK) {\n    return 'day';\n  } else if (absValue < MONTH) {\n    return 'week';\n  } else if (absValue < YEAR) {\n    return 'month';\n  }\n  return 'year';\n}\n\nfunction calculateRelativeTimeValue(\n  seconds: number,\n  unit: Intl.RelativeTimeFormatUnit\n) {\n  // We have to round the resulting values, as `Intl.RelativeTimeFormat`\n  // will include fractions like '2.1 hours ago'.\n  return Math.round(seconds / UNIT_SECONDS[unit]);\n}\n\ntype Props = {\n  locale: string;\n  timeZone?: TimeZone;\n  onError?(error: IntlError): void;\n  formats?: Partial<Formats>;\n  now?: Date;\n  /** @private */\n  _formatters?: Formatters;\n  /** @private */\n  _cache?: IntlCache;\n};\n\nexport function createFormatter({\n  _cache: cache = createCache(),\n  _formatters: formatters = createIntlFormatters(cache),\n  formats,\n  locale,\n  now: globalNow,\n  onError = defaultOnError,\n  timeZone: globalTimeZone,\n}: Props) {\n  function applyTimeZone(options?: DateTimeFormatOptions) {\n    if (!options?.timeZone) {\n      if (globalTimeZone) {\n        options = { ...options, timeZone: globalTimeZone };\n      } else {\n        onError(\n          new IntlError(\n            IntlErrorCode.ENVIRONMENT_FALLBACK,\n            process.env.NODE_ENV !== 'production'\n              ? `The \\`timeZone\\` parameter wasn't provided and there is no global default configured. Consider adding a global default to avoid markup mismatches caused by environment differences. Learn more: https://next-intl-docs.vercel.app/docs/configuration#time-zone`\n              : undefined\n          )\n        );\n      }\n    }\n\n    return options;\n  }\n\n  function resolveFormatOrOptions<Options>(\n    typeFormats: Record<string, Options> | undefined,\n    formatOrOptions?: string | Options\n  ) {\n    let options;\n    if (typeof formatOrOptions === 'string') {\n      const formatName = formatOrOptions;\n      options = typeFormats?.[formatName];\n\n      if (!options) {\n        const error = new IntlError(\n          IntlErrorCode.MISSING_FORMAT,\n          process.env.NODE_ENV !== 'production'\n            ? `Format \\`${formatName}\\` is not available. You can configure it on the provider or provide custom options.`\n            : undefined\n        );\n        onError(error);\n        throw error;\n      }\n    } else {\n      options = formatOrOptions;\n    }\n\n    return options;\n  }\n\n  function getFormattedValue<Options, Output>(\n    formatOrOptions: string | Options | undefined,\n    typeFormats: Record<string, Options> | undefined,\n    formatter: (options?: Options) => Output,\n    getFallback: () => Output\n  ) {\n    let options;\n    try {\n      options = resolveFormatOrOptions(typeFormats, formatOrOptions);\n    } catch {\n      return getFallback();\n    }\n\n    try {\n      return formatter(options);\n    } catch (error) {\n      onError(\n        new IntlError(IntlErrorCode.FORMATTING_ERROR, (error as Error).message)\n      );\n      return getFallback();\n    }\n  }\n\n  function dateTime(\n    /** If a number is supplied, this is interpreted as a UTC timestamp. */\n    value: Date | number,\n    /** If a time zone is supplied, the `value` is converted to that time zone.\n     * Otherwise the user time zone will be used. */\n    formatOrOptions?: string | DateTimeFormatOptions\n  ) {\n    return getFormattedValue(\n      formatOrOptions,\n      formats?.dateTime,\n      (options) => {\n        options = applyTimeZone(options);\n        return formatters.getDateTimeFormat(locale, options).format(value);\n      },\n      () => String(value)\n    );\n  }\n\n  function dateTimeRange(\n    /** If a number is supplied, this is interpreted as a UTC timestamp. */\n    start: Date | number,\n    /** If a number is supplied, this is interpreted as a UTC timestamp. */\n    end: Date | number,\n    /** If a time zone is supplied, the values are converted to that time zone.\n     * Otherwise the user time zone will be used. */\n    formatOrOptions?: string | DateTimeFormatOptions\n  ) {\n    return getFormattedValue(\n      formatOrOptions,\n      formats?.dateTime,\n      (options) => {\n        options = applyTimeZone(options);\n        return formatters\n          .getDateTimeFormat(locale, options)\n          .formatRange(start, end);\n      },\n      () => [dateTime(start), dateTime(end)].join(' – ')\n    );\n  }\n\n  function number(\n    value: number | bigint,\n    formatOrOptions?: string | NumberFormatOptions\n  ) {\n    return getFormattedValue(\n      formatOrOptions,\n      formats?.number,\n      (options) => formatters.getNumberFormat(locale, options).format(value),\n      () => String(value)\n    );\n  }\n\n  function getGlobalNow() {\n    if (globalNow) {\n      return globalNow;\n    } else {\n      onError(\n        new IntlError(\n          IntlErrorCode.ENVIRONMENT_FALLBACK,\n          process.env.NODE_ENV !== 'production'\n            ? `The \\`now\\` parameter wasn't provided and there is no global default configured. Consider adding a global default to avoid markup mismatches caused by environment differences. Learn more: https://next-intl-docs.vercel.app/docs/configuration#now`\n            : undefined\n        )\n      );\n      return new Date();\n    }\n  }\n\n  function relativeTime(\n    /** The date time that needs to be formatted. */\n    date: number | Date,\n    /** The reference point in time to which `date` will be formatted in relation to.  */\n    nowOrOptions?: RelativeTimeFormatOptions['now'] | RelativeTimeFormatOptions\n  ) {\n    try {\n      let nowDate: Date | undefined,\n        unit: Intl.RelativeTimeFormatUnit | undefined;\n      const opts: Intl.RelativeTimeFormatOptions = {};\n      if (nowOrOptions instanceof Date || typeof nowOrOptions === 'number') {\n        nowDate = new Date(nowOrOptions);\n      } else if (nowOrOptions) {\n        if (nowOrOptions.now != null) {\n          nowDate = new Date(nowOrOptions.now);\n        } else {\n          nowDate = getGlobalNow();\n        }\n        unit = nowOrOptions.unit;\n        opts.style = nowOrOptions.style;\n        // @ts-expect-error -- Types are slightly outdated\n        opts.numberingSystem = nowOrOptions.numberingSystem;\n      }\n\n      if (!nowDate) {\n        nowDate = getGlobalNow();\n      }\n\n      const dateDate = new Date(date);\n      const seconds = (dateDate.getTime() - nowDate.getTime()) / 1000;\n\n      if (!unit) {\n        unit = resolveRelativeTimeUnit(seconds);\n      }\n\n      // `numeric: 'auto'` can theoretically produce output like \"yesterday\",\n      // but it only works with integers. E.g. -1 day will produce \"yesterday\",\n      // but -1.1 days will produce \"-1.1 days\". Rounding before formatting is\n      // not desired, as the given dates might cross a threshold were the\n      // output isn't correct anymore. Example: 2024-01-08T23:00:00.000Z and\n      // 2024-01-08T01:00:00.000Z would produce \"yesterday\", which is not the\n      // case. By using `always` we can ensure correct output. The only exception\n      // is the formatting of times <1 second as \"now\".\n      opts.numeric = unit === 'second' ? 'auto' : 'always';\n\n      const value = calculateRelativeTimeValue(seconds, unit);\n      return formatters.getRelativeTimeFormat(locale, opts).format(value, unit);\n    } catch (error) {\n      onError(\n        new IntlError(IntlErrorCode.FORMATTING_ERROR, (error as Error).message)\n      );\n      return String(date);\n    }\n  }\n\n  type FormattableListValue = string | ReactElement;\n  function list<Value extends FormattableListValue>(\n    value: Iterable<Value>,\n    formatOrOptions?: string | Intl.ListFormatOptions\n  ): Value extends string ? string : Iterable<ReactElement> {\n    const serializedValue: Array<string> = [];\n    const richValues = new Map<string, Value>();\n\n    // `formatToParts` only accepts strings, therefore we have to temporarily\n    // replace React elements with a placeholder ID that can be used to retrieve\n    // the original value afterwards.\n    let index = 0;\n    for (const item of value) {\n      let serializedItem;\n      if (typeof item === 'object') {\n        serializedItem = String(index);\n        richValues.set(serializedItem, item);\n      } else {\n        serializedItem = String(item);\n      }\n      serializedValue.push(serializedItem);\n      index++;\n    }\n\n    return getFormattedValue<\n      Intl.ListFormatOptions,\n      Value extends string ? string : Iterable<ReactElement>\n    >(\n      formatOrOptions,\n      formats?.list,\n      // @ts-expect-error -- `richValues.size` is used to determine the return type, but TypeScript can't infer the meaning of this correctly\n      (options) => {\n        const result = formatters\n          .getListFormat(locale, options)\n          .formatToParts(serializedValue)\n          .map((part) =>\n            part.type === 'literal'\n              ? part.value\n              : richValues.get(part.value) || part.value\n          );\n\n        if (richValues.size > 0) {\n          return result;\n        } else {\n          return result.join('');\n        }\n      },\n      () => String(value)\n    );\n  }\n\n  return { dateTime, number, relativeTime, list, dateTimeRange };\n}\n"]}