@internationalized/string 3.2.7 → 3.2.8

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 (26) hide show
  1. package/dist/{main.js → index.cjs} +5 -5
  2. package/dist/{main.js.map → index.cjs.map} +1 -1
  3. package/dist/{import.mjs → index.js} +4 -4
  4. package/dist/{module.js.map → index.js.map} +1 -1
  5. package/dist/{module.js → index.mjs} +4 -4
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/{LocalizedStringDictionary.main.js → private/LocalizedStringDictionary.cjs} +22 -22
  8. package/dist/private/LocalizedStringDictionary.cjs.map +1 -0
  9. package/dist/{LocalizedStringDictionary.mjs → private/LocalizedStringDictionary.js} +16 -16
  10. package/dist/{LocalizedStringDictionary.module.js.map → private/LocalizedStringDictionary.js.map} +1 -1
  11. package/dist/{LocalizedStringDictionary.module.js → private/LocalizedStringDictionary.mjs} +22 -22
  12. package/dist/private/LocalizedStringDictionary.mjs.map +1 -0
  13. package/dist/{LocalizedStringFormatter.main.js → private/LocalizedStringFormatter.cjs} +13 -13
  14. package/dist/private/LocalizedStringFormatter.cjs.map +1 -0
  15. package/dist/{LocalizedStringFormatter.module.js → private/LocalizedStringFormatter.js} +9 -9
  16. package/dist/{LocalizedStringFormatter.module.js.map → private/LocalizedStringFormatter.js.map} +1 -1
  17. package/dist/{LocalizedStringFormatter.mjs → private/LocalizedStringFormatter.mjs} +13 -13
  18. package/dist/private/LocalizedStringFormatter.mjs.map +1 -0
  19. package/dist/types/src/LocalizedStringDictionary.d.ts +18 -0
  20. package/dist/types/src/LocalizedStringFormatter.d.ts +19 -0
  21. package/dist/types/src/index.d.ts +4 -0
  22. package/package.json +26 -11
  23. package/dist/LocalizedStringDictionary.main.js.map +0 -1
  24. package/dist/LocalizedStringFormatter.main.js.map +0 -1
  25. package/dist/types.d.ts +0 -32
  26. package/dist/types.d.ts.map +0 -1
