@generaltranslation/react-core 11.0.0-odysseus.14 → 11.0.0-odysseus.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/components/branches/Plural.shared.cjs +1 -1
  3. package/dist/components/branches/Plural.shared.cjs.map +1 -1
  4. package/dist/components/branches/Plural.shared.mjs +1 -1
  5. package/dist/components/branches/Plural.shared.mjs.map +1 -1
  6. package/dist/components/helpers/InternalLocaleSelector.cjs +1 -1
  7. package/dist/components/helpers/InternalLocaleSelector.cjs.map +1 -1
  8. package/dist/components/helpers/InternalLocaleSelector.mjs +1 -1
  9. package/dist/components/helpers/InternalRegionSelector.cjs +1 -1
  10. package/dist/components/helpers/InternalRegionSelector.cjs.map +1 -1
  11. package/dist/components/helpers/InternalRegionSelector.mjs +1 -1
  12. package/dist/components/translation/T.cjs +1 -1
  13. package/dist/components/translation/T.cjs.map +1 -1
  14. package/dist/components/translation/T.mjs +1 -1
  15. package/dist/components/translation/T.mjs.map +1 -1
  16. package/dist/components/translation/T.rsc.cjs +1 -1
  17. package/dist/components/translation/T.rsc.cjs.map +1 -1
  18. package/dist/components/translation/T.rsc.mjs +1 -1
  19. package/dist/components/translation/T.rsc.mjs.map +1 -1
  20. package/dist/components-rsc.cjs +1 -1
  21. package/dist/components-rsc.d.ts +3 -3
  22. package/dist/components-rsc.mjs +1 -1
  23. package/dist/condition-store/singleton-operations.cjs +1 -1
  24. package/dist/condition-store/singleton-operations.cjs.map +1 -1
  25. package/dist/condition-store/singleton-operations.d.ts +2 -7
  26. package/dist/condition-store/singleton-operations.d.ts.map +1 -1
  27. package/dist/condition-store/singleton-operations.mjs +1 -1
  28. package/dist/condition-store/singleton-operations.mjs.map +1 -1
  29. package/dist/context/InternalGTProvider.cjs +1 -1
  30. package/dist/context/InternalGTProvider.mjs +1 -1
  31. package/dist/context/context.cjs +1 -1
  32. package/dist/context/context.cjs.map +1 -1
  33. package/dist/context/context.mjs +1 -1
  34. package/dist/context/context.mjs.map +1 -1
  35. package/dist/functions/translation/t.cjs +1 -1
  36. package/dist/functions/translation/t.cjs.map +1 -1
  37. package/dist/functions/translation/t.d.ts.map +1 -1
  38. package/dist/functions/translation/t.mjs +1 -1
  39. package/dist/functions/translation/t.mjs.map +1 -1
  40. package/dist/hooks/condition-store.cjs +1 -1
  41. package/dist/hooks/condition-store.cjs.map +1 -1
  42. package/dist/hooks/condition-store.mjs +1 -1
  43. package/dist/hooks/condition-store.mjs.map +1 -1
  44. package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs +1 -1
  45. package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs.map +1 -1
  46. package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs +1 -1
  47. package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs.map +1 -1
  48. package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs +1 -1
  49. package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs.map +1 -1
  50. package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs +1 -1
  51. package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs.map +1 -1
  52. package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs +1 -1
  53. package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs.map +1 -1
  54. package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs +1 -1
  55. package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs.map +1 -1
  56. package/dist/hooks/external-store/useTrackedTranslationResolver.cjs +1 -1
  57. package/dist/hooks/external-store/useTrackedTranslationResolver.cjs.map +1 -1
  58. package/dist/hooks/external-store/useTrackedTranslationResolver.mjs +1 -1
  59. package/dist/hooks/external-store/useTrackedTranslationResolver.mjs.map +1 -1
  60. package/dist/hooks/external-store.cjs +1 -1
  61. package/dist/hooks/external-store.cjs.map +1 -1
  62. package/dist/hooks/external-store.mjs +1 -1
  63. package/dist/hooks/external-store.mjs.map +1 -1
  64. package/dist/hooks/i18n-config.cjs +1 -1
  65. package/dist/hooks/i18n-config.mjs +1 -1
  66. package/dist/hooks/useGT.cjs +1 -1
  67. package/dist/hooks/useGT.cjs.map +1 -1
  68. package/dist/hooks/useGT.mjs +1 -1
  69. package/dist/hooks/useGT.mjs.map +1 -1
  70. package/dist/hooks/useInternalLocaleSelector.cjs +1 -1
  71. package/dist/hooks/useInternalLocaleSelector.cjs.map +1 -1
  72. package/dist/hooks/useInternalLocaleSelector.mjs +1 -1
  73. package/dist/hooks/useInternalLocaleSelector.mjs.map +1 -1
  74. package/dist/hooks/useInternalRegionSelector.cjs +1 -1
  75. package/dist/hooks/useInternalRegionSelector.cjs.map +1 -1
  76. package/dist/hooks/useInternalRegionSelector.mjs +1 -1
  77. package/dist/hooks/useInternalRegionSelector.mjs.map +1 -1
  78. package/dist/hooks/useMessages.cjs +1 -1
  79. package/dist/hooks/useMessages.mjs +1 -1
  80. package/dist/hooks/useTranslations.cjs +1 -1
  81. package/dist/hooks/useTranslations.mjs +1 -1
  82. package/dist/hooks/utils/getShouldTranslate.cjs +1 -1
  83. package/dist/hooks/utils/getShouldTranslate.cjs.map +1 -1
  84. package/dist/hooks/utils/getShouldTranslate.mjs +1 -1
  85. package/dist/hooks/utils/getShouldTranslate.mjs.map +1 -1
  86. package/dist/hooks/utils/missing-translation.cjs +1 -1
  87. package/dist/hooks/utils/missing-translation.cjs.map +1 -1
  88. package/dist/hooks/utils/missing-translation.mjs +1 -1
  89. package/dist/hooks/utils/missing-translation.mjs.map +1 -1
  90. package/dist/hooks/utils.cjs +1 -1
  91. package/dist/hooks/utils.cjs.map +1 -1
  92. package/dist/hooks/utils.d.ts +1 -5
  93. package/dist/hooks/utils.d.ts.map +1 -1
  94. package/dist/hooks/utils.mjs +1 -1
  95. package/dist/hooks/utils.mjs.map +1 -1
  96. package/dist/hooks.cjs +1 -1
  97. package/dist/hooks.d.ts +2 -2
  98. package/dist/hooks.mjs +1 -1
  99. package/dist/i18n-store/singleton-operations.cjs +1 -1
  100. package/dist/i18n-store/singleton-operations.cjs.map +1 -1
  101. package/dist/i18n-store/singleton-operations.d.ts +1 -3
  102. package/dist/i18n-store/singleton-operations.d.ts.map +1 -1
  103. package/dist/i18n-store/singleton-operations.mjs +1 -1
  104. package/dist/i18n-store/singleton-operations.mjs.map +1 -1
  105. package/dist/i18n-store/storeTypes.d.ts +2 -1
  106. package/dist/i18n-store/storeTypes.d.ts.map +1 -1
  107. package/dist/pure.cjs +1 -1
  108. package/dist/pure.d.ts +7 -19
  109. package/dist/pure.mjs +1 -1
  110. package/dist/setup/i18nConfig.cjs +1 -1
  111. package/dist/setup/i18nConfig.d.ts +1 -2
  112. package/dist/setup/i18nConfig.d.ts.map +1 -1
  113. package/dist/setup/i18nConfig.mjs +1 -1
  114. package/dist/utils/rendering/renderDefaultChildren.shared.cjs +1 -1
  115. package/dist/utils/rendering/renderDefaultChildren.shared.cjs.map +1 -1
  116. package/dist/utils/rendering/renderDefaultChildren.shared.mjs +1 -1
  117. package/dist/utils/rendering/renderDefaultChildren.shared.mjs.map +1 -1
  118. package/dist/utils/rendering/renderTranslatedChildren.shared.cjs +1 -1
  119. package/dist/utils/rendering/renderTranslatedChildren.shared.cjs.map +1 -1
  120. package/dist/utils/rendering/renderTranslatedChildren.shared.mjs +1 -1
  121. package/dist/utils/rendering/renderTranslatedChildren.shared.mjs.map +1 -1
  122. package/dist/utils/translation/prepareT.shared.cjs +1 -1
  123. package/dist/utils/translation/prepareT.shared.mjs +1 -1
  124. package/dist/utils/translation/usePrepareT.cjs +1 -1
  125. package/dist/utils/translation/usePrepareT.mjs +1 -1
  126. package/dist/utils/types.d.ts +1 -35
  127. package/dist/utils/types.d.ts.map +1 -1
  128. package/package.json +4 -21
  129. package/dist/utils/dictionaries/flattenDictionary.cjs +0 -2
  130. package/dist/utils/dictionaries/flattenDictionary.cjs.map +0 -1
  131. package/dist/utils/dictionaries/flattenDictionary.d.ts +0 -15
  132. package/dist/utils/dictionaries/flattenDictionary.d.ts.map +0 -1
  133. package/dist/utils/dictionaries/flattenDictionary.mjs +0 -2
  134. package/dist/utils/dictionaries/flattenDictionary.mjs.map +0 -1
  135. package/dist/utils/dictionaries/getDictionaryEntry.cjs +0 -2
  136. package/dist/utils/dictionaries/getDictionaryEntry.cjs.map +0 -1
  137. package/dist/utils/dictionaries/getDictionaryEntry.d.ts +0 -8
  138. package/dist/utils/dictionaries/getDictionaryEntry.d.ts.map +0 -1
  139. package/dist/utils/dictionaries/getDictionaryEntry.mjs +0 -2
  140. package/dist/utils/dictionaries/getDictionaryEntry.mjs.map +0 -1
  141. package/dist/utils/dictionaries/getEntryAndMetadata.cjs +0 -2
  142. package/dist/utils/dictionaries/getEntryAndMetadata.cjs.map +0 -1
  143. package/dist/utils/dictionaries/getEntryAndMetadata.d.ts +0 -10
  144. package/dist/utils/dictionaries/getEntryAndMetadata.d.ts.map +0 -1
  145. package/dist/utils/dictionaries/getEntryAndMetadata.mjs +0 -2
  146. package/dist/utils/dictionaries/getEntryAndMetadata.mjs.map +0 -1
  147. package/dist/utils/dictionaries/indexDict.cjs +0 -2
  148. package/dist/utils/dictionaries/indexDict.cjs.map +0 -1
  149. package/dist/utils/dictionaries/indexDict.mjs +0 -2
  150. package/dist/utils/dictionaries/indexDict.mjs.map +0 -1
  151. package/dist/utils/dictionaries/isDictionaryEntry.cjs +0 -2
  152. package/dist/utils/dictionaries/isDictionaryEntry.cjs.map +0 -1
  153. package/dist/utils/dictionaries/isDictionaryEntry.d.ts +0 -12
  154. package/dist/utils/dictionaries/isDictionaryEntry.d.ts.map +0 -1
  155. package/dist/utils/dictionaries/isDictionaryEntry.mjs +0 -2
  156. package/dist/utils/dictionaries/isDictionaryEntry.mjs.map +0 -1
  157. package/dist/utils/dictionaries/mergeDictionaries.cjs +0 -2
  158. package/dist/utils/dictionaries/mergeDictionaries.cjs.map +0 -1
  159. package/dist/utils/dictionaries/mergeDictionaries.d.ts +0 -7
  160. package/dist/utils/dictionaries/mergeDictionaries.d.ts.map +0 -1
  161. package/dist/utils/dictionaries/mergeDictionaries.mjs +0 -2
  162. package/dist/utils/dictionaries/mergeDictionaries.mjs.map +0 -1
  163. package/dist/utils/internal/addGTIdentifier.d.ts +0 -8
  164. package/dist/utils/internal/addGTIdentifier.d.ts.map +0 -1
  165. package/dist/utils/internal/writeChildrenAsObjects.d.ts +0 -14
  166. package/dist/utils/internal/writeChildrenAsObjects.d.ts.map +0 -1
  167. package/dist/utils/variables/_getVariableProps.d.ts +0 -13
  168. package/dist/utils/variables/_getVariableProps.d.ts.map +0 -1
  169. package/dist/utils/variables/getVariableName.d.ts +0 -12
  170. package/dist/utils/variables/getVariableName.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @generaltranslation/react-core
2
2
 
