{"version":3,"file":"strings.mjs","names":[],"sources":["../../../src/server-dir/buildtime/strings.ts"],"sourcesContent":["import { use } from '../../utils/use';\nimport {\n  getGTInternal,\n  getMessagesInternal,\n  getTranslationsInternal,\n} from 'gt-i18n/internal';\nimport type { Message } from 'gt-i18n/types';\nimport { getRequestConditions } from '../../request/getRequestConditions';\n\nexport async function getGT(_messages?: Message[]) {\n  const conditions = await getRequestConditions();\n  return getGTInternal(\n    {\n      locale: conditions._locale,\n      enableI18n: conditions._enableI18n,\n    },\n    _messages\n  );\n}\n\nexport async function getMessages() {\n  const conditions = await getRequestConditions();\n  return getMessagesInternal({\n    locale: conditions._locale,\n    enableI18n: conditions._enableI18n,\n  });\n}\n\nexport async function getTranslations(rootId?: string) {\n  const conditions = await getRequestConditions();\n  return getTranslationsInternal({\n    locale: conditions._locale,\n    enableI18n: conditions._enableI18n,\n    rootId,\n  });\n}\n\nexport function useGT(_messages?: Message[]) {\n  return use(getGT(_messages));\n}\n\nexport function useMessages() {\n  return use(getMessages());\n}\n\nexport function useTranslations(rootId?: string) {\n  return use(getTranslations(rootId));\n}\n"],"mappings":";;;;AASA,eAAsB,MAAM,WAAuB;CACjD,MAAM,aAAa,MAAM,sBAAsB;AAC/C,QAAO,cACL;EACE,QAAQ,WAAW;EACnB,YAAY,WAAW;EACxB,EACD,UACD;;AAGH,eAAsB,cAAc;CAClC,MAAM,aAAa,MAAM,sBAAsB;AAC/C,QAAO,oBAAoB;EACzB,QAAQ,WAAW;EACnB,YAAY,WAAW;EACxB,CAAC;;AAGJ,eAAsB,gBAAgB,QAAiB;CACrD,MAAM,aAAa,MAAM,sBAAsB;AAC/C,QAAO,wBAAwB;EAC7B,QAAQ,WAAW;EACnB,YAAY,WAAW;EACvB;EACD,CAAC;;AAGJ,SAAgB,MAAM,WAAuB;AAC3C,QAAO,IAAI,MAAM,UAAU,CAAC;;AAG9B,SAAgB,cAAc;AAC5B,QAAO,IAAI,aAAa,CAAC;;AAG3B,SAAgB,gBAAgB,QAAiB;AAC/C,QAAO,IAAI,gBAAgB,OAAO,CAAC"}