gt-react 10.19.15 β†’ 10.19.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/browser.cjs +10914 -0
  3. package/dist/browser.cjs.map +1 -0
  4. package/dist/browser.d.cts +699 -0
  5. package/dist/browser.d.cts.map +1 -0
  6. package/dist/browser.d.mts +701 -0
  7. package/dist/browser.d.mts.map +1 -0
  8. package/dist/browser.mjs +10877 -0
  9. package/dist/browser.mjs.map +1 -0
  10. package/dist/client.cjs +3451 -0
  11. package/dist/client.cjs.map +1 -0
  12. package/dist/client.d.cts +248 -0
  13. package/dist/client.d.cts.map +1 -0
  14. package/dist/client.d.mts +249 -0
  15. package/dist/client.d.mts.map +1 -0
  16. package/dist/client.mjs +3392 -0
  17. package/dist/client.mjs.map +1 -0
  18. package/dist/index.cjs +3691 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.cts +377 -0
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.mts +376 -0
  23. package/dist/index.d.mts.map +1 -0
  24. package/dist/index.mjs +3636 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/internal.cjs +4046 -0
  27. package/dist/internal.cjs.map +1 -0
  28. package/dist/internal.d.cts +1118 -0
  29. package/dist/internal.d.cts.map +1 -0
  30. package/dist/internal.d.mts +1118 -0
  31. package/dist/internal.d.mts.map +1 -0
  32. package/dist/internal.mjs +3985 -0
  33. package/dist/internal.mjs.map +1 -0
  34. package/dist/macros.cjs +6206 -0
  35. package/dist/macros.cjs.map +1 -0
  36. package/dist/macros.d.cts +25 -0
  37. package/dist/macros.d.cts.map +1 -0
  38. package/dist/macros.d.mts +25 -0
  39. package/dist/macros.d.mts.map +1 -0
  40. package/dist/macros.mjs +6207 -0
  41. package/dist/macros.mjs.map +1 -0
  42. package/package.json +61 -41
  43. package/dist/browser-types.d.ts +0 -5
  44. package/dist/browser-types.d.ts.map +0 -1
  45. package/dist/browser.cjs.min.cjs +0 -2
  46. package/dist/browser.cjs.min.cjs.map +0 -1
  47. package/dist/browser.d.ts +0 -4
  48. package/dist/browser.d.ts.map +0 -1
  49. package/dist/browser.esm.min.mjs +0 -2
  50. package/dist/browser.esm.min.mjs.map +0 -1
  51. package/dist/client.cjs.min.cjs +0 -2
  52. package/dist/client.cjs.min.cjs.map +0 -1
  53. package/dist/client.d.ts +0 -6
  54. package/dist/client.d.ts.map +0 -1
  55. package/dist/client.esm.min.mjs +0 -2
  56. package/dist/client.esm.min.mjs.map +0 -1
  57. package/dist/i18n-context/browser-i18n-manager/BrowserConditionStore.d.ts +0 -32
  58. package/dist/i18n-context/browser-i18n-manager/BrowserConditionStore.d.ts.map +0 -1
  59. package/dist/i18n-context/browser-i18n-manager/BrowserI18nManager.d.ts +0 -42
  60. package/dist/i18n-context/browser-i18n-manager/BrowserI18nManager.d.ts.map +0 -1
  61. package/dist/i18n-context/browser-i18n-manager/LocalStorageTranslationCache.d.ts +0 -90
  62. package/dist/i18n-context/browser-i18n-manager/LocalStorageTranslationCache.d.ts.map +0 -1
  63. package/dist/i18n-context/browser-i18n-manager/singleton-operations.d.ts +0 -9
  64. package/dist/i18n-context/browser-i18n-manager/singleton-operations.d.ts.map +0 -1
  65. package/dist/i18n-context/browser-i18n-manager/utils/constants.d.ts +0 -3
  66. package/dist/i18n-context/browser-i18n-manager/utils/constants.d.ts.map +0 -1
  67. package/dist/i18n-context/browser-i18n-manager/utils/cookies.d.ts +0 -19
  68. package/dist/i18n-context/browser-i18n-manager/utils/cookies.d.ts.map +0 -1
  69. package/dist/i18n-context/browser-i18n-manager/utils/determineLocale.d.ts +0 -15
  70. package/dist/i18n-context/browser-i18n-manager/utils/determineLocale.d.ts.map +0 -1
  71. package/dist/i18n-context/browser-i18n-manager/utils/types.d.ts +0 -14
  72. package/dist/i18n-context/browser-i18n-manager/utils/types.d.ts.map +0 -1
  73. package/dist/i18n-context/functions/branching/GtInternalBranch.d.ts +0 -29
  74. package/dist/i18n-context/functions/branching/GtInternalBranch.d.ts.map +0 -1
  75. package/dist/i18n-context/functions/branching/GtInternalPlural.d.ts +0 -30
  76. package/dist/i18n-context/functions/branching/GtInternalPlural.d.ts.map +0 -1
  77. package/dist/i18n-context/functions/branching/index.d.ts +0 -3
  78. package/dist/i18n-context/functions/branching/index.d.ts.map +0 -1
  79. package/dist/i18n-context/functions/derivation/GtInternalDerive.d.ts +0 -31
  80. package/dist/i18n-context/functions/derivation/GtInternalDerive.d.ts.map +0 -1
  81. package/dist/i18n-context/functions/derivation/index.d.ts +0 -2
  82. package/dist/i18n-context/functions/derivation/index.d.ts.map +0 -1
  83. package/dist/i18n-context/functions/html-tag-operations.d.ts +0 -19
  84. package/dist/i18n-context/functions/html-tag-operations.d.ts.map +0 -1
  85. package/dist/i18n-context/functions/index.d.ts +0 -8
  86. package/dist/i18n-context/functions/index.d.ts.map +0 -1
  87. package/dist/i18n-context/functions/locale-operations.d.ts +0 -11
  88. package/dist/i18n-context/functions/locale-operations.d.ts.map +0 -1
  89. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts +0 -11
  90. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts.map +0 -1
  91. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts +0 -11
  92. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts.map +0 -1
  93. package/dist/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts +0 -33
  94. package/dist/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts.map +0 -1
  95. package/dist/i18n-context/functions/translation/index.d.ts +0 -5
  96. package/dist/i18n-context/functions/translation/index.d.ts.map +0 -1
  97. package/dist/i18n-context/functions/translation/t.d.ts +0 -25
  98. package/dist/i18n-context/functions/translation/t.d.ts.map +0 -1
  99. package/dist/i18n-context/functions/translation/types.d.ts +0 -21
  100. package/dist/i18n-context/functions/translation/types.d.ts.map +0 -1
  101. package/dist/i18n-context/functions/variables/GtInternalCurrency.d.ts +0 -28
  102. package/dist/i18n-context/functions/variables/GtInternalCurrency.d.ts.map +0 -1
  103. package/dist/i18n-context/functions/variables/GtInternalDateTime.d.ts +0 -26
  104. package/dist/i18n-context/functions/variables/GtInternalDateTime.d.ts.map +0 -1
  105. package/dist/i18n-context/functions/variables/GtInternalNum.d.ts +0 -26
  106. package/dist/i18n-context/functions/variables/GtInternalNum.d.ts.map +0 -1
  107. package/dist/i18n-context/functions/variables/GtInternalRelativeTime.d.ts +0 -35
  108. package/dist/i18n-context/functions/variables/GtInternalRelativeTime.d.ts.map +0 -1
  109. package/dist/i18n-context/functions/variables/GtInternalVar.d.ts +0 -23
  110. package/dist/i18n-context/functions/variables/GtInternalVar.d.ts.map +0 -1
  111. package/dist/i18n-context/functions/variables/index.d.ts +0 -6
  112. package/dist/i18n-context/functions/variables/index.d.ts.map +0 -1
  113. package/dist/i18n-context/functions/variables/utils/computeVar.d.ts +0 -9
  114. package/dist/i18n-context/functions/variables/utils/computeVar.d.ts.map +0 -1
  115. package/dist/i18n-context/functions/variables/utils/renderVariable.d.ts +0 -15
  116. package/dist/i18n-context/functions/variables/utils/renderVariable.d.ts.map +0 -1
  117. package/dist/i18n-context/setup/bootstrap.d.ts +0 -22
  118. package/dist/i18n-context/setup/bootstrap.d.ts.map +0 -1
  119. package/dist/i18n-context/setup/index.d.ts +0 -3
  120. package/dist/i18n-context/setup/index.d.ts.map +0 -1
  121. package/dist/i18n-context/setup/initializeGT.d.ts +0 -7
  122. package/dist/i18n-context/setup/initializeGT.d.ts.map +0 -1
  123. package/dist/i18n-context/setup/types.d.ts +0 -19
  124. package/dist/i18n-context/setup/types.d.ts.map +0 -1
  125. package/dist/i18n-context/ui/LocaleSelector.d.ts +0 -18
  126. package/dist/i18n-context/ui/LocaleSelector.d.ts.map +0 -1
  127. package/dist/i18n-context/utils/enforceBrowser.d.ts +0 -7
  128. package/dist/i18n-context/utils/enforceBrowser.d.ts.map +0 -1
  129. package/dist/index.cjs.min.cjs +0 -2
  130. package/dist/index.cjs.min.cjs.map +0 -1
  131. package/dist/index.d.ts +0 -8
  132. package/dist/index.d.ts.map +0 -1
  133. package/dist/index.esm.min.mjs +0 -2
  134. package/dist/index.esm.min.mjs.map +0 -1
  135. package/dist/internal.cjs.min.cjs +0 -2
  136. package/dist/internal.cjs.min.cjs.map +0 -1
  137. package/dist/internal.d.ts +0 -7
  138. package/dist/internal.d.ts.map +0 -1
  139. package/dist/internal.esm.min.mjs +0 -2
  140. package/dist/internal.esm.min.mjs.map +0 -1
  141. package/dist/macros.cjs.min.cjs +0 -2
  142. package/dist/macros.cjs.min.cjs.map +0 -1
  143. package/dist/macros.d.ts +0 -22
  144. package/dist/macros.d.ts.map +0 -1
  145. package/dist/macros.esm.min.mjs +0 -2
  146. package/dist/macros.esm.min.mjs.map +0 -1
  147. package/dist/react-context/provider/ClientProvider.d.ts +0 -4
  148. package/dist/react-context/provider/ClientProvider.d.ts.map +0 -1
  149. package/dist/react-context/provider/GTProvider.d.ts +0 -29
  150. package/dist/react-context/provider/GTProvider.d.ts.map +0 -1
  151. package/dist/react-context/provider/helpers/isSSREnabled.d.ts +0 -2
  152. package/dist/react-context/provider/helpers/isSSREnabled.d.ts.map +0 -1
  153. package/dist/react-context/provider/hooks/locales/useDetermineLocale.d.ts +0 -5
  154. package/dist/react-context/provider/hooks/locales/useDetermineLocale.d.ts.map +0 -1
  155. package/dist/react-context/provider/hooks/useEnableI18n.d.ts +0 -10
  156. package/dist/react-context/provider/hooks/useEnableI18n.d.ts.map +0 -1
  157. package/dist/react-context/provider/hooks/useRegionState.d.ts +0 -9
  158. package/dist/react-context/provider/hooks/useRegionState.d.ts.map +0 -1
  159. package/dist/react-context/types/config.d.ts +0 -67
  160. package/dist/react-context/types/config.d.ts.map +0 -1
  161. package/dist/react-context/ui/LocaleSelector.d.ts +0 -18
  162. package/dist/react-context/ui/LocaleSelector.d.ts.map +0 -1
  163. package/dist/react-context/ui/RegionSelector.d.ts +0 -38
  164. package/dist/react-context/ui/RegionSelector.d.ts.map +0 -1
  165. package/dist/react-context/utils/readAuthFromEnv.d.ts +0 -9
  166. package/dist/react-context/utils/readAuthFromEnv.d.ts.map +0 -1
  167. package/dist/shared/InternalLocaleSelector.d.ts +0 -26
  168. package/dist/shared/InternalLocaleSelector.d.ts.map +0 -1
  169. package/dist/shared/messages.d.ts +0 -11
  170. package/dist/shared/messages.d.ts.map +0 -1