3
+ ## 11.0.0-odysseus.16
4
+
5
+ ### Major Changes
6
+
7
+ - 463a8db: Add a config-aware `resolveCanonicalLocale` helper and remove the public `getGTClass` helper.
8
+ - 463a8db: Remove the deprecated `useGTClass` hook from public entry points.
9
+ - 40db0c5: Remove `useVersionId` from public package entrypoints.
10
+
11
+ The `getVersionId` helper remains available from public function entrypoints and `gt-i18n/internal`.
12
+
13
+ ### Patch Changes
14
+
15
+ - bea8233: Statically gate dev hot-reload code paths (tracked resolver invalidation, missing-translation queue, T hot-reload fallbacks, getGT dev preload) behind `process.env.NODE_ENV !== 'production'` so bundlers can drop them from production builds. Behavior is unchanged: the existing runtime `isDevHotReloadEnabled()` check still applies in development.
16
+ - 5736d58: Use production no-op stubs for dev hot-reload hooks so bundlers can drop more dev-only hot-reload code.
17
+ - 1f53e42: Clean up the `gt-i18n` public API surface by removing dead subpaths, internal exports, and unused types.
18
+ - e343775: Remove the accidental `useShouldTranslate` export from `@generaltranslation/react-core/hooks`. The hook is an internal implementation detail and was never meant to be public.
19
+ - Updated dependencies [463a8db]
20
+ - Updated dependencies [b72c30b]
21
+ - Updated dependencies [bea8233]
22
+ - Updated dependencies [1f53e42]
23
+ - Updated dependencies [d5cf2d3]
24
+ - gt-i18n@1.0.0-odysseus.9
25
+ - generaltranslation@9.0.0-odysseus.6
26
+ - @generaltranslation/supported-locales@2.1.2-odysseus.6
27
+
28
+ ## 11.0.0-odysseus.15
29
+
30
+ ### Patch Changes
31
+
32
+ - 04f419d: Fix source interpolation for default-locale string helpers.
33
+ Clarify that `tx()` does not apply ICU formatting by default.
34
+ - 72e9e16: Split the runtime surface of the GT class (locale management, formatting, runtime translation) into a GTRuntime base class exported from the new `generaltranslation/runtime` entry point. The SDK runtime (gt-i18n's I18nConfig, gt-next middleware) now constructs GTRuntime, so production browser bundles no longer ship the project/file management API client (enqueueFiles, uploads, downloads, etc.). The GT class extends GTRuntime and keeps its full API for the CLI and other tooling. Also import getLocaleProperties from @generaltranslation/format directly in react-core so client bundles don't reach the full core entry.
35
+ - 195f009: fix: make singleton not-initialized errors consistent and descriptive, and stop error paths from masking the original failure when I18nConfig is also uninitialized
36
+ - Updated dependencies [72e9e16]
37
+ - Updated dependencies [42a440f]
38
+ - Updated dependencies [5adeede]
39
+ - Updated dependencies [c5364f9]
40
+ - Updated dependencies [2e85ebd]
41
+ - Updated dependencies [195f009]
42
+ - generaltranslation@9.0.0-odysseus.5
43
+ - gt-i18n@1.0.0-odysseus.8
44
+ - @generaltranslation/supported-locales@2.1.2-odysseus.5
45
+
3
46
  ## 11.0.0-odysseus.14
4
47
 
5
48
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- const e=require(`../../utils/plurals/getPluralBranch.cjs`),t=require(`../../hooks/utils/getFormatLocales.cjs`);function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=t.getFormatLocales({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`&&e.getPluralBranch(a,c,s)||i}exports.renderPlural=n;
1
+ const e=require(`../../hooks/utils/getFormatLocales.cjs`),t=require(`../../utils/plurals/getPluralBranch.cjs`);function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=e.getFormatLocales({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`?t.getPluralBranch(a,c,s)??i:i}exports.renderPlural=n;
2
2
  //# sourceMappingURL=Plural.shared.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plural.shared.cjs","names":["getFormatLocales","getPluralBranch"],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n return getPluralBranch(n, locales, branches) || children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"+GAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAUA,EAAAA,iBAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAIF,OAHI,OAAO,GAAM,UAGVC,EAAAA,gBAAgB,EAAG,EAAS,EAAS,EAFnC"}
1
+ {"version":3,"file":"Plural.shared.cjs","names":["getFormatLocales","getPluralBranch"],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n const resolvedBranch = getPluralBranch(n, locales, branches);\n return resolvedBranch != null ? resolvedBranch : children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"+GAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAUA,EAAAA,iBAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAKF,OAJI,OAAO,GAAM,SAGMC,EAAAA,gBAAgB,EAAG,EAAS,EAC5C,EAA0C,EAHxC"}
@@ -1,2 +1,2 @@
1
- import{getPluralBranch as e}from"../../utils/plurals/getPluralBranch.mjs";import{getFormatLocales as t}from"../../hooks/utils/getFormatLocales.mjs";function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=t({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`&&e(a,c,s)||i}export{n as renderPlural};
1
+ import{getFormatLocales as e}from"../../hooks/utils/getFormatLocales.mjs";import{getPluralBranch as t}from"../../utils/plurals/getPluralBranch.mjs";function n({_enableI18n:n,_locale:r,children:i,n:a,locales:o=[],...s}){let c=e({locale:r,enableI18n:n,localesProp:o});return typeof a==`number`?t(a,c,s)??i:i}export{n as renderPlural};
2
2
  //# sourceMappingURL=Plural.shared.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plural.shared.mjs","names":[],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n return getPluralBranch(n, locales, branches) || children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"oJAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAU,EAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAIF,OAHI,OAAO,GAAM,UAGV,EAAgB,EAAG,EAAS,EAAS,EAFnC"}
1
+ {"version":3,"file":"Plural.shared.mjs","names":[],"sources":["../../../src/components/branches/Plural.shared.ts"],"sourcesContent":["import { getPluralBranch } from '../../utils/plurals/getPluralBranch';\nimport type { ReactNode } from 'react';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure render logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype PluralProps = {\n children?: ReactNode;\n n: number;\n locales?: string[];\n _locale?: string;\n _enableI18n?: boolean;\n [key: string]: ReactNode;\n};\n\ntype ResolvedPluralProps = PluralProps & {\n _locale: string;\n _enableI18n: boolean;\n};\n\nfunction renderPlural({\n _enableI18n,\n _locale,\n children,\n n,\n locales: localesProp = [],\n ...branches\n}: ResolvedPluralProps): ReactNode {\n const locales = getFormatLocales({\n locale: _locale,\n enableI18n: _enableI18n,\n localesProp,\n });\n if (typeof n !== 'number') {\n return children;\n }\n const resolvedBranch = getPluralBranch(n, locales, branches);\n return resolvedBranch != null ? resolvedBranch : children;\n}\n\nexport { renderPlural };\nexport type { PluralProps, ResolvedPluralProps };\n"],"mappings":"oJAsBA,SAAS,EAAa,CACpB,cACA,UACA,WACA,IACA,QAAS,EAAc,EAAE,CACzB,GAAG,GAC8B,CACjC,IAAM,EAAU,EAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAKF,OAJI,OAAO,GAAM,SAGM,EAAgB,EAAG,EAAS,EAC5C,EAA0C,EAHxC"}
@@ -1,2 +1,2 @@
1
- const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);function r(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function i(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function a({locale:e,locales:t,customNames:a,customMapping:o=i(a),setLocale:s,getLocaleProperties:c,...l}){let u=e=>{if(o&&o[e]){if(typeof o[e]==`string`)return o[e];if(o[e].name)return o[e].name}return r(c(e).nativeNameWithRegionCode)};return!t||t.length===0||!s?null:(0,n.jsxs)(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...l,value:e||``,onChange:e=>s(e.target.value),children:[!e&&(0,n.jsx)(`option`,{value:``}),t.map(e=>(0,n.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:u(e)},e))]})}exports.InternalLocaleSelector=a;
1
+ const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react/jsx-runtime`),n=require(`react`);n=e.__toESM(n);function r(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function i(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function a({locale:e,locales:n,customNames:a,customMapping:o=i(a),setLocale:s,getLocaleProperties:c,...l}){let u=e=>{if(o&&o[e]){if(typeof o[e]==`string`)return o[e];if(o[e].name)return o[e].name}return r(c(e).nativeNameWithRegionCode)};return!n||n.length===0||!s?null:(0,t.jsxs)(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...l,value:e||``,onChange:e=>s(e.target.value),children:[!e&&(0,t.jsx)(`option`,{value:``}),n.map(e=>(0,t.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:u(e)},e))]})}exports.InternalLocaleSelector=a;
2
2
  //# sourceMappingURL=InternalLocaleSelector.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalLocaleSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalLocaleSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { CustomMapping, LocaleProperties } from 'generaltranslation/types';\n\n/**\n * Capitalizes the first letter of a string if applicable.\n * For strings that do not use capitalization, it returns the string unchanged.\n * @param {string} str - The string to capitalize.\n * @returns {string} The string with the first letter capitalized if applicable.\n */\nfunction capitalizeName(str: string): string {\n if (!str) return '';\n return str.charAt(0).toUpperCase() + (str.length > 1 ? str.slice(1) : '');\n}\n\n/**\n * Internal helper to convert deprecated customNames prop to the new customMapping format.\n * Used for backward compatibility with previous LocaleSelector API.\n * @param {object} customNames - Mapping of locale to display name.\n * @returns {CustomMapping | undefined} The converted mapping or undefined.\n * @internal\n */\nfunction _convertCustomNamesToMapping(\n customNames?: { [key: string]: string } | undefined\n): CustomMapping | undefined {\n if (!customNames) return undefined;\n const result: CustomMapping = {};\n for (const locale in customNames) {\n result[locale] = { name: customNames[locale] };\n }\n return result;\n}\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string} locale - The currently selected locale.\n * @param {string[]} locales - The list of all available locales.\n * @param {function} setLocale - Function to update the current locale.\n * @param {function} getLocaleProperties - Function to retrieve properties for a given locale.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalLocaleSelector({\n locale,\n locales,\n customNames,\n customMapping = _convertCustomNamesToMapping(customNames),\n setLocale,\n getLocaleProperties,\n ...props\n}: {\n locale: string;\n locales: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n setLocale: (locale: string) => void;\n getLocaleProperties: (locale: string) => LocaleProperties;\n [key: string]: any;\n}): React.JSX.Element | null {\n // Get display name\n const getDisplayName = (locale: string) => {\n if (customMapping && customMapping[locale]) {\n if (typeof customMapping[locale] === 'string')\n return customMapping[locale];\n if (customMapping[locale].name) return customMapping[locale].name;\n }\n return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);\n };\n\n // If no locales are returned, just render nothing or handle gracefully\n if (!locales || locales.length === 0 || !setLocale) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-locale'\n aria-label='General Translation locale selector'\n {...props}\n // Fallback to an empty string if currentLocale is undefined\n value={locale || ''}\n onChange={(e) => setLocale(e.target.value)}\n >\n {/* Optional fallback for when no locale is set */}\n {!locale && <option value='' />}\n\n {locales.map((locale) => (\n <option key={locale} value={locale} suppressHydrationWarning>\n {getDisplayName(locale)}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"iIASA,SAAS,EAAe,EAAqB,CAE3C,OADK,EACE,EAAI,OAAO,EAAE,CAAC,aAAa,EAAI,EAAI,OAAS,EAAI,EAAI,MAAM,EAAE,CAAG,IADrD,GAWnB,SAAS,EACP,EAC2B,CAC3B,GAAI,CAAC,EAAa,OAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,IAAM,KAAU,EACnB,EAAO,GAAU,CAAE,KAAM,EAAY,GAAS,CAEhD,OAAO,EAeT,SAAgB,EAAuB,CACrC,SACA,UACA,cACA,gBAAgB,EAA6B,EAAY,CACzD,YACA,sBACA,GAAG,GASwB,CAE3B,IAAM,EAAkB,GAAmB,CACzC,GAAI,GAAiB,EAAc,GAAS,CAC1C,GAAI,OAAO,EAAc,IAAY,SACnC,OAAO,EAAc,GACvB,GAAI,EAAc,GAAQ,KAAM,OAAO,EAAc,GAAQ,KAE/D,OAAO,EAAe,EAAoB,EAAO,CAAC,yBAAyB,EAQ7E,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IAAU,EAAA,EAAA,KAAC,SAAD,CAAQ,MAAM,GAAK,CAAA,CAE9B,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAqB,MAAO,EAAQ,yBAAA,YACjC,EAAe,EAAO,CAChB,CAFI,EAEJ,CACT,CACK"}
1
+ {"version":3,"file":"InternalLocaleSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalLocaleSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { CustomMapping, LocaleProperties } from 'generaltranslation/types';\n\n/**\n * Capitalizes the first letter of a string if applicable.\n * For strings that do not use capitalization, it returns the string unchanged.\n * @param {string} str - The string to capitalize.\n * @returns {string} The string with the first letter capitalized if applicable.\n */\nfunction capitalizeName(str: string): string {\n if (!str) return '';\n return str.charAt(0).toUpperCase() + (str.length > 1 ? str.slice(1) : '');\n}\n\n/**\n * Internal helper to convert deprecated customNames prop to the new customMapping format.\n * Used for backward compatibility with previous LocaleSelector API.\n * @param {object} customNames - Mapping of locale to display name.\n * @returns {CustomMapping | undefined} The converted mapping or undefined.\n * @internal\n */\nfunction _convertCustomNamesToMapping(\n customNames?: { [key: string]: string } | undefined\n): CustomMapping | undefined {\n if (!customNames) return undefined;\n const result: CustomMapping = {};\n for (const locale in customNames) {\n result[locale] = { name: customNames[locale] };\n }\n return result;\n}\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string} locale - The currently selected locale.\n * @param {string[]} locales - The list of all available locales.\n * @param {function} setLocale - Function to update the current locale.\n * @param {function} getLocaleProperties - Function to retrieve properties for a given locale.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalLocaleSelector({\n locale,\n locales,\n customNames,\n customMapping = _convertCustomNamesToMapping(customNames),\n setLocale,\n getLocaleProperties,\n ...props\n}: {\n locale: string;\n locales: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n setLocale: (locale: string) => void;\n getLocaleProperties: (locale: string) => LocaleProperties;\n [key: string]: any;\n}): React.JSX.Element | null {\n // Get display name\n const getDisplayName = (locale: string) => {\n if (customMapping && customMapping[locale]) {\n if (typeof customMapping[locale] === 'string')\n return customMapping[locale];\n if (customMapping[locale].name) return customMapping[locale].name;\n }\n return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);\n };\n\n // If no locales are returned, just render nothing or handle gracefully\n if (!locales || locales.length === 0 || !setLocale) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-locale'\n aria-label='General Translation locale selector'\n {...props}\n // Fallback to an empty string if currentLocale is undefined\n value={locale || ''}\n onChange={(e) => setLocale(e.target.value)}\n >\n {/* Optional fallback for when no locale is set */}\n {!locale && <option value='' />}\n\n {locales.map((locale) => (\n <option key={locale} value={locale} suppressHydrationWarning>\n {getDisplayName(locale)}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"6HASA,SAAS,EAAe,EAAqB,CAE3C,OADK,EACE,EAAI,OAAO,EAAE,CAAC,aAAa,EAAI,EAAI,OAAS,EAAI,EAAI,MAAM,EAAE,CAAG,IADrD,GAWnB,SAAS,EACP,EAC2B,CAC3B,GAAI,CAAC,EAAa,OAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,IAAM,KAAU,EACnB,EAAO,GAAU,CAAE,KAAM,EAAY,GAAS,CAEhD,OAAO,EAeT,SAAgB,EAAuB,CACrC,SACA,UACA,cACA,gBAAgB,EAA6B,EAAY,CACzD,YACA,sBACA,GAAG,GASwB,CAE3B,IAAM,EAAkB,GAAmB,CACzC,GAAI,GAAiB,EAAc,GAAS,CAC1C,GAAI,OAAO,EAAc,IAAY,SACnC,OAAO,EAAc,GACvB,GAAI,EAAc,GAAQ,KAAM,OAAO,EAAc,GAAQ,KAE/D,OAAO,EAAe,EAAoB,EAAO,CAAC,yBAAyB,EAQ7E,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IAAU,EAAA,EAAA,KAAC,SAAD,CAAQ,MAAM,GAAK,CAAA,CAE9B,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAqB,MAAO,EAAQ,yBAAA,YACjC,EAAe,EAAO,CAChB,CAFI,EAEJ,CACT,CACK"}
@@ -1,2 +1,2 @@
1
- import"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function r(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function i({locale:i,locales:a,customNames:o,customMapping:s=r(o),setLocale:c,getLocaleProperties:l,...u}){let d=e=>{if(s&&s[e]){if(typeof s[e]==`string`)return s[e];if(s[e].name)return s[e].name}return n(l(e).nativeNameWithRegionCode)};return!a||a.length===0||!c?null:t(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...u,value:i||``,onChange:e=>c(e.target.value),children:[!i&&e(`option`,{value:``}),a.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:d(t)},t))]})}export{i as InternalLocaleSelector};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import"react";function n(e){return e?e.charAt(0).toUpperCase()+(e.length>1?e.slice(1):``):``}function r(e){if(!e)return;let t={};for(let n in e)t[n]={name:e[n]};return t}function i({locale:i,locales:a,customNames:o,customMapping:s=r(o),setLocale:c,getLocaleProperties:l,...u}){let d=e=>{if(s&&s[e]){if(typeof s[e]==`string`)return s[e];if(s[e].name)return s[e].name}return n(l(e).nativeNameWithRegionCode)};return!a||a.length===0||!c?null:t(`select`,{name:`generaltranslation-locale`,"aria-label":`General Translation locale selector`,...u,value:i||``,onChange:e=>c(e.target.value),children:[!i&&e(`option`,{value:``}),a.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:d(t)},t))]})}export{i as InternalLocaleSelector};
2
2
  //# sourceMappingURL=InternalLocaleSelector.mjs.map
@@ -1,2 +1,2 @@
1
- const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);function r({region:e,regions:t,regionData:r,setRegion:i,placeholder:a,...o}){return!t||t.length===0||!i?null:(0,n.jsxs)(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...o,value:e||``,onChange:e=>i(e.target.value),children:[!e&&(0,n.jsx)(`option`,{value:``,suppressHydrationWarning:!0,children:a||``},`placeholder`),t.map(e=>(0,n.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:r.get(e)?.name??e},e))]})}exports.InternalRegionSelector=r;
1
+ const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react/jsx-runtime`),n=require(`react`);n=e.__toESM(n);function r({region:e,regions:n,regionData:r,setRegion:i,placeholder:a,...o}){return!n||n.length===0||!i?null:(0,t.jsxs)(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...o,value:e||``,onChange:e=>i(e.target.value),children:[!e&&(0,t.jsx)(`option`,{value:``,suppressHydrationWarning:!0,children:a||``},`placeholder`),n.map(e=>(0,t.jsx)(`option`,{value:e,suppressHydrationWarning:!0,children:r.get(e)?.name??e},e))]})}exports.InternalRegionSelector=r;
2
2
  //# sourceMappingURL=InternalRegionSelector.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalRegionSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalRegionSelector.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport type { RegionData } from '../../hooks/useInternalRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string | undefined} region - The currently selected region.\n * @param {string[]} regions - The ordered list of available region codes.\n * @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).\n * @param {function} setRegion - Function to update the current region.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalRegionSelector({\n region,\n regions,\n regionData,\n setRegion,\n placeholder,\n ...props\n}: {\n region: string | undefined;\n regions: string[];\n regionData: Map<string, RegionData>;\n setRegion: (region: string) => void;\n placeholder?: ReactNode;\n [key: string]: any;\n}): React.JSX.Element | null {\n // If no regions are returned, just render nothing or handle gracefully\n if (!regions || regions.length === 0 || !setRegion) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-region'\n aria-label='General Translation region selector'\n {...props}\n // Fallback to an empty string if no region is set\n value={region || ''}\n onChange={(e) => setRegion(e.target.value)}\n >\n {/* Optional placeholder for when no region is set */}\n {!region && (\n <option key='placeholder' value='' suppressHydrationWarning>\n {placeholder || ''}\n </option>\n )}\n\n {regions.map((r) => (\n <option key={r} value={r} suppressHydrationWarning>\n {regionData.get(r)?.name ?? r}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"iIAcA,SAAgB,EAAuB,CACrC,SACA,UACA,aACA,YACA,cACA,GAAG,GAQwB,CAM3B,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IACA,EAAA,EAAA,KAAC,SAAD,CAA0B,MAAM,GAAG,yBAAA,YAChC,GAAe,GACT,CAFG,cAEH,CAGV,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAgB,MAAO,EAAG,yBAAA,YACvB,EAAW,IAAI,EAAE,EAAE,MAAQ,EACrB,CAFI,EAEJ,CACT,CACK"}
1
+ {"version":3,"file":"InternalRegionSelector.cjs","names":[],"sources":["../../../src/components/helpers/InternalRegionSelector.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport type { RegionData } from '../../hooks/useInternalRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string | undefined} region - The currently selected region.\n * @param {string[]} regions - The ordered list of available region codes.\n * @param {Map<string, RegionData>} regionData - Map of region codes to their display data (name, emoji, locale).\n * @param {function} setRegion - Function to update the current region.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @internal\n */\nexport function InternalRegionSelector({\n region,\n regions,\n regionData,\n setRegion,\n placeholder,\n ...props\n}: {\n region: string | undefined;\n regions: string[];\n regionData: Map<string, RegionData>;\n setRegion: (region: string) => void;\n placeholder?: ReactNode;\n [key: string]: any;\n}): React.JSX.Element | null {\n // If no regions are returned, just render nothing or handle gracefully\n if (!regions || regions.length === 0 || !setRegion) {\n return null;\n }\n\n return (\n <select\n name='generaltranslation-region'\n aria-label='General Translation region selector'\n {...props}\n // Fallback to an empty string if no region is set\n value={region || ''}\n onChange={(e) => setRegion(e.target.value)}\n >\n {/* Optional placeholder for when no region is set */}\n {!region && (\n <option key='placeholder' value='' suppressHydrationWarning>\n {placeholder || ''}\n </option>\n )}\n\n {regions.map((r) => (\n <option key={r} value={r} suppressHydrationWarning>\n {regionData.get(r)?.name ?? r}\n </option>\n ))}\n </select>\n );\n}\n"],"mappings":"6HAcA,SAAgB,EAAuB,CACrC,SACA,UACA,aACA,YACA,cACA,GAAG,GAQwB,CAM3B,MAJI,CAAC,GAAW,EAAQ,SAAW,GAAK,CAAC,EAChC,MAIP,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,4BACL,aAAW,sCACX,GAAI,EAEJ,MAAO,GAAU,GACjB,SAAW,GAAM,EAAU,EAAE,OAAO,MAAM,UAN5C,CASG,CAAC,IACA,EAAA,EAAA,KAAC,SAAD,CAA0B,MAAM,GAAG,yBAAA,YAChC,GAAe,GACT,CAFG,cAEH,CAGV,EAAQ,IAAK,IACZ,EAAA,EAAA,KAAC,SAAD,CAAgB,MAAO,EAAG,yBAAA,YACvB,EAAW,IAAI,EAAE,EAAE,MAAQ,EACrB,CAFI,EAEJ,CACT,CACK"}
@@ -1,2 +1,2 @@
1
- import"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function n({region:n,regions:r,regionData:i,setRegion:a,placeholder:o,...s}){return!r||r.length===0||!a?null:t(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...s,value:n||``,onChange:e=>a(e.target.value),children:[!n&&e(`option`,{value:``,suppressHydrationWarning:!0,children:o||``},`placeholder`),r.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:i.get(t)?.name??t},t))]})}export{n as InternalRegionSelector};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import"react";function n({region:n,regions:r,regionData:i,setRegion:a,placeholder:o,...s}){return!r||r.length===0||!a?null:t(`select`,{name:`generaltranslation-region`,"aria-label":`General Translation region selector`,...s,value:n||``,onChange:e=>a(e.target.value),children:[!n&&e(`option`,{value:``,suppressHydrationWarning:!0,children:o||``},`placeholder`),r.map(t=>e(`option`,{value:t,suppressHydrationWarning:!0,children:i.get(t)?.name??t},t))]})}export{n as InternalRegionSelector};
2
2
  //# sourceMappingURL=InternalRegionSelector.mjs.map
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../hooks/external-store.cjs`),t=require(`../../utils/rendering/renderPipeline.cjs`),n=require(`../../utils/translation/usePrepareT.cjs`);let r=require(`react`),i=require(`gt-i18n/internal`);function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t.renderPreparedT,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n.usePrepareT({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e.useTranslate({locale:d,message:h,options:p}),v=(0,r.useRef)(null);if((0,i.getI18nConfig)().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}exports.GtInternalTranslateJsx=o,exports.T=a;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../hooks/external-store.cjs`),t=require(`../../utils/rendering/renderPipeline.cjs`),n=require(`../../utils/translation/usePrepareT.cjs`);let r=require(`gt-i18n/internal`),i=require(`react`);function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t.renderPreparedT,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n.usePrepareT({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e.useTranslate({locale:d,message:h,options:p}),v=(0,i.useRef)(null);if(process.env.NODE_ENV!==`production`&&(0,r.getI18nConfig)().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}exports.GtInternalTranslateJsx=o,exports.T=a;
2
2
  //# sourceMappingURL=T.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"T.cjs","names":["renderPreparedT","usePrepareT","useTranslate"],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"kQAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmBA,EAAAA,gBACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACEC,EAAAA,YAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoBC,EAAAA,aAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,GAAA,EAAA,EAAA,QAAgC,KAAK,CAC3C,IAAA,EAAA,EAAA,gBACiB,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
1
+ {"version":3,"file":"T.cjs","names":["renderPreparedT","usePrepareT","useTranslate"],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n process.env.NODE_ENV !== 'production' &&\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"kQAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmBA,EAAAA,gBACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACEC,EAAAA,YAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoBC,EAAAA,aAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,GAAA,EAAA,EAAA,QAAgC,KAAK,CAC3C,GACE,QAAQ,IAAI,WAAa,eAAA,EAAA,EAAA,gBACV,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
@@ -1,2 +1,2 @@
1
- import{useTranslate as e}from"../../hooks/external-store.mjs";import{renderPreparedT as t}from"../../utils/rendering/renderPipeline.mjs";import{usePrepareT as n}from"../../utils/translation/usePrepareT.mjs";import{useRef as r}from"react";import{getI18nConfig as i}from"gt-i18n/internal";function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e({locale:d,message:h,options:p}),v=r(null);if(i().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}export{o as GtInternalTranslateJsx,a as T};
1
+ import{useTranslate as e}from"../../hooks/external-store.mjs";import{renderPreparedT as t}from"../../utils/rendering/renderPipeline.mjs";import{usePrepareT as n}from"../../utils/translation/usePrepareT.mjs";import{getI18nConfig as r}from"gt-i18n/internal";import{useRef as i}from"react";function a(e){return s(e)}function o(e){return s(e)}a._gtt=`translate-client`,o._gtt=`translate-client-automatic`;function s({children:a,_locale:o,_enableI18n:s,_renderPreparedT:c=t,...l}){let{defaultLocale:u,locale:d,enableI18n:f,targetOptions:p,taggedSourceChildren:m,sourceJsxChildren:h,shouldTranslate:g}=n({sourceChildren:a,params:l,_locale:o,_enableI18n:s}),_=e({locale:d,message:h,options:p}),v=i(null);if(process.env.NODE_ENV!==`production`&&r().isDevHotReloadEnabled()&&_==null&&v.current!=null&&g)return v.current;let y=c({taggedSourceChildren:m,targetJsxChildren:_,locale:d,defaultLocale:u,enableI18n:f,shouldTranslate:g});return v.current=y,y}export{o as GtInternalTranslateJsx,a as T};
2
2
  //# sourceMappingURL=T.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"T.mjs","names":[],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"+RAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmB,EACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACE,EAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoB,EAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,EAAO,EAAyB,KAAK,CAC3C,GACE,GAAe,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
1
+ {"version":3,"file":"T.mjs","names":[],"sources":["../../../src/components/translation/T.tsx"],"sourcesContent":["import { useTranslate } from '../../hooks/external-store';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { useRef, type ReactNode } from 'react';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline';\nimport type { TProps } from '../../utils/translation/prepareT.shared';\nimport { usePrepareT } from '../../utils/translation/usePrepareT';\n\n// ===== Component ===== //\n\n/**\n * External-store version of the `<T>` component.\n */\nfunction T(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\nfunction GtInternalTranslateJsx(props: TProps): ReactNode {\n return useComputeT(props);\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nT._gtt = 'translate-client';\nGtInternalTranslateJsx._gtt = 'translate-client-automatic';\n\nexport { GtInternalTranslateJsx, T };\n\n/**\n * Render logic\n */\nfunction useComputeT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n _renderPreparedT = renderPreparedT,\n ...params\n}: TProps): ReactNode {\n // Prepare our source children for rendering\n const {\n defaultLocale,\n locale,\n enableI18n,\n targetOptions,\n taggedSourceChildren,\n sourceJsxChildren,\n shouldTranslate,\n } = usePrepareT({\n sourceChildren,\n params,\n _locale,\n _enableI18n,\n });\n\n // Lookup translation in cache\n const targetJsxChildren = useTranslate({\n locale,\n message: sourceJsxChildren,\n options: targetOptions,\n });\n\n // Tx hot reload: render previous translation while loading new one\n // TODO: account for success vs loading vs failed request states\n const prev = useRef<ReactNode | null>(null);\n if (\n process.env.NODE_ENV !== 'production' &&\n getI18nConfig().isDevHotReloadEnabled() &&\n targetJsxChildren == null &&\n prev.current != null &&\n shouldTranslate\n ) {\n return prev.current;\n }\n\n const result = _renderPreparedT({\n taggedSourceChildren,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n\n // record previous result\n prev.current = result;\n\n return result;\n}\n"],"mappings":"+RAYA,SAAS,EAAE,EAA0B,CACnC,OAAO,EAAY,EAAM,CAG3B,SAAS,EAAuB,EAA0B,CACxD,OAAO,EAAY,EAAM,CAI3B,EAAE,KAAO,mBACT,EAAuB,KAAO,6BAO9B,SAAS,EAAY,CACnB,SAAU,EACV,UACA,cACA,mBAAmB,EACnB,GAAG,GACiB,CAEpB,GAAM,CACJ,gBACA,SACA,aACA,gBACA,uBACA,oBACA,mBACE,EAAY,CACd,iBACA,SACA,UACA,cACD,CAAC,CAGI,EAAoB,EAAa,CACrC,SACA,QAAS,EACT,QAAS,EACV,CAAC,CAII,EAAO,EAAyB,KAAK,CAC3C,GACE,QAAQ,IAAI,WAAa,cACzB,GAAe,CAAC,uBAAuB,EACvC,GAAqB,MACrB,EAAK,SAAW,MAChB,EAEA,OAAO,EAAK,QAGd,IAAM,EAAS,EAAiB,CAC9B,uBACA,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAKF,MAFA,GAAK,QAAU,EAER"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../i18n-cache/singleton-operations.cjs`),t=require(`../../utils/translation/prepareT.shared.cjs`),n=require(`../../utils/rendering/renderPipeline.rsc.cjs`);let r=require(`gt-i18n/internal`);async function i({children:i,_locale:a,_enableI18n:o,_renderPreparedT:s=n.renderPreparedT,...c}){let l=a,u=o,d=(0,r.getI18nConfig)().getDefaultLocale(),f=u&&(0,r.getI18nConfig)().requiresTranslation(l),p=t.prepareT({sourceChildren:i,params:c,locale:l});if(!f)return s({...p,targetJsxChildren:void 0,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f});let m,h=e.getReactI18nCache();return m=(0,r.getI18nConfig)().isDevHotReloadEnabled()?await h.lookupTranslationWithFallback(l,p.sourceJsxChildren,p.targetOptions):(await h.getLookupTranslation(l))(p.sourceJsxChildren,p.targetOptions),s({...p,targetJsxChildren:m,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f})}i._gtt=`translate-server`,exports.RscT=i;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../i18n-cache/singleton-operations.cjs`),t=require(`../../utils/translation/prepareT.shared.cjs`),n=require(`../../utils/rendering/renderPipeline.rsc.cjs`);let r=require(`gt-i18n/internal`);async function i({children:i,_locale:a,_enableI18n:o,_renderPreparedT:s=n.renderPreparedT,...c}){let l=a,u=o,d=(0,r.getI18nConfig)().getDefaultLocale(),f=u&&(0,r.getI18nConfig)().requiresTranslation(l),p=t.prepareT({sourceChildren:i,params:c,locale:l});if(!f)return s({...p,targetJsxChildren:void 0,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f});let m,h=e.getReactI18nCache();return m=process.env.NODE_ENV!==`production`&&(0,r.getI18nConfig)().isDevHotReloadEnabled()?await h.lookupTranslationWithFallback(l,p.sourceJsxChildren,p.targetOptions):(await h.getLookupTranslation(l))(p.sourceJsxChildren,p.targetOptions),s({...p,targetJsxChildren:m,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f})}i._gtt=`translate-server`,exports.RscT=i;
2
2
  //# sourceMappingURL=T.rsc.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"T.rsc.cjs","names":["renderPreparedT","prepareT","getReactI18nCache"],"sources":["../../../src/components/translation/T.rsc.tsx"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { ReactNode } from 'react';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline.rsc';\nimport {\n prepareT,\n type ResolvedTProps,\n} from '../../utils/translation/prepareT.shared';\nimport { JsxChildren } from '@generaltranslation/format/types';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nasync function RscT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n // TODO: don't expose to consumer, this should be thru an internal path\n _renderPreparedT = renderPreparedT,\n ...params\n}: ResolvedTProps): Promise<ReactNode> {\n const locale = _locale;\n const enableI18n = _enableI18n;\n const defaultLocale = getI18nConfig().getDefaultLocale();\n const shouldTranslate =\n enableI18n && getI18nConfig().requiresTranslation(locale);\n const prepared = prepareT({\n sourceChildren,\n params,\n locale,\n });\n\n if (!shouldTranslate) {\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren: undefined,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n }\n\n let targetJsxChildren: JsxChildren | undefined;\n const i18nCache = getReactI18nCache();\n if (getI18nConfig().isDevHotReloadEnabled()) {\n targetJsxChildren = await i18nCache.lookupTranslationWithFallback(\n locale,\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n } else {\n const lookupTranslation = await i18nCache.getLookupTranslation(locale);\n targetJsxChildren = lookupTranslation(\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n }\n\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscT._gtt = 'translate-server';\n\n// ===== Exports ===== //\n\nexport { RscT };\n"],"mappings":"kQAcA,eAAe,EAAK,CAClB,SAAU,EACV,UACA,cAEA,mBAAmBA,EAAAA,gBACnB,GAAG,GACkC,CACrC,IAAM,EAAS,EACT,EAAa,EACb,GAAA,EAAA,EAAA,gBAA+B,CAAC,kBAAkB,CAClD,EACJ,IAAA,EAAA,EAAA,gBAA6B,CAAC,oBAAoB,EAAO,CACrD,EAAWC,EAAAA,SAAS,CACxB,iBACA,SACA,SACD,CAAC,CAEF,GAAI,CAAC,EACH,OAAO,EAAiB,CACtB,GAAG,EACH,kBAAmB,IAAA,GACnB,SACA,gBACA,aACA,kBACD,CAAC,CAGJ,IAAI,EACE,EAAYC,EAAAA,mBAAmB,CAerC,MAdA,CAQE,GARF,EAAA,EAAA,gBAAmB,CAAC,uBAAuB,CACrB,MAAM,EAAU,8BAClC,EACA,EAAS,kBACT,EAAS,cACV,EAGmB,MADY,EAAU,qBAAqB,EAAO,EAEpE,EAAS,kBACT,EAAS,cACV,CAGI,EAAiB,CACtB,GAAG,EACH,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAIJ,EAAK,KAAO"}
1
+ {"version":3,"file":"T.rsc.cjs","names":["renderPreparedT","prepareT","getReactI18nCache"],"sources":["../../../src/components/translation/T.rsc.tsx"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { ReactNode } from 'react';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline.rsc';\nimport {\n prepareT,\n type ResolvedTProps,\n} from '../../utils/translation/prepareT.shared';\nimport { JsxChildren } from '@generaltranslation/format/types';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nasync function RscT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n // TODO: don't expose to consumer, this should be thru an internal path\n _renderPreparedT = renderPreparedT,\n ...params\n}: ResolvedTProps): Promise<ReactNode> {\n const locale = _locale;\n const enableI18n = _enableI18n;\n const defaultLocale = getI18nConfig().getDefaultLocale();\n const shouldTranslate =\n enableI18n && getI18nConfig().requiresTranslation(locale);\n const prepared = prepareT({\n sourceChildren,\n params,\n locale,\n });\n\n if (!shouldTranslate) {\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren: undefined,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n }\n\n let targetJsxChildren: JsxChildren | undefined;\n const i18nCache = getReactI18nCache();\n if (\n process.env.NODE_ENV !== 'production' &&\n getI18nConfig().isDevHotReloadEnabled()\n ) {\n targetJsxChildren = await i18nCache.lookupTranslationWithFallback(\n locale,\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n } else {\n const lookupTranslation = await i18nCache.getLookupTranslation(locale);\n targetJsxChildren = lookupTranslation(\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n }\n\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscT._gtt = 'translate-server';\n\n// ===== Exports ===== //\n\nexport { RscT };\n"],"mappings":"kQAcA,eAAe,EAAK,CAClB,SAAU,EACV,UACA,cAEA,mBAAmBA,EAAAA,gBACnB,GAAG,GACkC,CACrC,IAAM,EAAS,EACT,EAAa,EACb,GAAA,EAAA,EAAA,gBAA+B,CAAC,kBAAkB,CAClD,EACJ,IAAA,EAAA,EAAA,gBAA6B,CAAC,oBAAoB,EAAO,CACrD,EAAWC,EAAAA,SAAS,CACxB,iBACA,SACA,SACD,CAAC,CAEF,GAAI,CAAC,EACH,OAAO,EAAiB,CACtB,GAAG,EACH,kBAAmB,IAAA,GACnB,SACA,gBACA,aACA,kBACD,CAAC,CAGJ,IAAI,EACE,EAAYC,EAAAA,mBAAmB,CAkBrC,MAjBA,CAWE,EAVA,QAAQ,IAAI,WAAa,eAAA,EAAA,EAAA,gBACV,CAAC,uBAAuB,CAEnB,MAAM,EAAU,8BAClC,EACA,EAAS,kBACT,EAAS,cACV,EAGmB,MADY,EAAU,qBAAqB,EAAO,EAEpE,EAAS,kBACT,EAAS,cACV,CAGI,EAAiB,CACtB,GAAG,EACH,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAIJ,EAAK,KAAO"}
@@ -1,2 +1,2 @@
1
- import{getReactI18nCache as e}from"../../i18n-cache/singleton-operations.mjs";import{prepareT as t}from"../../utils/translation/prepareT.shared.mjs";import{renderPreparedT as n}from"../../utils/rendering/renderPipeline.rsc.mjs";import{getI18nConfig as r}from"gt-i18n/internal";async function i({children:i,_locale:a,_enableI18n:o,_renderPreparedT:s=n,...c}){let l=a,u=o,d=r().getDefaultLocale(),f=u&&r().requiresTranslation(l),p=t({sourceChildren:i,params:c,locale:l});if(!f)return s({...p,targetJsxChildren:void 0,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f});let m,h=e();return m=r().isDevHotReloadEnabled()?await h.lookupTranslationWithFallback(l,p.sourceJsxChildren,p.targetOptions):(await h.getLookupTranslation(l))(p.sourceJsxChildren,p.targetOptions),s({...p,targetJsxChildren:m,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f})}i._gtt=`translate-server`;export{i as RscT};
1
+ import{getReactI18nCache as e}from"../../i18n-cache/singleton-operations.mjs";import{prepareT as t}from"../../utils/translation/prepareT.shared.mjs";import{renderPreparedT as n}from"../../utils/rendering/renderPipeline.rsc.mjs";import{getI18nConfig as r}from"gt-i18n/internal";async function i({children:i,_locale:a,_enableI18n:o,_renderPreparedT:s=n,...c}){let l=a,u=o,d=r().getDefaultLocale(),f=u&&r().requiresTranslation(l),p=t({sourceChildren:i,params:c,locale:l});if(!f)return s({...p,targetJsxChildren:void 0,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f});let m,h=e();return m=process.env.NODE_ENV!==`production`&&r().isDevHotReloadEnabled()?await h.lookupTranslationWithFallback(l,p.sourceJsxChildren,p.targetOptions):(await h.getLookupTranslation(l))(p.sourceJsxChildren,p.targetOptions),s({...p,targetJsxChildren:m,locale:l,defaultLocale:d,enableI18n:u,shouldTranslate:f})}i._gtt=`translate-server`;export{i as RscT};
2
2
  //# sourceMappingURL=T.rsc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"T.rsc.mjs","names":[],"sources":["../../../src/components/translation/T.rsc.tsx"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { ReactNode } from 'react';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline.rsc';\nimport {\n prepareT,\n type ResolvedTProps,\n} from '../../utils/translation/prepareT.shared';\nimport { JsxChildren } from '@generaltranslation/format/types';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nasync function RscT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n // TODO: don't expose to consumer, this should be thru an internal path\n _renderPreparedT = renderPreparedT,\n ...params\n}: ResolvedTProps): Promise<ReactNode> {\n const locale = _locale;\n const enableI18n = _enableI18n;\n const defaultLocale = getI18nConfig().getDefaultLocale();\n const shouldTranslate =\n enableI18n && getI18nConfig().requiresTranslation(locale);\n const prepared = prepareT({\n sourceChildren,\n params,\n locale,\n });\n\n if (!shouldTranslate) {\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren: undefined,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n }\n\n let targetJsxChildren: JsxChildren | undefined;\n const i18nCache = getReactI18nCache();\n if (getI18nConfig().isDevHotReloadEnabled()) {\n targetJsxChildren = await i18nCache.lookupTranslationWithFallback(\n locale,\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n } else {\n const lookupTranslation = await i18nCache.getLookupTranslation(locale);\n targetJsxChildren = lookupTranslation(\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n }\n\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscT._gtt = 'translate-server';\n\n// ===== Exports ===== //\n\nexport { RscT };\n"],"mappings":"qRAcA,eAAe,EAAK,CAClB,SAAU,EACV,UACA,cAEA,mBAAmB,EACnB,GAAG,GACkC,CACrC,IAAM,EAAS,EACT,EAAa,EACb,EAAgB,GAAe,CAAC,kBAAkB,CAClD,EACJ,GAAc,GAAe,CAAC,oBAAoB,EAAO,CACrD,EAAW,EAAS,CACxB,iBACA,SACA,SACD,CAAC,CAEF,GAAI,CAAC,EACH,OAAO,EAAiB,CACtB,GAAG,EACH,kBAAmB,IAAA,GACnB,SACA,gBACA,aACA,kBACD,CAAC,CAGJ,IAAI,EACE,EAAY,GAAmB,CAerC,MAdA,CAQE,EARE,GAAe,CAAC,uBAAuB,CACrB,MAAM,EAAU,8BAClC,EACA,EAAS,kBACT,EAAS,cACV,EAGmB,MADY,EAAU,qBAAqB,EAAO,EAEpE,EAAS,kBACT,EAAS,cACV,CAGI,EAAiB,CACtB,GAAG,EACH,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAIJ,EAAK,KAAO"}
1
+ {"version":3,"file":"T.rsc.mjs","names":[],"sources":["../../../src/components/translation/T.rsc.tsx"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { ReactNode } from 'react';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { renderPreparedT } from '../../utils/rendering/renderPipeline.rsc';\nimport {\n prepareT,\n type ResolvedTProps,\n} from '../../utils/translation/prepareT.shared';\nimport { JsxChildren } from '@generaltranslation/format/types';\n\n// RSC implementation: request conditions are passed explicitly instead of\n// being read from hooks. This module must stay free of hook/context imports\n// so it can be exported from the components-rsc entrypoint.\n\nasync function RscT({\n children: sourceChildren,\n _locale,\n _enableI18n,\n // TODO: don't expose to consumer, this should be thru an internal path\n _renderPreparedT = renderPreparedT,\n ...params\n}: ResolvedTProps): Promise<ReactNode> {\n const locale = _locale;\n const enableI18n = _enableI18n;\n const defaultLocale = getI18nConfig().getDefaultLocale();\n const shouldTranslate =\n enableI18n && getI18nConfig().requiresTranslation(locale);\n const prepared = prepareT({\n sourceChildren,\n params,\n locale,\n });\n\n if (!shouldTranslate) {\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren: undefined,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n }\n\n let targetJsxChildren: JsxChildren | undefined;\n const i18nCache = getReactI18nCache();\n if (\n process.env.NODE_ENV !== 'production' &&\n getI18nConfig().isDevHotReloadEnabled()\n ) {\n targetJsxChildren = await i18nCache.lookupTranslationWithFallback(\n locale,\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n } else {\n const lookupTranslation = await i18nCache.getLookupTranslation(locale);\n targetJsxChildren = lookupTranslation(\n prepared.sourceJsxChildren,\n prepared.targetOptions\n );\n }\n\n return _renderPreparedT({\n ...prepared,\n targetJsxChildren,\n locale,\n defaultLocale,\n enableI18n,\n shouldTranslate,\n });\n}\n\n/** @internal _gtt - The GT transformation for the component. */\nRscT._gtt = 'translate-server';\n\n// ===== Exports ===== //\n\nexport { RscT };\n"],"mappings":"qRAcA,eAAe,EAAK,CAClB,SAAU,EACV,UACA,cAEA,mBAAmB,EACnB,GAAG,GACkC,CACrC,IAAM,EAAS,EACT,EAAa,EACb,EAAgB,GAAe,CAAC,kBAAkB,CAClD,EACJ,GAAc,GAAe,CAAC,oBAAoB,EAAO,CACrD,EAAW,EAAS,CACxB,iBACA,SACA,SACD,CAAC,CAEF,GAAI,CAAC,EACH,OAAO,EAAiB,CACtB,GAAG,EACH,kBAAmB,IAAA,GACnB,SACA,gBACA,aACA,kBACD,CAAC,CAGJ,IAAI,EACE,EAAY,GAAmB,CAkBrC,MAjBA,CAWE,EAVA,QAAQ,IAAI,WAAa,cACzB,GAAe,CAAC,uBAAuB,CAEnB,MAAM,EAAU,8BAClC,EACA,EAAS,kBACT,EAAS,cACV,EAGmB,MADY,EAAU,qBAAqB,EAAO,EAEpE,EAAS,kBACT,EAAS,cACV,CAGI,EAAiB,CACtB,GAAG,EACH,oBACA,SACA,gBACA,aACA,kBACD,CAAC,CAIJ,EAAK,KAAO"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utils/plurals/getPluralBranch.cjs`),t=require(`./hooks/utils/getFormatLocales.cjs`),n=require(`./i18n-cache/singleton-operations.cjs`),r=require(`./functions/helpers/getTranslationsSnapshot.cjs`),i=require(`./condition-store/singleton-operations.cjs`),a=require(`./hooks/utils/getShouldTranslate.cjs`),o=require(`./functions/translation/t.cjs`),s=require(`./utils/rendering/createRenderVariable.cjs`),c=require(`./utils/rendering/createRenderPipeline.cjs`),l=require(`./setup/initializeGTSRA.cjs`),u=require(`./components/branches/Branch.cjs`),d=require(`./components/derivation/Derive.cjs`),f=require(`./components/variables/Var.cjs`),p=require(`./utils/translation/prepareT.shared.cjs`),m=require(`./components/branches/Plural.rsc.cjs`),h=require(`./components/variables/Currency.rsc.cjs`),g=require(`./components/variables/DateTime.rsc.cjs`),_=require(`./components/variables/Num.rsc.cjs`),v=require(`./components/variables/RelativeTime.rsc.cjs`),y=require(`./utils/rendering/renderPipeline.rsc.cjs`),b=require(`./components/translation/T.rsc.cjs`),x=require(`./components/translation/Tx.rsc.cjs`);exports.Branch=u.Branch,exports.Currency=h.RscCurrency,exports.DateTime=g.RscDateTime,exports.Derive=d.Derive,exports.GtInternalBranch=u.GtInternalBranch,exports.GtInternalCurrency=h.RscGtInternalCurrency,exports.GtInternalDateTime=g.RscGtInternalDateTime,exports.GtInternalDerive=d.GtInternalDerive,exports.GtInternalNum=_.RscGtInternalNum,exports.GtInternalPlural=m.RscGtInternalPlural,exports.GtInternalRelativeTime=v.RscGtInternalRelativeTime,exports.GtInternalVar=f.GtInternalVar,exports.Num=_.RscNum,exports.Plural=m.RscPlural,exports.RelativeTime=v.RscRelativeTime,exports.T=b.RscT,exports.Tx=x.RscTx,exports.Var=f.Var,exports.createRenderPipeline=c.createRenderPipeline,exports.createRenderVariable=s.createRenderVariable,exports.getFormatLocales=t.getFormatLocales,exports.getPluralBranch=e.getPluralBranch,exports.getReactI18nCache=n.getReactI18nCache,exports.getReadonlyConditionStoreWithFallback=i.getReadonlyConditionStoreWithFallback,exports.getShouldTranslate=a.getShouldTranslate,exports.getTranslationsSnapshot=r.getTranslationsSnapshot,exports.internalInitializeGTSRA=l.internalInitializeGTSRA,exports.prepareT=p.prepareT,exports.renderDefaultChildren=y.renderDefaultChildren,exports.renderPreparedT=y.renderPreparedT,exports.renderTranslatedChildren=y.renderTranslatedChildren,exports.renderVariable=y.renderVariable,exports.setReactI18nCache=n.setReactI18nCache,exports.t=o.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./hooks/utils/getFormatLocales.cjs`),t=require(`./i18n-cache/singleton-operations.cjs`),n=require(`./functions/helpers/getTranslationsSnapshot.cjs`),r=require(`./condition-store/singleton-operations.cjs`),i=require(`./hooks/utils/getShouldTranslate.cjs`),a=require(`./functions/translation/t.cjs`),o=require(`./utils/rendering/createRenderVariable.cjs`),s=require(`./utils/plurals/getPluralBranch.cjs`),c=require(`./utils/rendering/createRenderPipeline.cjs`),l=require(`./setup/initializeGTSRA.cjs`),u=require(`./components/branches/Branch.cjs`),d=require(`./components/derivation/Derive.cjs`),f=require(`./components/variables/Var.cjs`),p=require(`./utils/translation/prepareT.shared.cjs`),m=require(`./components/branches/Plural.rsc.cjs`),h=require(`./components/variables/Currency.rsc.cjs`),g=require(`./components/variables/DateTime.rsc.cjs`),_=require(`./components/variables/Num.rsc.cjs`),v=require(`./components/variables/RelativeTime.rsc.cjs`),y=require(`./utils/rendering/renderPipeline.rsc.cjs`),b=require(`./components/translation/T.rsc.cjs`),x=require(`./components/translation/Tx.rsc.cjs`);exports.Branch=u.Branch,exports.Currency=h.RscCurrency,exports.DateTime=g.RscDateTime,exports.Derive=d.Derive,exports.GtInternalBranch=u.GtInternalBranch,exports.GtInternalCurrency=h.RscGtInternalCurrency,exports.GtInternalDateTime=g.RscGtInternalDateTime,exports.GtInternalDerive=d.GtInternalDerive,exports.GtInternalNum=_.RscGtInternalNum,exports.GtInternalPlural=m.RscGtInternalPlural,exports.GtInternalRelativeTime=v.RscGtInternalRelativeTime,exports.GtInternalVar=f.GtInternalVar,exports.Num=_.RscNum,exports.Plural=m.RscPlural,exports.RelativeTime=v.RscRelativeTime,exports.T=b.RscT,exports.Tx=x.RscTx,exports.Var=f.Var,exports.createRenderPipeline=c.createRenderPipeline,exports.createRenderVariable=o.createRenderVariable,exports.getFormatLocales=e.getFormatLocales,exports.getPluralBranch=s.getPluralBranch,exports.getReactI18nCache=t.getReactI18nCache,exports.getReadonlyConditionStore=r.getConditionStore,exports.getShouldTranslate=i.getShouldTranslate,exports.getTranslationsSnapshot=n.getTranslationsSnapshot,exports.internalInitializeGTSRA=l.internalInitializeGTSRA,exports.prepareT=p.prepareT,exports.renderDefaultChildren=y.renderDefaultChildren,exports.renderPreparedT=y.renderPreparedT,exports.renderTranslatedChildren=y.renderTranslatedChildren,exports.renderVariable=y.renderVariable,exports.setReactI18nCache=t.setReactI18nCache,exports.t=a.t;
@@ -20,13 +20,13 @@ import { RscT } from "./components/translation/T.rsc.js";
20
20
  import { RscTx } from "./components/translation/Tx.rsc.js";
21
21
  import { getTranslationsSnapshot } from "./functions/helpers/getTranslationsSnapshot.js";
22
22
  import { t } from "./functions/translation/t.js";
23
- import { getPluralBranch } from "./utils/plurals/getPluralBranch.js";
24
23
  import { getFormatLocales } from "./hooks/utils/getFormatLocales.js";
25
24
  import { createRenderVariable } from "./utils/rendering/createRenderVariable.js";
26
25
  import { RenderPipeline, createRenderPipeline } from "./utils/rendering/createRenderPipeline.js";
27
26
  import { getReactI18nCache, setReactI18nCache } from "./i18n-cache/singleton-operations.js";
28
27
  import { internalInitializeGTSRA } from "./setup/initializeGTSRA.js";
29
- import { getReadonlyConditionStoreWithFallback } from "./condition-store/singleton-operations.js";
28
+ import { getConditionStore } from "./condition-store/singleton-operations.js";
29
+ import { getPluralBranch } from "./utils/plurals/getPluralBranch.js";
30
30
  import { getShouldTranslate } from "./hooks/utils/getShouldTranslate.js";
31
31
  import { renderDefaultChildren, renderPreparedT, renderTranslatedChildren, renderVariable } from "./utils/rendering/renderPipeline.rsc.js";
32
- export { Branch, RscCurrency as Currency, type CurrencyProps, RscDateTime as DateTime, type DateTimeProps, Derive, GtInternalBranch, RscGtInternalCurrency as GtInternalCurrency, RscGtInternalDateTime as GtInternalDateTime, GtInternalDerive, RscGtInternalNum as GtInternalNum, RscGtInternalPlural as GtInternalPlural, RscGtInternalRelativeTime as GtInternalRelativeTime, GtInternalVar, type JsxTranslationOptions, RscNum as Num, type NumProps, RscPlural as Plural, type PluralProps, type PreparedT, RscRelativeTime as RelativeTime, type RelativeTimeFormatOptions, type RelativeTimeProps, type RenderDefaultChildrenArgs, type RenderPipeline, type RenderPreparedTParams, type RenderTranslatedChildrenArgs, type RenderVariable, type ResolvedCurrencyProps, type ResolvedDateTimeProps, type ResolvedNumProps, type ResolvedPluralProps, type ResolvedRelativeTimeProps, RscT as T, RscTx as Tx, Var, createRenderPipeline, createRenderVariable, getFormatLocales, getPluralBranch, getReactI18nCache, getReadonlyConditionStoreWithFallback, getShouldTranslate, getTranslationsSnapshot, internalInitializeGTSRA, prepareT, renderDefaultChildren, renderPreparedT, renderTranslatedChildren, renderVariable, setReactI18nCache, t };
32
+ export { Branch, RscCurrency as Currency, type CurrencyProps, RscDateTime as DateTime, type DateTimeProps, Derive, GtInternalBranch, RscGtInternalCurrency as GtInternalCurrency, RscGtInternalDateTime as GtInternalDateTime, GtInternalDerive, RscGtInternalNum as GtInternalNum, RscGtInternalPlural as GtInternalPlural, RscGtInternalRelativeTime as GtInternalRelativeTime, GtInternalVar, type JsxTranslationOptions, RscNum as Num, type NumProps, RscPlural as Plural, type PluralProps, type PreparedT, RscRelativeTime as RelativeTime, type RelativeTimeFormatOptions, type RelativeTimeProps, type RenderDefaultChildrenArgs, type RenderPipeline, type RenderPreparedTParams, type RenderTranslatedChildrenArgs, type RenderVariable, type ResolvedCurrencyProps, type ResolvedDateTimeProps, type ResolvedNumProps, type ResolvedPluralProps, type ResolvedRelativeTimeProps, RscT as T, RscTx as Tx, Var, createRenderPipeline, createRenderVariable, getFormatLocales, getPluralBranch, getReactI18nCache, getConditionStore as getReadonlyConditionStore, getShouldTranslate, getTranslationsSnapshot, internalInitializeGTSRA, prepareT, renderDefaultChildren, renderPreparedT, renderTranslatedChildren, renderVariable, setReactI18nCache, t };
@@ -1 +1 @@
1
- import{getPluralBranch as e}from"./utils/plurals/getPluralBranch.mjs";import{getFormatLocales as t}from"./hooks/utils/getFormatLocales.mjs";import{getReactI18nCache as n,setReactI18nCache as r}from"./i18n-cache/singleton-operations.mjs";import{getTranslationsSnapshot as i}from"./functions/helpers/getTranslationsSnapshot.mjs";import{getReadonlyConditionStoreWithFallback as a}from"./condition-store/singleton-operations.mjs";import{getShouldTranslate as o}from"./hooks/utils/getShouldTranslate.mjs";import{t as s}from"./functions/translation/t.mjs";import{createRenderVariable as c}from"./utils/rendering/createRenderVariable.mjs";import{createRenderPipeline as l}from"./utils/rendering/createRenderPipeline.mjs";import{internalInitializeGTSRA as u}from"./setup/initializeGTSRA.mjs";import{Branch as d,GtInternalBranch as f}from"./components/branches/Branch.mjs";import{Derive as p,GtInternalDerive as m}from"./components/derivation/Derive.mjs";import{GtInternalVar as h,Var as g}from"./components/variables/Var.mjs";import{prepareT as _}from"./utils/translation/prepareT.shared.mjs";import{RscGtInternalPlural as v,RscPlural as y}from"./components/branches/Plural.rsc.mjs";import{RscCurrency as b,RscGtInternalCurrency as x}from"./components/variables/Currency.rsc.mjs";import{RscDateTime as S,RscGtInternalDateTime as C}from"./components/variables/DateTime.rsc.mjs";import{RscGtInternalNum as w,RscNum as T}from"./components/variables/Num.rsc.mjs";import{RscGtInternalRelativeTime as E,RscRelativeTime as D}from"./components/variables/RelativeTime.rsc.mjs";import{renderDefaultChildren as O,renderPreparedT as k,renderTranslatedChildren as A,renderVariable as j}from"./utils/rendering/renderPipeline.rsc.mjs";import{RscT as M}from"./components/translation/T.rsc.mjs";import{RscTx as N}from"./components/translation/Tx.rsc.mjs";export{d as Branch,b as Currency,S as DateTime,p as Derive,f as GtInternalBranch,x as GtInternalCurrency,C as GtInternalDateTime,m as GtInternalDerive,w as GtInternalNum,v as GtInternalPlural,E as GtInternalRelativeTime,h as GtInternalVar,T as Num,y as Plural,D as RelativeTime,M as T,N as Tx,g as Var,l as createRenderPipeline,c as createRenderVariable,t as getFormatLocales,e as getPluralBranch,n as getReactI18nCache,a as getReadonlyConditionStoreWithFallback,o as getShouldTranslate,i as getTranslationsSnapshot,u as internalInitializeGTSRA,_ as prepareT,O as renderDefaultChildren,k as renderPreparedT,A as renderTranslatedChildren,j as renderVariable,r as setReactI18nCache,s as t};
1
+ import{getFormatLocales as e}from"./hooks/utils/getFormatLocales.mjs";import{getReactI18nCache as t,setReactI18nCache as n}from"./i18n-cache/singleton-operations.mjs";import{getTranslationsSnapshot as r}from"./functions/helpers/getTranslationsSnapshot.mjs";import{getConditionStore as i}from"./condition-store/singleton-operations.mjs";import{getShouldTranslate as a}from"./hooks/utils/getShouldTranslate.mjs";import{t as o}from"./functions/translation/t.mjs";import{createRenderVariable as s}from"./utils/rendering/createRenderVariable.mjs";import{getPluralBranch as c}from"./utils/plurals/getPluralBranch.mjs";import{createRenderPipeline as l}from"./utils/rendering/createRenderPipeline.mjs";import{internalInitializeGTSRA as u}from"./setup/initializeGTSRA.mjs";import{Branch as d,GtInternalBranch as f}from"./components/branches/Branch.mjs";import{Derive as p,GtInternalDerive as m}from"./components/derivation/Derive.mjs";import{GtInternalVar as h,Var as g}from"./components/variables/Var.mjs";import{prepareT as _}from"./utils/translation/prepareT.shared.mjs";import{RscGtInternalPlural as v,RscPlural as y}from"./components/branches/Plural.rsc.mjs";import{RscCurrency as b,RscGtInternalCurrency as x}from"./components/variables/Currency.rsc.mjs";import{RscDateTime as S,RscGtInternalDateTime as C}from"./components/variables/DateTime.rsc.mjs";import{RscGtInternalNum as w,RscNum as T}from"./components/variables/Num.rsc.mjs";import{RscGtInternalRelativeTime as E,RscRelativeTime as D}from"./components/variables/RelativeTime.rsc.mjs";import{renderDefaultChildren as O,renderPreparedT as k,renderTranslatedChildren as A,renderVariable as j}from"./utils/rendering/renderPipeline.rsc.mjs";import{RscT as M}from"./components/translation/T.rsc.mjs";import{RscTx as N}from"./components/translation/Tx.rsc.mjs";export{d as Branch,b as Currency,S as DateTime,p as Derive,f as GtInternalBranch,x as GtInternalCurrency,C as GtInternalDateTime,m as GtInternalDerive,w as GtInternalNum,v as GtInternalPlural,E as GtInternalRelativeTime,h as GtInternalVar,T as Num,y as Plural,D as RelativeTime,M as T,N as Tx,g as Var,l as createRenderPipeline,s as createRenderVariable,e as getFormatLocales,c as getPluralBranch,t as getReactI18nCache,i as getReadonlyConditionStore,a as getShouldTranslate,r as getTranslationsSnapshot,u as internalInitializeGTSRA,_ as prepareT,O as renderDefaultChildren,k as renderPreparedT,A as renderTranslatedChildren,j as renderVariable,n as setReactI18nCache,o as t};
@@ -1,2 +1,2 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../setup/i18nConfig.cjs`);let t=require(`generaltranslation/internal`),n=require(`gt-i18n/internal`);const{getConditionStore:r,setConditionStore:i,isConditionStoreInitialized:a}=(0,n.createConditionStoreSingleton)((0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`}));function o(){try{return r()}catch(r){let i=(0,n.getRuntimeEnvironment)(),a=e.getI18nConfig().getRenderStrategy(),o=(0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot access ConditionStore before it is initialized.`,details:(0,t.formatDiagnosticErrorDetails)(r),fix:a===`SPA`?`Initialize GT before reading GT runtime context.`:`Add a <GTProvider> at the root of your component tree.`,wayOut:i===`development`?void 0:a===`SPA`?`Request-specific values will fall back to the default configuration.`:`Request-specific values will fall back to the default configuration. This may cause hydration mismatches.`});if(i===`development`)throw Error(o);return console.error(o),{getLocale:()=>t.libraryDefaultLocale,getRegion:()=>void 0,getEnableI18n:()=>!0,setLocale:()=>{},setRegion:()=>{},setEnableI18n:()=>{}}}}exports.getReadonlyConditionStoreWithFallback=o,exports.isConditionStoreInitialized=a,exports.setConditionStore=i;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`gt-i18n/internal`),t=require(`generaltranslation/internal`);const{getConditionStore:n,setConditionStore:r,isConditionStoreInitialized:i}=(0,e.createConditionStoreSingleton)((0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`,fix:`Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.`}));exports.getConditionStore=n,exports.isConditionStoreInitialized=i;
2
2
  //# sourceMappingURL=singleton-operations.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"singleton-operations.cjs","names":["getI18nConfig","libraryDefaultLocale"],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import {\n createDiagnosticMessage,\n formatDiagnosticErrorDetails,\n libraryDefaultLocale,\n} from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n getRuntimeEnvironment,\n} from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\n/**\n * Opinionated decision: add a safety wrapper around the condition store to be more forgiving in production\n * TODO: perhaps this is how condition store should always be accessed\n */\nfunction getReadonlyConditionStoreWithFallback(): ReadonlyConditionStoreInterface {\n try {\n return getConditionStore();\n } catch (error) {\n // Error handling\n const runtimeEnvironment = getRuntimeEnvironment();\n const renderStrategy = getI18nConfig().getRenderStrategy();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot access ConditionStore before it is initialized.',\n details: formatDiagnosticErrorDetails(error),\n fix:\n renderStrategy === 'SPA'\n ? 'Initialize GT before reading GT runtime context.'\n : 'Add a <GTProvider> at the root of your component tree.',\n wayOut:\n runtimeEnvironment === 'development'\n ? undefined\n : renderStrategy === 'SPA'\n ? 'Request-specific values will fall back to the default configuration.'\n : 'Request-specific values will fall back to the default configuration. This may cause hydration mismatches.',\n });\n\n if (runtimeEnvironment === 'development') {\n throw new Error(errorMessage);\n } else {\n console.error(errorMessage);\n }\n\n // Fallback to default configuration (important: do not set globally)\n return {\n getLocale: () => libraryDefaultLocale,\n getRegion: () => undefined,\n getEnableI18n: () => true,\n setLocale: () => {},\n setRegion: () => {},\n setEnableI18n: () => {},\n };\n }\n}\n\nexport {\n getReadonlyConditionStoreWithFallback,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"mKAmBA,KAAM,CAAE,oBAAmB,oBAAmB,gCAAA,EAAA,EAAA,gCAAA,EAAA,EAAA,yBAPoB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACN,CAIoC,CAClC,CAMH,SAAS,GAAyE,CAChF,GAAI,CACF,OAAO,GAAmB,OACnB,EAAO,CAEd,IAAM,GAAA,EAAA,EAAA,wBAA4C,CAC5C,EAAiBA,EAAAA,eAAe,CAAC,mBAAmB,CACpD,GAAA,EAAA,EAAA,yBAAuC,CAC3C,OAAQ,iCACR,SAAU,QACV,aAAc,yDACd,SAAA,EAAA,EAAA,8BAAsC,EAAM,CAC5C,IACE,IAAmB,MACf,mDACA,yDACN,OACE,IAAuB,cACnB,IAAA,GACA,IAAmB,MACjB,uEACA,4GACT,CAAC,CAEF,GAAI,IAAuB,cACzB,MAAU,MAAM,EAAa,CAM/B,OAJE,QAAQ,MAAM,EAAa,CAItB,CACL,cAAiBC,EAAAA,qBACjB,cAAiB,IAAA,GACjB,kBAAqB,GACrB,cAAiB,GACjB,cAAiB,GACjB,kBAAqB,GACtB"}
1
+ {"version":3,"file":"singleton-operations.cjs","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createConditionStoreSingleton } from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n fix: 'Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\nexport {\n getConditionStore as getReadonlyConditionStore,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"wHAYA,KAAM,CAAE,oBAAmB,oBAAmB,gCAAA,EAAA,EAAA,gCAAA,EAAA,EAAA,yBARoB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACL,IAAK,gIACN,CAIoC,CAClC"}
@@ -1,12 +1,7 @@
1
1
  import { ReadonlyConditionStoreInterface } from "gt-i18n/internal/types";
2
2
 
3
3
  //#region src/condition-store/singleton-operations.d.ts
4
- declare const setConditionStore: (next: ReadonlyConditionStoreInterface) => void, isConditionStoreInitialized: () => boolean;
5
- /**
6
- * Opinionated decision: add a safety wrapper around the condition store to be more forgiving in production
7
- * TODO: perhaps this is how condition store should always be accessed
8
- */
9
- declare function getReadonlyConditionStoreWithFallback(): ReadonlyConditionStoreInterface;
4
+ declare const getConditionStore: () => ReadonlyConditionStoreInterface, setConditionStore: (next: ReadonlyConditionStoreInterface) => void, isConditionStoreInitialized: () => boolean;
10
5
  //#endregion
11
- export { getReadonlyConditionStoreWithFallback, setConditionStore };
6
+ export { getConditionStore };
12
7
  //# sourceMappingURL=singleton-operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"singleton-operations.d.ts","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"mappings":";;;cAmB2B,iBAAA,GAAiB,IAAA,EAAA,+BAAA,WAAE,2BAAA;;AAVgC;;;iBAmBrE,qCAAA,CAAA,GAAyC,+BAAA"}
1
+ {"version":3,"file":"singleton-operations.d.ts","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"mappings":";;;cAYQ,iBAAA,QAAiB,+BAAA,EAAE,iBAAA,GAAiB,IAAA,EAAA,+BAAA,WAAE,2BAAA"}
@@ -1,2 +1,2 @@
1
- import{getI18nConfig as e}from"../setup/i18nConfig.mjs";import{createDiagnosticMessage as t,formatDiagnosticErrorDetails as n,libraryDefaultLocale as r}from"generaltranslation/internal";import{createConditionStoreSingleton as i,getRuntimeEnvironment as a}from"gt-i18n/internal";const{getConditionStore:o,setConditionStore:s,isConditionStoreInitialized:c}=i(t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`}));function l(){try{return o()}catch(i){let o=a(),s=e().getRenderStrategy(),c=t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot access ConditionStore before it is initialized.`,details:n(i),fix:s===`SPA`?`Initialize GT before reading GT runtime context.`:`Add a <GTProvider> at the root of your component tree.`,wayOut:o===`development`?void 0:s===`SPA`?`Request-specific values will fall back to the default configuration.`:`Request-specific values will fall back to the default configuration. This may cause hydration mismatches.`});if(o===`development`)throw Error(c);return console.error(c),{getLocale:()=>r,getRegion:()=>void 0,getEnableI18n:()=>!0,setLocale:()=>{},setRegion:()=>{},setEnableI18n:()=>{}}}}export{l as getReadonlyConditionStoreWithFallback,c as isConditionStoreInitialized,s as setConditionStore};
1
+ import{createConditionStoreSingleton as e}from"gt-i18n/internal";import{createDiagnosticMessage as t}from"generaltranslation/internal";const{getConditionStore:n,setConditionStore:r,isConditionStoreInitialized:i}=e(t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GT runtime context before it has been initialized`,why:`The internal ConditionStore is unavailable`,fix:`Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.`}));export{n as getConditionStore,i as isConditionStoreInitialized};
2
2
  //# sourceMappingURL=singleton-operations.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"singleton-operations.mjs","names":["getI18nConfig"],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import {\n createDiagnosticMessage,\n formatDiagnosticErrorDetails,\n libraryDefaultLocale,\n} from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n getRuntimeEnvironment,\n} from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '../setup/i18nConfig';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\n/**\n * Opinionated decision: add a safety wrapper around the condition store to be more forgiving in production\n * TODO: perhaps this is how condition store should always be accessed\n */\nfunction getReadonlyConditionStoreWithFallback(): ReadonlyConditionStoreInterface {\n try {\n return getConditionStore();\n } catch (error) {\n // Error handling\n const runtimeEnvironment = getRuntimeEnvironment();\n const renderStrategy = getI18nConfig().getRenderStrategy();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot access ConditionStore before it is initialized.',\n details: formatDiagnosticErrorDetails(error),\n fix:\n renderStrategy === 'SPA'\n ? 'Initialize GT before reading GT runtime context.'\n : 'Add a <GTProvider> at the root of your component tree.',\n wayOut:\n runtimeEnvironment === 'development'\n ? undefined\n : renderStrategy === 'SPA'\n ? 'Request-specific values will fall back to the default configuration.'\n : 'Request-specific values will fall back to the default configuration. This may cause hydration mismatches.',\n });\n\n if (runtimeEnvironment === 'development') {\n throw new Error(errorMessage);\n } else {\n console.error(errorMessage);\n }\n\n // Fallback to default configuration (important: do not set globally)\n return {\n getLocale: () => libraryDefaultLocale,\n getRegion: () => undefined,\n getEnableI18n: () => true,\n setLocale: () => {},\n setRegion: () => {},\n setEnableI18n: () => {},\n };\n }\n}\n\nexport {\n getReadonlyConditionStoreWithFallback,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"sRAmBA,KAAM,CAAE,oBAAmB,oBAAmB,+BAC5C,EARwC,EAAwB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACN,CAIoC,CAClC,CAMH,SAAS,GAAyE,CAChF,GAAI,CACF,OAAO,GAAmB,OACnB,EAAO,CAEd,IAAM,EAAqB,GAAuB,CAC5C,EAAiBA,GAAe,CAAC,mBAAmB,CACpD,EAAe,EAAwB,CAC3C,OAAQ,iCACR,SAAU,QACV,aAAc,yDACd,QAAS,EAA6B,EAAM,CAC5C,IACE,IAAmB,MACf,mDACA,yDACN,OACE,IAAuB,cACnB,IAAA,GACA,IAAmB,MACjB,uEACA,4GACT,CAAC,CAEF,GAAI,IAAuB,cACzB,MAAU,MAAM,EAAa,CAM/B,OAJE,QAAQ,MAAM,EAAa,CAItB,CACL,cAAiB,EACjB,cAAiB,IAAA,GACjB,kBAAqB,GACrB,cAAiB,GACjB,cAAiB,GACjB,kBAAqB,GACtB"}
