{"version":3,"file":"index.rsc.mjs","names":[],"sources":["../src/index.rsc.ts"],"sourcesContent":["import 'server-only';\n\nimport { initializeGTServer } from './setup/initGT.server';\nimport type {\n  GetServerSideProps,\n  GetServerSidePropsContext,\n  PreviewData,\n} from 'next';\nimport type { ParsedUrlQuery } from 'querystring';\nimport {\n  getTranslationsSnapshotRscError,\n  withGTStaticPropsRscError,\n} from './errors/createErrors';\nimport type { WithGTServerSideProps } from './pages-dir/withGTServerSideProps';\nimport type {\n  WithGTStaticProps,\n  WithGTStaticPropsFunction,\n} from './pages-dir/withGTStaticProps';\ninitializeGTServer();\n\n// ===== Components ===== //\nexport { Branch } from './branches/Branch';\nexport { Currency } from './variables/Currency';\nexport { DateTime } from './variables/DateTime';\nexport { GTProvider } from './provider/GTProvider';\nexport { Num } from './variables/Num';\nexport { Plural } from './branches/Plural';\nexport { RelativeTime } from './variables/RelativeTime';\nexport { GtInternalTranslateJsx, T } from './server-dir/buildtime/T';\nexport { GtInternalVar, Var } from './variables/Var';\n\n// ===== Hooks ===== //\nexport { useLocale } from './request/getLocale';\nexport { useRegion } from './request/getRegion';\nexport { useLocaleDirection } from './request/getLocaleDirection';\nexport { useLocalizeHref } from './link/getLocalizeHref';\nexport {\n  useTranslations,\n  useMessages,\n  useGT,\n} from './server-dir/buildtime/strings';\n\n// ===== Client Boundary ===== //\n\nexport { Client_LocaleSelector as LocaleSelector } from './utils/client-boundary';\nexport { Client_RegionSelector as RegionSelector } from './utils/client-boundary';\n\n// ===== other ===== //\n\n/**\n * Placeholder for getTranslationsSnapshot()\n * This function is for next-pages use, not next-app use\n */\nexport function getTranslationsSnapshot(_: string) {\n  throw new Error(getTranslationsSnapshotRscError);\n}\n\n/**\n * Placeholder for parseLocale()\n * This function is for next-pages use, not next-app use\n */\nexport function parseLocale<\n  Params extends ParsedUrlQuery = ParsedUrlQuery,\n  Preview extends PreviewData = PreviewData,\n>(_: GetServerSidePropsContext<Params, Preview>): string {\n  throw new Error('parseLocale() is only available for the Pages Router.');\n}\n\n/**\n * Placeholder for withGTServerSideProps()\n * This function is for next-pages use, not next-app use\n */\nexport function withGTServerSideProps<\n  Props extends Record<string, unknown> = Record<string, unknown>,\n  Params extends ParsedUrlQuery = ParsedUrlQuery,\n  Preview extends PreviewData = PreviewData,\n>(\n  _?: GetServerSideProps<Props, Params, Preview>\n): GetServerSideProps<WithGTServerSideProps<Props>, Params, Preview> {\n  throw new Error(\n    'withGTServerSideProps() is only available for the Pages Router.'\n  );\n}\n\n/**\n * Placeholder for withGTStaticProps()\n * This function is for next-pages use, not next-app use\n */\nexport const withGTStaticProps: WithGTStaticPropsFunction = () => {\n  throw new Error(withGTStaticPropsRscError);\n};\n\n// ===== gt-react Components ===== //\nexport { Derive } from 'gt-react';\n\n// ===== gt-react Hooks ===== //\nexport { useDefaultLocale, useLocaleProperties, useLocales } from 'gt-react';\n\n// ===== gt-react Functions ===== //\nexport {\n  decodeMsg,\n  decodeOptions,\n  decodeVars,\n  declareVar,\n  derive,\n  getDefaultLocale,\n  getLocaleProperties,\n  getLocales,\n  resolveCanonicalLocale,\n  getVersionId,\n  gtFallback,\n  mFallback,\n  msg,\n} from 'gt-react';\nexport { isLocaleSupported } from './request/localeValidation';\n\n// ===== Types ===== //\nexport type { GTTranslationOptions, RuntimeTranslationOptions } from 'gt-react';\nexport type { WithGTServerSideProps, WithGTStaticProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkBA,oBAAoB;;;;;AAmCpB,SAAgB,wBAAwB,GAAW;AACjD,OAAM,IAAI,MAAM,gCAAgC;;;;;;AAOlD,SAAgB,YAGd,GAAuD;AACvD,OAAM,IAAI,MAAM,wDAAwD;;;;;;AAO1E,SAAgB,sBAKd,GACmE;AACnE,OAAM,IAAI,MACR,kEACD;;;;;;AAOH,MAAa,0BAAqD;AAChE,OAAM,IAAI,MAAM,0BAA0B"}