package/dist/index.cjs ADDED
@@ -0,0 +1,3691 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let _generaltranslation_react_core = require("@generaltranslation/react-core");
25
+ let react = require("react");
26
+ react = __toESM(react, 1);
27
+ let _generaltranslation_format = require("@generaltranslation/format");
28
+ let react_jsx_runtime = require("react/jsx-runtime");
29
+ require("generaltranslation");
30
+ //#region src/react-context/utils/readAuthFromEnv.tsx
31
+ /**
32
+ * Extract the project ID and development API key from the environment variables
33
+ * @param projectId - The project ID
34
+ * @param devApiKey - The development API key
35
+ * @returns The project ID and development API key
36
+ */
37
+ function readAuthFromEnv({ projectId, devApiKey }) {
38
+ const env = { ...typeof process !== "undefined" ? process.env : void 0 };
39
+ return {
40
+ projectId: projectId || env.VITE_GT_PROJECT_ID || env.REDWOOD_ENV_GT_PROJECT_ID || env.GT_PROJECT_ID || env.REACT_APP_GT_PROJECT_ID || env.NEXT_PUBLIC_GT_PROJECT_ID || env.GATSBY_GT_PROJECT_ID || "",
41
+ devApiKey: devApiKey || env.VITE_GT_DEV_API_KEY || env.VITE_GT_API_KEY || env.REDWOOD_ENV_GT_DEV_API_KEY || env.REDWOOD_ENV_GT_API_KEY || env.GT_DEV_API_KEY || env.GT_API_KEY || env.REACT_APP_GT_DEV_API_KEY || env.REACT_APP_GT_API_KEY || env.NEXT_PUBLIC_GT_DEV_API_KEY || env.NEXT_PUBLIC_GT_API_KEY || env.GATSBY_GT_DEV_API_KEY || env.GATSBY_GT_API_KEY
42
+ };
43
+ }
44
+ //#endregion
45
+ //#region src/shared/cookies.ts
46
+ /**
47
+ * Minimally parses a cookie value for a given cookie name.
48
+ * @param cookieName - The name of the cookie
49
+ * @returns The cookie value, or undefined when it is not found
50
+ */
51
+ function getCookieValue(cookieName) {
52
+ if (typeof document === "undefined") return void 0;
53
+ return document.cookie.split("; ").find((row) => row.startsWith(`${cookieName}=`))?.split("=")[1];
54
+ }
55
+ /**
56
+ * Sets a cookie value for a given cookie name.
57
+ * @param cookieName - The name of the cookie
58
+ * @param value - The value to set
59
+ */
60
+ function setCookieValue(cookieName, value) {
61
+ if (typeof document === "undefined") return;
62
+ document.cookie = `${cookieName}=${value};path=/`;
63
+ }
64
+ //#endregion
65
+ //#region src/react-context/provider/hooks/useRegionState.ts
66
+ function getNewRegion(_region, regionCookieName) {
67
+ const cookieRegion = getCookieValue(regionCookieName);
68
+ const newRegion = _region || cookieRegion;
69
+ if (cookieRegion && cookieRegion !== newRegion) setCookieValue(regionCookieName, newRegion || "");
70
+ return newRegion;
71
+ }
72
+ function useRegionState({ _region, ssr, regionCookieName }) {
73
+ const [region, _setRegion] = (0, react.useState)(ssr ? void 0 : getNewRegion(_region, regionCookieName));
74
+ const setRegion = (region) => {
75
+ _setRegion(region);
76
+ setCookieValue(regionCookieName, region || "");
77
+ };
78
+ (0, react.useEffect)(() => {
79
+ _setRegion(getNewRegion(_region, regionCookieName));
80
+ }, [_region, regionCookieName]);
81
+ return {
82
+ region,
83
+ setRegion
84
+ };
85
+ }
86
+ //#endregion
87
+ //#region src/react-context/provider/hooks/useEnableI18n.ts
88
+ /**
89
+ * Sync: no cookie
90
+ * Async: listen to cookie, until promise resolves
91
+ *
92
+ * Unfortunately, when dealing with SSR and an async enableI18n flag, there is no way to avoid a flicker of the default locale
93
+ * @returns enableI18n flag
94
+ */
95
+ function useEnableI18n({ enableI18n: _enableI18n, enableI18nCookieName, enableI18nLoaded, ssr }) {
96
+ const asyncEnabled = enableI18nLoaded !== void 0;
97
+ const isFirstRender = (0, react.useRef)(true);
98
+ const getCookieEnableI18nValue = () => {
99
+ const rawCookieValue = getCookieValue(enableI18nCookieName);
100
+ return rawCookieValue === "true" ? true : rawCookieValue === "false" ? false : null;
101
+ };
102
+ const [enableI18n, setEnableI18n] = (0, react.useState)(() => !asyncEnabled || ssr ? _enableI18n : getCookieEnableI18nValue() ?? _enableI18n);
103
+ (0, react.useEffect)(() => {
104
+ if (ssr && asyncEnabled && isFirstRender.current) {
105
+ isFirstRender.current = false;
106
+ const cookieValue = getCookieEnableI18nValue();
107
+ if (cookieValue !== null && cookieValue !== enableI18n) setEnableI18n(cookieValue);
108
+ return;
109
+ }
110
+ isFirstRender.current = false;
111
+ }, [
112
+ ssr,
113
+ asyncEnabled,
114
+ enableI18nCookieName,
115
+ enableI18n
116
+ ]);
117
+ (0, react.useEffect)(() => {
118
+ if (enableI18n === _enableI18n) return;
119
+ if (!asyncEnabled) {
120
+ setEnableI18n(_enableI18n);
121
+ return;
122
+ }
123
+ if (!enableI18nLoaded) return;
124
+ setCookieValue(enableI18nCookieName, _enableI18n ? "true" : "false");
125
+ setEnableI18n(_enableI18n);
126
+ }, [
127
+ _enableI18n,
128
+ enableI18n,
129
+ asyncEnabled,
130
+ enableI18nLoaded,
131
+ enableI18nCookieName
132
+ ]);
133
+ return { enableI18n };
134
+ }
135
+ //#endregion
136
+ //#region ../core/dist/base64-r7YWJYWt.mjs
137
+ function ensureSentence(text) {
138
+ const trimmed = text.trim();
139
+ if (!trimmed) return "";
140
+ return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
141
+ }
142
+ function stripSentence(text) {
143
+ const trimmed = text.trim();
144
+ let end = trimmed.length;
145
+ while (end > 0) {
146
+ const char = trimmed[end - 1];
147
+ if (char !== "." && char !== "!" && char !== "?") break;
148
+ end -= 1;
149
+ }
150
+ return trimmed.slice(0, end);
151
+ }
152
+ function lowercaseFirstWord(text) {
153
+ return text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());
154
+ }
155
+ function formatDetails(details) {
156
+ if (!details) return "";
157
+ const detailText = Array.isArray(details) ? details.join(", ") : details;
158
+ if (!detailText.trim()) return "";
159
+ return ensureSentence(`Details: ${detailText}`);
160
+ }
161
+ function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
162
+ const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
163
+ const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${lowercaseFirstWord(stripSentence(why))}` : whatHappened;
164
+ const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
165
+ const messageParts = [
166
+ whatAndWhy,
167
+ reassurance,
168
+ shouldCombineWayOut ? `${stripSentence(fix)}, or ${lowercaseFirstWord(stripSentence(wayOut))}` : fix,
169
+ shouldCombineWayOut ? void 0 : wayOut,
170
+ formatDetails(details)
171
+ ].filter((part) => !!part).map(ensureSentence);
172
+ if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
173
+ const message = messageParts.join(" ");
174
+ return prefix ? `${prefix} ${message}` : message;
175
+ }
176
+ //#endregion
177
+ //#region ../react-core/dist/errors.esm.min.mjs
178
+ function e(e) {
179
+ let t = e.trim();
180
+ return t ? /[.!?)]$/.test(t) ? t : `${t}.` : ``;
181
+ }
182
+ function t$1(e) {
183
+ let t = e.trim(), n = t.length;
184
+ for (; n > 0;) {
185
+ let e = t[n - 1];
186
+ if (e !== `.` && e !== `!` && e !== `?`) break;
187
+ --n;
188
+ }
189
+ return t.slice(0, n);
190
+ }
191
+ function n$1(e) {
192
+ return e.replace(/^[A-Z][a-z]/, (e) => e.toLowerCase());
193
+ }
194
+ function r$1(t) {
195
+ if (!t) return ``;
196
+ let n = Array.isArray(t) ? t.join(`, `) : t;
197
+ return n.trim() ? e(`Details: ${n}`) : ``;
198
+ }
199
+ function i$1({ source: i, severity: a, whatHappened: o, reassurance: s, why: c, fix: l, wayOut: u, details: d, docsUrl: f }) {
200
+ let p = i ? a ? `${i} ${a}:` : `${i}:` : a ? `${a}:` : ``, m = c ? `${t$1(o)} because ${n$1(t$1(c))}` : o, h = !!l && !!u && /^[a-z]/.test(t$1(u)), g = [
201
+ m,
202
+ s,
203
+ h ? `${t$1(l)}, or ${n$1(t$1(u))}` : l,
204
+ h ? void 0 : u,
205
+ r$1(d)
206
+ ].filter((e) => !!e).map(e);
207
+ f && g.push(`Learn more: ${f}`);
208
+ let _ = g.join(` `);
209
+ return p ? `${p} ${_}` : _;
210
+ }
211
+ const a$1 = `@generaltranslation/react-core`;
212
+ function o$1(e) {
213
+ return i$1({
214
+ source: a$1,
215
+ ...e
216
+ });
217
+ }
218
+ o$1({
219
+ severity: `Error`,
220
+ whatHappened: `Runtime translation needs a project ID`,
221
+ fix: `Add projectId to your <GTProvider> configuration or set GT_PROJECT_ID in your environment`,
222
+ docsUrl: `https://generaltranslation.com/dashboard`
223
+ }), o$1({
224
+ severity: `Error`,
225
+ whatHappened: `Production environments cannot use a development API key`,
226
+ fix: `Replace it with a production API key before deploying`
227
+ }), o$1({
228
+ severity: `Error`,
229
+ whatHappened: `The API key is available to client-side production code`,
230
+ fix: `Move translation credentials to a server-only environment before deploying`
231
+ }), o$1({
232
+ severity: `Error`,
233
+ whatHappened: `Runtime translation is not configured`,
234
+ fix: `Add projectId and devApiKey to your environment, or pass them to <GTProvider> directly`
235
+ }), o$1({
236
+ severity: `Error`,
237
+ whatHappened: `Runtime translations could not be loaded`,
238
+ wayOut: `Source content will render as a fallback`,
239
+ fix: `Check your runtime translation configuration and try again`
240
+ }), o$1({
241
+ severity: `Error`,
242
+ whatHappened: `Runtime translation could not be completed`
243
+ }), o$1({
244
+ severity: `Warning`,
245
+ whatHappened: `Runtime translation needs a project ID`,
246
+ fix: `Add projectId to <GTProvider> or set GT_PROJECT_ID in your environment`,
247
+ docsUrl: `https://generaltranslation.com/dashboard`
248
+ }), o$1({
249
+ severity: `Warning`,
250
+ whatHappened: `Runtime translation needs a development API key`,
251
+ fix: `Find your development API key at generaltranslation.com/dashboard, or set runtimeUrl to an empty string to disable runtime translation`
252
+ }), o$1({
253
+ severity: `Warning`,
254
+ whatHappened: `Runtime translation timed out`
255
+ });
256
+ const s$1 = (e, t, n = a$1) => `${n} Warning: "${t}" is not a supported locale. Update supported locales in your dashboard or gt.config.json. Falling back to "${e}".`;
257
+ o$1({
258
+ severity: `Warning`,
259
+ whatHappened: `No dictionary was found`,
260
+ fix: `Pass a dictionary to <GTProvider> or configure a dictionary loader before rendering translations`
261
+ }), `${a$1}`;
262
+ //#endregion
263
+ //#region ../react-core/dist/internal.esm.min.mjs
264
+ var c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.getOwnPropertyNames, d = Object.prototype.hasOwnProperty, f = (e, t) => () => (e && (t = e(e = 0)), t), p = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), m = (e, t) => {
265
+ let n = {};
266
+ for (var r in e) c(n, r, {
267
+ get: e[r],
268
+ enumerable: !0
269
+ });
270
+ return t || c(n, Symbol.toStringTag, { value: `Module` }), n;
271
+ }, h = (e, t, n, r) => {
272
+ if (t && typeof t == `object` || typeof t == `function`) for (var i = u(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !d.call(e, s) && s !== n && c(e, s, {
273
+ get: ((e) => t[e]).bind(null, s),
274
+ enumerable: !(r = l(t, s)) || r.enumerable
275
+ });
276
+ return e;
277
+ }, g = (e) => d.call(e, `module.exports`) ? e[`module.exports`] : h(c({}, `__esModule`, { value: !0 }), e);
278
+ function b(e) {
279
+ let t = e.trim();
280
+ return t ? /[.!?)]$/.test(t) ? t : `${t}.` : ``;
281
+ }
282
+ function x(e) {
283
+ let t = e.trim(), n = t.length;
284
+ for (; n > 0;) {
285
+ let e = t[n - 1];
286
+ if (e !== `.` && e !== `!` && e !== `?`) break;
287
+ --n;
288
+ }
289
+ return t.slice(0, n);
290
+ }
291
+ function te(e) {
292
+ return e.replace(/^[A-Z][a-z]/, (e) => e.toLowerCase());
293
+ }
294
+ function ne(e) {
295
+ if (!e) return ``;
296
+ let t = Array.isArray(e) ? e.join(`, `) : e;
297
+ return t.trim() ? b(`Details: ${t}`) : ``;
298
+ }
299
+ function S({ source: e, severity: t, whatHappened: n, reassurance: r, why: i, fix: a, wayOut: o, details: s, docsUrl: c }) {
300
+ let l = e ? t ? `${e} ${t}:` : `${e}:` : t ? `${t}:` : ``, u = i ? `${x(n)} because ${te(x(i))}` : n, d = !!a && !!o && /^[a-z]/.test(x(o)), f = [
301
+ u,
302
+ r,
303
+ d ? `${x(a)}, or ${te(x(o))}` : a,
304
+ d ? void 0 : o,
305
+ ne(s)
306
+ ].filter((e) => !!e).map(b);
307
+ c && f.push(`Learn more: ${c}`);
308
+ let p = f.join(` `);
309
+ return l ? `${l} ${p}` : p;
310
+ }
311
+ function ie(e) {
312
+ return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === `Uint8Array` && `BYTES_PER_ELEMENT` in e && e.BYTES_PER_ELEMENT === 1;
313
+ }
314
+ function D(e, t, n = ``) {
315
+ let r = ie(e), i = e?.length, a = t !== void 0;
316
+ if (!r || a && i !== t) {
317
+ let o = n && `"${n}" `, s = a ? ` of length ${t}` : ``, c = r ? `length=${i}` : `type=${typeof e}`, l = o + `expected Uint8Array` + s + `, got ` + c;
318
+ throw r ? RangeError(l) : TypeError(l);
319
+ }
320
+ return e;
321
+ }
322
+ function ae(e, t = !0) {
323
+ if (e.destroyed) throw Error(`Hash instance has been destroyed`);
324
+ if (t && e.finished) throw Error(`Hash#digest() has already been called`);
325
+ }
326
+ function oe(e, t) {
327
+ D(e, void 0, `digestInto() output`);
328
+ let n = t.outputLen;
329
+ if (e.length < n) throw RangeError(`"digestInto() output" expected to be of length >=` + n);
330
+ }
331
+ function se(...e) {
332
+ for (let t = 0; t < e.length; t++) e[t].fill(0);
333
+ }
334
+ function ce(e) {
335
+ return new DataView(e.buffer, e.byteOffset, e.byteLength);
336
+ }
337
+ function O(e, t) {
338
+ return e << 32 - t | e >>> t;
339
+ }
340
+ new Uint8Array(new Uint32Array([287454020]).buffer)[0];
341
+ typeof Uint8Array.from([]).toHex == `function` && Uint8Array.fromHex;
342
+ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, `0`));
343
+ function pe(e, t = {}) {
344
+ let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
345
+ return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
346
+ }
347
+ const me = (e) => ({ oid: Uint8Array.from([
348
+ 6,
349
+ 9,
350
+ 96,
351
+ 134,
352
+ 72,
353
+ 1,
354
+ 101,
355
+ 3,
356
+ 4,
357
+ 2,
358
+ e
359
+ ]) });
360
+ function he(e, t, n) {
361
+ return e & t ^ ~e & n;
362
+ }
363
+ function ge(e, t, n) {
364
+ return e & t ^ e & n ^ t & n;
365
+ }
366
+ var _e = class {
367
+ blockLen;
368
+ outputLen;
369
+ canXOF = !1;
370
+ padOffset;
371
+ isLE;
372
+ buffer;
373
+ view;
374
+ finished = !1;
375
+ length = 0;
376
+ pos = 0;
377
+ destroyed = !1;
378
+ constructor(e, t, n, r) {
379
+ this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view = ce(this.buffer);
380
+ }
381
+ update(e) {
382
+ ae(this), D(e);
383
+ let { view: t, buffer: n, blockLen: r } = this, i = e.length;
384
+ for (let a = 0; a < i;) {
385
+ let o = Math.min(r - this.pos, i - a);
386
+ if (o === r) {
387
+ let t = ce(e);
388
+ for (; r <= i - a; a += r) this.process(t, a);
389
+ continue;
390
+ }
391
+ n.set(e.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === r && (this.process(t, 0), this.pos = 0);
392
+ }
393
+ return this.length += e.length, this.roundClean(), this;
394
+ }
395
+ digestInto(e) {
396
+ ae(this), oe(e, this), this.finished = !0;
397
+ let { buffer: t, view: n, blockLen: r, isLE: i } = this, { pos: a } = this;
398
+ t[a++] = 128, se(this.buffer.subarray(a)), this.padOffset > r - a && (this.process(n, 0), a = 0);
399
+ for (let e = a; e < r; e++) t[e] = 0;
400
+ n.setBigUint64(r - 8, BigInt(this.length * 8), i), this.process(n, 0);
401
+ let o = ce(e), s = this.outputLen;
402
+ if (s % 4) throw Error(`_sha2: outputLen must be aligned to 32bit`);
403
+ let c = s / 4, l = this.get();
404
+ if (c > l.length) throw Error(`_sha2: outputLen bigger than state`);
405
+ for (let e = 0; e < c; e++) o.setUint32(4 * e, l[e], i);
406
+ }
407
+ digest() {
408
+ let { buffer: e, outputLen: t } = this;
409
+ this.digestInto(e);
410
+ let n = e.slice(0, t);
411
+ return this.destroy(), n;
412
+ }
413
+ _cloneInto(e) {
414
+ e ||= new this.constructor(), e.set(...this.get());
415
+ let { blockLen: t, buffer: n, length: r, finished: i, destroyed: a, pos: o } = this;
416
+ return e.destroyed = a, e.finished = i, e.length = r, e.pos = o, r % t && e.buffer.set(n), e;
417
+ }
418
+ clone() {
419
+ return this._cloneInto();
420
+ }
421
+ };
422
+ const k = Uint32Array.from([
423
+ 1779033703,
424
+ 3144134277,
425
+ 1013904242,
426
+ 2773480762,
427
+ 1359893119,
428
+ 2600822924,
429
+ 528734635,
430
+ 1541459225
431
+ ]), A = BigInt(2 ** 32 - 1), ve = BigInt(32);
432
+ function ye(e, t = !1) {
433
+ return t ? {
434
+ h: Number(e & A),
435
+ l: Number(e >> ve & A)
436
+ } : {
437
+ h: Number(e >> ve & A) | 0,
438
+ l: Number(e & A) | 0
439
+ };
440
+ }
441
+ function be(e, t = !1) {
442
+ let n = e.length, r = new Uint32Array(n), i = new Uint32Array(n);
443
+ for (let a = 0; a < n; a++) {
444
+ let { h: n, l: o } = ye(e[a], t);
445
+ [r[a], i[a]] = [n, o];
446
+ }
447
+ return [r, i];
448
+ }
449
+ const xe = Uint32Array.from([
450
+ 1116352408,
451
+ 1899447441,
452
+ 3049323471,
453
+ 3921009573,
454
+ 961987163,
455
+ 1508970993,
456
+ 2453635748,
457
+ 2870763221,
458
+ 3624381080,
459
+ 310598401,
460
+ 607225278,
461
+ 1426881987,
462
+ 1925078388,
463
+ 2162078206,
464
+ 2614888103,
465
+ 3248222580,
466
+ 3835390401,
467
+ 4022224774,
468
+ 264347078,
469
+ 604807628,
470
+ 770255983,
471
+ 1249150122,
472
+ 1555081692,
473
+ 1996064986,
474
+ 2554220882,
475
+ 2821834349,
476
+ 2952996808,
477
+ 3210313671,
478
+ 3336571891,
479
+ 3584528711,
480
+ 113926993,
481
+ 338241895,
482
+ 666307205,
483
+ 773529912,
484
+ 1294757372,
485
+ 1396182291,
486
+ 1695183700,
487
+ 1986661051,
488
+ 2177026350,
489
+ 2456956037,
490
+ 2730485921,
491
+ 2820302411,
492
+ 3259730800,
493
+ 3345764771,
494
+ 3516065817,
495
+ 3600352804,
496
+ 4094571909,
497
+ 275423344,
498
+ 430227734,
499
+ 506948616,
500
+ 659060556,
501
+ 883997877,
502
+ 958139571,
503
+ 1322822218,
504
+ 1537002063,
505
+ 1747873779,
506
+ 1955562222,
507
+ 2024104815,
508
+ 2227730452,
509
+ 2361852424,
510
+ 2428436474,
511
+ 2756734187,
512
+ 3204031479,
513
+ 3329325298
514
+ ]), j = new Uint32Array(64);
515
+ var Se = class extends _e {
516
+ constructor(e) {
517
+ super(64, e, 8, !1);
518
+ }
519
+ get() {
520
+ let { A: e, B: t, C: n, D: r, E: i, F: a, G: o, H: s } = this;
521
+ return [
522
+ e,
523
+ t,
524
+ n,
525
+ r,
526
+ i,
527
+ a,
528
+ o,
529
+ s
530
+ ];
531
+ }
532
+ set(e, t, n, r, i, a, o, s) {
533
+ this.A = e | 0, this.B = t | 0, this.C = n | 0, this.D = r | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = s | 0;
534
+ }
535
+ process(e, t) {
536
+ for (let n = 0; n < 16; n++, t += 4) j[n] = e.getUint32(t, !1);
537
+ for (let e = 16; e < 64; e++) {
538
+ let t = j[e - 15], n = j[e - 2], r = O(t, 7) ^ O(t, 18) ^ t >>> 3;
539
+ j[e] = (O(n, 17) ^ O(n, 19) ^ n >>> 10) + j[e - 7] + r + j[e - 16] | 0;
540
+ }
541
+ let { A: n, B: r, C: i, D: a, E: o, F: s, G: c, H: l } = this;
542
+ for (let e = 0; e < 64; e++) {
543
+ let t = O(o, 6) ^ O(o, 11) ^ O(o, 25), u = l + t + he(o, s, c) + xe[e] + j[e] | 0, d = (O(n, 2) ^ O(n, 13) ^ O(n, 22)) + ge(n, r, i) | 0;
544
+ l = c, c = s, s = o, o = a + u | 0, a = i, i = r, r = n, n = u + d | 0;
545
+ }
546
+ n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, s = s + this.F | 0, c = c + this.G | 0, l = l + this.H | 0, this.set(n, r, i, a, o, s, c, l);
547
+ }
548
+ roundClean() {
549
+ se(j);
550
+ }
551
+ destroy() {
552
+ this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), se(this.buffer);
553
+ }
554
+ }, Ce = class extends Se {
555
+ A = k[0] | 0;
556
+ B = k[1] | 0;
557
+ C = k[2] | 0;
558
+ D = k[3] | 0;
559
+ E = k[4] | 0;
560
+ F = k[5] | 0;
561
+ G = k[6] | 0;
562
+ H = k[7] | 0;
563
+ constructor() {
564
+ super(32);
565
+ }
566
+ };
567
+ const we = be(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map((e) => BigInt(e)));
568
+ we[0], we[1];
569
+ pe(() => new Ce(), me(1));
570
+ const Ee = (e) => `generaltranslation Formatting Error: Invalid cutoff style: ${e}.`, De = `DEFAULT_TERMINATOR_KEY`, Oe = {
571
+ ellipsis: {
572
+ fr: {
573
+ terminator: `…`,
574
+ separator: `β€―`
575
+ },
576
+ zh: {
577
+ terminator: `……`,
578
+ separator: void 0
579
+ },
580
+ ja: {
581
+ terminator: `……`,
582
+ separator: void 0
583
+ },
584
+ [De]: {
585
+ terminator: `…`,
586
+ separator: void 0
587
+ }
588
+ },
589
+ none: { [De]: {
590
+ terminator: void 0,
591
+ separator: void 0
592
+ } }
593
+ };
594
+ var ke = class e {
595
+ static resolveLocale(e) {
596
+ try {
597
+ let t = e ? Array.isArray(e) ? e.map(String) : [String(e)] : [`en`], [n] = Intl.getCanonicalLocales(t);
598
+ return n ?? `en`;
599
+ } catch {
600
+ return `en`;
601
+ }
602
+ }
603
+ constructor(t, n = {}) {
604
+ this.locale = e.resolveLocale(t);
605
+ let r = n.style ?? `ellipsis`;
606
+ if (!Oe[r]) throw Error(Ee(r));
607
+ let i = n.maxChars === void 0 ? void 0 : Oe[r][new Intl.Locale(this.locale).language] || Oe[r].DEFAULT_TERMINATOR_KEY, a = n.terminator ?? i?.terminator, o = a == null ? void 0 : n.separator ?? i?.separator;
608
+ this.additionLength = (a?.length ?? 0) + (o?.length ?? 0), n.maxChars !== void 0 && Math.abs(n.maxChars) < this.additionLength && (a = void 0, o = void 0), this.options = {
609
+ maxChars: n.maxChars,
610
+ style: n.maxChars === void 0 ? void 0 : r,
611
+ terminator: a,
612
+ separator: o
613
+ };
614
+ }
615
+ format(e) {
616
+ return this.formatToParts(e).join(``);
617
+ }
618
+ formatToParts(e) {
619
+ let { maxChars: t, terminator: n, separator: r } = this.options, i = t === void 0 || Math.abs(t) >= e.length ? t : t >= 0 ? Math.max(0, t - this.additionLength) : Math.min(0, t + this.additionLength), a = i !== void 0 && i > -1 ? e.slice(0, i) : e.slice(i);
620
+ return t == null || i == null || i === 0 || n == null || e.length <= Math.abs(t) ? [a] : i > 0 ? r == null ? [a, n] : [
621
+ a,
622
+ r,
623
+ n
624
+ ] : r == null ? [n, a] : [
625
+ n,
626
+ r,
627
+ a
628
+ ];
629
+ }
630
+ resolvedOptions() {
631
+ return this.options;
632
+ }
633
+ };
634
+ const Ae = {
635
+ Collator: Intl.Collator,
636
+ DateTimeFormat: Intl.DateTimeFormat,
637
+ DisplayNames: Intl.DisplayNames,
638
+ ListFormat: Intl.ListFormat,
639
+ Locale: Intl.Locale,
640
+ NumberFormat: Intl.NumberFormat,
641
+ PluralRules: Intl.PluralRules,
642
+ RelativeTimeFormat: Intl.RelativeTimeFormat,
643
+ Segmenter: Intl.Segmenter,
644
+ CutoffFormat: ke
645
+ };
646
+ new class {
647
+ constructor() {
648
+ this.cache = {};
649
+ }
650
+ generateKey(e, t = {}) {
651
+ return `${e ? Array.isArray(e) ? e.map((e) => String(e)).join(`,`) : String(e) : `undefined`}:${t ? JSON.stringify(t, Object.keys(t).sort()) : `{}`}`;
652
+ }
653
+ get(e, ...t) {
654
+ let [n = `en`, r = {}] = t, i = this.generateKey(n, r), a = this.cache[e];
655
+ a === void 0 && (a = {}, this.cache[e] = a);
656
+ let o = a[i];
657
+ return o === void 0 && (o = new Ae[e](...t), a[i] = o), o;
658
+ }
659
+ }();
660
+ var M = m({
661
+ __addDisposableResource: () => it,
662
+ __assign: () => F,
663
+ __asyncDelegator: () => Xe,
664
+ __asyncGenerator: () => Ye,
665
+ __asyncValues: () => Ze,
666
+ __await: () => P,
667
+ __awaiter: () => He,
668
+ __classPrivateFieldGet: () => tt,
669
+ __classPrivateFieldIn: () => rt,
670
+ __classPrivateFieldSet: () => nt,
671
+ __createBinding: () => I,
672
+ __decorate: () => Fe,
673
+ __disposeResources: () => at,
674
+ __esDecorate: () => Le,
675
+ __exportStar: () => We,
676
+ __extends: () => Ne,
677
+ __generator: () => Ue,
678
+ __importDefault: () => et,
679
+ __importStar: () => $e,
680
+ __makeTemplateObject: () => Qe,
681
+ __metadata: () => Ve,
682
+ __param: () => Ie,
683
+ __propKey: () => ze,
684
+ __read: () => Ge,
685
+ __rest: () => Pe,
686
+ __rewriteRelativeImportExtension: () => ot,
687
+ __runInitializers: () => Re,
688
+ __setFunctionName: () => Be,
689
+ __spread: () => Ke,
690
+ __spreadArray: () => Je,
691
+ __spreadArrays: () => qe,
692
+ __values: () => N,
693
+ default: () => ut
694
+ });
695
+ function Ne(e, t) {
696
+ if (typeof t != `function` && t !== null) throw TypeError(`Class extends value ` + String(t) + ` is not a constructor or null`);
697
+ st(e, t);
698
+ function n() {
699
+ this.constructor = e;
700
+ }
701
+ e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
702
+ }
703
+ function Pe(e, t) {
704
+ var n = {};
705
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
706
+ if (e != null && typeof Object.getOwnPropertySymbols == `function`) for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
707
+ return n;
708
+ }
709
+ function Fe(e, t, n, r) {
710
+ var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
711
+ if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a = Reflect.decorate(e, t, n, r);
712
+ else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
713
+ return i > 3 && a && Object.defineProperty(t, n, a), a;
714
+ }
715
+ function Ie(e, t) {
716
+ return function(n, r) {
717
+ t(n, r, e);
718
+ };
719
+ }
720
+ function Le(e, t, n, r, i, a) {
721
+ function o(e) {
722
+ if (e !== void 0 && typeof e != `function`) throw TypeError(`Function expected`);
723
+ return e;
724
+ }
725
+ for (var s = r.kind, c = s === `getter` ? `get` : s === `setter` ? `set` : `value`, l = !t && e ? r.static ? e : e.prototype : null, u = t || (l ? Object.getOwnPropertyDescriptor(l, r.name) : {}), d, f = !1, p = n.length - 1; p >= 0; p--) {
726
+ var m = {};
727
+ for (var h in r) m[h] = h === `access` ? {} : r[h];
728
+ for (var h in r.access) m.access[h] = r.access[h];
729
+ m.addInitializer = function(e) {
730
+ if (f) throw TypeError(`Cannot add initializers after decoration has completed`);
731
+ a.push(o(e || null));
732
+ };
733
+ var g = (0, n[p])(s === `accessor` ? {
734
+ get: u.get,
735
+ set: u.set
736
+ } : u[c], m);
737
+ if (s === `accessor`) {
738
+ if (g === void 0) continue;
739
+ if (typeof g != `object` || !g) throw TypeError(`Object expected`);
740
+ (d = o(g.get)) && (u.get = d), (d = o(g.set)) && (u.set = d), (d = o(g.init)) && i.unshift(d);
741
+ } else (d = o(g)) && (s === `field` ? i.unshift(d) : u[c] = d);
742
+ }
743
+ l && Object.defineProperty(l, r.name, u), f = !0;
744
+ }
745
+ function Re(e, t, n) {
746
+ for (var r = arguments.length > 2, i = 0; i < t.length; i++) n = r ? t[i].call(e, n) : t[i].call(e);
747
+ return r ? n : void 0;
748
+ }
749
+ function ze(e) {
750
+ return typeof e == `symbol` ? e : `${e}`;
751
+ }
752
+ function Be(e, t, n) {
753
+ return typeof t == `symbol` && (t = t.description ? `[${t.description}]` : ``), Object.defineProperty(e, `name`, {
754
+ configurable: !0,
755
+ value: n ? `${n} ${t}` : t
756
+ });
757
+ }
758
+ function Ve(e, t) {
759
+ if (typeof Reflect == `object` && typeof Reflect.metadata == `function`) return Reflect.metadata(e, t);
760
+ }
761
+ function He(e, t, n, r) {
762
+ function i(e) {
763
+ return e instanceof n ? e : new n(function(t) {
764
+ t(e);
765
+ });
766
+ }
767
+ return new (n ||= Promise)(function(n, a) {
768
+ function o(e) {
769
+ try {
770
+ c(r.next(e));
771
+ } catch (e) {
772
+ a(e);
773
+ }
774
+ }
775
+ function s(e) {
776
+ try {
777
+ c(r.throw(e));
778
+ } catch (e) {
779
+ a(e);
780
+ }
781
+ }
782
+ function c(e) {
783
+ e.done ? n(e.value) : i(e.value).then(o, s);
784
+ }
785
+ c((r = r.apply(e, t || [])).next());
786
+ });
787
+ }
788
+ function Ue(e, t) {
789
+ var n = {
790
+ label: 0,
791
+ sent: function() {
792
+ if (a[0] & 1) throw a[1];
793
+ return a[1];
794
+ },
795
+ trys: [],
796
+ ops: []
797
+ }, r, i, a, o = Object.create((typeof Iterator == `function` ? Iterator : Object).prototype);
798
+ return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == `function` && (o[Symbol.iterator] = function() {
799
+ return this;
800
+ }), o;
801
+ function s(e) {
802
+ return function(t) {
803
+ return c([e, t]);
804
+ };
805
+ }
806
+ function c(s) {
807
+ if (r) throw TypeError(`Generator is already executing.`);
808
+ for (; o && (o = 0, s[0] && (n = 0)), n;) try {
809
+ if (r = 1, i && (a = s[0] & 2 ? i.return : s[0] ? i.throw || ((a = i.return) && a.call(i), 0) : i.next) && !(a = a.call(i, s[1])).done) return a;
810
+ switch (i = 0, a && (s = [s[0] & 2, a.value]), s[0]) {
811
+ case 0:
812
+ case 1:
813
+ a = s;
814
+ break;
815
+ case 4: return n.label++, {
816
+ value: s[1],
817
+ done: !1
818
+ };
819
+ case 5:
820
+ n.label++, i = s[1], s = [0];
821
+ continue;
822
+ case 7:
823
+ s = n.ops.pop(), n.trys.pop();
824
+ continue;
825
+ default:
826
+ if ((a = n.trys, !(a = a.length > 0 && a[a.length - 1])) && (s[0] === 6 || s[0] === 2)) {
827
+ n = 0;
828
+ continue;
829
+ }
830
+ if (s[0] === 3 && (!a || s[1] > a[0] && s[1] < a[3])) {
831
+ n.label = s[1];
832
+ break;
833
+ }
834
+ if (s[0] === 6 && n.label < a[1]) {
835
+ n.label = a[1], a = s;
836
+ break;
837
+ }
838
+ if (a && n.label < a[2]) {
839
+ n.label = a[2], n.ops.push(s);
840
+ break;
841
+ }
842
+ a[2] && n.ops.pop(), n.trys.pop();
843
+ continue;
844
+ }
845
+ s = t.call(e, n);
846
+ } catch (e) {
847
+ s = [6, e], i = 0;
848
+ } finally {
849
+ r = a = 0;
850
+ }
851
+ if (s[0] & 5) throw s[1];
852
+ return {
853
+ value: s[0] ? s[1] : void 0,
854
+ done: !0
855
+ };
856
+ }
857
+ }
858
+ function We(e, t) {
859
+ for (var n in e) n !== `default` && !Object.prototype.hasOwnProperty.call(t, n) && I(t, e, n);
860
+ }
861
+ function N(e) {
862
+ var t = typeof Symbol == `function` && Symbol.iterator, n = t && e[t], r = 0;
863
+ if (n) return n.call(e);
864
+ if (e && typeof e.length == `number`) return { next: function() {
865
+ return e && r >= e.length && (e = void 0), {
866
+ value: e && e[r++],
867
+ done: !e
868
+ };
869
+ } };
870
+ throw TypeError(t ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
871
+ }
872
+ function Ge(e, t) {
873
+ var n = typeof Symbol == `function` && e[Symbol.iterator];
874
+ if (!n) return e;
875
+ var r = n.call(e), i, a = [], o;
876
+ try {
877
+ for (; (t === void 0 || t-- > 0) && !(i = r.next()).done;) a.push(i.value);
878
+ } catch (e) {
879
+ o = { error: e };
880
+ } finally {
881
+ try {
882
+ i && !i.done && (n = r.return) && n.call(r);
883
+ } finally {
884
+ if (o) throw o.error;
885
+ }
886
+ }
887
+ return a;
888
+ }
889
+ function Ke() {
890
+ for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(Ge(arguments[t]));
891
+ return e;
892
+ }
893
+ function qe() {
894
+ for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
895
+ for (var r = Array(e), i = 0, t = 0; t < n; t++) for (var a = arguments[t], o = 0, s = a.length; o < s; o++, i++) r[i] = a[o];
896
+ return r;
897
+ }
898
+ function Je(e, t, n) {
899
+ if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
900
+ return e.concat(a || Array.prototype.slice.call(t));
901
+ }
902
+ function P(e) {
903
+ return this instanceof P ? (this.v = e, this) : new P(e);
904
+ }
905
+ function Ye(e, t, n) {
906
+ if (!Symbol.asyncIterator) throw TypeError(`Symbol.asyncIterator is not defined.`);
907
+ var r = n.apply(e, t || []), i, a = [];
908
+ return i = Object.create((typeof AsyncIterator == `function` ? AsyncIterator : Object).prototype), s(`next`), s(`throw`), s(`return`, o), i[Symbol.asyncIterator] = function() {
909
+ return this;
910
+ }, i;
911
+ function o(e) {
912
+ return function(t) {
913
+ return Promise.resolve(t).then(e, d);
914
+ };
915
+ }
916
+ function s(e, t) {
917
+ r[e] && (i[e] = function(t) {
918
+ return new Promise(function(n, r) {
919
+ a.push([
920
+ e,
921
+ t,
922
+ n,
923
+ r
924
+ ]) > 1 || c(e, t);
925
+ });
926
+ }, t && (i[e] = t(i[e])));
927
+ }
928
+ function c(e, t) {
929
+ try {
930
+ l(r[e](t));
931
+ } catch (e) {
932
+ f(a[0][3], e);
933
+ }
934
+ }
935
+ function l(e) {
936
+ e.value instanceof P ? Promise.resolve(e.value.v).then(u, d) : f(a[0][2], e);
937
+ }
938
+ function u(e) {
939
+ c(`next`, e);
940
+ }
941
+ function d(e) {
942
+ c(`throw`, e);
943
+ }
944
+ function f(e, t) {
945
+ e(t), a.shift(), a.length && c(a[0][0], a[0][1]);
946
+ }
947
+ }
948
+ function Xe(e) {
949
+ var t, n;
950
+ return t = {}, r(`next`), r(`throw`, function(e) {
951
+ throw e;
952
+ }), r(`return`), t[Symbol.iterator] = function() {
953
+ return this;
954
+ }, t;
955
+ function r(r, i) {
956
+ t[r] = e[r] ? function(t) {
957
+ return (n = !n) ? {
958
+ value: P(e[r](t)),
959
+ done: !1
960
+ } : i ? i(t) : t;
961
+ } : i;
962
+ }
963
+ }
964
+ function Ze(e) {
965
+ if (!Symbol.asyncIterator) throw TypeError(`Symbol.asyncIterator is not defined.`);
966
+ var t = e[Symbol.asyncIterator], n;
967
+ return t ? t.call(e) : (e = typeof N == `function` ? N(e) : e[Symbol.iterator](), n = {}, r(`next`), r(`throw`), r(`return`), n[Symbol.asyncIterator] = function() {
968
+ return this;
969
+ }, n);
970
+ function r(t) {
971
+ n[t] = e[t] && function(n) {
972
+ return new Promise(function(r, a) {
973
+ n = e[t](n), i(r, a, n.done, n.value);
974
+ });
975
+ };
976
+ }
977
+ function i(e, t, n, r) {
978
+ Promise.resolve(r).then(function(t) {
979
+ e({
980
+ value: t,
981
+ done: n
982
+ });
983
+ }, t);
984
+ }
985
+ }
986
+ function Qe(e, t) {
987
+ return Object.defineProperty ? Object.defineProperty(e, `raw`, { value: t }) : e.raw = t, e;
988
+ }
989
+ function $e(e) {
990
+ if (e && e.__esModule) return e;
991
+ var t = {};
992
+ if (e != null) for (var n = L(e), r = 0; r < n.length; r++) n[r] !== `default` && I(t, e, n[r]);
993
+ return ct(t, e), t;
994
+ }
995
+ function et(e) {
996
+ return e && e.__esModule ? e : { default: e };
997
+ }
998
+ function tt(e, t, n, r) {
999
+ if (n === `a` && !r) throw TypeError(`Private accessor was defined without a getter`);
1000
+ if (typeof t == `function` ? e !== t || !r : !t.has(e)) throw TypeError(`Cannot read private member from an object whose class did not declare it`);
1001
+ return n === `m` ? r : n === `a` ? r.call(e) : r ? r.value : t.get(e);
1002
+ }
1003
+ function nt(e, t, n, r, i) {
1004
+ if (r === `m`) throw TypeError(`Private method is not writable`);
1005
+ if (r === `a` && !i) throw TypeError(`Private accessor was defined without a setter`);
1006
+ if (typeof t == `function` ? e !== t || !i : !t.has(e)) throw TypeError(`Cannot write private member to an object whose class did not declare it`);
1007
+ return r === `a` ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
1008
+ }
1009
+ function rt(e, t) {
1010
+ if (t === null || typeof t != `object` && typeof t != `function`) throw TypeError(`Cannot use 'in' operator on non-object`);
1011
+ return typeof e == `function` ? t === e : e.has(t);
1012
+ }
1013
+ function it(e, t, n) {
1014
+ if (t != null) {
1015
+ if (typeof t != `object` && typeof t != `function`) throw TypeError(`Object expected.`);
1016
+ var r, i;
1017
+ if (n) {
1018
+ if (!Symbol.asyncDispose) throw TypeError(`Symbol.asyncDispose is not defined.`);
1019
+ r = t[Symbol.asyncDispose];
1020
+ }
1021
+ if (r === void 0) {
1022
+ if (!Symbol.dispose) throw TypeError(`Symbol.dispose is not defined.`);
1023
+ r = t[Symbol.dispose], n && (i = r);
1024
+ }
1025
+ if (typeof r != `function`) throw TypeError(`Object not disposable.`);
1026
+ i && (r = function() {
1027
+ try {
1028
+ i.call(this);
1029
+ } catch (e) {
1030
+ return Promise.reject(e);
1031
+ }
1032
+ }), e.stack.push({
1033
+ value: t,
1034
+ dispose: r,
1035
+ async: n
1036
+ });
1037
+ } else n && e.stack.push({ async: !0 });
1038
+ return t;
1039
+ }
1040
+ function at(e) {
1041
+ function t(t) {
1042
+ e.error = e.hasError ? new lt(t, e.error, `An error was suppressed during disposal.`) : t, e.hasError = !0;
1043
+ }
1044
+ var n, r = 0;
1045
+ function i() {
1046
+ for (; n = e.stack.pop();) try {
1047
+ if (!n.async && r === 1) return r = 0, e.stack.push(n), Promise.resolve().then(i);
1048
+ if (n.dispose) {
1049
+ var a = n.dispose.call(n.value);
1050
+ if (n.async) return r |= 2, Promise.resolve(a).then(i, function(e) {
1051
+ return t(e), i();
1052
+ });
1053
+ } else r |= 1;
1054
+ } catch (e) {
1055
+ t(e);
1056
+ }
1057
+ if (r === 1) return e.hasError ? Promise.reject(e.error) : Promise.resolve();
1058
+ if (e.hasError) throw e.error;
1059
+ }
1060
+ return i();
1061
+ }
1062
+ function ot(e, t) {
1063
+ return typeof e == `string` && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(e, n, r, i, a) {
1064
+ return n ? t ? `.jsx` : `.js` : r && (!i || !a) ? e : r + i + `.` + a.toLowerCase() + `js`;
1065
+ }) : e;
1066
+ }
1067
+ var st, F, I, ct, L, lt, ut, R = f((() => {
1068
+ st = function(e, t) {
1069
+ return st = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1070
+ e.__proto__ = t;
1071
+ } || function(e, t) {
1072
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1073
+ }, st(e, t);
1074
+ }, F = function() {
1075
+ return F = Object.assign || function(e) {
1076
+ for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
1077
+ return e;
1078
+ }, F.apply(this, arguments);
1079
+ }, I = Object.create ? (function(e, t, n, r) {
1080
+ r === void 0 && (r = n);
1081
+ var i = Object.getOwnPropertyDescriptor(t, n);
1082
+ (!i || (`get` in i ? !t.__esModule : i.writable || i.configurable)) && (i = {
1083
+ enumerable: !0,
1084
+ get: function() {
1085
+ return t[n];
1086
+ }
1087
+ }), Object.defineProperty(e, r, i);
1088
+ }) : (function(e, t, n, r) {
1089
+ r === void 0 && (r = n), e[r] = t[n];
1090
+ }), ct = Object.create ? (function(e, t) {
1091
+ Object.defineProperty(e, `default`, {
1092
+ enumerable: !0,
1093
+ value: t
1094
+ });
1095
+ }) : function(e, t) {
1096
+ e.default = t;
1097
+ }, L = function(e) {
1098
+ return L = Object.getOwnPropertyNames || function(e) {
1099
+ var t = [];
1100
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
1101
+ return t;
1102
+ }, L(e);
1103
+ }, lt = typeof SuppressedError == `function` ? SuppressedError : function(e, t, n) {
1104
+ var r = Error(n);
1105
+ return r.name = `SuppressedError`, r.error = e, r.suppressed = t, r;
1106
+ }, ut = {
1107
+ __extends: Ne,
1108
+ __assign: F,
1109
+ __rest: Pe,
1110
+ __decorate: Fe,
1111
+ __param: Ie,
1112
+ __esDecorate: Le,
1113
+ __runInitializers: Re,
1114
+ __propKey: ze,
1115
+ __setFunctionName: Be,
1116
+ __metadata: Ve,
1117
+ __awaiter: He,
1118
+ __generator: Ue,
1119
+ __createBinding: I,
1120
+ __exportStar: We,
1121
+ __values: N,
1122
+ __read: Ge,
1123
+ __spread: Ke,
1124
+ __spreadArrays: qe,
1125
+ __spreadArray: Je,
1126
+ __await: P,
1127
+ __asyncGenerator: Ye,
1128
+ __asyncDelegator: Xe,
1129
+ __asyncValues: Ze,
1130
+ __makeTemplateObject: Qe,
1131
+ __importStar: $e,
1132
+ __importDefault: et,
1133
+ __classPrivateFieldGet: tt,
1134
+ __classPrivateFieldSet: nt,
1135
+ __classPrivateFieldIn: rt,
1136
+ __addDisposableResource: it,
1137
+ __disposeResources: at,
1138
+ __rewriteRelativeImportExtension: ot
1139
+ };
1140
+ })), dt = p(((e) => {
1141
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.ErrorKind = void 0;
1142
+ var t;
1143
+ (function(e) {
1144
+ e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = `EXPECT_ARGUMENT_CLOSING_BRACE`, e[e.EMPTY_ARGUMENT = 2] = `EMPTY_ARGUMENT`, e[e.MALFORMED_ARGUMENT = 3] = `MALFORMED_ARGUMENT`, e[e.EXPECT_ARGUMENT_TYPE = 4] = `EXPECT_ARGUMENT_TYPE`, e[e.INVALID_ARGUMENT_TYPE = 5] = `INVALID_ARGUMENT_TYPE`, e[e.EXPECT_ARGUMENT_STYLE = 6] = `EXPECT_ARGUMENT_STYLE`, e[e.INVALID_NUMBER_SKELETON = 7] = `INVALID_NUMBER_SKELETON`, e[e.INVALID_DATE_TIME_SKELETON = 8] = `INVALID_DATE_TIME_SKELETON`, e[e.EXPECT_NUMBER_SKELETON = 9] = `EXPECT_NUMBER_SKELETON`, e[e.EXPECT_DATE_TIME_SKELETON = 10] = `EXPECT_DATE_TIME_SKELETON`, e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = `UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`, e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = `EXPECT_SELECT_ARGUMENT_OPTIONS`, e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = `EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`, e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = `INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`, e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = `EXPECT_SELECT_ARGUMENT_SELECTOR`, e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = `EXPECT_PLURAL_ARGUMENT_SELECTOR`, e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = `EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`, e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = `EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`, e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = `INVALID_PLURAL_ARGUMENT_SELECTOR`, e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = `DUPLICATE_PLURAL_ARGUMENT_SELECTOR`, e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = `DUPLICATE_SELECT_ARGUMENT_SELECTOR`, e[e.MISSING_OTHER_CLAUSE = 22] = `MISSING_OTHER_CLAUSE`, e[e.INVALID_TAG = 23] = `INVALID_TAG`, e[e.INVALID_TAG_NAME = 25] = `INVALID_TAG_NAME`, e[e.UNMATCHED_CLOSING_TAG = 26] = `UNMATCHED_CLOSING_TAG`, e[e.UNCLOSED_TAG = 27] = `UNCLOSED_TAG`;
1145
+ })(t || (e.ErrorKind = t = {}));
1146
+ })), z = p(((e) => {
1147
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.SKELETON_TYPE = e.TYPE = void 0, e.isLiteralElement = r, e.isArgumentElement = i, e.isNumberElement = a, e.isDateElement = o, e.isTimeElement = s, e.isSelectElement = c, e.isPluralElement = l, e.isPoundElement = u, e.isTagElement = d, e.isNumberSkeleton = f, e.isDateTimeSkeleton = p, e.createLiteralElement = m, e.createNumberElement = h;
1148
+ var t;
1149
+ (function(e) {
1150
+ e[e.literal = 0] = `literal`, e[e.argument = 1] = `argument`, e[e.number = 2] = `number`, e[e.date = 3] = `date`, e[e.time = 4] = `time`, e[e.select = 5] = `select`, e[e.plural = 6] = `plural`, e[e.pound = 7] = `pound`, e[e.tag = 8] = `tag`;
1151
+ })(t || (e.TYPE = t = {}));
1152
+ var n;
1153
+ (function(e) {
1154
+ e[e.number = 0] = `number`, e[e.dateTime = 1] = `dateTime`;
1155
+ })(n || (e.SKELETON_TYPE = n = {}));
1156
+ function r(e) {
1157
+ return e.type === t.literal;
1158
+ }
1159
+ function i(e) {
1160
+ return e.type === t.argument;
1161
+ }
1162
+ function a(e) {
1163
+ return e.type === t.number;
1164
+ }
1165
+ function o(e) {
1166
+ return e.type === t.date;
1167
+ }
1168
+ function s(e) {
1169
+ return e.type === t.time;
1170
+ }
1171
+ function c(e) {
1172
+ return e.type === t.select;
1173
+ }
1174
+ function l(e) {
1175
+ return e.type === t.plural;
1176
+ }
1177
+ function u(e) {
1178
+ return e.type === t.pound;
1179
+ }
1180
+ function d(e) {
1181
+ return e.type === t.tag;
1182
+ }
1183
+ function f(e) {
1184
+ return !!(e && typeof e == `object` && e.type === n.number);
1185
+ }
1186
+ function p(e) {
1187
+ return !!(e && typeof e == `object` && e.type === n.dateTime);
1188
+ }
1189
+ function m(e) {
1190
+ return {
1191
+ type: t.literal,
1192
+ value: e
1193
+ };
1194
+ }
1195
+ function h(e, n) {
1196
+ return {
1197
+ type: t.number,
1198
+ value: e,
1199
+ style: n
1200
+ };
1201
+ }
1202
+ })), ft = p(((e) => {
1203
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.WHITE_SPACE_REGEX = e.SPACE_SEPARATOR_REGEX = void 0, e.SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, e.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/;
1204
+ })), pt = p(((e) => {
1205
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.parseDateTimeSkeleton = n;
1206
+ var t = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
1207
+ function n(e) {
1208
+ var n = {};
1209
+ return e.replace(t, function(e) {
1210
+ var t = e.length;
1211
+ switch (e[0]) {
1212
+ case `G`:
1213
+ n.era = t === 4 ? `long` : t === 5 ? `narrow` : `short`;
1214
+ break;
1215
+ case `y`:
1216
+ n.year = t === 2 ? `2-digit` : `numeric`;
1217
+ break;
1218
+ case `Y`:
1219
+ case `u`:
1220
+ case `U`:
1221
+ case `r`: throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
1222
+ case `q`:
1223
+ case `Q`: throw RangeError("`q/Q` (quarter) patterns are not supported");
1224
+ case `M`:
1225
+ case `L`:
1226
+ n.month = [
1227
+ `numeric`,
1228
+ `2-digit`,
1229
+ `short`,
1230
+ `long`,
1231
+ `narrow`
1232
+ ][t - 1];
1233
+ break;
1234
+ case `w`:
1235
+ case `W`: throw RangeError("`w/W` (week) patterns are not supported");
1236
+ case `d`:
1237
+ n.day = [`numeric`, `2-digit`][t - 1];
1238
+ break;
1239
+ case `D`:
1240
+ case `F`:
1241
+ case `g`: throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
1242
+ case `E`:
1243
+ n.weekday = t === 4 ? `long` : t === 5 ? `narrow` : `short`;
1244
+ break;
1245
+ case `e`:
1246
+ if (t < 4) throw RangeError("`e..eee` (weekday) patterns are not supported");
1247
+ n.weekday = [
1248
+ `short`,
1249
+ `long`,
1250
+ `narrow`,
1251
+ `short`
1252
+ ][t - 4];
1253
+ break;
1254
+ case `c`:
1255
+ if (t < 4) throw RangeError("`c..ccc` (weekday) patterns are not supported");
1256
+ n.weekday = [
1257
+ `short`,
1258
+ `long`,
1259
+ `narrow`,
1260
+ `short`
1261
+ ][t - 4];
1262
+ break;
1263
+ case `a`:
1264
+ n.hour12 = !0;
1265
+ break;
1266
+ case `b`:
1267
+ case `B`: throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");
1268
+ case `h`:
1269
+ n.hourCycle = `h12`, n.hour = [`numeric`, `2-digit`][t - 1];
1270
+ break;
1271
+ case `H`:
1272
+ n.hourCycle = `h23`, n.hour = [`numeric`, `2-digit`][t - 1];
1273
+ break;
1274
+ case `K`:
1275
+ n.hourCycle = `h11`, n.hour = [`numeric`, `2-digit`][t - 1];
1276
+ break;
1277
+ case `k`:
1278
+ n.hourCycle = `h24`, n.hour = [`numeric`, `2-digit`][t - 1];
1279
+ break;
1280
+ case `j`:
1281
+ case `J`:
1282
+ case `C`: throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
1283
+ case `m`:
1284
+ n.minute = [`numeric`, `2-digit`][t - 1];
1285
+ break;
1286
+ case `s`:
1287
+ n.second = [`numeric`, `2-digit`][t - 1];
1288
+ break;
1289
+ case `S`:
1290
+ case `A`: throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");
1291
+ case `z`:
1292
+ n.timeZoneName = t < 4 ? `short` : `long`;
1293
+ break;
1294
+ case `Z`:
1295
+ case `O`:
1296
+ case `v`:
1297
+ case `V`:
1298
+ case `X`:
1299
+ case `x`: throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
1300
+ }
1301
+ return ``;
1302
+ }), n;
1303
+ }
1304
+ })), mt = p(((e) => {
1305
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.WHITE_SPACE_REGEX = void 0, e.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
1306
+ })), ht = p(((e) => {
1307
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.parseNumberSkeletonFromString = r, e.parseNumberSkeleton = p;
1308
+ var t = (R(), g(M)), n = mt();
1309
+ function r(e) {
1310
+ if (e.length === 0) throw Error(`Number skeleton cannot be empty`);
1311
+ for (var t = e.split(n.WHITE_SPACE_REGEX).filter(function(e) {
1312
+ return e.length > 0;
1313
+ }), r = [], i = 0, a = t; i < a.length; i++) {
1314
+ var o = a[i].split(`/`);
1315
+ if (o.length === 0) throw Error(`Invalid number skeleton`);
1316
+ for (var s = o[0], c = o.slice(1), l = 0, u = c; l < u.length; l++) if (u[l].length === 0) throw Error(`Invalid number skeleton`);
1317
+ r.push({
1318
+ stem: s,
1319
+ options: c
1320
+ });
1321
+ }
1322
+ return r;
1323
+ }
1324
+ function i(e) {
1325
+ return e.replace(/^(.*?)-/, ``);
1326
+ }
1327
+ var a = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, o = /^(@+)?(\+|#+)?[rs]?$/g, s = /(\*)(0+)|(#+)(0+)|(0+)/g, c = /^(0+)$/;
1328
+ function l(e) {
1329
+ var t = {};
1330
+ return e[e.length - 1] === `r` ? t.roundingPriority = `morePrecision` : e[e.length - 1] === `s` && (t.roundingPriority = `lessPrecision`), e.replace(o, function(e, n, r) {
1331
+ return typeof r == `string` ? r === `+` ? t.minimumSignificantDigits = n.length : n[0] === `#` ? t.maximumSignificantDigits = n.length : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length + (typeof r == `string` ? r.length : 0)) : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length), ``;
1332
+ }), t;
1333
+ }
1334
+ function u(e) {
1335
+ switch (e) {
1336
+ case `sign-auto`: return { signDisplay: `auto` };
1337
+ case `sign-accounting`:
1338
+ case `()`: return { currencySign: `accounting` };
1339
+ case `sign-always`:
1340
+ case `+!`: return { signDisplay: `always` };
1341
+ case `sign-accounting-always`:
1342
+ case `()!`: return {
1343
+ signDisplay: `always`,
1344
+ currencySign: `accounting`
1345
+ };
1346
+ case `sign-except-zero`:
1347
+ case `+?`: return { signDisplay: `exceptZero` };
1348
+ case `sign-accounting-except-zero`:
1349
+ case `()?`: return {
1350
+ signDisplay: `exceptZero`,
1351
+ currencySign: `accounting`
1352
+ };
1353
+ case `sign-never`:
1354
+ case `+_`: return { signDisplay: `never` };
1355
+ }
1356
+ }
1357
+ function d(e) {
1358
+ var t;
1359
+ if (e[0] === `E` && e[1] === `E` ? (t = { notation: `engineering` }, e = e.slice(2)) : e[0] === `E` && (t = { notation: `scientific` }, e = e.slice(1)), t) {
1360
+ var n = e.slice(0, 2);
1361
+ if (n === `+!` ? (t.signDisplay = `always`, e = e.slice(2)) : n === `+?` && (t.signDisplay = `exceptZero`, e = e.slice(2)), !c.test(e)) throw Error(`Malformed concise eng/scientific notation`);
1362
+ t.minimumIntegerDigits = e.length;
1363
+ }
1364
+ return t;
1365
+ }
1366
+ function f(e) {
1367
+ return u(e) || {};
1368
+ }
1369
+ function p(e) {
1370
+ for (var n = {}, r = 0, p = e; r < p.length; r++) {
1371
+ var m = p[r];
1372
+ switch (m.stem) {
1373
+ case `percent`:
1374
+ case `%`:
1375
+ n.style = `percent`;
1376
+ continue;
1377
+ case `%x100`:
1378
+ n.style = `percent`, n.scale = 100;
1379
+ continue;
1380
+ case `currency`:
1381
+ n.style = `currency`, n.currency = m.options[0];
1382
+ continue;
1383
+ case `group-off`:
1384
+ case `,_`:
1385
+ n.useGrouping = !1;
1386
+ continue;
1387
+ case `precision-integer`:
1388
+ case `.`:
1389
+ n.maximumFractionDigits = 0;
1390
+ continue;
1391
+ case `measure-unit`:
1392
+ case `unit`:
1393
+ n.style = `unit`, n.unit = i(m.options[0]);
1394
+ continue;
1395
+ case `compact-short`:
1396
+ case `K`:
1397
+ n.notation = `compact`, n.compactDisplay = `short`;
1398
+ continue;
1399
+ case `compact-long`:
1400
+ case `KK`:
1401
+ n.notation = `compact`, n.compactDisplay = `long`;
1402
+ continue;
1403
+ case `scientific`:
1404
+ n = t.__assign(t.__assign(t.__assign({}, n), { notation: `scientific` }), m.options.reduce(function(e, n) {
1405
+ return t.__assign(t.__assign({}, e), f(n));
1406
+ }, {}));
1407
+ continue;
1408
+ case `engineering`:
1409
+ n = t.__assign(t.__assign(t.__assign({}, n), { notation: `engineering` }), m.options.reduce(function(e, n) {
1410
+ return t.__assign(t.__assign({}, e), f(n));
1411
+ }, {}));
1412
+ continue;
1413
+ case `notation-simple`:
1414
+ n.notation = `standard`;
1415
+ continue;
1416
+ case `unit-width-narrow`:
1417
+ n.currencyDisplay = `narrowSymbol`, n.unitDisplay = `narrow`;
1418
+ continue;
1419
+ case `unit-width-short`:
1420
+ n.currencyDisplay = `code`, n.unitDisplay = `short`;
1421
+ continue;
1422
+ case `unit-width-full-name`:
1423
+ n.currencyDisplay = `name`, n.unitDisplay = `long`;
1424
+ continue;
1425
+ case `unit-width-iso-code`:
1426
+ n.currencyDisplay = `symbol`;
1427
+ continue;
1428
+ case `scale`:
1429
+ n.scale = parseFloat(m.options[0]);
1430
+ continue;
1431
+ case `rounding-mode-floor`:
1432
+ n.roundingMode = `floor`;
1433
+ continue;
1434
+ case `rounding-mode-ceiling`:
1435
+ n.roundingMode = `ceil`;
1436
+ continue;
1437
+ case `rounding-mode-down`:
1438
+ n.roundingMode = `trunc`;
1439
+ continue;
1440
+ case `rounding-mode-up`:
1441
+ n.roundingMode = `expand`;
1442
+ continue;
1443
+ case `rounding-mode-half-even`:
1444
+ n.roundingMode = `halfEven`;
1445
+ continue;
1446
+ case `rounding-mode-half-down`:
1447
+ n.roundingMode = `halfTrunc`;
1448
+ continue;
1449
+ case `rounding-mode-half-up`:
1450
+ n.roundingMode = `halfExpand`;
1451
+ continue;
1452
+ case `integer-width`:
1453
+ if (m.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
1454
+ m.options[0].replace(s, function(e, t, r, i, a, o) {
1455
+ if (t) n.minimumIntegerDigits = r.length;
1456
+ else if (i && a) throw Error(`We currently do not support maximum integer digits`);
1457
+ else if (o) throw Error(`We currently do not support exact integer digits`);
1458
+ return ``;
1459
+ });
1460
+ continue;
1461
+ }
1462
+ if (c.test(m.stem)) {
1463
+ n.minimumIntegerDigits = m.stem.length;
1464
+ continue;
1465
+ }
1466
+ if (a.test(m.stem)) {
1467
+ if (m.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
1468
+ m.stem.replace(a, function(e, t, r, i, a, o) {
1469
+ return r === `*` ? n.minimumFractionDigits = t.length : i && i[0] === `#` ? n.maximumFractionDigits = i.length : a && o ? (n.minimumFractionDigits = a.length, n.maximumFractionDigits = a.length + o.length) : (n.minimumFractionDigits = t.length, n.maximumFractionDigits = t.length), ``;
1470
+ });
1471
+ var h = m.options[0];
1472
+ h === `w` ? n = t.__assign(t.__assign({}, n), { trailingZeroDisplay: `stripIfInteger` }) : h && (n = t.__assign(t.__assign({}, n), l(h)));
1473
+ continue;
1474
+ }
1475
+ if (o.test(m.stem)) {
1476
+ n = t.__assign(t.__assign({}, n), l(m.stem));
1477
+ continue;
1478
+ }
1479
+ var g = u(m.stem);
1480
+ g && (n = t.__assign(t.__assign({}, n), g));
1481
+ var _ = d(m.stem);
1482
+ _ && (n = t.__assign(t.__assign({}, n), _));
1483
+ }
1484
+ return n;
1485
+ }
1486
+ })), gt = p(((e) => {
1487
+ Object.defineProperty(e, `__esModule`, { value: !0 });
1488
+ var t = (R(), g(M));
1489
+ t.__exportStar(pt(), e), t.__exportStar(ht(), e);
1490
+ })), _t = p(((e) => {
1491
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.timeData = void 0, e.timeData = {
1492
+ "001": [`H`, `h`],
1493
+ 419: [
1494
+ `h`,
1495
+ `H`,
1496
+ `hB`,
1497
+ `hb`
1498
+ ],
1499
+ AC: [
1500
+ `H`,
1501
+ `h`,
1502
+ `hb`,
1503
+ `hB`
1504
+ ],
1505
+ AD: [`H`, `hB`],
1506
+ AE: [
1507
+ `h`,
1508
+ `hB`,
1509
+ `hb`,
1510
+ `H`
1511
+ ],
1512
+ AF: [
1513
+ `H`,
1514
+ `hb`,
1515
+ `hB`,
1516
+ `h`
1517
+ ],
1518
+ AG: [
1519
+ `h`,
1520
+ `hb`,
1521
+ `H`,
1522
+ `hB`
1523
+ ],
1524
+ AI: [
1525
+ `H`,
1526
+ `h`,
1527
+ `hb`,
1528
+ `hB`
1529
+ ],
1530
+ AL: [
1531
+ `h`,
1532
+ `H`,
1533
+ `hB`
1534
+ ],
1535
+ AM: [`H`, `hB`],
1536
+ AO: [`H`, `hB`],
1537
+ AR: [
1538
+ `h`,
1539
+ `H`,
1540
+ `hB`,
1541
+ `hb`
1542
+ ],
1543
+ AS: [`h`, `H`],
1544
+ AT: [`H`, `hB`],
1545
+ AU: [
1546
+ `h`,
1547
+ `hb`,
1548
+ `H`,
1549
+ `hB`
1550
+ ],
1551
+ AW: [`H`, `hB`],
1552
+ AX: [`H`],
1553
+ AZ: [
1554
+ `H`,
1555
+ `hB`,
1556
+ `h`
1557
+ ],
1558
+ BA: [
1559
+ `H`,
1560
+ `hB`,
1561
+ `h`
1562
+ ],
1563
+ BB: [
1564
+ `h`,
1565
+ `hb`,
1566
+ `H`,
1567
+ `hB`
1568
+ ],
1569
+ BD: [
1570
+ `h`,
1571
+ `hB`,
1572
+ `H`
1573
+ ],
1574
+ BE: [`H`, `hB`],
1575
+ BF: [`H`, `hB`],
1576
+ BG: [
1577
+ `H`,
1578
+ `hB`,
1579
+ `h`
1580
+ ],
1581
+ BH: [
1582
+ `h`,
1583
+ `hB`,
1584
+ `hb`,
1585
+ `H`
1586
+ ],
1587
+ BI: [`H`, `h`],
1588
+ BJ: [`H`, `hB`],
1589
+ BL: [`H`, `hB`],
1590
+ BM: [
1591
+ `h`,
1592
+ `hb`,
1593
+ `H`,
1594
+ `hB`
1595
+ ],
1596
+ BN: [
1597
+ `hb`,
1598
+ `hB`,
1599
+ `h`,
1600
+ `H`
1601
+ ],
1602
+ BO: [
1603
+ `h`,
1604
+ `H`,
1605
+ `hB`,
1606
+ `hb`
1607
+ ],
1608
+ BQ: [`H`],
1609
+ BR: [`H`, `hB`],
1610
+ BS: [
1611
+ `h`,
1612
+ `hb`,
1613
+ `H`,
1614
+ `hB`
1615
+ ],
1616
+ BT: [`h`, `H`],
1617
+ BW: [
1618
+ `H`,
1619
+ `h`,
1620
+ `hb`,
1621
+ `hB`
1622
+ ],
1623
+ BY: [`H`, `h`],
1624
+ BZ: [
1625
+ `H`,
1626
+ `h`,
1627
+ `hb`,
1628
+ `hB`
1629
+ ],
1630
+ CA: [
1631
+ `h`,
1632
+ `hb`,
1633
+ `H`,
1634
+ `hB`
1635
+ ],
1636
+ CC: [
1637
+ `H`,
1638
+ `h`,
1639
+ `hb`,
1640
+ `hB`
1641
+ ],
1642
+ CD: [`hB`, `H`],
1643
+ CF: [
1644
+ `H`,
1645
+ `h`,
1646
+ `hB`
1647
+ ],
1648
+ CG: [`H`, `hB`],
1649
+ CH: [
1650
+ `H`,
1651
+ `hB`,
1652
+ `h`
1653
+ ],
1654
+ CI: [`H`, `hB`],
1655
+ CK: [
1656
+ `H`,
1657
+ `h`,
1658
+ `hb`,
1659
+ `hB`
1660
+ ],
1661
+ CL: [
1662
+ `h`,
1663
+ `H`,
1664
+ `hB`,
1665
+ `hb`
1666
+ ],
1667
+ CM: [
1668
+ `H`,
1669
+ `h`,
1670
+ `hB`
1671
+ ],
1672
+ CN: [
1673
+ `H`,
1674
+ `hB`,
1675
+ `hb`,
1676
+ `h`
1677
+ ],
1678
+ CO: [
1679
+ `h`,
1680
+ `H`,
1681
+ `hB`,
1682
+ `hb`
1683
+ ],
1684
+ CP: [`H`],
1685
+ CR: [
1686
+ `h`,
1687
+ `H`,
1688
+ `hB`,
1689
+ `hb`
1690
+ ],
1691
+ CU: [
1692
+ `h`,
1693
+ `H`,
1694
+ `hB`,
1695
+ `hb`
1696
+ ],
1697
+ CV: [`H`, `hB`],
1698
+ CW: [`H`, `hB`],
1699
+ CX: [
1700
+ `H`,
1701
+ `h`,
1702
+ `hb`,
1703
+ `hB`
1704
+ ],
1705
+ CY: [
1706
+ `h`,
1707
+ `H`,
1708
+ `hb`,
1709
+ `hB`
1710
+ ],
1711
+ CZ: [`H`],
1712
+ DE: [`H`, `hB`],
1713
+ DG: [
1714
+ `H`,
1715
+ `h`,
1716
+ `hb`,
1717
+ `hB`
1718
+ ],
1719
+ DJ: [`h`, `H`],
1720
+ DK: [`H`],
1721
+ DM: [
1722
+ `h`,
1723
+ `hb`,
1724
+ `H`,
1725
+ `hB`
1726
+ ],
1727
+ DO: [
1728
+ `h`,
1729
+ `H`,
1730
+ `hB`,
1731
+ `hb`
1732
+ ],
1733
+ DZ: [
1734
+ `h`,
1735
+ `hB`,
1736
+ `hb`,
1737
+ `H`
1738
+ ],
1739
+ EA: [
1740
+ `H`,
1741
+ `h`,
1742
+ `hB`,
1743
+ `hb`
1744
+ ],
1745
+ EC: [
1746
+ `h`,
1747
+ `H`,
1748
+ `hB`,
1749
+ `hb`
1750
+ ],
1751
+ EE: [`H`, `hB`],
1752
+ EG: [
1753
+ `h`,
1754
+ `hB`,
1755
+ `hb`,
1756
+ `H`
1757
+ ],
1758
+ EH: [
1759
+ `h`,
1760
+ `hB`,
1761
+ `hb`,
1762
+ `H`
1763
+ ],
1764
+ ER: [`h`, `H`],
1765
+ ES: [
1766
+ `H`,
1767
+ `hB`,
1768
+ `h`,
1769
+ `hb`
1770
+ ],
1771
+ ET: [
1772
+ `hB`,
1773
+ `hb`,
1774
+ `h`,
1775
+ `H`
1776
+ ],
1777
+ FI: [`H`],
1778
+ FJ: [
1779
+ `h`,
1780
+ `hb`,
1781
+ `H`,
1782
+ `hB`
1783
+ ],
1784
+ FK: [
1785
+ `H`,
1786
+ `h`,
1787
+ `hb`,
1788
+ `hB`
1789
+ ],
1790
+ FM: [
1791
+ `h`,
1792
+ `hb`,
1793
+ `H`,
1794
+ `hB`
1795
+ ],
1796
+ FO: [`H`, `h`],
1797
+ FR: [`H`, `hB`],
1798
+ GA: [`H`, `hB`],
1799
+ GB: [
1800
+ `H`,
1801
+ `h`,
1802
+ `hb`,
1803
+ `hB`
1804
+ ],
1805
+ GD: [
1806
+ `h`,
1807
+ `hb`,
1808
+ `H`,
1809
+ `hB`
1810
+ ],
1811
+ GE: [
1812
+ `H`,
1813
+ `hB`,
1814
+ `h`
1815
+ ],
1816
+ GF: [`H`, `hB`],
1817
+ GG: [
1818
+ `H`,
1819
+ `h`,
1820
+ `hb`,
1821
+ `hB`
1822
+ ],
1823
+ GH: [`h`, `H`],
1824
+ GI: [
1825
+ `H`,
1826
+ `h`,
1827
+ `hb`,
1828
+ `hB`
1829
+ ],
1830
+ GL: [`H`, `h`],
1831
+ GM: [
1832
+ `h`,
1833
+ `hb`,
1834
+ `H`,
1835
+ `hB`
1836
+ ],
1837
+ GN: [`H`, `hB`],
1838
+ GP: [`H`, `hB`],
1839
+ GQ: [
1840
+ `H`,
1841
+ `hB`,
1842
+ `h`,
1843
+ `hb`
1844
+ ],
1845
+ GR: [
1846
+ `h`,
1847
+ `H`,
1848
+ `hb`,
1849
+ `hB`
1850
+ ],
1851
+ GT: [
1852
+ `h`,
1853
+ `H`,
1854
+ `hB`,
1855
+ `hb`
1856
+ ],
1857
+ GU: [
1858
+ `h`,
1859
+ `hb`,
1860
+ `H`,
1861
+ `hB`
1862
+ ],
1863
+ GW: [`H`, `hB`],
1864
+ GY: [
1865
+ `h`,
1866
+ `hb`,
1867
+ `H`,
1868
+ `hB`
1869
+ ],
1870
+ HK: [
1871
+ `h`,
1872
+ `hB`,
1873
+ `hb`,
1874
+ `H`
1875
+ ],
1876
+ HN: [
1877
+ `h`,
1878
+ `H`,
1879
+ `hB`,
1880
+ `hb`
1881
+ ],
1882
+ HR: [`H`, `hB`],
1883
+ HU: [`H`, `h`],
1884
+ IC: [
1885
+ `H`,
1886
+ `h`,
1887
+ `hB`,
1888
+ `hb`
1889
+ ],
1890
+ ID: [`H`],
1891
+ IE: [
1892
+ `H`,
1893
+ `h`,
1894
+ `hb`,
1895
+ `hB`
1896
+ ],
1897
+ IL: [`H`, `hB`],
1898
+ IM: [
1899
+ `H`,
1900
+ `h`,
1901
+ `hb`,
1902
+ `hB`
1903
+ ],
1904
+ IN: [`h`, `H`],
1905
+ IO: [
1906
+ `H`,
1907
+ `h`,
1908
+ `hb`,
1909
+ `hB`
1910
+ ],
1911
+ IQ: [
1912
+ `h`,
1913
+ `hB`,
1914
+ `hb`,
1915
+ `H`
1916
+ ],
1917
+ IR: [`hB`, `H`],
1918
+ IS: [`H`],
1919
+ IT: [`H`, `hB`],
1920
+ JE: [
1921
+ `H`,
1922
+ `h`,
1923
+ `hb`,
1924
+ `hB`
1925
+ ],
1926
+ JM: [
1927
+ `h`,
1928
+ `hb`,
1929
+ `H`,
1930
+ `hB`
1931
+ ],
1932
+ JO: [
1933
+ `h`,
1934
+ `hB`,
1935
+ `hb`,
1936
+ `H`
1937
+ ],
1938
+ JP: [
1939
+ `H`,
1940
+ `K`,
1941
+ `h`
1942
+ ],
1943
+ KE: [
1944
+ `hB`,
1945
+ `hb`,
1946
+ `H`,
1947
+ `h`
1948
+ ],
1949
+ KG: [
1950
+ `H`,
1951
+ `h`,
1952
+ `hB`,
1953
+ `hb`
1954
+ ],
1955
+ KH: [
1956
+ `hB`,
1957
+ `h`,
1958
+ `H`,
1959
+ `hb`
1960
+ ],
1961
+ KI: [
1962
+ `h`,
1963
+ `hb`,
1964
+ `H`,
1965
+ `hB`
1966
+ ],
1967
+ KM: [
1968
+ `H`,
1969
+ `h`,
1970
+ `hB`,
1971
+ `hb`
1972
+ ],
1973
+ KN: [
1974
+ `h`,
1975
+ `hb`,
1976
+ `H`,
1977
+ `hB`
1978
+ ],
1979
+ KP: [
1980
+ `h`,
1981
+ `H`,
1982
+ `hB`,
1983
+ `hb`
1984
+ ],
1985
+ KR: [
1986
+ `h`,
1987
+ `H`,
1988
+ `hB`,
1989
+ `hb`
1990
+ ],
1991
+ KW: [
1992
+ `h`,
1993
+ `hB`,
1994
+ `hb`,
1995
+ `H`
1996
+ ],
1997
+ KY: [
1998
+ `h`,
1999
+ `hb`,
2000
+ `H`,
2001
+ `hB`
2002
+ ],
2003
+ KZ: [`H`, `hB`],
2004
+ LA: [
2005
+ `H`,
2006
+ `hb`,
2007
+ `hB`,
2008
+ `h`
2009
+ ],
2010
+ LB: [
2011
+ `h`,
2012
+ `hB`,
2013
+ `hb`,
2014
+ `H`
2015
+ ],
2016
+ LC: [
2017
+ `h`,
2018
+ `hb`,
2019
+ `H`,
2020
+ `hB`
2021
+ ],
2022
+ LI: [
2023
+ `H`,
2024
+ `hB`,
2025
+ `h`
2026
+ ],
2027
+ LK: [
2028
+ `H`,
2029
+ `h`,
2030
+ `hB`,
2031
+ `hb`
2032
+ ],
2033
+ LR: [
2034
+ `h`,
2035
+ `hb`,
2036
+ `H`,
2037
+ `hB`
2038
+ ],
2039
+ LS: [`h`, `H`],
2040
+ LT: [
2041
+ `H`,
2042
+ `h`,
2043
+ `hb`,
2044
+ `hB`
2045
+ ],
2046
+ LU: [
2047
+ `H`,
2048
+ `h`,
2049
+ `hB`
2050
+ ],
2051
+ LV: [
2052
+ `H`,
2053
+ `hB`,
2054
+ `hb`,
2055
+ `h`
2056
+ ],
2057
+ LY: [
2058
+ `h`,
2059
+ `hB`,
2060
+ `hb`,
2061
+ `H`
2062
+ ],
2063
+ MA: [
2064
+ `H`,
2065
+ `h`,
2066
+ `hB`,
2067
+ `hb`
2068
+ ],
2069
+ MC: [`H`, `hB`],
2070
+ MD: [`H`, `hB`],
2071
+ ME: [
2072
+ `H`,
2073
+ `hB`,
2074
+ `h`
2075
+ ],
2076
+ MF: [`H`, `hB`],
2077
+ MG: [`H`, `h`],
2078
+ MH: [
2079
+ `h`,
2080
+ `hb`,
2081
+ `H`,
2082
+ `hB`
2083
+ ],
2084
+ MK: [
2085
+ `H`,
2086
+ `h`,
2087
+ `hb`,
2088
+ `hB`
2089
+ ],
2090
+ ML: [`H`],
2091
+ MM: [
2092
+ `hB`,
2093
+ `hb`,
2094
+ `H`,
2095
+ `h`
2096
+ ],
2097
+ MN: [
2098
+ `H`,
2099
+ `h`,
2100
+ `hb`,
2101
+ `hB`
2102
+ ],
2103
+ MO: [
2104
+ `h`,
2105
+ `hB`,
2106
+ `hb`,
2107
+ `H`
2108
+ ],
2109
+ MP: [
2110
+ `h`,
2111
+ `hb`,
2112
+ `H`,
2113
+ `hB`
2114
+ ],
2115
+ MQ: [`H`, `hB`],
2116
+ MR: [
2117
+ `h`,
2118
+ `hB`,
2119
+ `hb`,
2120
+ `H`
2121
+ ],
2122
+ MS: [
2123
+ `H`,
2124
+ `h`,
2125
+ `hb`,
2126
+ `hB`
2127
+ ],
2128
+ MT: [`H`, `h`],
2129
+ MU: [`H`, `h`],
2130
+ MV: [`H`, `h`],
2131
+ MW: [
2132
+ `h`,
2133
+ `hb`,
2134
+ `H`,
2135
+ `hB`
2136
+ ],
2137
+ MX: [
2138
+ `h`,
2139
+ `H`,
2140
+ `hB`,
2141
+ `hb`
2142
+ ],
2143
+ MY: [
2144
+ `hb`,
2145
+ `hB`,
2146
+ `h`,
2147
+ `H`
2148
+ ],
2149
+ MZ: [`H`, `hB`],
2150
+ NA: [
2151
+ `h`,
2152
+ `H`,
2153
+ `hB`,
2154
+ `hb`
2155
+ ],
2156
+ NC: [`H`, `hB`],
2157
+ NE: [`H`],
2158
+ NF: [
2159
+ `H`,
2160
+ `h`,
2161
+ `hb`,
2162
+ `hB`
2163
+ ],
2164
+ NG: [
2165
+ `H`,
2166
+ `h`,
2167
+ `hb`,
2168
+ `hB`
2169
+ ],
2170
+ NI: [
2171
+ `h`,
2172
+ `H`,
2173
+ `hB`,
2174
+ `hb`
2175
+ ],
2176
+ NL: [`H`, `hB`],
2177
+ NO: [`H`, `h`],
2178
+ NP: [
2179
+ `H`,
2180
+ `h`,
2181
+ `hB`
2182
+ ],
2183
+ NR: [
2184
+ `H`,
2185
+ `h`,
2186
+ `hb`,
2187
+ `hB`
2188
+ ],
2189
+ NU: [
2190
+ `H`,
2191
+ `h`,
2192
+ `hb`,
2193
+ `hB`
2194
+ ],
2195
+ NZ: [
2196
+ `h`,
2197
+ `hb`,
2198
+ `H`,
2199
+ `hB`
2200
+ ],
2201
+ OM: [
2202
+ `h`,
2203
+ `hB`,
2204
+ `hb`,
2205
+ `H`
2206
+ ],
2207
+ PA: [
2208
+ `h`,
2209
+ `H`,
2210
+ `hB`,
2211
+ `hb`
2212
+ ],
2213
+ PE: [
2214
+ `h`,
2215
+ `H`,
2216
+ `hB`,
2217
+ `hb`
2218
+ ],
2219
+ PF: [
2220
+ `H`,
2221
+ `h`,
2222
+ `hB`
2223
+ ],
2224
+ PG: [`h`, `H`],
2225
+ PH: [
2226
+ `h`,
2227
+ `hB`,
2228
+ `hb`,
2229
+ `H`
2230
+ ],
2231
+ PK: [
2232
+ `h`,
2233
+ `hB`,
2234
+ `H`
2235
+ ],
2236
+ PL: [`H`, `h`],
2237
+ PM: [`H`, `hB`],
2238
+ PN: [
2239
+ `H`,
2240
+ `h`,
2241
+ `hb`,
2242
+ `hB`
2243
+ ],
2244
+ PR: [
2245
+ `h`,
2246
+ `H`,
2247
+ `hB`,
2248
+ `hb`
2249
+ ],
2250
+ PS: [
2251
+ `h`,
2252
+ `hB`,
2253
+ `hb`,
2254
+ `H`
2255
+ ],
2256
+ PT: [`H`, `hB`],
2257
+ PW: [`h`, `H`],
2258
+ PY: [
2259
+ `h`,
2260
+ `H`,
2261
+ `hB`,
2262
+ `hb`
2263
+ ],
2264
+ QA: [
2265
+ `h`,
2266
+ `hB`,
2267
+ `hb`,
2268
+ `H`
2269
+ ],
2270
+ RE: [`H`, `hB`],
2271
+ RO: [`H`, `hB`],
2272
+ RS: [
2273
+ `H`,
2274
+ `hB`,
2275
+ `h`
2276
+ ],
2277
+ RU: [`H`],
2278
+ RW: [`H`, `h`],
2279
+ SA: [
2280
+ `h`,
2281
+ `hB`,
2282
+ `hb`,
2283
+ `H`
2284
+ ],
2285
+ SB: [
2286
+ `h`,
2287
+ `hb`,
2288
+ `H`,
2289
+ `hB`
2290
+ ],
2291
+ SC: [
2292
+ `H`,
2293
+ `h`,
2294
+ `hB`
2295
+ ],
2296
+ SD: [
2297
+ `h`,
2298
+ `hB`,
2299
+ `hb`,
2300
+ `H`
2301
+ ],
2302
+ SE: [`H`],
2303
+ SG: [
2304
+ `h`,
2305
+ `hb`,
2306
+ `H`,
2307
+ `hB`
2308
+ ],
2309
+ SH: [
2310
+ `H`,
2311
+ `h`,
2312
+ `hb`,
2313
+ `hB`
2314
+ ],
2315
+ SI: [`H`, `hB`],
2316
+ SJ: [`H`],
2317
+ SK: [`H`],
2318
+ SL: [
2319
+ `h`,
2320
+ `hb`,
2321
+ `H`,
2322
+ `hB`
2323
+ ],
2324
+ SM: [
2325
+ `H`,
2326
+ `h`,
2327
+ `hB`
2328
+ ],
2329
+ SN: [
2330
+ `H`,
2331
+ `h`,
2332
+ `hB`
2333
+ ],
2334
+ SO: [`h`, `H`],
2335
+ SR: [`H`, `hB`],
2336
+ SS: [
2337
+ `h`,
2338
+ `hb`,
2339
+ `H`,
2340
+ `hB`
2341
+ ],
2342
+ ST: [`H`, `hB`],
2343
+ SV: [
2344
+ `h`,
2345
+ `H`,
2346
+ `hB`,
2347
+ `hb`
2348
+ ],
2349
+ SX: [
2350
+ `H`,
2351
+ `h`,
2352
+ `hb`,
2353
+ `hB`
2354
+ ],
2355
+ SY: [
2356
+ `h`,
2357
+ `hB`,
2358
+ `hb`,
2359
+ `H`
2360
+ ],
2361
+ SZ: [
2362
+ `h`,
2363
+ `hb`,
2364
+ `H`,
2365
+ `hB`
2366
+ ],
2367
+ TA: [
2368
+ `H`,
2369
+ `h`,
2370
+ `hb`,
2371
+ `hB`
2372
+ ],
2373
+ TC: [
2374
+ `h`,
2375
+ `hb`,
2376
+ `H`,
2377
+ `hB`
2378
+ ],
2379
+ TD: [
2380
+ `h`,
2381
+ `H`,
2382
+ `hB`
2383
+ ],
2384
+ TF: [
2385
+ `H`,
2386
+ `h`,
2387
+ `hB`
2388
+ ],
2389
+ TG: [`H`, `hB`],
2390
+ TH: [`H`, `h`],
2391
+ TJ: [`H`, `h`],
2392
+ TL: [
2393
+ `H`,
2394
+ `hB`,
2395
+ `hb`,
2396
+ `h`
2397
+ ],
2398
+ TM: [`H`, `h`],
2399
+ TN: [
2400
+ `h`,
2401
+ `hB`,
2402
+ `hb`,
2403
+ `H`
2404
+ ],
2405
+ TO: [`h`, `H`],
2406
+ TR: [`H`, `hB`],
2407
+ TT: [
2408
+ `h`,
2409
+ `hb`,
2410
+ `H`,
2411
+ `hB`
2412
+ ],
2413
+ TW: [
2414
+ `hB`,
2415
+ `hb`,
2416
+ `h`,
2417
+ `H`
2418
+ ],
2419
+ TZ: [
2420
+ `hB`,
2421
+ `hb`,
2422
+ `H`,
2423
+ `h`
2424
+ ],
2425
+ UA: [
2426
+ `H`,
2427
+ `hB`,
2428
+ `h`
2429
+ ],
2430
+ UG: [
2431
+ `hB`,
2432
+ `hb`,
2433
+ `H`,
2434
+ `h`
2435
+ ],
2436
+ UM: [
2437
+ `h`,
2438
+ `hb`,
2439
+ `H`,
2440
+ `hB`
2441
+ ],
2442
+ US: [
2443
+ `h`,
2444
+ `hb`,
2445
+ `H`,
2446
+ `hB`
2447
+ ],
2448
+ UY: [
2449
+ `h`,
2450
+ `H`,
2451
+ `hB`,
2452
+ `hb`
2453
+ ],
2454
+ UZ: [
2455
+ `H`,
2456
+ `hB`,
2457
+ `h`
2458
+ ],
2459
+ VA: [
2460
+ `H`,
2461
+ `h`,
2462
+ `hB`
2463
+ ],
2464
+ VC: [
2465
+ `h`,
2466
+ `hb`,
2467
+ `H`,
2468
+ `hB`
2469
+ ],
2470
+ VE: [
2471
+ `h`,
2472
+ `H`,
2473
+ `hB`,
2474
+ `hb`
2475
+ ],
2476
+ VG: [
2477
+ `h`,
2478
+ `hb`,
2479
+ `H`,
2480
+ `hB`
2481
+ ],
2482
+ VI: [
2483
+ `h`,
2484
+ `hb`,
2485
+ `H`,
2486
+ `hB`
2487
+ ],
2488
+ VN: [`H`, `h`],
2489
+ VU: [`h`, `H`],
2490
+ WF: [`H`, `hB`],
2491
+ WS: [`h`, `H`],
2492
+ XK: [
2493
+ `H`,
2494
+ `hB`,
2495
+ `h`
2496
+ ],
2497
+ YE: [
2498
+ `h`,
2499
+ `hB`,
2500
+ `hb`,
2501
+ `H`
2502
+ ],
2503
+ YT: [`H`, `hB`],
2504
+ ZA: [
2505
+ `H`,
2506
+ `h`,
2507
+ `hb`,
2508
+ `hB`
2509
+ ],
2510
+ ZM: [
2511
+ `h`,
2512
+ `hb`,
2513
+ `H`,
2514
+ `hB`
2515
+ ],
2516
+ ZW: [`H`, `h`],
2517
+ "af-ZA": [
2518
+ `H`,
2519
+ `h`,
2520
+ `hB`,
2521
+ `hb`
2522
+ ],
2523
+ "ar-001": [
2524
+ `h`,
2525
+ `hB`,
2526
+ `hb`,
2527
+ `H`
2528
+ ],
2529
+ "ca-ES": [
2530
+ `H`,
2531
+ `h`,
2532
+ `hB`
2533
+ ],
2534
+ "en-001": [
2535
+ `h`,
2536
+ `hb`,
2537
+ `H`,
2538
+ `hB`
2539
+ ],
2540
+ "en-HK": [
2541
+ `h`,
2542
+ `hb`,
2543
+ `H`,
2544
+ `hB`
2545
+ ],
2546
+ "en-IL": [
2547
+ `H`,
2548
+ `h`,
2549
+ `hb`,
2550
+ `hB`
2551
+ ],
2552
+ "en-MY": [
2553
+ `h`,
2554
+ `hb`,
2555
+ `H`,
2556
+ `hB`
2557
+ ],
2558
+ "es-BR": [
2559
+ `H`,
2560
+ `h`,
2561
+ `hB`,
2562
+ `hb`
2563
+ ],
2564
+ "es-ES": [
2565
+ `H`,
2566
+ `h`,
2567
+ `hB`,
2568
+ `hb`
2569
+ ],
2570
+ "es-GQ": [
2571
+ `H`,
2572
+ `h`,
2573
+ `hB`,
2574
+ `hb`
2575
+ ],
2576
+ "fr-CA": [
2577
+ `H`,
2578
+ `h`,
2579
+ `hB`
2580
+ ],
2581
+ "gl-ES": [
2582
+ `H`,
2583
+ `h`,
2584
+ `hB`
2585
+ ],
2586
+ "gu-IN": [
2587
+ `hB`,
2588
+ `hb`,
2589
+ `h`,
2590
+ `H`
2591
+ ],
2592
+ "hi-IN": [
2593
+ `hB`,
2594
+ `h`,
2595
+ `H`
2596
+ ],
2597
+ "it-CH": [
2598
+ `H`,
2599
+ `h`,
2600
+ `hB`
2601
+ ],
2602
+ "it-IT": [
2603
+ `H`,
2604
+ `h`,
2605
+ `hB`
2606
+ ],
2607
+ "kn-IN": [
2608
+ `hB`,
2609
+ `h`,
2610
+ `H`
2611
+ ],
2612
+ "ml-IN": [
2613
+ `hB`,
2614
+ `h`,
2615
+ `H`
2616
+ ],
2617
+ "mr-IN": [
2618
+ `hB`,
2619
+ `hb`,
2620
+ `h`,
2621
+ `H`
2622
+ ],
2623
+ "pa-IN": [
2624
+ `hB`,
2625
+ `hb`,
2626
+ `h`,
2627
+ `H`
2628
+ ],
2629
+ "ta-IN": [
2630
+ `hB`,
2631
+ `h`,
2632
+ `hb`,
2633
+ `H`
2634
+ ],
2635
+ "te-IN": [
2636
+ `hB`,
2637
+ `h`,
2638
+ `H`
2639
+ ],
2640
+ "zu-ZA": [
2641
+ `H`,
2642
+ `hB`,
2643
+ `hb`,
2644
+ `h`
2645
+ ]
2646
+ };
2647
+ })), vt = p(((e) => {
2648
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.getBestPattern = n;
2649
+ var t = _t();
2650
+ function n(e, t) {
2651
+ for (var n = ``, i = 0; i < e.length; i++) {
2652
+ var a = e.charAt(i);
2653
+ if (a === `j`) {
2654
+ for (var o = 0; i + 1 < e.length && e.charAt(i + 1) === a;) o++, i++;
2655
+ var s = 1 + (o & 1), c = o < 2 ? 1 : 3 + (o >> 1), l = `a`, u = r(t);
2656
+ for ((u == `H` || u == `k`) && (c = 0); c-- > 0;) n += l;
2657
+ for (; s-- > 0;) n = u + n;
2658
+ } else a === `J` ? n += `H` : n += a;
2659
+ }
2660
+ return n;
2661
+ }
2662
+ function r(e) {
2663
+ var n = e.hourCycle;
2664
+ if (n === void 0 && e.hourCycles && e.hourCycles.length && (n = e.hourCycles[0]), n) switch (n) {
2665
+ case `h24`: return `k`;
2666
+ case `h23`: return `H`;
2667
+ case `h12`: return `h`;
2668
+ case `h11`: return `K`;
2669
+ default: throw Error(`Invalid hourCycle`);
2670
+ }
2671
+ var r = e.language, i;
2672
+ return r !== `root` && (i = e.maximize().region), (t.timeData[i || ``] || t.timeData[r || ``] || t.timeData[`${r}-001`] || t.timeData[`001`])[0];
2673
+ }
2674
+ })), yt = p(((e) => {
2675
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.Parser = void 0;
2676
+ var t = (R(), g(M)), n = dt(), r = z(), i = ft(), a = gt(), o = vt(), s = RegExp(`^${i.SPACE_SEPARATOR_REGEX.source}*`), c = RegExp(`${i.SPACE_SEPARATOR_REGEX.source}*\$`);
2677
+ function l(e, t) {
2678
+ return {
2679
+ start: e,
2680
+ end: t
2681
+ };
2682
+ }
2683
+ var u = !!String.prototype.startsWith && `_a`.startsWith(`a`, 1), d = !!String.fromCodePoint, f = !!Object.fromEntries, p = !!String.prototype.codePointAt, m = !!String.prototype.trimStart, h = !!String.prototype.trimEnd, _ = Number.isSafeInteger ? Number.isSafeInteger : function(e) {
2684
+ return typeof e == `number` && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
2685
+ }, v = !0;
2686
+ try {
2687
+ v = S(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`).exec(`a`)?.[0] === `a`;
2688
+ } catch {
2689
+ v = !1;
2690
+ }
2691
+ var ee = u ? function(e, t, n) {
2692
+ return e.startsWith(t, n);
2693
+ } : function(e, t, n) {
2694
+ return e.slice(n, n + t.length) === t;
2695
+ }, y = d ? String.fromCodePoint : function() {
2696
+ for (var e = [...arguments], t = ``, n = e.length, r = 0, i; n > r;) {
2697
+ if (i = e[r++], i > 1114111) throw RangeError(i + ` is not a valid code point`);
2698
+ t += i < 65536 ? String.fromCharCode(i) : String.fromCharCode(((i -= 65536) >> 10) + 55296, i % 1024 + 56320);
2699
+ }
2700
+ return t;
2701
+ }, b = f ? Object.fromEntries : function(e) {
2702
+ for (var t = {}, n = 0, r = e; n < r.length; n++) {
2703
+ var i = r[n], a = i[0];
2704
+ t[a] = i[1];
2705
+ }
2706
+ return t;
2707
+ }, x = p ? function(e, t) {
2708
+ return e.codePointAt(t);
2709
+ } : function(e, t) {
2710
+ var n = e.length;
2711
+ if (!(t < 0 || t >= n)) {
2712
+ var r = e.charCodeAt(t), i;
2713
+ return r < 55296 || r > 56319 || t + 1 === n || (i = e.charCodeAt(t + 1)) < 56320 || i > 57343 ? r : (r - 55296 << 10) + (i - 56320) + 65536;
2714
+ }
2715
+ }, te = m ? function(e) {
2716
+ return e.trimStart();
2717
+ } : function(e) {
2718
+ return e.replace(s, ``);
2719
+ }, ne = h ? function(e) {
2720
+ return e.trimEnd();
2721
+ } : function(e) {
2722
+ return e.replace(c, ``);
2723
+ };
2724
+ function S(e, t) {
2725
+ return new RegExp(e, t);
2726
+ }
2727
+ var C;
2728
+ if (v) {
2729
+ var w = S(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
2730
+ C = function(e, t) {
2731
+ return w.lastIndex = t, w.exec(e)[1] ?? ``;
2732
+ };
2733
+ } else C = function(e, t) {
2734
+ for (var n = [];;) {
2735
+ var r = x(e, t);
2736
+ if (r === void 0 || ie(r) || D(r)) break;
2737
+ n.push(r), t += r >= 65536 ? 2 : 1;
2738
+ }
2739
+ return y.apply(void 0, n);
2740
+ };
2741
+ e.Parser = function() {
2742
+ function e(e, t) {
2743
+ t === void 0 && (t = {}), this.message = e, this.position = {
2744
+ offset: 0,
2745
+ line: 1,
2746
+ column: 1
2747
+ }, this.ignoreTag = !!t.ignoreTag, this.locale = t.locale, this.requiresOtherClause = !!t.requiresOtherClause, this.shouldParseSkeletons = !!t.shouldParseSkeletons;
2748
+ }
2749
+ return e.prototype.parse = function() {
2750
+ if (this.offset() !== 0) throw Error(`parser can only be used once`);
2751
+ return this.parseMessage(0, ``, !1);
2752
+ }, e.prototype.parseMessage = function(e, t, i) {
2753
+ for (var a = []; !this.isEOF();) {
2754
+ var o = this.char();
2755
+ if (o === 123) {
2756
+ var s = this.parseArgument(e, i);
2757
+ if (s.err) return s;
2758
+ a.push(s.val);
2759
+ } else if (o === 125 && e > 0) break;
2760
+ else if (o === 35 && (t === `plural` || t === `selectordinal`)) {
2761
+ var c = this.clonePosition();
2762
+ this.bump(), a.push({
2763
+ type: r.TYPE.pound,
2764
+ location: l(c, this.clonePosition())
2765
+ });
2766
+ } else if (o === 60 && !this.ignoreTag && this.peek() === 47) {
2767
+ if (i) break;
2768
+ return this.error(n.ErrorKind.UNMATCHED_CLOSING_TAG, l(this.clonePosition(), this.clonePosition()));
2769
+ } else if (o === 60 && !this.ignoreTag && T(this.peek() || 0)) {
2770
+ var s = this.parseTag(e, t);
2771
+ if (s.err) return s;
2772
+ a.push(s.val);
2773
+ } else {
2774
+ var s = this.parseLiteral(e, t);
2775
+ if (s.err) return s;
2776
+ a.push(s.val);
2777
+ }
2778
+ }
2779
+ return {
2780
+ val: a,
2781
+ err: null
2782
+ };
2783
+ }, e.prototype.parseTag = function(e, t) {
2784
+ var i = this.clonePosition();
2785
+ this.bump();
2786
+ var a = this.parseTagName();
2787
+ if (this.bumpSpace(), this.bumpIf(`/>`)) return {
2788
+ val: {
2789
+ type: r.TYPE.literal,
2790
+ value: `<${a}/>`,
2791
+ location: l(i, this.clonePosition())
2792
+ },
2793
+ err: null
2794
+ };
2795
+ if (this.bumpIf(`>`)) {
2796
+ var o = this.parseMessage(e + 1, t, !0);
2797
+ if (o.err) return o;
2798
+ var s = o.val, c = this.clonePosition();
2799
+ if (this.bumpIf(`</`)) {
2800
+ if (this.isEOF() || !T(this.char())) return this.error(n.ErrorKind.INVALID_TAG, l(c, this.clonePosition()));
2801
+ var u = this.clonePosition();
2802
+ return a === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? {
2803
+ val: {
2804
+ type: r.TYPE.tag,
2805
+ value: a,
2806
+ children: s,
2807
+ location: l(i, this.clonePosition())
2808
+ },
2809
+ err: null
2810
+ } : this.error(n.ErrorKind.INVALID_TAG, l(c, this.clonePosition()))) : this.error(n.ErrorKind.UNMATCHED_CLOSING_TAG, l(u, this.clonePosition()));
2811
+ } else return this.error(n.ErrorKind.UNCLOSED_TAG, l(i, this.clonePosition()));
2812
+ } else return this.error(n.ErrorKind.INVALID_TAG, l(i, this.clonePosition()));
2813
+ }, e.prototype.parseTagName = function() {
2814
+ var e = this.offset();
2815
+ for (this.bump(); !this.isEOF() && E(this.char());) this.bump();
2816
+ return this.message.slice(e, this.offset());
2817
+ }, e.prototype.parseLiteral = function(e, t) {
2818
+ for (var n = this.clonePosition(), i = ``;;) {
2819
+ var a = this.tryParseQuote(t);
2820
+ if (a) {
2821
+ i += a;
2822
+ continue;
2823
+ }
2824
+ var o = this.tryParseUnquoted(e, t);
2825
+ if (o) {
2826
+ i += o;
2827
+ continue;
2828
+ }
2829
+ var s = this.tryParseLeftAngleBracket();
2830
+ if (s) {
2831
+ i += s;
2832
+ continue;
2833
+ }
2834
+ break;
2835
+ }
2836
+ var c = l(n, this.clonePosition());
2837
+ return {
2838
+ val: {
2839
+ type: r.TYPE.literal,
2840
+ value: i,
2841
+ location: c
2842
+ },
2843
+ err: null
2844
+ };
2845
+ }, e.prototype.tryParseLeftAngleBracket = function() {
2846
+ return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !re(this.peek() || 0)) ? (this.bump(), `<`) : null;
2847
+ }, e.prototype.tryParseQuote = function(e) {
2848
+ if (this.isEOF() || this.char() !== 39) return null;
2849
+ switch (this.peek()) {
2850
+ case 39: return this.bump(), this.bump(), `'`;
2851
+ case 123:
2852
+ case 60:
2853
+ case 62:
2854
+ case 125: break;
2855
+ case 35:
2856
+ if (e === `plural` || e === `selectordinal`) break;
2857
+ return null;
2858
+ default: return null;
2859
+ }
2860
+ this.bump();
2861
+ var t = [this.char()];
2862
+ for (this.bump(); !this.isEOF();) {
2863
+ var n = this.char();
2864
+ if (n === 39) if (this.peek() === 39) t.push(39), this.bump();
2865
+ else {
2866
+ this.bump();
2867
+ break;
2868
+ }
2869
+ else t.push(n);
2870
+ this.bump();
2871
+ }
2872
+ return y.apply(void 0, t);
2873
+ }, e.prototype.tryParseUnquoted = function(e, t) {
2874
+ if (this.isEOF()) return null;
2875
+ var n = this.char();
2876
+ return n === 60 || n === 123 || n === 35 && (t === `plural` || t === `selectordinal`) || n === 125 && e > 0 ? null : (this.bump(), y(n));
2877
+ }, e.prototype.parseArgument = function(e, t) {
2878
+ var i = this.clonePosition();
2879
+ if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(n.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition()));
2880
+ if (this.char() === 125) return this.bump(), this.error(n.ErrorKind.EMPTY_ARGUMENT, l(i, this.clonePosition()));
2881
+ var a = this.parseIdentifierIfPossible().value;
2882
+ if (!a) return this.error(n.ErrorKind.MALFORMED_ARGUMENT, l(i, this.clonePosition()));
2883
+ if (this.bumpSpace(), this.isEOF()) return this.error(n.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition()));
2884
+ switch (this.char()) {
2885
+ case 125: return this.bump(), {
2886
+ val: {
2887
+ type: r.TYPE.argument,
2888
+ value: a,
2889
+ location: l(i, this.clonePosition())
2890
+ },
2891
+ err: null
2892
+ };
2893
+ case 44: return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(n.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, l(i, this.clonePosition())) : this.parseArgumentOptions(e, t, a, i);
2894
+ default: return this.error(n.ErrorKind.MALFORMED_ARGUMENT, l(i, this.clonePosition()));
2895
+ }
2896
+ }, e.prototype.parseIdentifierIfPossible = function() {
2897
+ var e = this.clonePosition(), t = this.offset(), n = C(this.message, t), r = t + n.length;
2898
+ return this.bumpTo(r), {
2899
+ value: n,
2900
+ location: l(e, this.clonePosition())
2901
+ };
2902
+ }, e.prototype.parseArgumentOptions = function(e, i, s, c) {
2903
+ var u = this.clonePosition(), d = this.parseIdentifierIfPossible().value, f = this.clonePosition();
2904
+ switch (d) {
2905
+ case ``: return this.error(n.ErrorKind.EXPECT_ARGUMENT_TYPE, l(u, f));
2906
+ case `number`:
2907
+ case `date`:
2908
+ case `time`:
2909
+ this.bumpSpace();
2910
+ var p = null;
2911
+ if (this.bumpIf(`,`)) {
2912
+ this.bumpSpace();
2913
+ var m = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible();
2914
+ if (h.err) return h;
2915
+ var g = ne(h.val);
2916
+ if (g.length === 0) return this.error(n.ErrorKind.EXPECT_ARGUMENT_STYLE, l(this.clonePosition(), this.clonePosition()));
2917
+ p = {
2918
+ style: g,
2919
+ styleLocation: l(m, this.clonePosition())
2920
+ };
2921
+ }
2922
+ var _ = this.tryParseArgumentClose(c);
2923
+ if (_.err) return _;
2924
+ var v = l(c, this.clonePosition());
2925
+ if (p && ee(p?.style, `::`, 0)) {
2926
+ var y = te(p.style.slice(2));
2927
+ if (d === `number`) {
2928
+ var h = this.parseNumberSkeletonFromString(y, p.styleLocation);
2929
+ return h.err ? h : {
2930
+ val: {
2931
+ type: r.TYPE.number,
2932
+ value: s,
2933
+ location: v,
2934
+ style: h.val
2935
+ },
2936
+ err: null
2937
+ };
2938
+ } else {
2939
+ if (y.length === 0) return this.error(n.ErrorKind.EXPECT_DATE_TIME_SKELETON, v);
2940
+ var x = y;
2941
+ this.locale && (x = (0, o.getBestPattern)(y, this.locale));
2942
+ var g = {
2943
+ type: r.SKELETON_TYPE.dateTime,
2944
+ pattern: x,
2945
+ location: p.styleLocation,
2946
+ parsedOptions: this.shouldParseSkeletons ? (0, a.parseDateTimeSkeleton)(x) : {}
2947
+ };
2948
+ return {
2949
+ val: {
2950
+ type: d === `date` ? r.TYPE.date : r.TYPE.time,
2951
+ value: s,
2952
+ location: v,
2953
+ style: g
2954
+ },
2955
+ err: null
2956
+ };
2957
+ }
2958
+ }
2959
+ return {
2960
+ val: {
2961
+ type: d === `number` ? r.TYPE.number : d === `date` ? r.TYPE.date : r.TYPE.time,
2962
+ value: s,
2963
+ location: v,
2964
+ style: p?.style ?? null
2965
+ },
2966
+ err: null
2967
+ };
2968
+ case `plural`:
2969
+ case `selectordinal`:
2970
+ case `select`:
2971
+ var S = this.clonePosition();
2972
+ if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(n.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, l(S, t.__assign({}, S)));
2973
+ this.bumpSpace();
2974
+ var C = this.parseIdentifierIfPossible(), w = 0;
2975
+ if (d !== `select` && C.value === `offset`) {
2976
+ if (!this.bumpIf(`:`)) return this.error(n.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, l(this.clonePosition(), this.clonePosition()));
2977
+ this.bumpSpace();
2978
+ var h = this.tryParseDecimalInteger(n.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, n.ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
2979
+ if (h.err) return h;
2980
+ this.bumpSpace(), C = this.parseIdentifierIfPossible(), w = h.val;
2981
+ }
2982
+ var T = this.tryParsePluralOrSelectOptions(e, d, i, C);
2983
+ if (T.err) return T;
2984
+ var _ = this.tryParseArgumentClose(c);
2985
+ if (_.err) return _;
2986
+ var re = l(c, this.clonePosition());
2987
+ return d === `select` ? {
2988
+ val: {
2989
+ type: r.TYPE.select,
2990
+ value: s,
2991
+ options: b(T.val),
2992
+ location: re
2993
+ },
2994
+ err: null
2995
+ } : {
2996
+ val: {
2997
+ type: r.TYPE.plural,
2998
+ value: s,
2999
+ options: b(T.val),
3000
+ offset: w,
3001
+ pluralType: d === `plural` ? `cardinal` : `ordinal`,
3002
+ location: re
3003
+ },
3004
+ err: null
3005
+ };
3006
+ default: return this.error(n.ErrorKind.INVALID_ARGUMENT_TYPE, l(u, f));
3007
+ }
3008
+ }, e.prototype.tryParseArgumentClose = function(e) {
3009
+ return this.isEOF() || this.char() !== 125 ? this.error(n.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, l(e, this.clonePosition())) : (this.bump(), {
3010
+ val: !0,
3011
+ err: null
3012
+ });
3013
+ }, e.prototype.parseSimpleArgStyleIfPossible = function() {
3014
+ for (var e = 0, t = this.clonePosition(); !this.isEOF();) switch (this.char()) {
3015
+ case 39:
3016
+ this.bump();
3017
+ var r = this.clonePosition();
3018
+ if (!this.bumpUntil(`'`)) return this.error(n.ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, l(r, this.clonePosition()));
3019
+ this.bump();
3020
+ break;
3021
+ case 123:
3022
+ e += 1, this.bump();
3023
+ break;
3024
+ case 125:
3025
+ if (e > 0) --e;
3026
+ else return {
3027
+ val: this.message.slice(t.offset, this.offset()),
3028
+ err: null
3029
+ };
3030
+ break;
3031
+ default:
3032
+ this.bump();
3033
+ break;
3034
+ }
3035
+ return {
3036
+ val: this.message.slice(t.offset, this.offset()),
3037
+ err: null
3038
+ };
3039
+ }, e.prototype.parseNumberSkeletonFromString = function(e, t) {
3040
+ var i = [];
3041
+ try {
3042
+ i = (0, a.parseNumberSkeletonFromString)(e);
3043
+ } catch {
3044
+ return this.error(n.ErrorKind.INVALID_NUMBER_SKELETON, t);
3045
+ }
3046
+ return {
3047
+ val: {
3048
+ type: r.SKELETON_TYPE.number,
3049
+ tokens: i,
3050
+ location: t,
3051
+ parsedOptions: this.shouldParseSkeletons ? (0, a.parseNumberSkeleton)(i) : {}
3052
+ },
3053
+ err: null
3054
+ };
3055
+ }, e.prototype.tryParsePluralOrSelectOptions = function(e, t, r, i) {
3056
+ for (var a, o = !1, s = [], c = /* @__PURE__ */ new Set(), u = i.value, d = i.location;;) {
3057
+ if (u.length === 0) {
3058
+ var f = this.clonePosition();
3059
+ if (t !== `select` && this.bumpIf(`=`)) {
3060
+ var p = this.tryParseDecimalInteger(n.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, n.ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
3061
+ if (p.err) return p;
3062
+ d = l(f, this.clonePosition()), u = this.message.slice(f.offset, this.offset());
3063
+ } else break;
3064
+ }
3065
+ if (c.has(u)) return this.error(t === `select` ? n.ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : n.ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, d);
3066
+ u === `other` && (o = !0), this.bumpSpace();
3067
+ var m = this.clonePosition();
3068
+ if (!this.bumpIf(`{`)) return this.error(t === `select` ? n.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : n.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, l(this.clonePosition(), this.clonePosition()));
3069
+ var h = this.parseMessage(e + 1, t, r);
3070
+ if (h.err) return h;
3071
+ var g = this.tryParseArgumentClose(m);
3072
+ if (g.err) return g;
3073
+ s.push([u, {
3074
+ value: h.val,
3075
+ location: l(m, this.clonePosition())
3076
+ }]), c.add(u), this.bumpSpace(), a = this.parseIdentifierIfPossible(), u = a.value, d = a.location;
3077
+ }
3078
+ return s.length === 0 ? this.error(t === `select` ? n.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : n.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, l(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(n.ErrorKind.MISSING_OTHER_CLAUSE, l(this.clonePosition(), this.clonePosition())) : {
3079
+ val: s,
3080
+ err: null
3081
+ };
3082
+ }, e.prototype.tryParseDecimalInteger = function(e, t) {
3083
+ var n = 1, r = this.clonePosition();
3084
+ this.bumpIf(`+`) || this.bumpIf(`-`) && (n = -1);
3085
+ for (var i = !1, a = 0; !this.isEOF();) {
3086
+ var o = this.char();
3087
+ if (o >= 48 && o <= 57) i = !0, a = a * 10 + (o - 48), this.bump();
3088
+ else break;
3089
+ }
3090
+ var s = l(r, this.clonePosition());
3091
+ return i ? (a *= n, _(a) ? {
3092
+ val: a,
3093
+ err: null
3094
+ } : this.error(t, s)) : this.error(e, s);
3095
+ }, e.prototype.offset = function() {
3096
+ return this.position.offset;
3097
+ }, e.prototype.isEOF = function() {
3098
+ return this.offset() === this.message.length;
3099
+ }, e.prototype.clonePosition = function() {
3100
+ return {
3101
+ offset: this.position.offset,
3102
+ line: this.position.line,
3103
+ column: this.position.column
3104
+ };
3105
+ }, e.prototype.char = function() {
3106
+ var e = this.position.offset;
3107
+ if (e >= this.message.length) throw Error(`out of bound`);
3108
+ var t = x(this.message, e);
3109
+ if (t === void 0) throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);
3110
+ return t;
3111
+ }, e.prototype.error = function(e, t) {
3112
+ return {
3113
+ val: null,
3114
+ err: {
3115
+ kind: e,
3116
+ message: this.message,
3117
+ location: t
3118
+ }
3119
+ };
3120
+ }, e.prototype.bump = function() {
3121
+ if (!this.isEOF()) {
3122
+ var e = this.char();
3123
+ e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2);
3124
+ }
3125
+ }, e.prototype.bumpIf = function(e) {
3126
+ if (ee(this.message, e, this.offset())) {
3127
+ for (var t = 0; t < e.length; t++) this.bump();
3128
+ return !0;
3129
+ }
3130
+ return !1;
3131
+ }, e.prototype.bumpUntil = function(e) {
3132
+ var t = this.offset(), n = this.message.indexOf(e, t);
3133
+ return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1);
3134
+ }, e.prototype.bumpTo = function(e) {
3135
+ if (this.offset() > e) throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);
3136
+ for (e = Math.min(e, this.message.length);;) {
3137
+ var t = this.offset();
3138
+ if (t === e) break;
3139
+ if (t > e) throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);
3140
+ if (this.bump(), this.isEOF()) break;
3141
+ }
3142
+ }, e.prototype.bumpSpace = function() {
3143
+ for (; !this.isEOF() && ie(this.char());) this.bump();
3144
+ }, e.prototype.peek = function() {
3145
+ if (this.isEOF()) return null;
3146
+ var e = this.char(), t = this.offset();
3147
+ return this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)) ?? null;
3148
+ }, e;
3149
+ }();
3150
+ function T(e) {
3151
+ return e >= 97 && e <= 122 || e >= 65 && e <= 90;
3152
+ }
3153
+ function re(e) {
3154
+ return T(e) || e === 47;
3155
+ }
3156
+ function E(e) {
3157
+ return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
3158
+ }
3159
+ function ie(e) {
3160
+ return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
3161
+ }
3162
+ function D(e) {
3163
+ return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
3164
+ }
3165
+ })), bt = p(((e) => {
3166
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.hoistSelectors = s, e.isStructurallySame = l;
3167
+ var t = (R(), g(M)), n = z();
3168
+ function r(e) {
3169
+ return Array.isArray(e) ? t.__spreadArray([], e.map(r), !0) : typeof e == `object` && e ? Object.keys(e).reduce(function(t, n) {
3170
+ return t[n] = r(e[n]), t;
3171
+ }, {}) : e;
3172
+ }
3173
+ function i(e, n, i) {
3174
+ var a = r(n), o = a.options;
3175
+ return a.options = Object.keys(o).reduce(function(n, r) {
3176
+ return n[r] = { value: s(t.__spreadArray(t.__spreadArray(t.__spreadArray([], e.slice(0, i), !0), o[r].value, !0), e.slice(i + 1), !0)) }, n;
3177
+ }, {}), a;
3178
+ }
3179
+ function a(e) {
3180
+ return (0, n.isPluralElement)(e) || (0, n.isSelectElement)(e);
3181
+ }
3182
+ function o(e) {
3183
+ return !!e.find(function(e) {
3184
+ return a(e) ? !0 : (0, n.isTagElement)(e) ? o(e.children) : !1;
3185
+ });
3186
+ }
3187
+ function s(e) {
3188
+ for (var t = 0; t < e.length; t++) {
3189
+ var r = e[t];
3190
+ if (a(r)) return [i(e, r, t)];
3191
+ if ((0, n.isTagElement)(r) && o([r])) throw Error(`Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option`);
3192
+ }
3193
+ return e;
3194
+ }
3195
+ function c(e, t) {
3196
+ t === void 0 && (t = /* @__PURE__ */ new Map()), e.forEach(function(e) {
3197
+ if ((0, n.isArgumentElement)(e) || (0, n.isDateElement)(e) || (0, n.isTimeElement)(e) || (0, n.isNumberElement)(e)) {
3198
+ if (e.value in t && t.get(e.value) !== e.type) throw Error(`Variable ${e.value} has conflicting types`);
3199
+ t.set(e.value, e.type);
3200
+ }
3201
+ ((0, n.isPluralElement)(e) || (0, n.isSelectElement)(e)) && (t.set(e.value, e.type), Object.keys(e.options).forEach(function(n) {
3202
+ c(e.options[n].value, t);
3203
+ })), (0, n.isTagElement)(e) && (t.set(e.value, e.type), c(e.children, t));
3204
+ });
3205
+ }
3206
+ function l(e, t) {
3207
+ var r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
3208
+ return c(e, r), c(t, i), r.size === i.size ? Array.from(r.entries()).reduce(function(e, t) {
3209
+ var r = t[0], a = t[1];
3210
+ if (!e.success) return e;
3211
+ var o = i.get(r);
3212
+ return o == null ? {
3213
+ success: !1,
3214
+ error: Error(`Missing variable ${r} in message`)
3215
+ } : o === a ? e : {
3216
+ success: !1,
3217
+ error: Error(`Variable ${r} has conflicting types: ${n.TYPE[a]} vs ${n.TYPE[o]}`)
3218
+ };
3219
+ }, { success: !0 }) : {
3220
+ success: !1,
3221
+ error: Error(`Different number of variables: [${Array.from(r.keys()).join(`, `)}] vs [${Array.from(i.keys()).join(`, `)}]`)
3222
+ };
3223
+ }
3224
+ })), xt = p(((e) => {
3225
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.isStructurallySame = e._Parser = void 0, e.parse = o;
3226
+ var t = (R(), g(M)), n = dt(), r = yt(), i = z();
3227
+ function a(e) {
3228
+ e.forEach(function(e) {
3229
+ if (delete e.location, (0, i.isSelectElement)(e) || (0, i.isPluralElement)(e)) for (var t in e.options) delete e.options[t].location, a(e.options[t].value);
3230
+ else (0, i.isNumberElement)(e) && (0, i.isNumberSkeleton)(e.style) || ((0, i.isDateElement)(e) || (0, i.isTimeElement)(e)) && (0, i.isDateTimeSkeleton)(e.style) ? delete e.style.location : (0, i.isTagElement)(e) && a(e.children);
3231
+ });
3232
+ }
3233
+ function o(e, i) {
3234
+ i === void 0 && (i = {}), i = t.__assign({
3235
+ shouldParseSkeletons: !0,
3236
+ requiresOtherClause: !0
3237
+ }, i);
3238
+ var o = new r.Parser(e, i).parse();
3239
+ if (o.err) {
3240
+ var s = SyntaxError(n.ErrorKind[o.err.kind]);
3241
+ throw s.location = o.err.location, s.originalMessage = o.err.message, s;
3242
+ }
3243
+ return i?.captureLocation || a(o.val), o.val;
3244
+ }
3245
+ t.__exportStar(z(), e), e._Parser = r.Parser;
3246
+ var s = bt();
3247
+ Object.defineProperty(e, `isStructurallySame`, {
3248
+ enumerable: !0,
3249
+ get: function() {
3250
+ return s.isStructurallySame;
3251
+ }
3252
+ });
3253
+ })), St = p(((e) => {
3254
+ Object.defineProperty(e, `__esModule`, { value: !0 }), e.printAST = r;
3255
+ var t = (R(), g(M)), n = z();
3256
+ function r(e) {
3257
+ return i(e, !1);
3258
+ }
3259
+ function i(e, t) {
3260
+ return e.map(function(r, i) {
3261
+ if ((0, n.isLiteralElement)(r)) return s(r, t, i === 0, i === e.length - 1);
3262
+ if ((0, n.isArgumentElement)(r)) return c(r);
3263
+ if ((0, n.isDateElement)(r) || (0, n.isTimeElement)(r) || (0, n.isNumberElement)(r)) return l(r);
3264
+ if ((0, n.isPluralElement)(r)) return m(r);
3265
+ if ((0, n.isSelectElement)(r)) return p(r);
3266
+ if ((0, n.isPoundElement)(r)) return `#`;
3267
+ if ((0, n.isTagElement)(r)) return a(r);
3268
+ }).join(``);
3269
+ }
3270
+ function a(e) {
3271
+ return `<${e.value}>${r(e.children)}</${e.value}>`;
3272
+ }
3273
+ function o(e) {
3274
+ return e.replace(/([{}](?:[\s\S]*[{}])?)/, `'$1'`);
3275
+ }
3276
+ function s(e, t, n, r) {
3277
+ var i = e.value;
3278
+ return !n && i[0] === `'` && (i = `''${i.slice(1)}`), !r && i[i.length - 1] === `'` && (i = `${i.slice(0, i.length - 1)}''`), i = o(i), t ? i.replace(`#`, `'#'`) : i;
3279
+ }
3280
+ function c(e) {
3281
+ return `{${e.value}}`;
3282
+ }
3283
+ function l(e) {
3284
+ return `{${e.value}, ${n.TYPE[e.type]}${e.style ? `, ${d(e.style)}` : ``}}`;
3285
+ }
3286
+ function u(e) {
3287
+ var t = e.stem, n = e.options;
3288
+ return n.length === 0 ? t : `${t}${n.map(function(e) {
3289
+ return `/${e}`;
3290
+ }).join(``)}`;
3291
+ }
3292
+ function d(e) {
3293
+ return typeof e == `string` ? o(e) : e.type === n.SKELETON_TYPE.dateTime ? `::${f(e)}` : `::${e.tokens.map(u).join(` `)}`;
3294
+ }
3295
+ function f(e) {
3296
+ return e.pattern;
3297
+ }
3298
+ function p(e) {
3299
+ return `{${[
3300
+ e.value,
3301
+ `select`,
3302
+ Object.keys(e.options).map(function(t) {
3303
+ return `${t}{${i(e.options[t].value, !1)}}`;
3304
+ }).join(` `)
3305
+ ].join(`,`)}}`;
3306
+ }
3307
+ function m(e) {
3308
+ var n = e.pluralType === `cardinal` ? `plural` : `selectordinal`;
3309
+ return `{${[
3310
+ e.value,
3311
+ n,
3312
+ t.__spreadArray([e.offset ? `offset:${e.offset}` : ``], Object.keys(e.options).map(function(t) {
3313
+ return `${t}{${i(e.options[t].value, !0)}}`;
3314
+ }), !0).filter(Boolean).join(` `)
3315
+ ].join(`,`)}}`;
3316
+ }
3317
+ }));
3318
+ xt();
3319
+ z();
3320
+ St();
3321
+ const U = `_gt_`;
3322
+ RegExp(`^${U}\\d+$`);
3323
+ RegExp(`^${U}$`);
3324
+ const Ht = `@generaltranslation/react-core`;
3325
+ function W(e) {
3326
+ return S({
3327
+ source: Ht,
3328
+ ...e
3329
+ });
3330
+ }
3331
+ W({
3332
+ severity: `Error`,
3333
+ whatHappened: `Runtime translation needs a project ID`,
3334
+ fix: `Add projectId to your <GTProvider> configuration or set GT_PROJECT_ID in your environment`,
3335
+ docsUrl: `https://generaltranslation.com/dashboard`
3336
+ }), W({
3337
+ severity: `Error`,
3338
+ whatHappened: `Production environments cannot use a development API key`,
3339
+ fix: `Replace it with a production API key before deploying`
3340
+ }), W({
3341
+ severity: `Error`,
3342
+ whatHappened: `The API key is available to client-side production code`,
3343
+ fix: `Move translation credentials to a server-only environment before deploying`
3344
+ }), W({
3345
+ severity: `Error`,
3346
+ whatHappened: `Runtime translation is not configured`,
3347
+ fix: `Add projectId and devApiKey to your environment, or pass them to <GTProvider> directly`
3348
+ }), W({
3349
+ severity: `Error`,
3350
+ whatHappened: `Runtime translations could not be loaded`,
3351
+ wayOut: `Source content will render as a fallback`,
3352
+ fix: `Check your runtime translation configuration and try again`
3353
+ }), W({
3354
+ severity: `Error`,
3355
+ whatHappened: `Runtime translation could not be completed`
3356
+ });
3357
+ W({
3358
+ severity: `Warning`,
3359
+ whatHappened: `Runtime translation needs a project ID`,
3360
+ fix: `Add projectId to <GTProvider> or set GT_PROJECT_ID in your environment`,
3361
+ docsUrl: `https://generaltranslation.com/dashboard`
3362
+ }), W({
3363
+ severity: `Warning`,
3364
+ whatHappened: `Runtime translation needs a development API key`,
3365
+ fix: `Find your development API key at generaltranslation.com/dashboard, or set runtimeUrl to an empty string to disable runtime translation`
3366
+ }), W({
3367
+ severity: `Warning`,
3368
+ whatHappened: `Runtime translation timed out`
3369
+ }), W({
3370
+ severity: `Warning`,
3371
+ whatHappened: `No dictionary was found`,
3372
+ fix: `Pass a dictionary to <GTProvider> or configure a dictionary loader before rendering translations`
3373
+ });
3374
+ `${Ht}`;
3375
+ const pn = `generaltranslation.locale`;
3376
+ react.use;
3377
+ function Jn({ children: e }) {
3378
+ return e;
3379
+ }
3380
+ function Yn(e) {
3381
+ return Jn(e);
3382
+ }
3383
+ Jn._gtt = `derive`, Yn._gtt = `derive`;
3384
+ //#endregion
3385
+ //#region src/shared/messages.ts
3386
+ const PACKAGE_NAME = "gt-react";
3387
+ createDiagnosticMessage({
3388
+ source: `${PACKAGE_NAME}/browser`,
3389
+ severity: "Error",
3390
+ whatHappened: "This module requires a browser environment",
3391
+ fix: "Import it only from client-side code"
3392
+ });
3393
+ createDiagnosticMessage({
3394
+ source: PACKAGE_NAME,
3395
+ severity: "Error",
3396
+ whatHappened: "A browser-only module was imported outside the browser",
3397
+ fix: "Move this import to client-side code"
3398
+ });
3399
+ createDiagnosticMessage({
3400
+ source: PACKAGE_NAME,
3401
+ severity: "Error",
3402
+ whatHappened: "BrowserI18nManager is not initialized",
3403
+ fix: "Call initializeGT() before using browser translation APIs"
3404
+ });
3405
+ //#endregion
3406
+ //#region src/react-context/provider/hooks/locales/useDetermineLocale.ts
3407
+ function useDetermineLocale({ locale: initialLocale = "", defaultLocale = "en", locales: initialLocales = [], localeCookieName = pn, ssr = true, customMapping, enableI18n, reloadOnLocaleUpdate = false }) {
3408
+ const _locale = (0, react.useMemo)(() => (0, _generaltranslation_format.resolveAliasLocale)(initialLocale, customMapping), [initialLocale, customMapping]);
3409
+ const locales = (0, react.useMemo)(() => initialLocales.map((locale) => (0, _generaltranslation_format.resolveAliasLocale)(locale, customMapping)), [initialLocales, customMapping]);
3410
+ /**
3411
+ * Choose a locale to use
3412
+ * (1) use provided locale
3413
+ * (2) use cookie locale
3414
+ * (3) use preferred locale
3415
+ * (5) fallback to defaultLocale
3416
+ * Update the cookie locale to be correct
3417
+ */
3418
+ const getNewLocale = (0, react.useCallback)((locale) => {
3419
+ if (!enableI18n) return defaultLocale;
3420
+ if (_locale && _locale === locale && (0, _generaltranslation_format.determineLocale)(_locale, locales, customMapping) === locale) return _locale;
3421
+ let cookieLocale = getCookieValue(localeCookieName);
3422
+ if (cookieLocale) cookieLocale = (0, _generaltranslation_format.resolveAliasLocale)(cookieLocale, customMapping);
3423
+ const browserLocales = getBrowserLocales(customMapping);
3424
+ let newLocale = (0, _generaltranslation_format.determineLocale)([
3425
+ ..._locale ? [_locale] : [],
3426
+ ...cookieLocale ? [cookieLocale] : [],
3427
+ ...browserLocales
3428
+ ], locales, customMapping) || defaultLocale;
3429
+ if (newLocale) newLocale = (0, _generaltranslation_format.resolveAliasLocale)(newLocale, customMapping);
3430
+ if (cookieLocale && cookieLocale !== newLocale) setCookieValue(localeCookieName, newLocale);
3431
+ return newLocale;
3432
+ }, [
3433
+ _locale,
3434
+ customMapping,
3435
+ defaultLocale,
3436
+ enableI18n,
3437
+ localeCookieName,
3438
+ locales
3439
+ ]);
3440
+ const initializeLocale = () => {
3441
+ if (!enableI18n) return defaultLocale;
3442
+ return (0, _generaltranslation_format.resolveAliasLocale)(ssr ? _locale ? (0, _generaltranslation_format.determineLocale)(_locale, locales, customMapping) || "" : "" : getNewLocale(_locale), customMapping);
3443
+ };
3444
+ const [locale, _setLocale] = (0, react.useState)(initializeLocale);
3445
+ const currentLocale = (0, _generaltranslation_format.resolveAliasLocale)(locale, customMapping);
3446
+ const setLocaleWithoutSettingCookie = (0, react.useCallback)((newLocale) => {
3447
+ if (!enableI18n) return defaultLocale;
3448
+ if (newLocale === currentLocale) return currentLocale;
3449
+ const validatedLocale = (0, _generaltranslation_format.resolveAliasLocale)((0, _generaltranslation_format.determineLocale)(newLocale, locales, customMapping) || currentLocale || defaultLocale, customMapping);
3450
+ if (validatedLocale !== newLocale) console.warn(s$1(validatedLocale, newLocale, PACKAGE_NAME));
3451
+ _setLocale(validatedLocale);
3452
+ return validatedLocale;
3453
+ }, [
3454
+ currentLocale,
3455
+ customMapping,
3456
+ defaultLocale,
3457
+ enableI18n,
3458
+ locales
3459
+ ]);
3460
+ const setLocale = (newLocale) => {
3461
+ if (!enableI18n) return;
3462
+ newLocale = (0, _generaltranslation_format.resolveAliasLocale)(newLocale);
3463
+ setCookieValue(localeCookieName, setLocaleWithoutSettingCookie(newLocale));
3464
+ if (typeof window !== "undefined" && newLocale !== currentLocale && reloadOnLocaleUpdate) window.location.reload();
3465
+ };
3466
+ (0, react.useEffect)(() => {
3467
+ setLocaleWithoutSettingCookie(getNewLocale(locale));
3468
+ }, [
3469
+ locale,
3470
+ setLocaleWithoutSettingCookie,
3471
+ getNewLocale
3472
+ ]);
3473
+ return [locale, setLocale];
3474
+ }
3475
+ function getBrowserLocales(customMapping) {
3476
+ if (typeof navigator === "undefined") return [];
3477
+ const legacyNavigator = navigator;
3478
+ return (navigator.languages || (navigator.language ? [navigator.language] : legacyNavigator.userLanguage ? [legacyNavigator.userLanguage] : [])).map((locale) => (0, _generaltranslation_format.resolveAliasLocale)(locale, customMapping));
3479
+ }
3480
+ //#endregion
3481
+ //#region src/react-context/provider/helpers/isSSREnabled.ts
3482
+ function isSSREnabled() {
3483
+ if (typeof process !== "undefined" && process.env.NEXT_RUNTIME) return true;
3484
+ if (globalThis?.__NEXT_DATA__ !== void 0) return true;
3485
+ return false;
3486
+ }
3487
+ //#endregion
3488
+ //#region src/react-context/provider/GTProvider.tsx
3489
+ /**
3490
+ * Provides General Translation context to its children, which can then access `useGT`, `useLocale`, and `useDefaultLocale`.
3491
+ *
3492
+ * @param {React.ReactNode} children - The children components that will use the translation context.
3493
+ * @param {string} [projectId] - The project ID required for General Translation cloud services.
3494
+ * @param {Dictionary} [dictionary=defaultDictionary] - The translation dictionary for the project.
3495
+ * @param {string[]} [locales] - The list of approved locales for the project.
3496
+ * @param {string} [defaultLocale=libraryDefaultLocale] - The default locale to use if no other locale is found.
3497
+ * @param {string} [locale] - The current locale, if already set.
3498
+ * @param {string} [cacheUrl='https://cdn.gtx.dev'] - The URL of the cache service for fetching translations.
3499
+ * @param {string} [runtimeUrl='https://runtime.gtx.dev'] - The URL of the runtime service for fetching translations.
3500
+ * @param {RenderSettings} [renderSettings=defaultRenderSettings] - The settings for rendering translations.
3501
+ * @param {string} [_versionId] - The version ID for fetching translations.
3502
+ * @param {string} [devApiKey] - The API key for development environments.
3503
+ * @param {object} [metadata] - Additional metadata to pass to the context.
3504
+ * @param {boolean} [ssr=isSSREnabled()] - Whether to enable server-side rendering.
3505
+ * @param {string} [localeCookieName=defaultLocaleCookieName] - The name of the cookie to store the locale.
3506
+ * @param {boolean} [enableI18n=true] - Whether to enable i18n.
3507
+ * @param {boolean|undefined} [enableI18nLoaded=undefined] - Flag to indicate if the enableI18n flag is finished loading asynchronously. Undefined means flag is loaded synchronously.
3508
+ * @param {Translations | null} [translations=null] - The translations to use for the context.
3509
+ * @param {React.ReactNode} [fallback = undefined] - Custom fallback to display while loading
3510
+ *
3511
+ * @returns {JSX.Element} The provider component for General Translation context.
3512
+ */
3513
+ function GTProvider(props) {
3514
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_generaltranslation_react_core.GTProvider, {
3515
+ ssr: isSSREnabled(),
3516
+ environment: process.env.NODE_ENV,
3517
+ ...props,
3518
+ readAuthFromEnv,
3519
+ useDetermineLocale,
3520
+ useRegionState,
3521
+ useEnableI18n
3522
+ });
3523
+ }
3524
+ //#endregion
3525
+ //#region src/shared/InternalLocaleSelector.tsx
3526
+ /**
3527
+ * Capitalizes the first letter of a string if applicable.
3528
+ * For strings that do not use capitalization, it returns the string unchanged.
3529
+ * @param {string} str - The string to capitalize.
3530
+ * @returns {string} The string with the first letter capitalized if applicable.
3531
+ */
3532
+ function capitalizeName(str) {
3533
+ if (!str) return "";
3534
+ return str.charAt(0).toUpperCase() + (str.length > 1 ? str.slice(1) : "");
3535
+ }
3536
+ /**
3537
+ * Internal helper to convert deprecated customNames prop to the new customMapping format.
3538
+ * Used for backward compatibility with previous LocaleSelector API.
3539
+ * @param {object} customNames - Mapping of locale to display name.
3540
+ * @returns {CustomMapping | undefined} The converted mapping or undefined.
3541
+ * @internal
3542
+ */
3543
+ function _convertCustomNamesToMapping(customNames) {
3544
+ if (!customNames) return void 0;
3545
+ const result = {};
3546
+ for (const locale in customNames) result[locale] = { name: customNames[locale] };
3547
+ return result;
3548
+ }
3549
+ /**
3550
+ * A dropdown component that allows users to select a locale.
3551
+ * @param {string} locale - The currently selected locale.
3552
+ * @param {string[]} locales - The list of all available locales.
3553
+ * @param {function} setLocale - Function to update the current locale.
3554
+ * @param {function} getLocaleProperties - Function to retrieve properties for a given locale.
3555
+ * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
3556
+ * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
3557
+ * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
3558
+ *
3559
+ * @internal
3560
+ */
3561
+ function InternalLocaleSelector({ locale, locales, customNames, customMapping = _convertCustomNamesToMapping(customNames), setLocale, getLocaleProperties, ...props }) {
3562
+ const getDisplayName = (locale) => {
3563
+ const customLocale = customMapping?.[locale];
3564
+ if (typeof customLocale === "string") return customLocale;
3565
+ if (customLocale?.name) return customLocale.name;
3566
+ return capitalizeName(getLocaleProperties(locale).nativeNameWithRegionCode);
3567
+ };
3568
+ if (!locales?.length || !setLocale) return null;
3569
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3570
+ ...props,
3571
+ value: locale || "",
3572
+ onChange: (e) => setLocale(e.target.value),
3573
+ children: [!locale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", { value: "" }), locales.map((locale) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3574
+ value: locale,
3575
+ suppressHydrationWarning: true,
3576
+ children: getDisplayName(locale)
3577
+ }, locale))]
3578
+ });
3579
+ }
3580
+ //#endregion
3581
+ //#region src/react-context/ui/LocaleSelector.tsx
3582
+ /**
3583
+ * A dropdown component that allows users to select a locale.
3584
+ * @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.
3585
+ * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
3586
+ * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
3587
+ * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
3588
+ */
3589
+ function LocaleSelector({ locales: _locales, ...props }) {
3590
+ const { locale, locales, setLocale, getLocaleProperties } = (0, _generaltranslation_react_core.useLocaleSelector)(_locales);
3591
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalLocaleSelector, {
3592
+ locale,
3593
+ locales,
3594
+ setLocale,
3595
+ getLocaleProperties,
3596
+ ...props
3597
+ });
3598
+ }
3599
+ //#endregion
3600
+ //#region src/react-context/ui/RegionSelector.tsx
3601
+ /**
3602
+ * A dropdown component that allows users to select a region.
3603
+ *
3604
+ * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales in the `<GTProvider>` context.
3605
+ * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.
3606
+ * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales. The value can be a string (display name) or an object with `name`, `emoji`, and/or `locale` properties.
3607
+ * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.
3608
+ * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.
3609
+ * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.
3610
+ * @param {object} [props] - Additional props to pass to the underlying `<select>` element.
3611
+ * @returns {React.JSX.Element | null} The rendered region dropdown component or null if no regions are available.
3612
+ *
3613
+ * @example
3614
+ * ```tsx
3615
+ * <RegionSelector
3616
+ * regions={['US', 'CA']}
3617
+ * customMapping={{ US: { name: "United States", emoji: "πŸ‡ΊπŸ‡Έ" } }}
3618
+ * placeholder="Select a region"
3619
+ * />
3620
+ * ```
3621
+ */
3622
+ function RegionSelector({ regions: _regions, placeholder, customMapping, prioritizeCurrentLocaleRegion, sortRegionsAlphabetically, asLocaleSelector = false, ...props }) {
3623
+ const { region, setRegion, regions, regionData, locale, setLocale } = (0, _generaltranslation_react_core.useRegionSelector)({
3624
+ regions: _regions,
3625
+ customMapping,
3626
+ prioritizeCurrentLocaleRegion,
3627
+ sortRegionsAlphabetically
3628
+ });
3629
+ const changeRegion = (region) => {
3630
+ setRegion(region);
3631
+ if (asLocaleSelector) {
3632
+ const regionLocale = regionData.get(region).locale;
3633
+ if (locale !== regionLocale) setLocale(regionLocale);
3634
+ }
3635
+ };
3636
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3637
+ ...props,
3638
+ value: region || "",
3639
+ onChange: (e) => changeRegion(e.target.value),
3640
+ children: [!region && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3641
+ value: "",
3642
+ disabled: Boolean(region),
3643
+ hidden: Boolean(region),
3644
+ suppressHydrationWarning: true,
3645
+ children: placeholder || ""
3646
+ }, "placeholder"), regions.map((r) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3647
+ value: r,
3648
+ suppressHydrationWarning: true,
3649
+ children: regionData.get(r).name
3650
+ }, r))]
3651
+ });
3652
+ }
3653
+ //#endregion
3654
+ exports.Branch = _generaltranslation_react_core.Branch;
3655
+ exports.Currency = _generaltranslation_react_core.Currency;
3656
+ exports.DateTime = _generaltranslation_react_core.DateTime;
3657
+ exports.Derive = _generaltranslation_react_core.Derive;
3658
+ exports.GTProvider = GTProvider;
3659
+ exports.LocaleSelector = LocaleSelector;
3660
+ exports.Num = _generaltranslation_react_core.Num;
3661
+ exports.Plural = _generaltranslation_react_core.Plural;
3662
+ exports.RegionSelector = RegionSelector;
3663
+ exports.RelativeTime = _generaltranslation_react_core.RelativeTime;
3664
+ exports.Static = _generaltranslation_react_core.Static;
3665
+ exports.T = _generaltranslation_react_core.T;
3666
+ exports.Var = _generaltranslation_react_core.Var;
3667
+ exports.declareStatic = _generaltranslation_react_core.declareStatic;
3668
+ exports.declareVar = _generaltranslation_react_core.declareVar;
3669
+ exports.decodeMsg = _generaltranslation_react_core.decodeMsg;
3670
+ exports.decodeOptions = _generaltranslation_react_core.decodeOptions;
3671
+ exports.decodeVars = _generaltranslation_react_core.decodeVars;
3672
+ exports.derive = _generaltranslation_react_core.derive;
3673
+ exports.gtFallback = _generaltranslation_react_core.gtFallback;
3674
+ exports.mFallback = _generaltranslation_react_core.mFallback;
3675
+ exports.msg = _generaltranslation_react_core.msg;
3676
+ exports.useDefaultLocale = _generaltranslation_react_core.useDefaultLocale;
3677
+ exports.useGT = _generaltranslation_react_core.useGT;
3678
+ exports.useGTClass = _generaltranslation_react_core.useGTClass;
3679
+ exports.useLocale = _generaltranslation_react_core.useLocale;
3680
+ exports.useLocaleDirection = _generaltranslation_react_core.useLocaleDirection;
3681
+ exports.useLocaleProperties = _generaltranslation_react_core.useLocaleProperties;
3682
+ exports.useLocaleSelector = _generaltranslation_react_core.useLocaleSelector;
3683
+ exports.useLocales = _generaltranslation_react_core.useLocales;
3684
+ exports.useMessages = _generaltranslation_react_core.useMessages;
3685
+ exports.useRegion = _generaltranslation_react_core.useRegion;
3686
+ exports.useRegionSelector = _generaltranslation_react_core.useRegionSelector;
3687
+ exports.useSetLocale = _generaltranslation_react_core.useSetLocale;
3688
+ exports.useTranslations = _generaltranslation_react_core.useTranslations;
3689
+ exports.useVersionId = _generaltranslation_react_core.useVersionId;
3690
+
3691
+ //# sourceMappingURL=index.cjs.map