{"version":3,"file":"compact.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact(1200); // \"1.2K\"\n *\n * @example\n * compact(\"1000000\", { locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n  value: string | number,\n  options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n  getCachedIntl(\n    Intl.NumberFormat,\n    options?.locale ?? internationalization?.defaultLocale,\n\n    {\n      ...options,\n      notation: 'compact',\n    }\n  ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAa,WACX,OACA,YAEAA,iCACE,KAAK,cACL,SAAS,UAAUC,6CAAsB,eAEzC;CACE,GAAG;CACH,UAAU;CACX,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}