1
+ {"version":3,"file":"singleton-operations.mjs","names":[],"sources":["../../src/condition-store/singleton-operations.ts"],"sourcesContent":["import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createConditionStoreSingleton } from 'gt-i18n/internal';\nimport type { ReadonlyConditionStoreInterface } from 'gt-i18n/internal/types';\n\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'The internal ConditionStore is unavailable',\n fix: 'Call initializeGT() during setup (gt-next runs this automatically) and add a <GTProvider> at the root of your component tree.',\n});\n\nconst { getConditionStore, setConditionStore, isConditionStoreInitialized } =\n createConditionStoreSingleton<ReadonlyConditionStoreInterface>(\n conditionStoreNotInitializedError\n );\n\nexport {\n getConditionStore as getReadonlyConditionStore,\n setConditionStore as setReadonlyConditionStore,\n isConditionStoreInitialized as isReadonlyConditionStoreInitialized,\n};\n"],"mappings":"uIAYA,KAAM,CAAE,oBAAmB,oBAAmB,+BAC5C,EATwC,EAAwB,CAChE,OAAQ,iCACR,SAAU,QACV,aAAc,gEACd,IAAK,6CACL,IAAK,gIACN,CAIoC,CAClC"}
@@ -1,2 +1,2 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./context.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`);const r=e.getGTContext();function i({children:e,translations:i,dictionaries:a,conditionStore:o,i18nStore:s,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}){let d=(0,t.useMemo)(()=>({translationsSnapshot:i,dictionariesSnapshot:a??{},i18nStore:s,conditionStore:o,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}),[i,a,s,o,c,l,u]);return(0,t.useEffect)(()=>{s.updateTranslations(i),s.updateDictionaries(a??{})},[i,a,s]),(0,n.jsx)(r.Provider,{value:d,children:e})}exports.InternalGTProvider=i;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./context.cjs`);let t=require(`react/jsx-runtime`),n=require(`react`);const r=e.getGTContext();function i({children:e,translations:i,dictionaries:a,conditionStore:o,i18nStore:s,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}){let d=(0,n.useMemo)(()=>({translationsSnapshot:i,dictionariesSnapshot:a??{},i18nStore:s,conditionStore:o,onMissingTranslation:c,onMissingDictionaryEntry:l,onMissingDictionaryObj:u}),[i,a,s,o,c,l,u]);return(0,n.useEffect)(()=>{s.updateTranslations(i),s.updateDictionaries(a??{})},[i,a,s]),(0,t.jsx)(r.Provider,{value:d,children:e})}exports.InternalGTProvider=i;
2
2
  //# sourceMappingURL=InternalGTProvider.cjs.map
