{"version":3,"sources":["../../src/i18n/server-translations.native.tsx"],"names":["importResource","serverSideTranslations","initialLocale","namespacesRequired","store","ns"],"mappings":"AAGA,OAAS,kBAAAA,MAAsB,wBAExB,MAAMC,EAAyB,MACrCC,EACAC,EAA2C,SACvC,CAEJ,GAAI,OAAOD,GAAkB,SAC5B,MAAM,IAAI,MAAM,oEAAoE,EAIrF,MAAME,EAAQ,CAAC,EACf,QAASC,KAAMF,GAAsB,CAAC,EACrCC,EAAMC,GAAM,MAAML,EAAeE,EAAeG,CAAE,EAGnD,MAAO,CACN,aAAc,CACb,iBAAkB,CACjB,CAACH,GAAgBE,CAClB,EACA,cAAAF,EACA,GAAIC,CACL,CACD,CACD","sourcesContent":["/**\n * © 2022 WavePlay <dev@waveplay.com>\n */\nimport { importResource } from '../_generated/locales'\n\nexport const serverSideTranslations = async (\n\tinitialLocale: string,\n\tnamespacesRequired: string[] | undefined = undefined\n) => {\n\t// We need a locale at all times\n\tif (typeof initialLocale !== 'string') {\n\t\tthrow new Error('Initial locale argument was not passed into serverSideTranslations')\n\t}\n\n\t// Import only the necessary resources\n\tconst store = {}\n\tfor (let ns of namespacesRequired || []) {\n\t\tstore[ns] = await importResource(initialLocale, ns)\n\t}\n\n\treturn {\n\t\t_nextI18Next: {\n\t\t\tinitialI18nStore: {\n\t\t\t\t[initialLocale]: store\n\t\t\t},\n\t\t\tinitialLocale,\n\t\t\tns: namespacesRequired\n\t\t}\n\t}\n}\n"]}