{"version":3,"file":"useCompact.cjs","names":["resolveAmbientLocale","compact"],"sources":["../../../../src/server/format/useCompact.ts"],"sourcesContent":["import { compact } from '@intlayer/core/formatters';\nimport { resolveAmbientLocale } from '../ambientLocale';\n\n/**\n * On the server side, hook returning a `compact` formatter bound to the ambient\n * locale: the server context, falling back to the locale carried by the\n * request. A per-call `locale` option still wins.\n *\n * Reimplemented rather than re-exported from `react-intlayer/server/format`:\n * that one takes no locale argument, so there is no way to hand it the ambient\n * locale — it would read the server context alone and format with the default\n * locale on any render the provider did not reach.\n */\nexport const useCompact = () => {\n  const locale = resolveAmbientLocale();\n\n  return (...args: Parameters<typeof compact>) =>\n    compact(args[0], {\n      ...args[1],\n      locale: args[1]?.locale ?? locale,\n    });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAa,mBAAmB;CAC9B,MAAM,SAASA,kDAAqB;CAEpC,QAAQ,GAAG,aACTC,mCAAQ,KAAK,IAAI;EACf,GAAG,KAAK;EACR,QAAQ,KAAK,EAAE,EAAE,UAAU;CAC7B,CAAC;AACL"}