@@ -1,13 +1,13 @@
1
- var $f80be5fd4d03dda9$exports = require("./LocalizedStringDictionary.main.js");
2
- var $3e95fbf3429967d1$exports = require("./LocalizedStringFormatter.main.js");
1
+ var $2f953b27181a8377$exports = require("./private/LocalizedStringDictionary.cjs");
2
+ var $7da27b9d142b3465$exports = require("./private/LocalizedStringFormatter.cjs");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "LocalizedStringDictionary", () => $f80be5fd4d03dda9$exports.LocalizedStringDictionary);
10
- $parcel$export(module.exports, "LocalizedStringFormatter", () => $3e95fbf3429967d1$exports.LocalizedStringFormatter);
9
+ $parcel$export(module.exports, "LocalizedStringDictionary", function () { return $2f953b27181a8377$exports.LocalizedStringDictionary; });
10
+ $parcel$export(module.exports, "LocalizedStringFormatter", function () { return $7da27b9d142b3465$exports.LocalizedStringFormatter; });
11
11
  /*
12
12
  * Copyright 2022 Adobe. All rights reserved.
13
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -22,4 +22,4 @@ $parcel$export(module.exports, "LocalizedStringFormatter", () => $3e95fbf3429967
22
22
 
23
23
 
24
24
 
25
- //# sourceMappingURL=main.js.map
25
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/string/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/string/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"index.cjs.map"}
@@ -1,5 +1,5 @@
1
- import {LocalizedStringDictionary as $5b160d28a433310d$export$c17fa47878dc55b6} from "./LocalizedStringDictionary.mjs";
2
- import {LocalizedStringFormatter as $6db58dc88e78b024$export$2f817fcdc4b89ae0} from "./LocalizedStringFormatter.mjs";
1
+ import {LocalizedStringDictionary as $a9f502cbcdb3951f$export$c17fa47878dc55b6} from "./private/LocalizedStringDictionary.js";
2
+ import {LocalizedStringFormatter as $1e8423fa4cde1500$export$2f817fcdc4b89ae0} from "./private/LocalizedStringFormatter.js";
3
3
 
4
4
  /*
5
5
  * Copyright 2022 Adobe. All rights reserved.
@@ -15,5 +15,5 @@ import {LocalizedStringFormatter as $6db58dc88e78b024$export$2f817fcdc4b89ae0} f
15
15
 
16
16
 
17
17
 
18
- export {$5b160d28a433310d$export$c17fa47878dc55b6 as LocalizedStringDictionary, $6db58dc88e78b024$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
19
- //# sourceMappingURL=module.js.map
18
+ export {$a9f502cbcdb3951f$export$c17fa47878dc55b6 as LocalizedStringDictionary, $1e8423fa4cde1500$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
19
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/string/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/string/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"index.js.map"}
@@ -1,5 +1,5 @@
1
- import {LocalizedStringDictionary as $5b160d28a433310d$export$c17fa47878dc55b6} from "./LocalizedStringDictionary.module.js";
2
- import {LocalizedStringFormatter as $6db58dc88e78b024$export$2f817fcdc4b89ae0} from "./LocalizedStringFormatter.module.js";
1
+ import {LocalizedStringDictionary as $a747a10fe70a57da$export$c17fa47878dc55b6} from "./private/LocalizedStringDictionary.mjs";
2
+ import {LocalizedStringFormatter as $b27c684a33948c64$export$2f817fcdc4b89ae0} from "./private/LocalizedStringFormatter.mjs";
3
3
 
4
4
  /*
5
5
  * Copyright 2022 Adobe. All rights reserved.
@@ -15,5 +15,5 @@ import {LocalizedStringFormatter as $6db58dc88e78b024$export$2f817fcdc4b89ae0} f
15
15
 
16
16
 
17
17
 
18
- export {$5b160d28a433310d$export$c17fa47878dc55b6 as LocalizedStringDictionary, $6db58dc88e78b024$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
19
- //# sourceMappingURL=module.js.map
18
+ export {$a747a10fe70a57da$export$c17fa47878dc55b6 as LocalizedStringDictionary, $b27c684a33948c64$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
19
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/string/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"index.mjs.map"}
@@ -3,7 +3,7 @@ function $parcel$export(e, n, v, s) {
3
3
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
4
  }
5
5
 
6
- $parcel$export(module.exports, "LocalizedStringDictionary", () => $f80be5fd4d03dda9$export$c17fa47878dc55b6);
6
+ $parcel$export(module.exports, "LocalizedStringDictionary", function () { return $2f953b27181a8377$export$c17fa47878dc55b6; });
7
7
  /*
8
8
  * Copyright 2022 Adobe. All rights reserved.
9
9
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -14,10 +14,16 @@ $parcel$export(module.exports, "LocalizedStringDictionary", () => $f80be5fd4d03d
14
14
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
15
  * OF ANY KIND, either express or implied. See the License for the specific language
16
16
  * governing permissions and limitations under the License.
17
- */ const $f80be5fd4d03dda9$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
18
- const $f80be5fd4d03dda9$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
19
- let $f80be5fd4d03dda9$var$cachedGlobalStrings = undefined;
20
- class $f80be5fd4d03dda9$export$c17fa47878dc55b6 {
17
+ */ const $2f953b27181a8377$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
18
+ const $2f953b27181a8377$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
19
+ let $2f953b27181a8377$var$cachedGlobalStrings = undefined;
20
+ class $2f953b27181a8377$export$c17fa47878dc55b6 {
21
+ constructor(messages, defaultLocale = 'en-US'){
22
+ // Clone messages so we don't modify the original object.
23
+ // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
24
+ this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
25
+ this.defaultLocale = defaultLocale;
26
+ }
21
27
  /** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
22
28
  let strings = this.getStringsForLocale(locale);
23
29
  let string = strings[key];
@@ -27,34 +33,28 @@ class $f80be5fd4d03dda9$export$c17fa47878dc55b6 {
27
33
  /** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
28
34
  let strings = this.strings[locale];
29
35
  if (!strings) {
30
- strings = $f80be5fd4d03dda9$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
36
+ strings = $2f953b27181a8377$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
31
37
  this.strings[locale] = strings;
32
38
  }
33
39
  return strings;
34
40
  }
35
41
  static getGlobalDictionaryForPackage(packageName) {
36
42
  if (typeof window === 'undefined') return null;
37
- let locale = window[$f80be5fd4d03dda9$var$localeSymbol];
38
- if ($f80be5fd4d03dda9$var$cachedGlobalStrings === undefined) {
39
- let globalStrings = window[$f80be5fd4d03dda9$var$stringsSymbol];
43
+ let locale = window[$2f953b27181a8377$var$localeSymbol];
44
+ if ($2f953b27181a8377$var$cachedGlobalStrings === undefined) {
45
+ let globalStrings = window[$2f953b27181a8377$var$stringsSymbol];
40
46
  if (!globalStrings) return null;
41
- $f80be5fd4d03dda9$var$cachedGlobalStrings = {};
42
- for(let pkg in globalStrings)$f80be5fd4d03dda9$var$cachedGlobalStrings[pkg] = new $f80be5fd4d03dda9$export$c17fa47878dc55b6({
47
+ $2f953b27181a8377$var$cachedGlobalStrings = {};
48
+ for(let pkg in globalStrings)$2f953b27181a8377$var$cachedGlobalStrings[pkg] = new $2f953b27181a8377$export$c17fa47878dc55b6({
43
49
  [locale]: globalStrings[pkg]
44
50
  }, locale);
45
51
  }
46
- let dictionary = $f80be5fd4d03dda9$var$cachedGlobalStrings === null || $f80be5fd4d03dda9$var$cachedGlobalStrings === void 0 ? void 0 : $f80be5fd4d03dda9$var$cachedGlobalStrings[packageName];
52
+ let dictionary = $2f953b27181a8377$var$cachedGlobalStrings?.[packageName];
47
53
  if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
48
54
  return dictionary;
49
55
  }
50
- constructor(messages, defaultLocale = 'en-US'){
51
- // Clone messages so we don't modify the original object.
52
- // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
53
- this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
54
- this.defaultLocale = defaultLocale;
55
- }
56
56
  }
57
- function $f80be5fd4d03dda9$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
57
+ function $2f953b27181a8377$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
58
58
  // If there is an exact match, use it.
59
59
  if (strings[locale]) return strings[locale];
60
60
  // Attempt to find the closest match by language.
@@ -62,7 +62,7 @@ function $f80be5fd4d03dda9$var$getStringsForLocale(locale, strings, defaultLocal
62
62
  // an fr-FR (France) set of strings, use that.
63
63
  // This could be replaced with Intl.LocaleMatcher once it is supported.
64
64
  // https://github.com/tc39/proposal-intl-localematcher
65
- let language = $f80be5fd4d03dda9$var$getLanguage(locale);
65
+ let language = $2f953b27181a8377$var$getLanguage(locale);
66
66
  if (strings[language]) return strings[language];
67
67
  for(let key in strings){
68
68
  if (key.startsWith(language + '-')) return strings[key];
@@ -70,7 +70,7 @@ function $f80be5fd4d03dda9$var$getStringsForLocale(locale, strings, defaultLocal
70
70
  // Nothing close, use english.
71
71
  return strings[defaultLocale];
72
72
  }
73
- function $f80be5fd4d03dda9$var$getLanguage(locale) {
73
+ function $2f953b27181a8377$var$getLanguage(locale) {
74
74
  // @ts-ignore
75
75
  if (Intl.Locale) // @ts-ignore
76
76
  return new Intl.Locale(locale).language;
@@ -78,4 +78,4 @@ function $f80be5fd4d03dda9$var$getLanguage(locale) {
78
78
  }
79
79
 
80
80
 
81
- //# sourceMappingURL=LocalizedStringDictionary.main.js.map
81
+ //# sourceMappingURL=LocalizedStringDictionary.cjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAQD,MAAM,qCAAe,OAAO,GAAG,CAAC;AAChC,MAAM,sCAAgB,OAAO,GAAG,CAAC;AACjC,IAAI,4CAAuG;AAMpG,MAAM;IAIX,YAAY,QAAgC,EAAE,gBAAwB,OAAO,CAAE;QAC7E,yDAAyD;QACzD,uGAAuG;QACvG,IAAI,CAAC,OAAO,GAAG,OAAO,WAAW,CAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,CAAC,CAAC,GAAG,EAAE,GAAK;QAE7C,IAAI,CAAC,aAAa,GAAG;IACvB;IAEA,6DAA6D,GAC7D,mBAAmB,GAAM,EAAE,MAAc,EAAK;QAC5C,IAAI,UAAU,IAAI,CAAC,mBAAmB,CAAC;QACvC,IAAI,SAAS,OAAO,CAAC,IAAI;QACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,CAAC,4BAA4B,EAAE,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;QAG1E,OAAO;IACT;IAEA,wDAAwD,GACxD,oBAAoB,MAAc,EAAgB;QAChD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,OAAO;QAClC,IAAI,CAAC,SAAS;YACZ,UAAU,0CAAoB,QAAQ,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YACtE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;QACzB;QAEA,OAAO;IACT;IAEA,OAAO,8BAA6F,WAAmB,EAA0C;QAC/J,IAAI,OAAO,WAAW,aACpB,OAAO;QAGT,IAAI,SAAS,MAAM,CAAC,mCAAa;QACjC,IAAI,8CAAwB,WAAW;YACrC,IAAI,gBAAgB,MAAM,CAAC,oCAAc;YACzC,IAAI,CAAC,eACH,OAAO;YAGT,4CAAsB,CAAC;YACvB,IAAK,IAAI,OAAO,cACd,yCAAmB,CAAC,IAAI,GAAG,IAAI,0CAA0B;gBAAC,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI;YAAA,GAAG;QAE7F;QAEA,IAAI,aAAa,2CAAqB,CAAC,YAAY;QACnD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,CAAC,qBAAqB,EAAE,YAAY,oHAAoH,CAAC;QAG3K,OAAO;IACT;AACF;AAEA,SAAS,0CAAiE,MAAc,EAAE,OAA+B,EAAE,gBAAgB,OAAO;IAChJ,sCAAsC;IACtC,IAAI,OAAO,CAAC,OAAO,EACjB,OAAO,OAAO,CAAC,OAAO;IAGxB,iDAAiD;IACjD,2EAA2E;IAC3E,8CAA8C;IAC9C,uEAAuE;IACvE,sDAAsD;IACtD,IAAI,WAAW,kCAAY;IAC3B,IAAI,OAAO,CAAC,SAAS,EACnB,OAAO,OAAO,CAAC,SAAS;IAG1B,IAAK,IAAI,OAAO,QAAS;QACvB,IAAI,IAAI,UAAU,CAAC,WAAW,MAC5B,OAAO,OAAO,CAAC,IAAI;IAEvB;IAEA,8BAA8B;IAC9B,OAAO,OAAO,CAAC,cAAc;AAC/B;AAEA,SAAS,kCAAY,MAAc;IACjC,aAAa;IACb,IAAI,KAAK,MAAM,EACb,aAAa;IACb,OAAO,IAAI,KAAK,MAAM,CAAC,QAAQ,QAAQ;IAGzC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE;AAC7B","sources":["packages/@internationalized/string/src/LocalizedStringDictionary.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n"],"names":[],"version":3,"file":"LocalizedStringDictionary.cjs.map"}
@@ -8,10 +8,10 @@
8
8
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
- */ const $5b160d28a433310d$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
12
- const $5b160d28a433310d$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
13
- let $5b160d28a433310d$var$cachedGlobalStrings = undefined;
14
- class $5b160d28a433310d$export$c17fa47878dc55b6 {
11
+ */ const $a9f502cbcdb3951f$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
12
+ const $a9f502cbcdb3951f$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
13
+ let $a9f502cbcdb3951f$var$cachedGlobalStrings = undefined;
14
+ class $a9f502cbcdb3951f$export$c17fa47878dc55b6 {
15
15
  /** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
16
16
  let strings = this.getStringsForLocale(locale);
17
17
  let string = strings[key];
@@ -21,23 +21,23 @@ class $5b160d28a433310d$export$c17fa47878dc55b6 {
21
21
  /** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
22
22
  let strings = this.strings[locale];
23
23
  if (!strings) {
24
- strings = $5b160d28a433310d$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
24
+ strings = $a9f502cbcdb3951f$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
25
25
  this.strings[locale] = strings;
26
26
  }
27
27
  return strings;
28
28
  }
29
29
  static getGlobalDictionaryForPackage(packageName) {
30
30
  if (typeof window === 'undefined') return null;
31
- let locale = window[$5b160d28a433310d$var$localeSymbol];
32
- if ($5b160d28a433310d$var$cachedGlobalStrings === undefined) {
33
- let globalStrings = window[$5b160d28a433310d$var$stringsSymbol];
31
+ let locale = window[$a9f502cbcdb3951f$var$localeSymbol];
32
+ if ($a9f502cbcdb3951f$var$cachedGlobalStrings === undefined) {
33
+ let globalStrings = window[$a9f502cbcdb3951f$var$stringsSymbol];
34
34
  if (!globalStrings) return null;
35
- $5b160d28a433310d$var$cachedGlobalStrings = {};
36
- for(let pkg in globalStrings)$5b160d28a433310d$var$cachedGlobalStrings[pkg] = new $5b160d28a433310d$export$c17fa47878dc55b6({
35
+ $a9f502cbcdb3951f$var$cachedGlobalStrings = {};
36
+ for(let pkg in globalStrings)$a9f502cbcdb3951f$var$cachedGlobalStrings[pkg] = new $a9f502cbcdb3951f$export$c17fa47878dc55b6({
37
37
  [locale]: globalStrings[pkg]
38
38
  }, locale);
39
39
  }
40
- let dictionary = $5b160d28a433310d$var$cachedGlobalStrings === null || $5b160d28a433310d$var$cachedGlobalStrings === void 0 ? void 0 : $5b160d28a433310d$var$cachedGlobalStrings[packageName];
40
+ let dictionary = $a9f502cbcdb3951f$var$cachedGlobalStrings === null || $a9f502cbcdb3951f$var$cachedGlobalStrings === void 0 ? void 0 : $a9f502cbcdb3951f$var$cachedGlobalStrings[packageName];
41
41
  if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
42
42
  return dictionary;
43
43
  }
@@ -48,7 +48,7 @@ class $5b160d28a433310d$export$c17fa47878dc55b6 {
48
48
  this.defaultLocale = defaultLocale;
49
49
  }
50
50
  }
51
- function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
51
+ function $a9f502cbcdb3951f$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
52
52
  // If there is an exact match, use it.
53
53
  if (strings[locale]) return strings[locale];
54
54
  // Attempt to find the closest match by language.
@@ -56,7 +56,7 @@ function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocal
56
56
  // an fr-FR (France) set of strings, use that.
57
57
  // This could be replaced with Intl.LocaleMatcher once it is supported.
58
58
  // https://github.com/tc39/proposal-intl-localematcher
59
- let language = $5b160d28a433310d$var$getLanguage(locale);
59
+ let language = $a9f502cbcdb3951f$var$getLanguage(locale);
60
60
  if (strings[language]) return strings[language];
61
61
  for(let key in strings){
62
62
  if (key.startsWith(language + '-')) return strings[key];
@@ -64,7 +64,7 @@ function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocal
64
64
  // Nothing close, use english.
65
65
  return strings[defaultLocale];
66
66
  }
67
- function $5b160d28a433310d$var$getLanguage(locale) {
67
+ function $a9f502cbcdb3951f$var$getLanguage(locale) {
68
68
  // @ts-ignore
69
69
  if (Intl.Locale) // @ts-ignore
70
70
  return new Intl.Locale(locale).language;
@@ -72,5 +72,5 @@ function $5b160d28a433310d$var$getLanguage(locale) {
72
72
  }
73
73
 
74
74
 
75
- export {$5b160d28a433310d$export$c17fa47878dc55b6 as LocalizedStringDictionary};
76
- //# sourceMappingURL=LocalizedStringDictionary.module.js.map
75
+ export {$a9f502cbcdb3951f$export$c17fa47878dc55b6 as LocalizedStringDictionary};
76
+ //# sourceMappingURL=LocalizedStringDictionary.js.map
@@ -1 +1 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,qCAAe,OAAO,GAAG,CAAC;AAChC,MAAM,sCAAgB,OAAO,GAAG,CAAC;AACjC,IAAI,4CAAuG;AAMpG,MAAM;IAaX,6DAA6D,GAC7D,mBAAmB,GAAM,EAAE,MAAc,EAAK;QAC5C,IAAI,UAAU,IAAI,CAAC,mBAAmB,CAAC;QACvC,IAAI,SAAS,OAAO,CAAC,IAAI;QACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,CAAC,4BAA4B,EAAE,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;QAG1E,OAAO;IACT;IAEA,wDAAwD,GACxD,oBAAoB,MAAc,EAAgB;QAChD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,OAAO;QAClC,IAAI,CAAC,SAAS;YACZ,UAAU,0CAAoB,QAAQ,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YACtE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;QACzB;QAEA,OAAO;IACT;IAEA,OAAO,8BAA6F,WAAmB,EAA0C;QAC/J,IAAI,OAAO,WAAW,aACpB,OAAO;QAGT,IAAI,SAAS,MAAM,CAAC,mCAAa;QACjC,IAAI,8CAAwB,WAAW;YACrC,IAAI,gBAAgB,MAAM,CAAC,oCAAc;YACzC,IAAI,CAAC,eACH,OAAO;YAGT,4CAAsB,CAAC;YACvB,IAAK,IAAI,OAAO,cACd,yCAAmB,CAAC,IAAI,GAAG,IAAI,0CAA0B;gBAAC,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI;YAAA,GAAG;QAE7F;QAEA,IAAI,aAAa,sDAAA,gEAAA,yCAAqB,CAAC,YAAY;QACnD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,CAAC,qBAAqB,EAAE,YAAY,oHAAoH,CAAC;QAG3K,OAAO;IACT;IAvDA,YAAY,QAAgC,EAAE,gBAAwB,OAAO,CAAE;QAC7E,yDAAyD;QACzD,uGAAuG;QACvG,IAAI,CAAC,OAAO,GAAG,OAAO,WAAW,CAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,CAAC,CAAC,GAAG,EAAE,GAAK;QAE7C,IAAI,CAAC,aAAa,GAAG;IACvB;AAiDF;AAEA,SAAS,0CAAiE,MAAc,EAAE,OAA+B,EAAE,gBAAgB,OAAO;IAChJ,sCAAsC;IACtC,IAAI,OAAO,CAAC,OAAO,EACjB,OAAO,OAAO,CAAC,OAAO;IAGxB,iDAAiD;IACjD,2EAA2E;IAC3E,8CAA8C;IAC9C,uEAAuE;IACvE,sDAAsD;IACtD,IAAI,WAAW,kCAAY;IAC3B,IAAI,OAAO,CAAC,SAAS,EACnB,OAAO,OAAO,CAAC,SAAS;IAG1B,IAAK,IAAI,OAAO,QAAS;QACvB,IAAI,IAAI,UAAU,CAAC,WAAW,MAC5B,OAAO,OAAO,CAAC,IAAI;IAEvB;IAEA,8BAA8B;IAC9B,OAAO,OAAO,CAAC,cAAc;AAC/B;AAEA,SAAS,kCAAY,MAAc;IACjC,aAAa;IACb,IAAI,KAAK,MAAM,EACb,aAAa;IACb,OAAO,IAAI,KAAK,MAAM,CAAC,QAAQ,QAAQ;IAGzC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE;AAC7B","sources":["packages/@internationalized/string/src/LocalizedStringDictionary.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n"],"names":[],"version":3,"file":"LocalizedStringDictionary.module.js.map"}
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,qCAAe,OAAO,GAAG,CAAC;AAChC,MAAM,sCAAgB,OAAO,GAAG,CAAC;AACjC,IAAI,4CAAuG;AAMpG,MAAM;IAaX,6DAA6D,GAC7D,mBAAmB,GAAM,EAAE,MAAc,EAAK;QAC5C,IAAI,UAAU,IAAI,CAAC,mBAAmB,CAAC;QACvC,IAAI,SAAS,OAAO,CAAC,IAAI;QACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,CAAC,4BAA4B,EAAE,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;QAG1E,OAAO;IACT;IAEA,wDAAwD,GACxD,oBAAoB,MAAc,EAAgB;QAChD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,OAAO;QAClC,IAAI,CAAC,SAAS;YACZ,UAAU,0CAAoB,QAAQ,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YACtE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;QACzB;QAEA,OAAO;IACT;IAEA,OAAO,8BAA6F,WAAmB,EAA0C;QAC/J,IAAI,OAAO,WAAW,aACpB,OAAO;QAGT,IAAI,SAAS,MAAM,CAAC,mCAAa;QACjC,IAAI,8CAAwB,WAAW;YACrC,IAAI,gBAAgB,MAAM,CAAC,oCAAc;YACzC,IAAI,CAAC,eACH,OAAO;YAGT,4CAAsB,CAAC;YACvB,IAAK,IAAI,OAAO,cACd,yCAAmB,CAAC,IAAI,GAAG,IAAI,0CAA0B;gBAAC,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI;YAAA,GAAG;QAE7F;QAEA,IAAI,aAAa,sDAAA,gEAAA,yCAAqB,CAAC,YAAY;QACnD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,CAAC,qBAAqB,EAAE,YAAY,oHAAoH,CAAC;QAG3K,OAAO;IACT;IAvDA,YAAY,QAAgC,EAAE,gBAAwB,OAAO,CAAE;QAC7E,yDAAyD;QACzD,uGAAuG;QACvG,IAAI,CAAC,OAAO,GAAG,OAAO,WAAW,CAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,CAAC,CAAC,GAAG,EAAE,GAAK;QAE7C,IAAI,CAAC,aAAa,GAAG;IACvB;AAiDF;AAEA,SAAS,0CAAiE,MAAc,EAAE,OAA+B,EAAE,gBAAgB,OAAO;IAChJ,sCAAsC;IACtC,IAAI,OAAO,CAAC,OAAO,EACjB,OAAO,OAAO,CAAC,OAAO;IAGxB,iDAAiD;IACjD,2EAA2E;IAC3E,8CAA8C;IAC9C,uEAAuE;IACvE,sDAAsD;IACtD,IAAI,WAAW,kCAAY;IAC3B,IAAI,OAAO,CAAC,SAAS,EACnB,OAAO,OAAO,CAAC,SAAS;IAG1B,IAAK,IAAI,OAAO,QAAS;QACvB,IAAI,IAAI,UAAU,CAAC,WAAW,MAC5B,OAAO,OAAO,CAAC,IAAI;IAEvB;IAEA,8BAA8B;IAC9B,OAAO,OAAO,CAAC,cAAc;AAC/B;AAEA,SAAS,kCAAY,MAAc;IACjC,aAAa;IACb,IAAI,KAAK,MAAM,EACb,aAAa;IACb,OAAO,IAAI,KAAK,MAAM,CAAC,QAAQ,QAAQ;IAGzC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE;AAC7B","sources":["packages/@internationalized/string/src/LocalizedStringDictionary.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n"],"names":[],"version":3,"file":"LocalizedStringDictionary.js.map"}
@@ -8,10 +8,16 @@
8
8
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
- */ const $5b160d28a433310d$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
12
- const $5b160d28a433310d$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
13
- let $5b160d28a433310d$var$cachedGlobalStrings = undefined;
14
- class $5b160d28a433310d$export$c17fa47878dc55b6 {
11
+ */ const $a747a10fe70a57da$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
12
+ const $a747a10fe70a57da$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
13
+ let $a747a10fe70a57da$var$cachedGlobalStrings = undefined;
14
+ class $a747a10fe70a57da$export$c17fa47878dc55b6 {
15
+ constructor(messages, defaultLocale = 'en-US'){
16
+ // Clone messages so we don't modify the original object.
17
+ // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
18
+ this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
19
+ this.defaultLocale = defaultLocale;
20
+ }
15
21
  /** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
16
22
  let strings = this.getStringsForLocale(locale);
17
23
  let string = strings[key];
@@ -21,34 +27,28 @@ class $5b160d28a433310d$export$c17fa47878dc55b6 {
21
27
  /** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
22
28
  let strings = this.strings[locale];
23
29
  if (!strings) {
24
- strings = $5b160d28a433310d$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
30
+ strings = $a747a10fe70a57da$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
25
31
  this.strings[locale] = strings;
26
32
  }
27
33
  return strings;
28
34
  }
29
35
  static getGlobalDictionaryForPackage(packageName) {
30
36
  if (typeof window === 'undefined') return null;
31
- let locale = window[$5b160d28a433310d$var$localeSymbol];
32
- if ($5b160d28a433310d$var$cachedGlobalStrings === undefined) {
33
- let globalStrings = window[$5b160d28a433310d$var$stringsSymbol];
37
+ let locale = window[$a747a10fe70a57da$var$localeSymbol];
38
+ if ($a747a10fe70a57da$var$cachedGlobalStrings === undefined) {
39
+ let globalStrings = window[$a747a10fe70a57da$var$stringsSymbol];
34
40
  if (!globalStrings) return null;
35
- $5b160d28a433310d$var$cachedGlobalStrings = {};
36
- for(let pkg in globalStrings)$5b160d28a433310d$var$cachedGlobalStrings[pkg] = new $5b160d28a433310d$export$c17fa47878dc55b6({
41
+ $a747a10fe70a57da$var$cachedGlobalStrings = {};
42
+ for(let pkg in globalStrings)$a747a10fe70a57da$var$cachedGlobalStrings[pkg] = new $a747a10fe70a57da$export$c17fa47878dc55b6({
37
43
  [locale]: globalStrings[pkg]
38
44
  }, locale);
39
45
  }
40
- let dictionary = $5b160d28a433310d$var$cachedGlobalStrings === null || $5b160d28a433310d$var$cachedGlobalStrings === void 0 ? void 0 : $5b160d28a433310d$var$cachedGlobalStrings[packageName];
46
+ let dictionary = $a747a10fe70a57da$var$cachedGlobalStrings?.[packageName];
41
47
  if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
42
48
  return dictionary;
43
49
  }
44
- constructor(messages, defaultLocale = 'en-US'){
45
- // Clone messages so we don't modify the original object.
46
- // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
47
- this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
48
- this.defaultLocale = defaultLocale;
49
- }
50
50
  }
51
- function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
51
+ function $a747a10fe70a57da$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
52
52
  // If there is an exact match, use it.
53
53
  if (strings[locale]) return strings[locale];
54
54
  // Attempt to find the closest match by language.
@@ -56,7 +56,7 @@ function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocal
56
56
  // an fr-FR (France) set of strings, use that.
57
57
  // This could be replaced with Intl.LocaleMatcher once it is supported.
58
58
  // https://github.com/tc39/proposal-intl-localematcher
59
- let language = $5b160d28a433310d$var$getLanguage(locale);
59
+ let language = $a747a10fe70a57da$var$getLanguage(locale);
60
60
  if (strings[language]) return strings[language];
61
61
  for(let key in strings){
62
62
  if (key.startsWith(language + '-')) return strings[key];
@@ -64,7 +64,7 @@ function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocal
64
64
  // Nothing close, use english.
65
65
  return strings[defaultLocale];
66
66
  }
67
- function $5b160d28a433310d$var$getLanguage(locale) {
67
+ function $a747a10fe70a57da$var$getLanguage(locale) {
68
68
  // @ts-ignore
69
69
  if (Intl.Locale) // @ts-ignore
70
70
  return new Intl.Locale(locale).language;
@@ -72,5 +72,5 @@ function $5b160d28a433310d$var$getLanguage(locale) {
72
72
  }
73
73
 
74
74
 
75
- export {$5b160d28a433310d$export$c17fa47878dc55b6 as LocalizedStringDictionary};
76
- //# sourceMappingURL=LocalizedStringDictionary.module.js.map
75
+ export {$a747a10fe70a57da$export$c17fa47878dc55b6 as LocalizedStringDictionary};
76
+ //# sourceMappingURL=LocalizedStringDictionary.mjs.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,qCAAe,OAAO,GAAG,CAAC;AAChC,MAAM,sCAAgB,OAAO,GAAG,CAAC;AACjC,IAAI,4CAAuG;AAMpG,MAAM;IAIX,YAAY,QAAgC,EAAE,gBAAwB,OAAO,CAAE;QAC7E,yDAAyD;QACzD,uGAAuG;QACvG,IAAI,CAAC,OAAO,GAAG,OAAO,WAAW,CAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,CAAC,CAAC,GAAG,EAAE,GAAK;QAE7C,IAAI,CAAC,aAAa,GAAG;IACvB;IAEA,6DAA6D,GAC7D,mBAAmB,GAAM,EAAE,MAAc,EAAK;QAC5C,IAAI,UAAU,IAAI,CAAC,mBAAmB,CAAC;QACvC,IAAI,SAAS,OAAO,CAAC,IAAI;QACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,CAAC,4BAA4B,EAAE,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;QAG1E,OAAO;IACT;IAEA,wDAAwD,GACxD,oBAAoB,MAAc,EAAgB;QAChD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,OAAO;QAClC,IAAI,CAAC,SAAS;YACZ,UAAU,0CAAoB,QAAQ,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YACtE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;QACzB;QAEA,OAAO;IACT;IAEA,OAAO,8BAA6F,WAAmB,EAA0C;QAC/J,IAAI,OAAO,WAAW,aACpB,OAAO;QAGT,IAAI,SAAS,MAAM,CAAC,mCAAa;QACjC,IAAI,8CAAwB,WAAW;YACrC,IAAI,gBAAgB,MAAM,CAAC,oCAAc;YACzC,IAAI,CAAC,eACH,OAAO;YAGT,4CAAsB,CAAC;YACvB,IAAK,IAAI,OAAO,cACd,yCAAmB,CAAC,IAAI,GAAG,IAAI,0CAA0B;gBAAC,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI;YAAA,GAAG;QAE7F;QAEA,IAAI,aAAa,2CAAqB,CAAC,YAAY;QACnD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,CAAC,qBAAqB,EAAE,YAAY,oHAAoH,CAAC;QAG3K,OAAO;IACT;AACF;AAEA,SAAS,0CAAiE,MAAc,EAAE,OAA+B,EAAE,gBAAgB,OAAO;IAChJ,sCAAsC;IACtC,IAAI,OAAO,CAAC,OAAO,EACjB,OAAO,OAAO,CAAC,OAAO;IAGxB,iDAAiD;IACjD,2EAA2E;IAC3E,8CAA8C;IAC9C,uEAAuE;IACvE,sDAAsD;IACtD,IAAI,WAAW,kCAAY;IAC3B,IAAI,OAAO,CAAC,SAAS,EACnB,OAAO,OAAO,CAAC,SAAS;IAG1B,IAAK,IAAI,OAAO,QAAS;QACvB,IAAI,IAAI,UAAU,CAAC,WAAW,MAC5B,OAAO,OAAO,CAAC,IAAI;IAEvB;IAEA,8BAA8B;IAC9B,OAAO,OAAO,CAAC,cAAc;AAC/B;AAEA,SAAS,kCAAY,MAAc;IACjC,aAAa;IACb,IAAI,KAAK,MAAM,EACb,aAAa;IACb,OAAO,IAAI,KAAK,MAAM,CAAC,QAAQ,QAAQ;IAGzC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE;AAC7B","sources":["packages/@internationalized/string/src/LocalizedStringDictionary.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n"],"names":[],"version":3,"file":"LocalizedStringDictionary.mjs.map"}
@@ -3,7 +3,7 @@ function $parcel$export(e, n, v, s) {
3
3
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
4
  }
5
5
 
6
- $parcel$export(module.exports, "LocalizedStringFormatter", () => $3e95fbf3429967d1$export$2f817fcdc4b89ae0);
6
+ $parcel$export(module.exports, "LocalizedStringFormatter", function () { return $7da27b9d142b3465$export$2f817fcdc4b89ae0; });
7
7
  /*
8
8
  * Copyright 2022 Adobe. All rights reserved.
9
9
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -14,9 +14,13 @@ $parcel$export(module.exports, "LocalizedStringFormatter", () => $3e95fbf3429967
14
14
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
15
  * OF ANY KIND, either express or implied. See the License for the specific language
16
16
  * governing permissions and limitations under the License.
17
- */ const $3e95fbf3429967d1$var$pluralRulesCache = new Map();
18
- const $3e95fbf3429967d1$var$numberFormatCache = new Map();
19
- class $3e95fbf3429967d1$export$2f817fcdc4b89ae0 {
17
+ */ const $7da27b9d142b3465$var$pluralRulesCache = new Map();
18
+ const $7da27b9d142b3465$var$numberFormatCache = new Map();
19
+ class $7da27b9d142b3465$export$2f817fcdc4b89ae0 {
20
+ constructor(locale, strings){
21
+ this.locale = locale;
22
+ this.strings = strings;
23
+ }
20
24
  /** Formats a localized string for the given key with the provided variables. */ format(key, variables) {
21
25
  let message = this.strings.getStringForLocale(key, this.locale);
22
26
  return typeof message === 'function' ? message(variables, this) : message;
@@ -25,22 +29,22 @@ class $3e95fbf3429967d1$export$2f817fcdc4b89ae0 {
25
29
  let opt = options['=' + count];
26
30
  if (opt) return typeof opt === 'function' ? opt() : opt;
27
31
  let key = this.locale + ':' + type;
28
- let pluralRules = $3e95fbf3429967d1$var$pluralRulesCache.get(key);
32
+ let pluralRules = $7da27b9d142b3465$var$pluralRulesCache.get(key);
29
33
  if (!pluralRules) {
30
34
  pluralRules = new Intl.PluralRules(this.locale, {
31
35
  type: type
32
36
  });
33
- $3e95fbf3429967d1$var$pluralRulesCache.set(key, pluralRules);
37
+ $7da27b9d142b3465$var$pluralRulesCache.set(key, pluralRules);
34
38
  }
35
39
  let selected = pluralRules.select(count);
36
40
  opt = options[selected] || options.other;
37
41
  return typeof opt === 'function' ? opt() : opt;
38
42
  }
39
43
  number(value) {
40
- let numberFormat = $3e95fbf3429967d1$var$numberFormatCache.get(this.locale);
44
+ let numberFormat = $7da27b9d142b3465$var$numberFormatCache.get(this.locale);
41
45
  if (!numberFormat) {
42
46
  numberFormat = new Intl.NumberFormat(this.locale);
43
- $3e95fbf3429967d1$var$numberFormatCache.set(this.locale, numberFormat);
47
+ $7da27b9d142b3465$var$numberFormatCache.set(this.locale, numberFormat);
44
48
  }
45
49
  return numberFormat.format(value);
46
50
  }
@@ -48,11 +52,7 @@ class $3e95fbf3429967d1$export$2f817fcdc4b89ae0 {
48
52
  let opt = options[value] || options.other;
49
53
  return typeof opt === 'function' ? opt() : opt;
50
54
  }
51
- constructor(locale, strings){
52
- this.locale = locale;
53
- this.strings = strings;
54
- }
55
55
  }
56
56
 
57
57
 
58
- //# sourceMappingURL=LocalizedStringFormatter.main.js.map
58
+ //# sourceMappingURL=LocalizedStringFormatter.cjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IAIX,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;IAEA,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;AACF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.cjs.map"}
@@ -8,9 +8,9 @@
8
8
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
- */ const $6db58dc88e78b024$var$pluralRulesCache = new Map();
12
- const $6db58dc88e78b024$var$numberFormatCache = new Map();
13
- class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
11
+ */ const $1e8423fa4cde1500$var$pluralRulesCache = new Map();
12
+ const $1e8423fa4cde1500$var$numberFormatCache = new Map();
13
+ class $1e8423fa4cde1500$export$2f817fcdc4b89ae0 {
14
14
  /** Formats a localized string for the given key with the provided variables. */ format(key, variables) {
15
15
  let message = this.strings.getStringForLocale(key, this.locale);
16
16
  return typeof message === 'function' ? message(variables, this) : message;
@@ -19,22 +19,22 @@ class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
19
19
  let opt = options['=' + count];
20
20
  if (opt) return typeof opt === 'function' ? opt() : opt;
21
21
  let key = this.locale + ':' + type;
22
- let pluralRules = $6db58dc88e78b024$var$pluralRulesCache.get(key);
22
+ let pluralRules = $1e8423fa4cde1500$var$pluralRulesCache.get(key);
23
23
  if (!pluralRules) {
24
24
  pluralRules = new Intl.PluralRules(this.locale, {
25
25
  type: type
26
26
  });
27
- $6db58dc88e78b024$var$pluralRulesCache.set(key, pluralRules);
27
+ $1e8423fa4cde1500$var$pluralRulesCache.set(key, pluralRules);
28
28
  }
29
29
  let selected = pluralRules.select(count);
30
30
  opt = options[selected] || options.other;
31
31
  return typeof opt === 'function' ? opt() : opt;
32
32
  }
33
33
  number(value) {
34
- let numberFormat = $6db58dc88e78b024$var$numberFormatCache.get(this.locale);
34
+ let numberFormat = $1e8423fa4cde1500$var$numberFormatCache.get(this.locale);
35
35
  if (!numberFormat) {
36
36
  numberFormat = new Intl.NumberFormat(this.locale);
37
- $6db58dc88e78b024$var$numberFormatCache.set(this.locale, numberFormat);
37
+ $1e8423fa4cde1500$var$numberFormatCache.set(this.locale, numberFormat);
38
38
  }
39
39
  return numberFormat.format(value);
40
40
  }
@@ -49,5 +49,5 @@ class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
49
49
  }
50
50
 
51
51
 
52
- export {$6db58dc88e78b024$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
53
- //# sourceMappingURL=LocalizedStringFormatter.module.js.map
52
+ export {$1e8423fa4cde1500$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
53
+ //# sourceMappingURL=LocalizedStringFormatter.js.map
@@ -1 +1 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IASX,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAzCA,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;AAuCF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.module.js.map"}
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IASX,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAzCA,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;AAuCF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.js.map"}
@@ -8,9 +8,13 @@
8
8
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
- */ const $6db58dc88e78b024$var$pluralRulesCache = new Map();
12
- const $6db58dc88e78b024$var$numberFormatCache = new Map();
13
- class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
11
+ */ const $b27c684a33948c64$var$pluralRulesCache = new Map();
12
+ const $b27c684a33948c64$var$numberFormatCache = new Map();
13
+ class $b27c684a33948c64$export$2f817fcdc4b89ae0 {
14
+ constructor(locale, strings){
15
+ this.locale = locale;
16
+ this.strings = strings;
17
+ }
14
18
  /** Formats a localized string for the given key with the provided variables. */ format(key, variables) {
15
19
  let message = this.strings.getStringForLocale(key, this.locale);
16
20
  return typeof message === 'function' ? message(variables, this) : message;
@@ -19,22 +23,22 @@ class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
19
23
  let opt = options['=' + count];
20
24
  if (opt) return typeof opt === 'function' ? opt() : opt;
21
25
  let key = this.locale + ':' + type;
22
- let pluralRules = $6db58dc88e78b024$var$pluralRulesCache.get(key);
26
+ let pluralRules = $b27c684a33948c64$var$pluralRulesCache.get(key);
23
27
  if (!pluralRules) {
24
28
  pluralRules = new Intl.PluralRules(this.locale, {
25
29
  type: type
26
30
  });
27
- $6db58dc88e78b024$var$pluralRulesCache.set(key, pluralRules);
31
+ $b27c684a33948c64$var$pluralRulesCache.set(key, pluralRules);
28
32
  }
29
33
  let selected = pluralRules.select(count);
30
34
  opt = options[selected] || options.other;
31
35
  return typeof opt === 'function' ? opt() : opt;
32
36
  }
33
37
  number(value) {
34
- let numberFormat = $6db58dc88e78b024$var$numberFormatCache.get(this.locale);
38
+ let numberFormat = $b27c684a33948c64$var$numberFormatCache.get(this.locale);
35
39
  if (!numberFormat) {
36
40
  numberFormat = new Intl.NumberFormat(this.locale);
37
- $6db58dc88e78b024$var$numberFormatCache.set(this.locale, numberFormat);
41
+ $b27c684a33948c64$var$numberFormatCache.set(this.locale, numberFormat);
38
42
  }
39
43
  return numberFormat.format(value);
40
44
  }
@@ -42,12 +46,8 @@ class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
42
46
  let opt = options[value] || options.other;
43
47
  return typeof opt === 'function' ? opt() : opt;
44
48
  }
45
- constructor(locale, strings){
46
- this.locale = locale;
47
- this.strings = strings;
48
- }
49
49
  }
50
50
 
51
51
 
52
- export {$6db58dc88e78b024$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
53
- //# sourceMappingURL=LocalizedStringFormatter.module.js.map
52
+ export {$b27c684a33948c64$export$2f817fcdc4b89ae0 as LocalizedStringFormatter};
53
+ //# sourceMappingURL=LocalizedStringFormatter.mjs.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IAIX,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;IAEA,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;AACF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.mjs.map"}
@@ -0,0 +1,18 @@
1
+ import type { LocalizedString } from './LocalizedStringFormatter';
2
+ export type LocalizedStrings<K extends string, T extends LocalizedString> = {
3
+ [lang: string]: Record<K, T>;
4
+ };
5
+ /**
6
+ * Stores a mapping of localized strings. Can be used to find the
7
+ * closest available string for a given locale.
8
+ */
9
+ export declare class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {
10
+ private strings;
11
+ private defaultLocale;
12
+ constructor(messages: LocalizedStrings<K, T>, defaultLocale?: string);
13
+ /** Returns a localized string for the given key and locale. */
14
+ getStringForLocale(key: K, locale: string): T;
15
+ /** Returns all localized strings for the given locale. */
16
+ getStringsForLocale(locale: string): Record<K, T>;
17
+ static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null;
18
+ }
@@ -0,0 +1,19 @@
1
+ import type { LocalizedStringDictionary } from './LocalizedStringDictionary';
2
+ export type Variables = Record<string, string | number | boolean> | undefined;
3
+ export type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);
4
+ type InternalString = string | (() => string);
5
+ /**
6
+ * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,
7
+ * selecting the correct pluralization, and formatting numbers for the locale.
8
+ */
9
+ export declare class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {
10
+ private locale;
11
+ private strings;
12
+ constructor(locale: string, strings: LocalizedStringDictionary<K, T>);
13
+ /** Formats a localized string for the given key with the provided variables. */
14
+ format(key: K, variables?: Variables): string;
15
+ protected plural(count: number, options: Record<string, InternalString>, type?: Intl.PluralRuleType): string;
16
+ protected number(value: number): string;
17
+ protected select(options: Record<string, InternalString>, value: string): string;
18
+ }
19
+ export {};
@@ -0,0 +1,4 @@
1
+ export type { Variables, LocalizedString } from './LocalizedStringFormatter';
2
+ export type { LocalizedStrings } from './LocalizedStringDictionary';
3
+ export { LocalizedStringDictionary } from './LocalizedStringDictionary';
4
+ export { LocalizedStringFormatter } from './LocalizedStringFormatter';
package/package.json CHANGED
@@ -1,20 +1,18 @@
1
1
  {
2
2
  "name": "@internationalized/string",
3
- "version": "3.2.7",
3
+ "version": "3.2.8",
4
4
  "description": "Internationalized string formatting and locale negotiation",
5
5
  "license": "Apache-2.0",
6
- "main": "dist/main.js",
7
- "module": "dist/module.js",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "import": "dist/index.mjs",
8
9
  "exports": {
9
10
  "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.cjs"
16
14
  },
17
- "types": "dist/types.d.ts",
15
+ "types": "./dist/types/src/index.d.ts",
18
16
  "source": "src/index.ts",
19
17
  "files": [
20
18
  "dist",
@@ -31,5 +29,22 @@
31
29
  "publishConfig": {
32
30
  "access": "public"
33
31
  },
34
- "gitHead": "265b4d7f107905ee1c6e87a8af1613ab440a6849"
32
+ "targets": {
33
+ "types": false,
34
+ "module": {
35
+ "engines": {
36
+ "browsers": [
37
+ "chrome >= 79",
38
+ "firefox >= 85",
39
+ "safari >= 13"
40
+ ]
41
+ }
42
+ },
43
+ "import": {
44
+ "isLibrary": true,
45
+ "outputFormat": "esmodule",
46
+ "includeNodeModules": false
47
+ }
48
+ },
49
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
35
50
  }
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAQD,MAAM,qCAAe,OAAO,GAAG,CAAC;AAChC,MAAM,sCAAgB,OAAO,GAAG,CAAC;AACjC,IAAI,4CAAuG;AAMpG,MAAM;IAaX,6DAA6D,GAC7D,mBAAmB,GAAM,EAAE,MAAc,EAAK;QAC5C,IAAI,UAAU,IAAI,CAAC,mBAAmB,CAAC;QACvC,IAAI,SAAS,OAAO,CAAC,IAAI;QACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,CAAC,4BAA4B,EAAE,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;QAG1E,OAAO;IACT;IAEA,wDAAwD,GACxD,oBAAoB,MAAc,EAAgB;QAChD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,OAAO;QAClC,IAAI,CAAC,SAAS;YACZ,UAAU,0CAAoB,QAAQ,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YACtE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;QACzB;QAEA,OAAO;IACT;IAEA,OAAO,8BAA6F,WAAmB,EAA0C;QAC/J,IAAI,OAAO,WAAW,aACpB,OAAO;QAGT,IAAI,SAAS,MAAM,CAAC,mCAAa;QACjC,IAAI,8CAAwB,WAAW;YACrC,IAAI,gBAAgB,MAAM,CAAC,oCAAc;YACzC,IAAI,CAAC,eACH,OAAO;YAGT,4CAAsB,CAAC;YACvB,IAAK,IAAI,OAAO,cACd,yCAAmB,CAAC,IAAI,GAAG,IAAI,0CAA0B;gBAAC,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI;YAAA,GAAG;QAE7F;QAEA,IAAI,aAAa,sDAAA,gEAAA,yCAAqB,CAAC,YAAY;QACnD,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,CAAC,qBAAqB,EAAE,YAAY,oHAAoH,CAAC;QAG3K,OAAO;IACT;IAvDA,YAAY,QAAgC,EAAE,gBAAwB,OAAO,CAAE;QAC7E,yDAAyD;QACzD,uGAAuG;QACvG,IAAI,CAAC,OAAO,GAAG,OAAO,WAAW,CAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,CAAC,CAAC,GAAG,EAAE,GAAK;QAE7C,IAAI,CAAC,aAAa,GAAG;IACvB;AAiDF;AAEA,SAAS,0CAAiE,MAAc,EAAE,OAA+B,EAAE,gBAAgB,OAAO;IAChJ,sCAAsC;IACtC,IAAI,OAAO,CAAC,OAAO,EACjB,OAAO,OAAO,CAAC,OAAO;IAGxB,iDAAiD;IACjD,2EAA2E;IAC3E,8CAA8C;IAC9C,uEAAuE;IACvE,sDAAsD;IACtD,IAAI,WAAW,kCAAY;IAC3B,IAAI,OAAO,CAAC,SAAS,EACnB,OAAO,OAAO,CAAC,SAAS;IAG1B,IAAK,IAAI,OAAO,QAAS;QACvB,IAAI,IAAI,UAAU,CAAC,WAAW,MAC5B,OAAO,OAAO,CAAC,IAAI;IAEvB;IAEA,8BAA8B;IAC9B,OAAO,OAAO,CAAC,cAAc;AAC/B;AAEA,SAAS,kCAAY,MAAc;IACjC,aAAa;IACb,IAAI,KAAK,MAAM,EACb,aAAa;IACb,OAAO,IAAI,KAAK,MAAM,CAAC,QAAQ,QAAQ;IAGzC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE;AAC7B","sources":["packages/@internationalized/string/src/LocalizedStringDictionary.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedString} from './LocalizedStringFormatter';\n\nexport type LocalizedStrings<K extends string, T extends LocalizedString> = {\n [lang: string]: Record<K, T>\n};\n\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\nconst stringsSymbol = Symbol.for('react-aria.i18n.strings');\nlet cachedGlobalStrings: {[packageName: string]: LocalizedStringDictionary<any, any>} | null | undefined = undefined;\n\n/**\n * Stores a mapping of localized strings. Can be used to find the\n * closest available string for a given locale.\n */\nexport class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {\n private strings: LocalizedStrings<K, T>;\n private defaultLocale: string;\n\n constructor(messages: LocalizedStrings<K, T>, defaultLocale: string = 'en-US') {\n // Clone messages so we don't modify the original object.\n // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.\n this.strings = Object.fromEntries(\n Object.entries(messages).filter(([, v]) => v)\n );\n this.defaultLocale = defaultLocale;\n }\n\n /** Returns a localized string for the given key and locale. */\n getStringForLocale(key: K, locale: string): T {\n let strings = this.getStringsForLocale(locale);\n let string = strings[key];\n if (!string) {\n throw new Error(`Could not find intl message ${key} in ${locale} locale`);\n }\n\n return string;\n }\n\n /** Returns all localized strings for the given locale. */\n getStringsForLocale(locale: string): Record<K, T> {\n let strings = this.strings[locale];\n if (!strings) {\n strings = getStringsForLocale(locale, this.strings, this.defaultLocale);\n this.strings[locale] = strings;\n }\n\n return strings;\n }\n\n static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n let locale = window[localeSymbol];\n if (cachedGlobalStrings === undefined) {\n let globalStrings = window[stringsSymbol];\n if (!globalStrings) {\n return null;\n }\n\n cachedGlobalStrings = {};\n for (let pkg in globalStrings) {\n cachedGlobalStrings[pkg] = new LocalizedStringDictionary({[locale]: globalStrings[pkg]}, locale);\n }\n }\n\n let dictionary = cachedGlobalStrings?.[packageName];\n if (!dictionary) {\n throw new Error(`Strings for package \"${packageName}\" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);\n }\n\n return dictionary;\n }\n}\n\nfunction getStringsForLocale<K extends string, T extends LocalizedString>(locale: string, strings: LocalizedStrings<K, T>, defaultLocale = 'en-US') {\n // If there is an exact match, use it.\n if (strings[locale]) {\n return strings[locale];\n }\n\n // Attempt to find the closest match by language.\n // For example, if the locale is fr-CA (French Canadian), but there is only\n // an fr-FR (France) set of strings, use that.\n // This could be replaced with Intl.LocaleMatcher once it is supported.\n // https://github.com/tc39/proposal-intl-localematcher\n let language = getLanguage(locale);\n if (strings[language]) {\n return strings[language];\n }\n\n for (let key in strings) {\n if (key.startsWith(language + '-')) {\n return strings[key];\n }\n }\n\n // Nothing close, use english.\n return strings[defaultLocale];\n}\n\nfunction getLanguage(locale: string) {\n // @ts-ignore\n if (Intl.Locale) {\n // @ts-ignore\n return new Intl.Locale(locale).language;\n }\n\n return locale.split('-')[0];\n}\n"],"names":[],"version":3,"file":"LocalizedStringDictionary.main.js.map"}
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAQD,MAAM,yCAAmB,IAAI;AAC7B,MAAM,0CAAoB,IAAI;AAMvB,MAAM;IASX,8EAA8E,GAC9E,OAAO,GAAM,EAAE,SAAqB,EAAU;QAC5C,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,MAAM;QAC9D,OAAO,OAAO,YAAY,aAAa,QAAQ,WAAW,IAAI,IAAI;IACpE;IAEU,OAAO,KAAa,EAAE,OAAuC,EAAE,OAA4B,UAAU,EAAU;QACvH,IAAI,MAAM,OAAO,CAAC,MAAM,MAAM;QAC9B,IAAI,KACF,OAAO,OAAO,QAAQ,aAAa,QAAQ;QAG7C,IAAI,MAAM,IAAI,CAAC,MAAM,GAAG,MAAM;QAC9B,IAAI,cAAc,uCAAiB,GAAG,CAAC;QACvC,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;sBAAC;YAAI;YACrD,uCAAiB,GAAG,CAAC,KAAK;QAC5B;QAEA,IAAI,WAAW,YAAY,MAAM,CAAC;QAClC,MAAM,OAAO,CAAC,SAAS,IAAI,QAAQ,KAAK;QACxC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAEU,OAAO,KAAa,EAAU;QACtC,IAAI,eAAe,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM;QACpD,IAAI,CAAC,cAAc;YACjB,eAAe,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,MAAM;YAChD,wCAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;QACrC;QACA,OAAO,aAAa,MAAM,CAAC;IAC7B;IAEU,OAAO,OAAuC,EAAE,KAAa,EAAU;QAC/E,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI,QAAQ,KAAK;QACzC,OAAO,OAAO,QAAQ,aAAa,QAAQ;IAC7C;IAzCA,YAAY,MAAc,EAAE,OAAwC,CAAE;QACpE,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,OAAO,GAAG;IACjB;AAuCF","sources":["packages/@internationalized/string/src/LocalizedStringFormatter.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {LocalizedStringDictionary} from './LocalizedStringDictionary';\n\nexport type Variables = Record<string, string | number | boolean> | undefined;\nexport type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);\ntype InternalString = string | (() => string);\n\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/**\n * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,\n * selecting the correct pluralization, and formatting numbers for the locale.\n */\nexport class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {\n private locale: string;\n private strings: LocalizedStringDictionary<K, T>;\n\n constructor(locale: string, strings: LocalizedStringDictionary<K, T>) {\n this.locale = locale;\n this.strings = strings;\n }\n\n /** Formats a localized string for the given key with the provided variables. */\n format(key: K, variables?: Variables): string {\n let message = this.strings.getStringForLocale(key, this.locale);\n return typeof message === 'function' ? message(variables, this) : message;\n }\n\n protected plural(count: number, options: Record<string, InternalString>, type: Intl.PluralRuleType = 'cardinal'): string {\n let opt = options['=' + count];\n if (opt) {\n return typeof opt === 'function' ? opt() : opt;\n }\n\n let key = this.locale + ':' + type;\n let pluralRules = pluralRulesCache.get(key);\n if (!pluralRules) {\n pluralRules = new Intl.PluralRules(this.locale, {type});\n pluralRulesCache.set(key, pluralRules);\n }\n\n let selected = pluralRules.select(count);\n opt = options[selected] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n\n protected number(value: number): string {\n let numberFormat = numberFormatCache.get(this.locale);\n if (!numberFormat) {\n numberFormat = new Intl.NumberFormat(this.locale);\n numberFormatCache.set(this.locale, numberFormat);\n }\n return numberFormat.format(value);\n }\n\n protected select(options: Record<string, InternalString>, value: string): string {\n let opt = options[value] || options.other;\n return typeof opt === 'function' ? opt() : opt;\n }\n}\n"],"names":[],"version":3,"file":"LocalizedStringFormatter.main.js.map"}
package/dist/types.d.ts DELETED
@@ -1,32 +0,0 @@
1
- export type LocalizedStrings<K extends string, T extends LocalizedString> = {
2
- [lang: string]: Record<K, T>;
3
- };
4
- /**
5
- * Stores a mapping of localized strings. Can be used to find the
6
- * closest available string for a given locale.
7
- */
8
- export class LocalizedStringDictionary<K extends string = string, T extends LocalizedString = string> {
9
- constructor(messages: LocalizedStrings<K, T>, defaultLocale?: string);
10
- /** Returns a localized string for the given key and locale. */
11
- getStringForLocale(key: K, locale: string): T;
12
- /** Returns all localized strings for the given locale. */
13
- getStringsForLocale(locale: string): Record<K, T>;
14
- static getGlobalDictionaryForPackage<K extends string = string, T extends LocalizedString = string>(packageName: string): LocalizedStringDictionary<K, T> | null;
15
- }
16
- export type Variables = Record<string, string | number | boolean> | undefined;
17
- export type LocalizedString = string | ((args: Variables, formatter?: LocalizedStringFormatter<any, any>) => string);
18
- type InternalString = string | (() => string);
19
- /**
20
- * Formats localized strings from a LocalizedStringDictionary. Supports interpolating variables,
21
- * selecting the correct pluralization, and formatting numbers for the locale.
22
- */
23
- export class LocalizedStringFormatter<K extends string = string, T extends LocalizedString = string> {
24
- constructor(locale: string, strings: LocalizedStringDictionary<K, T>);
25
- /** Formats a localized string for the given key with the provided variables. */
26
- format(key: K, variables?: Variables): string;
27
- protected plural(count: number, options: Record<string, InternalString>, type?: Intl.PluralRuleType): string;
28
- protected number(value: number): string;
29
- protected select(options: Record<string, InternalString>, value: string): string;
30
- }
31
-
32
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":"AAcA,6BAA6B,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,eAAe,IAAI;IAC1E,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAC7B,CAAC;AAMF;;;GAGG;AACH,uCAAuC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM;gBAItF,QAAQ,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,GAAE,MAAgB;IAS7E,+DAA+D;IAC/D,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;IAU7C,0DAA0D;IAC1D,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAUjD,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI;CAyBjK;ACxED,wBAAwB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,SAAS,CAAC;AAC9E,8BAA8B,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,yBAAyB,GAAG,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC;AACrH,sBAAsB,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;AAK9C;;;GAGG;AACH,sCAAsC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM;gBAIrF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAKpE,gFAAgF;IAChF,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM;IAK7C,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,IAAI,GAAE,KAAK,cAA2B,GAAG,MAAM;IAkBxH,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IASvC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAIjF","sources":["packages/@internationalized/string/src/packages/@internationalized/string/src/LocalizedStringDictionary.ts","packages/@internationalized/string/src/packages/@internationalized/string/src/LocalizedStringFormatter.ts","packages/@internationalized/string/src/packages/@internationalized/string/src/index.ts","packages/@internationalized/string/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {Variables, LocalizedString} from './LocalizedStringFormatter';\nexport type {LocalizedStrings} from './LocalizedStringDictionary';\nexport {LocalizedStringDictionary} from './LocalizedStringDictionary';\nexport {LocalizedStringFormatter} from './LocalizedStringFormatter';\n"],"names":[],"version":3,"file":"types.d.ts.map"}