gt-react 10.19.14 β†’ 10.19.16

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