@@ -1,2 +1,2 @@
1
- import{getGTContext as e}from"./context.mjs";import{useEffect as t,useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=e();function a({children:e,translations:a,dictionaries:o,conditionStore:s,i18nStore:c,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}){let f=n(()=>({translationsSnapshot:a,dictionariesSnapshot:o??{},i18nStore:c,conditionStore:s,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}),[a,o,c,s,l,u,d]);return t(()=>{c.updateTranslations(a),c.updateDictionaries(o??{})},[a,o,c]),r(i.Provider,{value:f,children:e})}export{a as InternalGTProvider};
1
+ import{getGTContext as e}from"./context.mjs";import{jsx as t}from"react/jsx-runtime";import{useEffect as n,useMemo as r}from"react";const i=e();function a({children:e,translations:a,dictionaries:o,conditionStore:s,i18nStore:c,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}){let f=r(()=>({translationsSnapshot:a,dictionariesSnapshot:o??{},i18nStore:c,conditionStore:s,onMissingTranslation:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}),[a,o,c,s,l,u,d]);return n(()=>{c.updateTranslations(a),c.updateDictionaries(o??{})},[a,o,c]),t(i.Provider,{value:f,children:e})}export{a as InternalGTProvider};
2
2
  //# sourceMappingURL=InternalGTProvider.mjs.map
@@ -1,2 +1,2 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../setup/i18nConfig.cjs`);let t=require(`generaltranslation/internal`),n=require(`react`);const r=(0,require(`gt-i18n/internal`).createGlobalSingleton)({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>`GTContext has not been initialized.`});function i(){return r.isInitialized()||r.set((0,n.createContext)(void 0)),r.get()}function a(){let t=(0,n.useContext)(i());if(t||e.getI18nConfig().getRenderStrategy()===`SPA`)return t;throw Error(o())}function o(){return(0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}exports.getGTContext=i,exports.useGTContext=a;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../setup/i18nConfig.cjs`);let t=require(`gt-i18n/internal`),n=require(`generaltranslation/internal`),r=require(`react`);const i=(0,t.createGlobalSingleton)({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>(0,n.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GTContext before it has been initialized`,why:`the internal GTContext singleton is unavailable`,fix:`Add a <GTProvider> at the root of your component tree.`})});function a(){return i.isInitialized()||i.set((0,r.createContext)(void 0)),i.get()}function o(){let t=(0,r.useContext)(a());if(t||e.getI18nConfig().getRenderStrategy()===`SPA`)return t;throw Error(s())}function s(){return(0,n.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}exports.getGTContext=a,exports.useGTContext=o;
2
2
  //# sourceMappingURL=context.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () => 'GTContext has not been initialized.',\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"wJA6CA,MAAM,GAAA,6BAAA,CAAA,uBAEJ,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBAAsB,sCACvB,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,KAAA,EAAA,EAAA,eAA6C,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,GAAA,EAAA,EAAA,YAAqB,GAAc,CAAC,CAC1C,GAAI,GAAWA,EAAAA,eAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAA,EAAA,EAAA,yBAA+B,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
1
+ {"version":3,"file":"context.cjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GTContext before it has been initialized',\n why: 'the internal GTContext singleton is unavailable',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n }),\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"sLA6CA,MAAM,GAAA,EAAA,EAAA,uBAEJ,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,oBAAA,EAAA,EAAA,yBAC0B,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,uDACd,IAAK,kDACL,IAAK,yDACN,CAAC,CACL,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,KAAA,EAAA,EAAA,eAA6C,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,GAAA,EAAA,EAAA,YAAqB,GAAc,CAAC,CAC1C,GAAI,GAAWA,EAAAA,eAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAA,EAAA,EAAA,yBAA+B,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
@@ -1,2 +1,2 @@
1
- import{getI18nConfig as e}from"../setup/i18nConfig.mjs";import{createDiagnosticMessage as t}from"generaltranslation/internal";import{createContext as n,useContext as r}from"react";import{createGlobalSingleton as i}from"gt-i18n/internal";const a=i({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>`GTContext has not been initialized.`});function o(){return a.isInitialized()||a.set(n(void 0)),a.get()}function s(){let t=r(o());if(t||e().getRenderStrategy()===`SPA`)return t;throw Error(c())}function c(){return t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}export{o as getGTContext,s as useGTContext};
1
+ import{getI18nConfig as e}from"../setup/i18nConfig.mjs";import{createGlobalSingleton as t}from"gt-i18n/internal";import{createDiagnosticMessage as n}from"generaltranslation/internal";import{createContext as r,useContext as i}from"react";const a=t({namespace:`reactCore`,key:`gtContext`,source:`@generaltranslation/react-core`,notInitialized:()=>n({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read GTContext before it has been initialized`,why:`the internal GTContext singleton is unavailable`,fix:`Add a <GTProvider> at the root of your component tree.`})});function o(){return a.isInitialized()||a.set(r(void 0)),a.get()}function s(){let t=i(o());if(t||e().getRenderStrategy()===`SPA`)return t;throw Error(c())}function c(){return n({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`GT runtime context could not be read`,why:`GTContext was accessed outside of a <GTProvider>`,fix:`Add a <GTProvider> at the root of your component tree.`})}export{o as getGTContext,s as useGTContext};
2
2
  //# sourceMappingURL=context.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.mjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () => 'GTContext has not been initialized.',\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"6OA6CA,MAAM,EAAqB,EAEzB,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBAAsB,sCACvB,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,IAAI,EAAyC,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,EAAU,EAAW,GAAc,CAAC,CAC1C,GAAI,GAAWA,GAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAO,EAAwB,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
