gt-react 11.4.3 → 11.4.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # gt-react
2
2
 
3
+ ## 11.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2330](https://github.com/generaltranslation/gt/pull/2330) [`9ee7dc3`](https://github.com/generaltranslation/gt/commit/9ee7dc3ae792cd81ce7edb5c6e43c963f7055261) Thanks [@eoinest](https://github.com/eoinest)! - Use server-provided locale and condition props as the only rendered state in server-rendered apps. Condition setters write cookies for middleware and request a reload; provider-free SPA apps keep their cookie-backed behavior.
8
+
9
+ - Updated dependencies [[`5d75eb4`](https://github.com/generaltranslation/gt/commit/5d75eb475a9e36a61845f0368566a9d40466251c), [`9ee7dc3`](https://github.com/generaltranslation/gt/commit/9ee7dc3ae792cd81ce7edb5c6e43c963f7055261)]:
10
+ - generaltranslation@9.5.1
11
+ - @generaltranslation/react-core@11.4.4
12
+ - gt-i18n@1.0.32
13
+
3
14
  ## 11.4.3
4
15
 
5
16
  ### Patch Changes
@@ -100,16 +100,10 @@ function readBrowserLocale(localeCookieName) {
100
100
  */
101
101
  var BrowserConditionStore = class {
102
102
  constructor(config) {
103
- this.pending = {};
104
103
  this.getLocale = () => {
105
- if (this.serverConditions !== void 0) return this.serverConditions.locale;
106
104
  return getBrowserLocale(this.customGetLocale);
107
105
  };
108
106
  this.setLocale = (locale) => {
109
- if (this.serverConditions !== void 0) {
110
- locale = (0, _generaltranslation_react_core_pure.getI18nConfig)().resolveSupportedLocale(locale);
111
- this.pending.locale = locale;
112
- }
113
107
  this.updateLocale(locale);
114
108
  setCookieValue({
115
109
  cookieName: _generaltranslation_react_core_pure.defaultResetLocaleCookieName,
@@ -118,13 +112,11 @@ var BrowserConditionStore = class {
118
112
  this.reload();
119
113
  };
120
114
  this.getRegion = () => {
121
- if (this.serverConditions !== void 0) return this.serverConditions.region;
122
115
  const cookieRegion = getCookieValue$1({ cookieName: (0, _generaltranslation_react_core_pure.getI18nConfig)().getRegionCookieName() });
123
116
  if (cookieRegion) return cookieRegion;
124
117
  return this.customGetRegion?.();
125
118
  };
126
119
  this.setRegion = (region) => {
127
- if (this.serverConditions !== void 0) this.pending.region = region;
128
120
  this.updateRegion(region);
129
121
  this.reload();
130
122
  };
@@ -134,7 +126,6 @@ var BrowserConditionStore = class {
134
126
  return cookieEnableI18n === "true";
135
127
  };
136
128
  this.setEnableI18n = (enableI18n) => {
137
- if (this.serverConditions !== void 0) this.pending.enableI18n = enableI18n;
138
129
  this.updateEnableI18n(enableI18n);
139
130
  this.reload();
140
131
  };
@@ -163,17 +154,13 @@ var BrowserConditionStore = class {
163
154
  region: this.getRegion(),
164
155
  enableI18n: this.getEnableI18n()
165
156
  };
166
- this.customReload(this.serverConditions !== void 0 ? {
167
- ...state,
168
- ...this.pending
169
- } : state);
157
+ this.customReload(state);
170
158
  };
171
159
  const i18nConfig = (0, _generaltranslation_react_core_pure.getI18nConfig)();
172
160
  this.customReload = config._reload ?? (() => typeof window !== "undefined" ? window.location.reload() : void 0);
173
161
  this.customGetLocale = config._getLocale;
174
162
  this.customGetRegion = config._getRegion;
175
163
  this.customGetEnableI18n = config._getEnableI18n;
176
- this.serverConditions = config._serverConditions;
177
164
  setCookieValue({
178
165
  cookieName: i18nConfig.getLocaleCookieName(),
179
166
  value: i18nConfig.resolveSupportedLocale(config.locale)
@@ -254,14 +241,6 @@ const { getConditionStore: getBrowserConditionStore, setConditionStore: setBrows
254
241
  * initializeGT() apply here without being threaded through provider props.
255
242
  */
256
243
  function createOrUpdateBrowserConditionStore(config) {
257
- if (config._serverConditions !== void 0) {
258
- const conditionStore = new BrowserConditionStore({
259
- ...config,
260
- locale: config._serverConditions.locale
261
- });
262
- setBrowserConditionStore(conditionStore);
263
- return conditionStore;
264
- }
265
244
  const locale = determineLocale(config);
266
245
  const region = determineRegion(config);
267
246
  const enableI18n = determineEnableI18n(config);
@@ -498,28 +477,105 @@ function RegionSelector({ regions: _regions, customMapping, prioritizeCurrentLoc
498
477
  }
499
478
  //#endregion
500
479
  //#region src/provider/BrowserGTProvider.tsx
501
- /**
502
- * Consumes snapshot from server
503
- * Implementation for client-side only
504
- */
480
+ /** Client-side provider for server-rendered applications. */
505
481
  function BrowserGTProvider(props) {
506
- const conditionStore = (0, react.useMemo)(() => {
507
- return createOrUpdateBrowserConditionStore(props);
482
+ const i18nConfig = (0, _generaltranslation_react_core_pure.getI18nConfig)();
483
+ const { locale, region } = props;
484
+ const enableI18n = props.enableI18n ?? true;
485
+ const reload = (0, react.useCallback)((next) => {
486
+ if (props._reload) props._reload(next);
487
+ else if (typeof window !== "undefined") window.location.reload();
488
+ }, [props._reload]);
489
+ const setLocale = (0, react.useCallback)((nextLocale) => {
490
+ const resolvedLocale = i18nConfig.resolveSupportedLocale(nextLocale);
491
+ setCookieValue({
492
+ cookieName: i18nConfig.getLocaleCookieName(),
493
+ value: resolvedLocale
494
+ });
495
+ setCookieValue({
496
+ cookieName: _generaltranslation_react_core_pure.defaultResetLocaleCookieName,
497
+ value: "true"
498
+ });
499
+ reload({
500
+ locale: resolvedLocale,
501
+ region,
502
+ enableI18n
503
+ });
508
504
  }, [
509
- props.locale,
510
- props.region,
511
- props.enableI18n,
512
- props._reload,
513
- props._serverConditions
505
+ i18nConfig,
506
+ region,
507
+ enableI18n,
508
+ reload
514
509
  ]);
515
- const i18nStoreRef = (0, react.useRef)(null);
516
- if (i18nStoreRef.current == null) i18nStoreRef.current = new _generaltranslation_react_core_components.I18nStore();
510
+ const setRegion = (0, react.useCallback)((nextRegion) => {
511
+ setCookieValue({
512
+ cookieName: i18nConfig.getRegionCookieName(),
513
+ value: nextRegion ?? ""
514
+ });
515
+ reload({
516
+ locale,
517
+ region: nextRegion,
518
+ enableI18n
519
+ });
520
+ }, [
521
+ i18nConfig,
522
+ locale,
523
+ enableI18n,
524
+ reload
525
+ ]);
526
+ const setEnableI18n = (0, react.useCallback)((nextEnableI18n) => {
527
+ setCookieValue({
528
+ cookieName: i18nConfig.getEnableI18nCookieName(),
529
+ value: nextEnableI18n ? "true" : "false"
530
+ });
531
+ reload({
532
+ locale,
533
+ region,
534
+ enableI18n: nextEnableI18n
535
+ });
536
+ }, [
537
+ i18nConfig,
538
+ locale,
539
+ region,
540
+ reload
541
+ ]);
542
+ (0, react.useEffect)(() => {
543
+ setCookieValue({
544
+ cookieName: i18nConfig.getLocaleCookieName(),
545
+ value: locale
546
+ });
547
+ if (region !== void 0) setCookieValue({
548
+ cookieName: i18nConfig.getRegionCookieName(),
549
+ value: region
550
+ });
551
+ setCookieValue({
552
+ cookieName: i18nConfig.getEnableI18nCookieName(),
553
+ value: enableI18n ? "true" : "false"
554
+ });
555
+ }, [
556
+ i18nConfig,
557
+ locale,
558
+ region,
559
+ enableI18n,
560
+ props.translations
561
+ ]);
562
+ const i18nStore = useI18nStore();
517
563
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core_components.InternalGTProvider, {
518
564
  ...props,
519
- conditionStore,
520
- i18nStore: i18nStoreRef.current
565
+ locale,
566
+ region,
567
+ enableI18n,
568
+ setLocale,
569
+ setRegion,
570
+ setEnableI18n,
571
+ i18nStore
521
572
  });
522
573
  }
574
+ function useI18nStore() {
575
+ const i18nStoreRef = (0, react.useRef)(null);
576
+ if (i18nStoreRef.current == null) i18nStoreRef.current = new _generaltranslation_react_core_components.I18nStore();
577
+ return i18nStoreRef.current;
578
+ }
523
579
  //#endregion
524
580
  //#region src/index.client.ts
525
581
  async function Tx(_props) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.cjs","names":["I18nCache","getCookieValue","getCookieValue","defaultResetLocaleCookieName","getCookieValue","getCookieValue","I18nStore","InternalLocaleSelector","InternalRegionSelector","I18nStore","InternalGTProvider"],"sources":["../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../../core/dist/diagnostics-DKA2SkZB.mjs","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n // Keep accepting htmlTagOptions without passing it to the translation cache.\n const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n /** App Router only: authoritative conditions supplied by this server render. */\n _serverConditions?: {\n locale: string;\n region?: string;\n enableI18n?: boolean;\n };\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n private serverConditions?: BrowserConditionStoreParams['_serverConditions'];\n private pending: Partial<SerializedBrowserConditionStoreState> = {};\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n this.serverConditions = config._serverConditions;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n if (this.serverConditions !== undefined)\n return this.serverConditions.locale;\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n if (this.serverConditions !== undefined) {\n locale = getI18nConfig().resolveSupportedLocale(locale);\n this.pending.locale = locale;\n }\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n if (this.serverConditions !== undefined)\n return this.serverConditions.region;\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n if (this.serverConditions !== undefined) this.pending.region = region;\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n // App Router does not resolve this preference on the server yet, so retain\n // its existing client behavior rather than accepting the server's true.\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n if (this.serverConditions !== undefined)\n this.pending.enableI18n = enableI18n;\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(\n this.serverConditions !== undefined\n ? { ...state, ...this.pending }\n : state\n );\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\nexport { formatDiagnosticErrorDetails as n, createDiagnosticMessage as t };\n\n//# sourceMappingURL=diagnostics-DKA2SkZB.mjs.map","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n if (config._serverConditions !== undefined) {\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale: config._serverConditions.locale,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n }\n\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\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 */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [\n props.locale,\n props.region,\n props.enableI18n,\n props._reload,\n // A rejected App Router locale switch can return the same locale as before.\n // Reconcile that new server result, but leave client-only rerenders alone.\n props._serverConditions,\n ]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;;AAiBA,IAAI;;;;AAcJ,IAAa,mBAA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;;;;;;;ACHN,SAAgB,eAAe,EAC7B,SAAS,UACT,eACA,+BACA,2BACA,mBAAmB,OACnB,GAAG,SAC6C;CAEhD,MAAM,EAAE,QAAQ,SAAS,YAAY,QAAQ,WAAW,cACtD,kBAAkB;EAChB,SAAS;EACT;EACA;EACA;EACD,CAAC;CAEJ,MAAM,gBAAgB,WAAmB;AACvC,MAAI,kBAAkB;GACpB,MAAM,eAAe,WAAW,IAAI,OAAO,EAAE;AAE7C,OAAI,gBAAgB,WAAW,aAAc,WAAU,aAAa;;AAEtE,YAAU,OAAO;;AAGnB,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,wBAAD;EACU;EACC;EACG;EACZ,WAAW;EACX,GAAI;EACJ,CAAA;;;;;;;;AC7CN,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,oCAAoC,MAAM;IAChD;EACD,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EAGN,MAAM;EACP,CAAC;CAEF,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACHN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
1
+ {"version":3,"file":"index.client.cjs","names":["I18nCache","getCookieValue","getCookieValue","defaultResetLocaleCookieName","getCookieValue","getCookieValue","I18nStore","InternalLocaleSelector","InternalRegionSelector","defaultResetLocaleCookieName","InternalGTProvider","I18nStore"],"sources":["../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../../core/dist/diagnostics-DKA2SkZB.mjs","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n // Keep accepting htmlTagOptions without passing it to the translation cache.\n const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n // App Router does not resolve this preference on the server yet, so retain\n // its existing client behavior rather than accepting the server's true.\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\nexport { formatDiagnosticErrorDetails as n, createDiagnosticMessage as t };\n\n//# sourceMappingURL=diagnostics-DKA2SkZB.mjs.map","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\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 */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport { useCallback, useEffect, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { setCookieValue } from '../condition-store/cookies';\n\ntype Conditions = Parameters<NonNullable<SharedGTProviderProps['_reload']>>[0];\n\n/** Client-side provider for server-rendered applications. */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const i18nConfig = getI18nConfig();\n const { locale, region } = props;\n const enableI18n = props.enableI18n ?? true;\n const reload = useCallback(\n (next: Conditions) => {\n if (props._reload) props._reload(next);\n else if (typeof window !== 'undefined') window.location.reload();\n },\n [props._reload]\n );\n const setLocale = useCallback(\n (nextLocale: string) => {\n const resolvedLocale = i18nConfig.resolveSupportedLocale(nextLocale);\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: resolvedLocale,\n });\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n reload({ locale: resolvedLocale, region, enableI18n });\n },\n [i18nConfig, region, enableI18n, reload]\n );\n const setRegion = useCallback(\n (nextRegion: string | undefined) => {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: nextRegion ?? '',\n });\n reload({ locale, region: nextRegion, enableI18n });\n },\n [i18nConfig, locale, enableI18n, reload]\n );\n const setEnableI18n = useCallback(\n (nextEnableI18n: boolean) => {\n setCookieValue({\n cookieName: i18nConfig.getEnableI18nCookieName(),\n value: nextEnableI18n ? 'true' : 'false',\n });\n reload({ locale, region, enableI18n: nextEnableI18n });\n },\n [i18nConfig, locale, region, reload]\n );\n\n useEffect(() => {\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: locale,\n });\n if (region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: region,\n });\n }\n setCookieValue({\n cookieName: i18nConfig.getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n }, [i18nConfig, locale, region, enableI18n, props.translations]);\n\n const i18nStore = useI18nStore();\n\n return (\n <InternalGTProvider\n {...props}\n locale={locale}\n region={region}\n enableI18n={enableI18n}\n setLocale={setLocale}\n setRegion={setRegion}\n setEnableI18n={setEnableI18n}\n i18nStore={i18nStore}\n />\n );\n}\n\nfunction useI18nStore(): I18nStore {\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n return i18nStoreRef.current;\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;;AAiBA,IAAI;;;;AAcJ,IAAa,mBAAb,cAAsCA,iBAAAA,UAAuB;CAI3D,YAAY,QAAgC;EAG1C,MAAM,EAAE,gBAAgB,iBAAiB,GAAG,kBAAkB;EAC9D,MAAM,qBAAgD,EAAE;EACxD,MAAM,cAAA,GAAA,iBAAA,gBAA4B;EAClC,MAAM,sBACJ,CAAC,CAAC,OAAO,oBAAoB,WAAW,uBAAuB;EACjE,MAAM,YAAY,WAAW,cAAc;EAC3C,MAAM,mBAAmB,sBACrB,2BACE,OAAO,kBACP,WACA,mBACD,GACD,OAAO;AAGX,QAAM;GACJ,GAAG;GACH;GACD,CAAC;0BAvBuB;AAyBzB,OAAK,mBAAmB;AAGxB,MAAI,oBACF,MAAK,2BAA2B,EAAE,QAAQ,MAAM,kBAAkB;AAC3D,gCAA6B,oBAAoB;IACpD;IACA;IACD,CAAC,CAAC,MAAM,UAAU,MAAM,MAAM,MAAM,YAAY,CAAC;;;;;;CAQxD,oBAA6B;AAC3B,SAAO,KAAK;;;;;;;;;;;AAchB,SAAS,2BACP,gBACA,WACA,oBACA;AACA,QAAO,OAAO,WAAmB;AAO/B,UAAO,MALa,6BAA6B,oBAAoB;GACnE;GACA;GACA,MAAM,MAJyB,eAAe,OAAO;GAKtD,CAAC,EACW,kBAAkB;;;AAGnC,SAAS,6BACP,oBACA,QAKuC;AAEvC,QAAQ,mBAAmB,OAAO,YAAY,uBAAuB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AAED,EAAA,GAAA,MAAA,iBAAgB;AACd,iBAAe;GACb,YAAY,WAAW,qBAAqB;GAC5C,OAAO;GACR,CAAC;AACF,MAAI,WAAW,KAAA,EACb,gBAAe;GACb,YAAY,WAAW,qBAAqB;GAC5C,OAAO;GACR,CAAC;AAEJ,iBAAe;GACb,YAAY,WAAW,yBAAyB;GAChD,OAAO,aAAa,SAAS;GAC9B,CAAC;IACD;EAAC;EAAY;EAAQ;EAAQ;EAAY,MAAM;EAAa,CAAC;CAEhE,MAAM,YAAY,cAAc;AAEhC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACI;EACA;EACI;EACD;EACA;EACI;EACJ;EACX,CAAA;;AAIN,SAAS,eAA0B;CACjC,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAExC,QAAO,aAAa;;;;ACpEtB,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
@@ -56,12 +56,7 @@ type BrowserConditionStoreParams = WritableConditionStoreParams & {
56
56
  _getLocale?: GetLocale;
57
57
  _getRegion?: GetRegion;
58
58
  _getEnableI18n?: GetEnableI18n;
59
- _reload?: ReloadType; /** App Router only: authoritative conditions supplied by this server render. */
60
- _serverConditions?: {
61
- locale: string;
62
- region?: string;
63
- enableI18n?: boolean;
64
- };
59
+ _reload?: ReloadType;
65
60
  };
66
61
  /**
67
62
  * Condition store implementation for Browser.
@@ -71,8 +66,6 @@ declare class BrowserConditionStore implements WritableConditionStoreInterface {
71
66
  private customGetLocale?;
72
67
  private customGetRegion?;
73
68
  private customGetEnableI18n?;
74
- private serverConditions?;
75
- private pending;
76
69
  constructor(config: BrowserConditionStoreParams);
77
70
  getLocale: () => string;
78
71
  setLocale: (locale: LocaleCandidates) => void;
@@ -301,20 +294,12 @@ type RegionSelectorProps = {
301
294
  * - {@link InternalGTProviderProps} - requires translations and dictionaries
302
295
  * - {@link BrowserConditionStoreParams} - requires locale
303
296
  */
304
- type SharedGTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore'> & Omit<BrowserConditionStoreParams, 'locale'> & {
305
- locale: string; /** Internal App Router snapshot; a new object represents a new server result. */
306
- _serverConditions?: {
307
- locale: string;
308
- region?: string;
309
- enableI18n?: boolean;
310
- };
297
+ type SharedGTProviderProps = Omit<InternalGTProviderProps, 'i18nStore' | 'region' | 'enableI18n' | 'setLocale' | 'setRegion' | 'setEnableI18n'> & Omit<BrowserConditionStoreParams, 'locale'> & {
298
+ locale: string;
311
299
  };
312
300
  //#endregion
313
301
  //#region src/provider/BrowserGTProvider.d.ts
314
- /**
315
- * Consumes snapshot from server
316
- * Implementation for client-side only
317
- */
302
+ /** Client-side provider for server-rendered applications. */
318
303
  declare function BrowserGTProvider(props: SharedGTProviderProps): _$react_jsx_runtime0.JSX.Element;
319
304
  //#endregion
320
305
  //#region src/index.client.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA,EHzBS;EG2BnB,iBAAA;IACE,MAAA;IACA,MAAA;IACA,UAAA;EAAA;AAAA;;;;cAOS,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;EAAA,QACA,gBAAA;EAAA,QACA,OAAA;cAEI,MAAA,EAAQ,2BAAA;EAuBpB,SAAA;EAMA,SAAA,GAAa,MAAA,EAAQ,gBAAA;EAarB,SAAA;EAUA,SAAA,GAAa,MAAA;EAMb,aAAA;EAYA,aAAA,GAAiB,UAAA;EFjHM;;;EE2HvB,YAAA,GAAgB,MAAA,EAAQ,gBAAA;EFpHd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,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AXjCH;;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;EAEA,iBAAA;IACE,MAAA;IACA,MAAA;IACA,UAAA;EAAA;AAAA;;;;;;;iBCPU,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
1
+ {"version":3,"file":"index.client.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;cAMC,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,gBAAA;EASrB,SAAA;EAQA,SAAA,GAAa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AAA;;;;;;;;;;;;;;;iBCbzD,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AXjCH;;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,yFAQA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;iBCJY,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCiBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
@@ -56,12 +56,7 @@ type BrowserConditionStoreParams = WritableConditionStoreParams & {
56
56
  _getLocale?: GetLocale;
57
57
  _getRegion?: GetRegion;
58
58
  _getEnableI18n?: GetEnableI18n;
59
- _reload?: ReloadType; /** App Router only: authoritative conditions supplied by this server render. */
60
- _serverConditions?: {
61
- locale: string;
62
- region?: string;
63
- enableI18n?: boolean;
64
- };
59
+ _reload?: ReloadType;
65
60
  };
66
61
  /**
67
62
  * Condition store implementation for Browser.
@@ -71,8 +66,6 @@ declare class BrowserConditionStore implements WritableConditionStoreInterface {
71
66
  private customGetLocale?;
72
67
  private customGetRegion?;
73
68
  private customGetEnableI18n?;
74
- private serverConditions?;
75
- private pending;
76
69
  constructor(config: BrowserConditionStoreParams);
77
70
  getLocale: () => string;
78
71
  setLocale: (locale: LocaleCandidates$1) => void;
@@ -301,20 +294,12 @@ type RegionSelectorProps = {
301
294
  * - {@link InternalGTProviderProps} - requires translations and dictionaries
302
295
  * - {@link BrowserConditionStoreParams} - requires locale
303
296
  */
304
- type SharedGTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore'> & Omit<BrowserConditionStoreParams, 'locale'> & {
305
- locale: string; /** Internal App Router snapshot; a new object represents a new server result. */
306
- _serverConditions?: {
307
- locale: string;
308
- region?: string;
309
- enableI18n?: boolean;
310
- };
297
+ type SharedGTProviderProps = Omit<InternalGTProviderProps, 'i18nStore' | 'region' | 'enableI18n' | 'setLocale' | 'setRegion' | 'setEnableI18n'> & Omit<BrowserConditionStoreParams, 'locale'> & {
298
+ locale: string;
311
299
  };
312
300
  //#endregion
313
301
  //#region src/provider/BrowserGTProvider.d.ts
314
- /**
315
- * Consumes snapshot from server
316
- * Implementation for client-side only
317
- */
302
+ /** Client-side provider for server-rendered applications. */
318
303
  declare function BrowserGTProvider(props: SharedGTProviderProps): _$react_jsx_runtime0.JSX.Element;
319
304
  //#endregion
320
305
  //#region src/index.client.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA,EHzBS;EG2BnB,iBAAA;IACE,MAAA;IACA,MAAA;IACA,UAAA;EAAA;AAAA;;;;cAOS,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;EAAA,QACA,gBAAA;EAAA,QAC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;;;2CAAD,gBAAA;;;;;;;;;;;;;;;ATfjC;;;;;;;;iBUuBgB,iBAAA,CAAkB,OAAA,GAAU,6BAAA;;;0BAA6B,uCAAA,CAAA,UAAA;;;;;;;;;;;;;;;iBCbzD,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AXjCH;;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;EAEA,iBAAA;IACE,MAAA;IACA,MAAA;IACA,UAAA;EAAA;AAAA;;;;;;;iBCPU,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
1
+ {"version":3,"file":"index.client.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-CbRDetV3.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UA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