{"ast":null,"code":"import { MessageDictionary, MessageFormatter } from '@internationalized/message';\nimport { useCallback, useMemo } from 'react';\nimport { useLocale } from '@react-aria/i18n';\nvar cache = new WeakMap();\nfunction getCachedDictionary(strings) {\n  var dictionary = cache.get(strings);\n  if (!dictionary) {\n    dictionary = new MessageDictionary(strings);\n    cache.set(strings, dictionary);\n  }\n  return dictionary;\n}\nexport function useMessageFormatter(strings) {\n  var _useLocale = useLocale(),\n    locale = _useLocale.locale;\n  var dictionary = useMemo(function () {\n    return getCachedDictionary(strings);\n  }, [strings]);\n  var formatter = useMemo(function () {\n    return new MessageFormatter(locale, dictionary);\n  }, [locale, dictionary]);\n  return useCallback(function (key, variables) {\n    return formatter.format(key, variables);\n  }, [formatter]);\n}","map":{"version":3,"names":["MessageDictionary","MessageFormatter","useCallback","useMemo","useLocale","cache","WeakMap","getCachedDictionary","strings","dictionary","get","set","useMessageFormatter","_useLocale","locale","formatter","key","variables","format"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/@react-aria/i18n/dist/useMessageFormatter.module.js"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { MessageDictionary, MessageFormatter } from '@internationalized/message';\nimport { useCallback, useMemo } from 'react';\nimport { useLocale } from '@react-aria/i18n';\nconst cache = new WeakMap();\n\nfunction getCachedDictionary(strings) {\n  let dictionary = cache.get(strings);\n\n  if (!dictionary) {\n    dictionary = new MessageDictionary(strings);\n    cache.set(strings, dictionary);\n  }\n\n  return dictionary;\n}\n/**\n * Handles formatting ICU Message strings to create localized strings for the current locale.\n * Automatically updates when the locale changes, and handles caching of messages for performance.\n * @param strings - A mapping of languages to strings by key.\n * @deprecated - use useLocalizedStringFormatter instead.\n */\n\n\nexport function useMessageFormatter(strings) {\n  let {\n    locale\n  } = useLocale();\n  let dictionary = useMemo(() => getCachedDictionary(strings), [strings]);\n  let formatter = useMemo(() => new MessageFormatter(locale, dictionary), [locale, dictionary]);\n  return useCallback((key, variables) => formatter.format(key, variables), [formatter]);\n}\n"],"mappings":"AAWA,SAASA,iBAAiB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAChF,SAASC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,IAAMC,KAAK,GAAG,IAAIC,OAAO,CAAC,CAAC;AAE3B,SAASC,mBAAmBA,CAACC,OAAO,EAAE;EACpC,IAAIC,UAAU,GAAGJ,KAAK,CAACK,GAAG,CAACF,OAAO,CAAC;EAEnC,IAAI,CAACC,UAAU,EAAE;IACfA,UAAU,GAAG,IAAIT,iBAAiB,CAACQ,OAAO,CAAC;IAC3CH,KAAK,CAACM,GAAG,CAACH,OAAO,EAAEC,UAAU,CAAC;EAChC;EAEA,OAAOA,UAAU;AACnB;AASA,OAAO,SAASG,mBAAmBA,CAACJ,OAAO,EAAE;EAC3C,IAAAK,UAAA,GAEIT,SAAS,CAAC,CAAC;IADbU,MAAM,GAAAD,UAAA,CAANC,MAAM;EAER,IAAIL,UAAU,GAAGN,OAAO,CAAC;IAAA,OAAMI,mBAAmB,CAACC,OAAO,CAAC;EAAA,GAAE,CAACA,OAAO,CAAC,CAAC;EACvE,IAAIO,SAAS,GAAGZ,OAAO,CAAC;IAAA,OAAM,IAAIF,gBAAgB,CAACa,MAAM,EAAEL,UAAU,CAAC;EAAA,GAAE,CAACK,MAAM,EAAEL,UAAU,CAAC,CAAC;EAC7F,OAAOP,WAAW,CAAC,UAACc,GAAG,EAAEC,SAAS;IAAA,OAAKF,SAAS,CAACG,MAAM,CAACF,GAAG,EAAEC,SAAS,CAAC;EAAA,GAAE,CAACF,SAAS,CAAC,CAAC;AACvF"},"metadata":{},"sourceType":"module"}