1
+ {"version":3,"file":"context.mjs","names":["getI18nConfig"],"sources":["../../src/context/context.ts"],"sourcesContent":["import {\n Dictionary,\n Hash,\n Locale,\n ReadonlyConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport { Translation } from 'gt-i18n/types';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\nimport { createGlobalSingleton } from 'gt-i18n/internal';\nimport { createContext, useContext, type Context } from 'react';\nimport { I18nStore } from '../i18n-store/I18nStore';\nimport { getI18nConfig } from '../setup/i18nConfig';\nimport type {\n OnMissingTranslation,\n OnMissingDictionaryEntry,\n OnMissingDictionaryObj,\n} from '../hooks/utils/missing-translation';\n\nexport type GTContextType = {\n /**\n * Source of truth for translations, streamed from server\n * In SPA mode, these won't be accessible and translations\n * can be accessed via useSyncExternalStore() directly\n */\n translationsSnapshot: Record<Locale, Record<Hash, Translation>>;\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * I18nStore allows us to sync state updates in ConditionStore and I18nCache\n * with renders\n */\n i18nStore: I18nStore;\n /**\n * ConditionStore should always remain separate from i18nStore as\n * it manages how we perform lookups\n */\n conditionStore: ReadonlyConditionStoreInterface;\n /**\n * Custom override behavior on missing translations\n * Used for server triggering tx hmr b/c no access to useEffect\n */\n onMissingTranslation?: OnMissingTranslation;\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst gtContextSingleton = createGlobalSingleton<\n Context<GTContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'gtContext',\n source: '@generaltranslation/react-core',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'Cannot read GTContext before it has been initialized',\n why: 'the internal GTContext singleton is unavailable',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n }),\n});\n\nexport function getGTContext(): Context<GTContextType | undefined> {\n // Lazily create the React context once and share it across instances.\n if (!gtContextSingleton.isInitialized()) {\n gtContextSingleton.set(createContext<GTContextType | undefined>(undefined));\n }\n return gtContextSingleton.get();\n}\n\nexport function useGTContext(): GTContextType | undefined {\n const context = useContext(getGTContext());\n if (context || getI18nConfig().getRenderStrategy() === 'SPA') {\n return context;\n }\n /**\n * TODO: in a separate PR, we should figure out how to make this more of a forgiving system\n */\n throw new Error(createMissingGTProviderError());\n}\n\nfunction createMissingGTProviderError(): string {\n return createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened: 'GT runtime context could not be read',\n why: 'GTContext was accessed outside of a <GTProvider>',\n fix: 'Add a <GTProvider> at the root of your component tree.',\n });\n}\n"],"mappings":"6OA6CA,MAAM,EAAqB,EAEzB,CACA,UAAW,YACX,IAAK,YACL,OAAQ,iCACR,mBACE,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aAAc,uDACd,IAAK,kDACL,IAAK,yDACN,CAAC,CACL,CAAC,CAEF,SAAgB,GAAmD,CAKjE,OAHK,EAAmB,eAAe,EACrC,EAAmB,IAAI,EAAyC,IAAA,GAAU,CAAC,CAEtE,EAAmB,KAAK,CAGjC,SAAgB,GAA0C,CACxD,IAAM,EAAU,EAAW,GAAc,CAAC,CAC1C,GAAI,GAAWA,GAAe,CAAC,mBAAmB,GAAK,MACrD,OAAO,EAKT,MAAU,MAAM,GAA8B,CAAC,CAGjD,SAAS,GAAuC,CAC9C,OAAO,EAAwB,CAC7B,OAAQ,iCACR,SAAU,QACV,aAAc,uCACd,IAAK,mDACL,IAAK,yDACN,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../i18n-cache/singleton-operations.cjs`),t=require(`../../setup/i18nConfig.cjs`),n=require(`../../condition-store/singleton-operations.cjs`),r=require(`../../hooks/utils/getShouldTranslate.cjs`);let i=require(`generaltranslation/internal`),a=require(`gt-i18n/internal`);const o=(e,...t)=>{if(d(e),typeof e==`string`){let n=t.at(0);return s(n?.$locale??f(),e,n)}return c(e,t)};function s(n,i,o={}){let s=e.getReactI18nCache(),c=t.getI18nConfig().getDefaultLocale();if(!r.getShouldTranslate())return(0,a.interpolateMessage)({options:o,source:i,sourceLocale:c});let l=(0,a.createLookupOptions)(n,o,`ICU`);return(0,a.interpolateMessage)({source:i,target:s.lookupTranslation(l.$locale,i,l),options:l,sourceLocale:c})}function c(t,n){let r=f(),i=u(t,n),a=e.getReactI18nCache().lookupTranslation(r,i,{$format:`STRING`});if(a)return a;let{message:o,variables:c}=l(t,n);return s(r,o,c)}function l(e,t){let n=[],r={},i=0;for(let a=0;a<e.length;a++)if(n.push(e[a]),a<t.length){let e=i.toString();n.push(`{${e}}`),r[e]=t[a],i++}return{message:n.join(``),variables:r}}function u(e,t){return e.map((e,n)=>e+(t[n]??``)).join(``)}function d(e){let r=t.getI18nConfig().getRenderStrategy()===`server-render`,o=!n.isConditionStoreInitialized();if(!r||!o)return;let s=typeof e==`string`?e:e.join(``),c=(0,i.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Using the t() function at the module level is forbidden in server-rendered applications.`,fix:`Either move the t() invocation into a request-time scope or register the string with the msg() function and translate with an m() function. Ensure that you have added the <GTProvider> at the root of your component tree.`,wayOut:(0,a.getRuntimeEnvironment)()===`development`?void 0:`Falling back to defaultLocale value.`,details:`Message: "${s}"`});if((0,a.getRuntimeEnvironment)()===`development`)throw Error(c);console.error(c)}function f(){return n.getReadonlyConditionStoreWithFallback().getLocale()}exports.t=o;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../i18n-cache/singleton-operations.cjs`),t=require(`../../setup/i18nConfig.cjs`),n=require(`../../condition-store/singleton-operations.cjs`),r=require(`../../hooks/utils/getShouldTranslate.cjs`);let i=require(`gt-i18n/internal`),a=require(`generaltranslation/internal`);const o=(e,...t)=>{if(d(e),typeof e==`string`){let n=t.at(0),r=n?.$locale??f();return s(r,e,(0,i.createLookupOptions)(r,n??{},`ICU`))}return c(e,t)};function s(n,a,o={}){let s=e.getReactI18nCache(),c=t.getI18nConfig().getDefaultLocale();if(!r.getShouldTranslate())return(0,i.interpolateMessage)({options:o,source:a,sourceLocale:c});let l=(0,i.createLookupOptions)(n,o,`ICU`);return(0,i.interpolateMessage)({source:a,target:s.lookupTranslation(l.$locale,a,l),options:l,sourceLocale:c})}function c(t,n){let r=f(),i=u(t,n),a=e.getReactI18nCache().lookupTranslation(r,i,{$format:`STRING`});if(a)return a;let{message:o,variables:c}=l(t,n);return s(r,o,c)}function l(e,t){let n=[],r={},i=0;for(let a=0;a<e.length;a++)if(n.push(e[a]),a<t.length){let e=i.toString();n.push(`{${e}}`),r[e]=t[a],i++}return{message:n.join(``),variables:r}}function u(e,t){return e.map((e,n)=>e+(t[n]??``)).join(``)}function d(e){let r=t.getI18nConfig().getRenderStrategy()===`server-render`,o=!n.isConditionStoreInitialized();if(!r||!o)return;let s=typeof e==`string`?e:e.join(``),c=(0,a.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Using the t() function at the module level is forbidden in server-rendered applications.`,fix:`Either move the t() invocation into a request-time scope or register the string with the msg() function and translate with an m() function. Ensure that you have added the <GTProvider> at the root of your component tree.`,wayOut:(0,i.getRuntimeEnvironment)()===`development`?void 0:`Falling back to defaultLocale value.`,details:`Message: "${s}"`});if((0,i.getRuntimeEnvironment)()===`development`)throw Error(c);console.error(c)}function f(){return n.getConditionStore().getLocale()}exports.t=o;
2
2
  //# sourceMappingURL=t.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"t.cjs","names":["getReactI18nCache","getI18nConfig","getShouldTranslate","isReadonlyConditionStoreInitialized","getReadonlyConditionStoreWithFallback"],"sources":["../../../src/functions/translation/t.ts"],"sourcesContent":["import {\n createLookupOptions,\n getRuntimeEnvironment,\n interpolateMessage,\n} from 'gt-i18n/internal';\nimport type { GTTranslationOptions, LookupOptionsFor } from 'gt-i18n/types';\nimport { getI18nConfig } from '../../setup/i18nConfig';\nimport {\n getReadonlyConditionStoreWithFallback,\n isReadonlyConditionStoreInitialized,\n} from '../../condition-store/singleton-operations';\nimport { StringContent, StringFormat } from 'generaltranslation/types';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { getShouldTranslate } from '../../hooks/utils/getShouldTranslate';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\n/**\n * Translate a message\n * @param {string} message - The message to translate.\n * @param {GTTranslationOptions} [options] - The options for the translation.\n * @returns {string} The translated message.\n *\n * @example\n * t('Hello, world!'); // Translates 'Hello, world!'\n *\n * @example\n * t('Hello, {name}!', { name: 'John' }); // Translates 'Hello, John!'\n *\n * @example\n * t`Hello, ${name}` // Translate via tagged template literal\n *\n */\nexport const t: StringOrTemplateSyncResolutionFunction = (\n messageOrStrings: string | TemplateStringsArray,\n ...values: unknown[]\n) => {\n // Warnings and errors\n enforceSSRRules(messageOrStrings);\n\n // t(\"Hello, {name}!\", { name: \"John\" })\n if (typeof messageOrStrings === 'string') {\n const options = values.at(0) as GTTranslationOptions | undefined;\n const locale = options?.$locale ?? getLocale();\n return resolveStringContent(locale, messageOrStrings, options);\n }\n\n // t`Hello, ${name}`\n return handleTaggedTemplateLiteralTranslation(messageOrStrings, values);\n};\n\n// ----- Helper Functions ----- //\n\nexport function resolveStringContent(\n locale: string,\n content: StringContent,\n options: LookupOptionsFor<StringFormat> = {}\n): StringContent {\n const i18nCache = getReactI18nCache();\n const defaultLocale = getI18nConfig().getDefaultLocale();\n if (!getShouldTranslate()) {\n return interpolateMessage({\n options,\n source: content,\n sourceLocale: defaultLocale,\n });\n }\n\n const lookupOptions = createLookupOptions(locale, options, 'ICU');\n const translation = i18nCache.lookupTranslation(\n lookupOptions.$locale,\n content,\n lookupOptions\n );\n return interpolateMessage({\n source: content,\n target: translation,\n options: lookupOptions,\n sourceLocale: defaultLocale,\n });\n}\n\n/**\n * Handle tagged template literal translation\n * @param messageOrStrings - The message or strings to translate.\n * @param values - The values to interpolate.\n * @returns The translated message.\n *\n * This is triggered when there has been no compiler transformation\n *\n * Try looking up interpolated template first\n * If not found, resolve uninterpolated message\n */\nfunction handleTaggedTemplateLiteralTranslation(\n messageOrStrings: TemplateStringsArray,\n values: unknown[]\n): string {\n const locale = getLocale();\n // for tagged template literals, there has been no compiler transformation\n // (1) lookup interpolated template (aka derived message)\n const interpolatedTemplate = interpolateTemplateLiteral(\n messageOrStrings,\n values\n );\n const i18nCache = getReactI18nCache();\n const translatedInterpolatedTemplate = i18nCache.lookupTranslation(\n locale,\n interpolatedTemplate,\n { $format: 'STRING' }\n );\n if (translatedInterpolatedTemplate) return translatedInterpolatedTemplate;\n\n // (2) resolve uninterpolated message\n const { message, variables } = extractInterpolatableValues(\n messageOrStrings,\n values\n );\n return resolveStringContent(locale, message, variables);\n}\n\n/**\n * Given a TemplateStringsArray, and values, return the uninterpolated message and variables.\n * @param strings - The template strings.\n * @param values - The values to interpolate.\n * @returns The interpolated message and variables.\n */\nfunction extractInterpolatableValues(\n strings: TemplateStringsArray,\n values: unknown[]\n): {\n message: string;\n variables: Record<string, unknown>;\n} {\n // String parts\n const parts: string[] = [];\n // Variables\n const variables: Record<string, unknown> = {};\n let varIndex = 0;\n\n for (let i = 0; i < strings.length; i++) {\n // Add the cooked text from the quasi (use cooked to handle escape sequences)\n parts.push(strings[i]);\n\n // If there's a corresponding expression, create a variable placeholder\n if (i < values.length) {\n const key = varIndex.toString();\n parts.push(`{${key}}`);\n variables[key] = values[i];\n varIndex++;\n }\n }\n\n return {\n message: parts.join(''),\n variables,\n };\n}\n\n/**\n * Interpolate a template literal\n * @param message - The message to interpolate.\n * @param variables - The variables to interpolate.\n * @returns The interpolated message.\n */\nfunction interpolateTemplateLiteral(\n strings: TemplateStringsArray,\n values: unknown[]\n): string {\n return strings\n .map((string, index) => {\n return string + (values[index] ?? '');\n })\n .join('');\n}\n\n/**\n * Module-level t() only works for SPA.\n * We have to error or fallback in SSR.\n */\nfunction enforceSSRRules(messageOrStrings: string | TemplateStringsArray) {\n const ssrEnabled = getI18nConfig().getRenderStrategy() === 'server-render';\n const moduleLevel = !isReadonlyConditionStoreInitialized();\n if (!ssrEnabled || !moduleLevel) return;\n\n const message =\n typeof messageOrStrings === 'string'\n ? messageOrStrings\n : messageOrStrings.join('');\n const runtimeEnvironment = getRuntimeEnvironment();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'Using the t() function at the module level is forbidden in server-rendered applications.',\n fix: 'Either move the t() invocation into a request-time scope or register the string with the msg() function and translate with an m() function. Ensure that you have added the <GTProvider> at the root of your component tree.',\n wayOut:\n runtimeEnvironment === 'development'\n ? undefined\n : 'Falling back to defaultLocale value.',\n details: `Message: \"${message}\"`,\n });\n if (getRuntimeEnvironment() === 'development') {\n throw new Error(errorMessage);\n } else {\n console.error(errorMessage);\n }\n}\n\nfunction getLocale(): string {\n return getReadonlyConditionStoreWithFallback().getLocale();\n}\n\n/**\n * Overloaded type for the `t` function.\n * - Tagged template: t`Hello, ${name}` (transformed by the compiler plugin at build time)\n * - Function call: t(\"Hello, {name}\", { name: \"John\" })\n *\n * {@link TemplateSyncResolutionFunction}\n * {@link SyncResolutionFunction}\n */\ninterface StringOrTemplateSyncResolutionFunction {\n (strings: TemplateStringsArray, ...values: unknown[]): string;\n (message: string, options?: GTTranslationOptions): string;\n}\n\n/**\n * Type for the `t` function when used as a tagged template literal.\n * @param strings - The template strings.\n * @param values - The values to interpolate.\n * @returns The translated message.\n */\ntype TemplateSyncResolutionFunction = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n) => string;\n"],"mappings":"kVAgCA,MAAa,GACX,EACA,GAAG,IACA,CAKH,GAHA,EAAgB,EAAiB,CAG7B,OAAO,GAAqB,SAAU,CACxC,IAAM,EAAU,EAAO,GAAG,EAAE,CAE5B,OAAO,EADQ,GAAS,SAAW,GAAW,CACV,EAAkB,EAAQ,CAIhE,OAAO,EAAuC,EAAkB,EAAO,EAKzE,SAAgB,EACd,EACA,EACA,EAA0C,EAAE,CAC7B,CACf,IAAM,EAAYA,EAAAA,mBAAmB,CAC/B,EAAgBC,EAAAA,eAAe,CAAC,kBAAkB,CACxD,GAAI,CAACC,EAAAA,oBAAoB,CACvB,OAAA,EAAA,EAAA,oBAA0B,CACxB,UACA,OAAQ,EACR,aAAc,EACf,CAAC,CAGJ,IAAM,GAAA,EAAA,EAAA,qBAAoC,EAAQ,EAAS,MAAM,CAMjE,OAAA,EAAA,EAAA,oBAA0B,CACxB,OAAQ,EACR,OAPkB,EAAU,kBAC5B,EAAc,QACd,EACA,EAImB,CACnB,QAAS,EACT,aAAc,EACf,CAAC,CAcJ,SAAS,EACP,EACA,EACQ,CACR,IAAM,EAAS,GAAW,CAGpB,EAAuB,EAC3B,EACA,EACD,CAEK,EADYF,EAAAA,mBAC8B,CAAC,kBAC/C,EACA,EACA,CAAE,QAAS,SAAU,CACtB,CACD,GAAI,EAAgC,OAAO,EAG3C,GAAM,CAAE,UAAS,aAAc,EAC7B,EACA,EACD,CACD,OAAO,EAAqB,EAAQ,EAAS,EAAU,CASzD,SAAS,EACP,EACA,EAIA,CAEA,IAAM,EAAkB,EAAE,CAEpB,EAAqC,EAAE,CACzC,EAAW,EAEf,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAKlC,GAHA,EAAM,KAAK,EAAQ,GAAG,CAGlB,EAAI,EAAO,OAAQ,CACrB,IAAM,EAAM,EAAS,UAAU,CAC/B,EAAM,KAAK,IAAI,EAAI,GAAG,CACtB,EAAU,GAAO,EAAO,GACxB,IAIJ,MAAO,CACL,QAAS,EAAM,KAAK,GAAG,CACvB,YACD,CASH,SAAS,EACP,EACA,EACQ,CACR,OAAO,EACJ,KAAK,EAAQ,IACL,GAAU,EAAO,IAAU,IAClC,CACD,KAAK,GAAG,CAOb,SAAS,EAAgB,EAAiD,CACxE,IAAM,EAAaC,EAAAA,eAAe,CAAC,mBAAmB,GAAK,gBACrD,EAAc,CAACE,EAAAA,6BAAqC,CAC1D,GAAI,CAAC,GAAc,CAAC,EAAa,OAEjC,IAAM,EACJ,OAAO,GAAqB,SACxB,EACA,EAAiB,KAAK,GAAG,CAEzB,GAAA,EAAA,EAAA,yBAAuC,CAC3C,OAAQ,iCACR,SAAU,QACV,aACE,2FACF,IAAK,8NACL,QAAA,EAAA,EAAA,wBACoB,GAAK,cACnB,IAAA,GACA,uCACN,QAAS,aAAa,EAAQ,GAC/B,CAAC,CACF,IAAA,EAAA,EAAA,wBAA2B,GAAK,cAC9B,MAAU,MAAM,EAAa,CAE7B,QAAQ,MAAM,EAAa,CAI/B,SAAS,GAAoB,CAC3B,OAAOC,EAAAA,uCAAuC,CAAC,WAAW"}
1
+ {"version":3,"file":"t.cjs","names":["getReactI18nCache","getI18nConfig","getShouldTranslate","isReadonlyConditionStoreInitialized","getReadonlyConditionStore"],"sources":["../../../src/functions/translation/t.ts"],"sourcesContent":["import {\n createLookupOptions,\n getRuntimeEnvironment,\n interpolateMessage,\n} from 'gt-i18n/internal';\nimport type { GTTranslationOptions } from 'gt-i18n/types';\nimport type { LookupOptionsFor } from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '../../setup/i18nConfig';\nimport {\n getReadonlyConditionStore,\n isReadonlyConditionStoreInitialized,\n} from '../../condition-store/singleton-operations';\nimport { StringContent, StringFormat } from 'generaltranslation/types';\nimport { getReactI18nCache } from '../../i18n-cache/singleton-operations';\nimport { getShouldTranslate } from '../../hooks/utils/getShouldTranslate';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\n/**\n * Translate a message\n * @param {string} message - The message to translate.\n * @param {GTTranslationOptions} [options] - The options for the translation.\n * @returns {string} The translated message.\n *\n * @example\n * t('Hello, world!'); // Translates 'Hello, world!'\n *\n * @example\n * t('Hello, {name}!', { name: 'John' }); // Translates 'Hello, John!'\n *\n * @example\n * t`Hello, ${name}` // Translate via tagged template literal\n *\n */\nexport const t: StringOrTemplateSyncResolutionFunction = (\n messageOrStrings: string | TemplateStringsArray,\n ...values: unknown[]\n) => {\n // Warnings and errors\n enforceSSRRules(messageOrStrings);\n\n // t(\"Hello, {name}!\", { name: \"John\" })\n if (typeof messageOrStrings === 'string') {\n const options = values.at(0) as GTTranslationOptions | undefined;\n const locale = options?.$locale ?? getLocale();\n return resolveStringContent(\n locale,\n messageOrStrings,\n createLookupOptions(locale, options ?? {}, 'ICU')\n );\n }\n\n // t`Hello, ${name}`\n return handleTaggedTemplateLiteralTranslation(messageOrStrings, values);\n};\n\n// ----- Helper Functions ----- //\n\nexport function resolveStringContent(\n locale: string,\n content: StringContent,\n options: LookupOptionsFor<StringFormat> = {}\n): StringContent {\n const i18nCache = getReactI18nCache();\n const defaultLocale = getI18nConfig().getDefaultLocale();\n if (!getShouldTranslate()) {\n return interpolateMessage({\n options,\n source: content,\n sourceLocale: defaultLocale,\n });\n }\n\n const lookupOptions = createLookupOptions(locale, options, 'ICU');\n const translation = i18nCache.lookupTranslation(\n lookupOptions.$locale,\n content,\n lookupOptions\n );\n return interpolateMessage({\n source: content,\n target: translation,\n options: lookupOptions,\n sourceLocale: defaultLocale,\n });\n}\n\n/**\n * Handle tagged template literal translation\n * @param messageOrStrings - The message or strings to translate.\n * @param values - The values to interpolate.\n * @returns The translated message.\n *\n * This is triggered when there has been no compiler transformation\n *\n * Try looking up interpolated template first\n * If not found, resolve uninterpolated message\n */\nfunction handleTaggedTemplateLiteralTranslation(\n messageOrStrings: TemplateStringsArray,\n values: unknown[]\n): string {\n const locale = getLocale();\n // for tagged template literals, there has been no compiler transformation\n // (1) lookup interpolated template (aka derived message)\n const interpolatedTemplate = interpolateTemplateLiteral(\n messageOrStrings,\n values\n );\n const i18nCache = getReactI18nCache();\n const translatedInterpolatedTemplate = i18nCache.lookupTranslation(\n locale,\n interpolatedTemplate,\n { $format: 'STRING' }\n );\n if (translatedInterpolatedTemplate) return translatedInterpolatedTemplate;\n\n // (2) resolve uninterpolated message\n const { message, variables } = extractInterpolatableValues(\n messageOrStrings,\n values\n );\n return resolveStringContent(locale, message, variables);\n}\n\n/**\n * Given a TemplateStringsArray, and values, return the uninterpolated message and variables.\n * @param strings - The template strings.\n * @param values - The values to interpolate.\n * @returns The interpolated message and variables.\n */\nfunction extractInterpolatableValues(\n strings: TemplateStringsArray,\n values: unknown[]\n): {\n message: string;\n variables: Record<string, unknown>;\n} {\n // String parts\n const parts: string[] = [];\n // Variables\n const variables: Record<string, unknown> = {};\n let varIndex = 0;\n\n for (let i = 0; i < strings.length; i++) {\n // Add the cooked text from the quasi (use cooked to handle escape sequences)\n parts.push(strings[i]);\n\n // If there's a corresponding expression, create a variable placeholder\n if (i < values.length) {\n const key = varIndex.toString();\n parts.push(`{${key}}`);\n variables[key] = values[i];\n varIndex++;\n }\n }\n\n return {\n message: parts.join(''),\n variables,\n };\n}\n\n/**\n * Interpolate a template literal\n * @param message - The message to interpolate.\n * @param variables - The variables to interpolate.\n * @returns The interpolated message.\n */\nfunction interpolateTemplateLiteral(\n strings: TemplateStringsArray,\n values: unknown[]\n): string {\n return strings\n .map((string, index) => {\n return string + (values[index] ?? '');\n })\n .join('');\n}\n\n/**\n * Module-level t() only works for SPA.\n * We have to error or fallback in SSR.\n */\nfunction enforceSSRRules(messageOrStrings: string | TemplateStringsArray) {\n const ssrEnabled = getI18nConfig().getRenderStrategy() === 'server-render';\n const moduleLevel = !isReadonlyConditionStoreInitialized();\n if (!ssrEnabled || !moduleLevel) return;\n\n const message =\n typeof messageOrStrings === 'string'\n ? messageOrStrings\n : messageOrStrings.join('');\n const runtimeEnvironment = getRuntimeEnvironment();\n const errorMessage = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'Using the t() function at the module level is forbidden in server-rendered applications.',\n fix: 'Either move the t() invocation into a request-time scope or register the string with the msg() function and translate with an m() function. Ensure that you have added the <GTProvider> at the root of your component tree.',\n wayOut:\n runtimeEnvironment === 'development'\n ? undefined\n : 'Falling back to defaultLocale value.',\n details: `Message: \"${message}\"`,\n });\n if (getRuntimeEnvironment() === 'development') {\n throw new Error(errorMessage);\n } else {\n console.error(errorMessage);\n }\n}\n\nfunction getLocale(): string {\n return getReadonlyConditionStore().getLocale();\n}\n\n/**\n * Overloaded type for the `t` function.\n * - Tagged template: t`Hello, ${name}` (transformed by the compiler plugin at build time)\n * - Function call: t(\"Hello, {name}\", { name: \"John\" })\n *\n * {@link TemplateSyncResolutionFunction}\n * {@link SyncResolutionFunction}\n */\ninterface StringOrTemplateSyncResolutionFunction {\n (strings: TemplateStringsArray, ...values: unknown[]): string;\n (message: string, options?: GTTranslationOptions): string;\n}\n\n/**\n * Type for the `t` function when used as a tagged template literal.\n * @param strings - The template strings.\n * @param values - The values to interpolate.\n * @returns The translated message.\n */\ntype TemplateSyncResolutionFunction = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n) => string;\n"],"mappings":"kVAiCA,MAAa,GACX,EACA,GAAG,IACA,CAKH,GAHA,EAAgB,EAAiB,CAG7B,OAAO,GAAqB,SAAU,CACxC,IAAM,EAAU,EAAO,GAAG,EAAE,CACtB,EAAS,GAAS,SAAW,GAAW,CAC9C,OAAO,EACL,EACA,GAAA,EAAA,EAAA,qBACoB,EAAQ,GAAW,EAAE,CAAE,MAAM,CAClD,CAIH,OAAO,EAAuC,EAAkB,EAAO,EAKzE,SAAgB,EACd,EACA,EACA,EAA0C,EAAE,CAC7B,CACf,IAAM,EAAYA,EAAAA,mBAAmB,CAC/B,EAAgBC,EAAAA,eAAe,CAAC,kBAAkB,CACxD,GAAI,CAACC,EAAAA,oBAAoB,CACvB,OAAA,EAAA,EAAA,oBAA0B,CACxB,UACA,OAAQ,EACR,aAAc,EACf,CAAC,CAGJ,IAAM,GAAA,EAAA,EAAA,qBAAoC,EAAQ,EAAS,MAAM,CAMjE,OAAA,EAAA,EAAA,oBAA0B,CACxB,OAAQ,EACR,OAPkB,EAAU,kBAC5B,EAAc,QACd,EACA,EAImB,CACnB,QAAS,EACT,aAAc,EACf,CAAC,CAcJ,SAAS,EACP,EACA,EACQ,CACR,IAAM,EAAS,GAAW,CAGpB,EAAuB,EAC3B,EACA,EACD,CAEK,EADYF,EAAAA,mBAC8B,CAAC,kBAC/C,EACA,EACA,CAAE,QAAS,SAAU,CACtB,CACD,GAAI,EAAgC,OAAO,EAG3C,GAAM,CAAE,UAAS,aAAc,EAC7B,EACA,EACD,CACD,OAAO,EAAqB,EAAQ,EAAS,EAAU,CASzD,SAAS,EACP,EACA,EAIA,CAEA,IAAM,EAAkB,EAAE,CAEpB,EAAqC,EAAE,CACzC,EAAW,EAEf,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAKlC,GAHA,EAAM,KAAK,EAAQ,GAAG,CAGlB,EAAI,EAAO,OAAQ,CACrB,IAAM,EAAM,EAAS,UAAU,CAC/B,EAAM,KAAK,IAAI,EAAI,GAAG,CACtB,EAAU,GAAO,EAAO,GACxB,IAIJ,MAAO,CACL,QAAS,EAAM,KAAK,GAAG,CACvB,YACD,CASH,SAAS,EACP,EACA,EACQ,CACR,OAAO,EACJ,KAAK,EAAQ,IACL,GAAU,EAAO,IAAU,IAClC,CACD,KAAK,GAAG,CAOb,SAAS,EAAgB,EAAiD,CACxE,IAAM,EAAaC,EAAAA,eAAe,CAAC,mBAAmB,GAAK,gBACrD,EAAc,CAACE,EAAAA,6BAAqC,CAC1D,GAAI,CAAC,GAAc,CAAC,EAAa,OAEjC,IAAM,EACJ,OAAO,GAAqB,SACxB,EACA,EAAiB,KAAK,GAAG,CAEzB,GAAA,EAAA,EAAA,yBAAuC,CAC3C,OAAQ,iCACR,SAAU,QACV,aACE,2FACF,IAAK,8NACL,QAAA,EAAA,EAAA,wBACoB,GAAK,cACnB,IAAA,GACA,uCACN,QAAS,aAAa,EAAQ,GAC/B,CAAC,CACF,IAAA,EAAA,EAAA,wBAA2B,GAAK,cAC9B,MAAU,MAAM,EAAa,CAE7B,QAAQ,MAAM,EAAa,CAI/B,SAAS,GAAoB,CAC3B,OAAOC,EAAAA,mBAA2B,CAAC,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/functions/translation/t.ts"],"mappings":";;;;AAgCA;;;;;AA+CC;;;;;;;;;cA/CY,CAAA,EAAG,sCAAA;;;;;;;;;UA2LN,sCAAA;EAAA,CACP,OAAA,EAAS,oBAAA,KAAyB,MAAA;EAAA,CAClC,OAAA,UAAiB,OAAA,GAAU,oBAAA;AAAA"}
1
+ {"version":3,"file":"t.d.ts","names":[],"sources":["../../../src/functions/translation/t.ts"],"mappings":";;;;AAiCA;;;;;AAmDC;;;;;;;;;cAnDY,CAAA,EAAG,sCAAA;;;;;;;;;UA+LN,sCAAA;EAAA,CACP,OAAA,EAAS,oBAAA,KAAyB,MAAA;EAAA,CAClC,OAAA,UAAiB,OAAA,GAAU,oBAAA;AAAA"}