gt-next 5.2.35 → 5.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # gt-next
2
2
 
3
+ ## 5.2.36
4
+
5
+ ### Patch Changes
6
+
7
+ - [#348](https://github.com/generaltranslation/gt/pull/348) [`c43bd6d`](https://github.com/generaltranslation/gt/commit/c43bd6df7dd106723e8dc173b6c0d65009be461e) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - refactor: rename useDict to useTranslations
8
+
9
+ - Updated dependencies [[`c43bd6d`](https://github.com/generaltranslation/gt/commit/c43bd6df7dd106723e8dc173b6c0d65009be461e)]:
10
+ - gt-react@9.2.26
11
+
3
12
  ## 5.2.35
4
13
 
5
14
  ### Patch Changes
package/dist/client.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- import { T, useGT, useDict, useLocale, useDefaultLocale, LocaleSelector, GTProvider, useLocales, useSetLocale, useLocaleSelector, Var, Currency, DateTime, Num, Plural, Branch, useLocaleProperties, useGTClass } from 'gt-react/client';
2
- export { GTProvider as GTClientProvider, T, useGT, useLocale, useLocales, useSetLocale, useDefaultLocale, useDict, LocaleSelector, useLocaleSelector, Var, Currency, DateTime, Num, Plural, Branch, useGTClass, useLocaleProperties, };
1
+ import { T, useGT, useLocale, useDefaultLocale, LocaleSelector, GTProvider, useLocales, useSetLocale, useLocaleSelector, Var, Currency, DateTime, Num, Plural, Branch, useLocaleProperties, useGTClass, useTranslations } from 'gt-react/client';
2
+ export { GTProvider as GTClientProvider, T, useGT, useLocale, useLocales, useSetLocale, useDefaultLocale, useTranslations,
3
+ /**
4
+ * @deprecated Use useTranslations instead
5
+ */
6
+ useTranslations as useDict, LocaleSelector, useLocaleSelector, Var, Currency, DateTime, Num, Plural, Branch, useGTClass, useLocaleProperties, };
3
7
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,CAAC,EACD,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,CAAC,EACD,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,MAAM,EACN,MAAM,EACN,UAAU,EACV,mBAAmB,GACpB,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,CAAC,EACD,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,CAAC,EACD,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe;AACf;;GAEG;AACH,eAAe,IAAI,OAAO,EAC1B,cAAc,EACd,iBAAiB,EACjB,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,MAAM,EACN,MAAM,EACN,UAAU,EACV,mBAAmB,GACpB,CAAC"}
package/dist/client.js CHANGED
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLocaleProperties = exports.useGTClass = exports.Branch = exports.Plural = exports.Num = exports.DateTime = exports.Currency = exports.Var = exports.useLocaleSelector = exports.LocaleSelector = exports.useDict = exports.useDefaultLocale = exports.useSetLocale = exports.useLocales = exports.useLocale = exports.useGT = exports.T = exports.GTClientProvider = void 0;
4
+ exports.useLocaleProperties = exports.useGTClass = exports.Branch = exports.Plural = exports.Num = exports.DateTime = exports.Currency = exports.Var = exports.useLocaleSelector = exports.LocaleSelector = exports.useDict = exports.useTranslations = exports.useDefaultLocale = exports.useSetLocale = exports.useLocales = exports.useLocale = exports.useGT = exports.T = exports.GTClientProvider = void 0;
5
5
  var client_1 = require("gt-react/client");
6
6
  Object.defineProperty(exports, "T", { enumerable: true, get: function () { return client_1.T; } });
7
7
  Object.defineProperty(exports, "useGT", { enumerable: true, get: function () { return client_1.useGT; } });
8
- Object.defineProperty(exports, "useDict", { enumerable: true, get: function () { return client_1.useDict; } });
9
8
  Object.defineProperty(exports, "useLocale", { enumerable: true, get: function () { return client_1.useLocale; } });
10
9
  Object.defineProperty(exports, "useDefaultLocale", { enumerable: true, get: function () { return client_1.useDefaultLocale; } });
11
10
  Object.defineProperty(exports, "LocaleSelector", { enumerable: true, get: function () { return client_1.LocaleSelector; } });
@@ -21,4 +20,6 @@ Object.defineProperty(exports, "Plural", { enumerable: true, get: function () {
21
20
  Object.defineProperty(exports, "Branch", { enumerable: true, get: function () { return client_1.Branch; } });
22
21
  Object.defineProperty(exports, "useLocaleProperties", { enumerable: true, get: function () { return client_1.useLocaleProperties; } });
23
22
  Object.defineProperty(exports, "useGTClass", { enumerable: true, get: function () { return client_1.useGTClass; } });
23
+ Object.defineProperty(exports, "useTranslations", { enumerable: true, get: function () { return client_1.useTranslations; } });
24
+ Object.defineProperty(exports, "useDict", { enumerable: true, get: function () { return client_1.useTranslations; } });
24
25
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,0CAmByB;AAIvB,kFAtBA,UAAC,OAsBA;AACD,sFAtBA,cAAK,OAsBA;AAKL,wFA1BA,gBAAO,OA0BA;AAJP,0FArBA,kBAAS,OAqBA;AAGT,iGAvBA,yBAAgB,OAuBA;AAEhB,+FAxBA,uBAAc,OAwBA;AARA,iGAfd,mBAAU,OAeoB;AAI9B,2FAlBA,mBAAU,OAkBA;AACV,6FAlBA,qBAAY,OAkBA;AAIZ,kGArBA,0BAAiB,OAqBA;AACjB,oFArBA,YAAG,OAqBA;AACH,yFArBA,iBAAQ,OAqBA;AACR,yFArBA,iBAAQ,OAqBA;AACR,oFArBA,YAAG,OAqBA;AACH,uFArBA,eAAM,OAqBA;AACN,uFArBA,eAAM,OAqBA;AAEN,oGAtBA,4BAAmB,OAsBA;AADnB,2FApBA,mBAAU,OAoBA"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,0CAmByB;AAIvB,kFAtBA,UAAC,OAsBA;AACD,sFAtBA,cAAK,OAsBA;AACL,0FAtBA,kBAAS,OAsBA;AAGT,iGAxBA,yBAAgB,OAwBA;AAMhB,+FA7BA,uBAAc,OA6BA;AAZA,iGAhBd,mBAAU,OAgBoB;AAI9B,2FAnBA,mBAAU,OAmBA;AACV,6FAnBA,qBAAY,OAmBA;AAQZ,kGA1BA,0BAAiB,OA0BA;AACjB,oFA1BA,YAAG,OA0BA;AACH,yFA1BA,iBAAQ,OA0BA;AACR,yFA1BA,iBAAQ,OA0BA;AACR,oFA1BA,YAAG,OA0BA;AACH,uFA1BA,eAAM,OA0BA;AACN,uFA1BA,eAAM,OA0BA;AAEN,oGA3BA,4BAAmB,OA2BA;AADnB,2FAzBA,mBAAU,OAyBA;AAbV,gGAXA,wBAAe,OAWA;AAII,wFAfnB,wBAAe,OAeW"}
@@ -0,0 +1,16 @@
1
+ import { DictionaryTranslationOptions } from 'gt-react/internal';
2
+ /**
3
+ * Returns the dictionary access function `t()`, which is used to translate an item from the dictionary.
4
+ *
5
+ * @param {string} [id] - Optional prefix to prepend to the translation keys.
6
+ * @returns {Function} A translation function that accepts a key string and returns the translated value.
7
+ *
8
+ * @example
9
+ * const t = await getTranslations('user');
10
+ * console.log(t('name')); // Translates item 'user.name'
11
+ *
12
+ * const t = await getTranslations();
13
+ * console.log(t('hello')); // Translates item 'hello'
14
+ */
15
+ export default function getTranslations(id?: string): Promise<(id: string, options?: DictionaryTranslationOptions) => string>;
16
+ //# sourceMappingURL=getTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTranslations.d.ts","sourceRoot":"","sources":["../../../src/server-dir/buildtime/getTranslations.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAI7B,MAAM,mBAAmB,CAAC;AAiB3B;;;;;;;;;;;;GAYG;AACH,wBAA8B,eAAe,CAC3C,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,MAAM,CAAC,CA4JzE"}
@@ -50,7 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.default = getDict;
53
+ exports.default = getTranslations;
54
54
  var internal_1 = require("gt-react/internal");
55
55
  var getDictionary_1 = __importDefault(require("../../dictionary/getDictionary"));
56
56
  var createErrors_1 = require("../../errors/createErrors");
@@ -59,21 +59,21 @@ var getLocale_1 = __importDefault(require("../../request/getLocale"));
59
59
  var generaltranslation_1 = require("generaltranslation");
60
60
  var id_1 = require("generaltranslation/id");
61
61
  /**
62
- * Returns the dictionary access function `d()`, which is used to translate an item from the dictionary.
62
+ * Returns the dictionary access function `t()`, which is used to translate an item from the dictionary.
63
63
  *
64
64
  * @param {string} [id] - Optional prefix to prepend to the translation keys.
65
65
  * @returns {Function} A translation function that accepts a key string and returns the translated value.
66
66
  *
67
67
  * @example
68
- * const d = await getDict('user');
69
- * console.log(d('name')); // Translates item 'user.name'
68
+ * const t = await getTranslations('user');
69
+ * console.log(t('name')); // Translates item 'user.name'
70
70
  *
71
- * const d = await getDict();
72
- * console.log(d('hello')); // Translates item 'hello'
71
+ * const t = await getTranslations();
72
+ * console.log(t('hello')); // Translates item 'hello'
73
73
  */
74
- function getDict(id) {
74
+ function getTranslations(id) {
75
75
  return __awaiter(this, void 0, void 0, function () {
76
- var getId, dictionary, I18NConfig, locale, defaultLocale, translationRequired, dictionaryTranslations, _a, translations, _b, renderSettings, d;
76
+ var getId, dictionary, I18NConfig, locale, defaultLocale, translationRequired, dictionaryTranslations, _a, translations, _b, renderSettings, t;
77
77
  return __generator(this, function (_c) {
78
78
  switch (_c.label) {
79
79
  case 0:
@@ -110,7 +110,7 @@ function getDict(id) {
110
110
  case 8:
111
111
  translations = _b;
112
112
  renderSettings = I18NConfig.getRenderSettings();
113
- d = function (id, options) {
113
+ t = function (id, options) {
114
114
  if (options === void 0) { options = {}; }
115
115
  // Get entry
116
116
  id = getId(id);
@@ -180,9 +180,9 @@ function getDict(id) {
180
180
  // Default is returning source, rather than returning a loading state
181
181
  return renderContent(source, [defaultLocale]);
182
182
  };
183
- return [2 /*return*/, d];
183
+ return [2 /*return*/, t];
184
184
  }
185
185
  });
186
186
  });
187
187
  }
188
- //# sourceMappingURL=getDict.js.map
188
+ //# sourceMappingURL=getTranslations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTranslations.js","sourceRoot":"","sources":["../../../src/server-dir/buildtime/getTranslations.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,kCA8JC;AAjMD,8CAK2B;AAE3B,iFAA2D;AAC3D,0DAKmC;AACnC,iFAA2D;AAC3D,sEAAgD;AAChD,yDAG4B;AA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Q,uBAAR,QAAQ,CAAE,OAAO,EAAE,CAAC,KACxD,EAAE,IAAA,EACF,IAAI,MAAA,GACL;yBACF,CAAC,CAAC,KAAK,CAAC,cAAO,CAAC,CAAC,CAAC,CAAC,6BAA6B;wBAEjD,8BAA8B;wBAC9B,OAAO,CAAC,IAAI,CAAC,wCAAyB,CAAC,CAAC;wBAExC,mBAAmB;wBACnB,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;4BACxC,OAAO,aAAa,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;wBAChD,CAAC;6BAAM,IAAI,cAAc,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;4BAChD,OAAO,EAAE,CAAC;wBACZ,CAAC;wBAED,qEAAqE;wBACrE,OAAO,aAAa,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;oBAChD,CAAC,CAAC;oBAEF,sBAAO,CAAC,EAAC;;;;CACV"}
package/dist/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import T from './server-dir/buildtime/T';
2
2
  import tx from './server-dir/runtime/tx';
3
3
  import getLocale from './request/getLocale';
4
- import getDict from './server-dir/buildtime/getDict';
4
+ import getTranslations from './server-dir/buildtime/getTranslations';
5
5
  import GTProvider from './provider/GTProvider';
6
6
  import Tx from './server-dir/runtime/_Tx';
7
7
  import getGT from './server-dir/buildtime/getGT';
@@ -10,5 +10,9 @@ export declare function getDefaultLocale(): string;
10
10
  export declare function getGTClass(): import("generaltranslation").GT;
11
11
  export declare function getLocaleProperties(locale: string): LocaleProperties;
12
12
  export { GTProvider, T, getGT, tx, Tx, getLocale, // getDefaultLocale
13
- getDict, };
13
+ getTranslations,
14
+ /**
15
+ * @deprecated Use getTranslations instead
16
+ */
17
+ getTranslations as getDict, };
14
18
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AA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e,IAAI,OAAO,GAC3B,CAAC"}
package/dist/server.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDict = exports.getLocale = exports.Tx = exports.tx = exports.getGT = exports.T = exports.GTProvider = void 0;
6
+ exports.getDict = exports.getTranslations = exports.getLocale = exports.Tx = exports.tx = exports.getGT = exports.T = exports.GTProvider = void 0;
7
7
  exports.getDefaultLocale = getDefaultLocale;
8
8
  exports.getGTClass = getGTClass;
9
9
  exports.getLocaleProperties = getLocaleProperties;
@@ -14,8 +14,9 @@ exports.tx = tx_1.default;
14
14
  var getLocale_1 = __importDefault(require("./request/getLocale"));
15
15
  exports.getLocale = getLocale_1.default;
16
16
  var getI18NConfig_1 = __importDefault(require("./config-dir/getI18NConfig"));
17
- var getDict_1 = __importDefault(require("./server-dir/buildtime/getDict"));
18
- exports.getDict = getDict_1.default;
17
+ var getTranslations_1 = __importDefault(require("./server-dir/buildtime/getTranslations"));
18
+ exports.getTranslations = getTranslations_1.default;
19
+ exports.getDict = getTranslations_1.default;
19
20
  var GTProvider_1 = __importDefault(require("./provider/GTProvider"));
20
21
  exports.GTProvider = GTProvider_1.default;
21
22
  var _Tx_1 = __importDefault(require("./server-dir/runtime/_Tx"));
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;AAUA,4CAEC;AAED,gCAEC;AAED,kDAEC;AApBD,+DAAyC;AAwBvC,YAxBK,WAAC,CAwBL;AAvBH,+DAAyC;AAyBvC,aAzBK,YAAE,CAyBL;AAxBJ,kEAA4C;AA0B1C,oBA1BK,mBAAS,CA0BL;AAzBX,6EAAuD;AACvD,2EAAqD;AAyBnD,kBAzBK,iBAAO,CAyBL;AAxBT,qEAA+C;AAkB7C,qBAlBK,oBAAU,CAkBL;AAjBZ,iEAA0C;AAqBxC,aArBK,aAAE,CAqBL;AApBJ,uEAAiD;AAkB/C,gBAlBK,eAAK,CAkBL;AAfP,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC;AAC5C,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;AACtC,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAc;IAChD,OAAO,UAAU,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;AAUA,4CAEC;AAED,gCAEC;AAED,kDAEC;AApBD,+DAAyC;AAwBvC,YAxBK,WAAC,CAwBL;AAvBH,+DAAyC;AAyBvC,aAzBK,YAAE,CAyBL;AAxBJ,kEAA4C;AA0B1C,oBA1BK,mBAAS,CA0BL;AAzBX,6EAAuD;AACvD,2FAAqE;AAyBnE,0BAzBK,yBAAe,CAyBL;AAII,kBA7Bd,yBAAe,CA6BM;AA5B5B,qEAA+C;AAkB7C,qBAlBK,oBAAU,CAkBL;AAjBZ,iEAA0C;AAqBxC,aArBK,aAAE,CAqBL;AApBJ,uEAAiD;AAkB/C,gBAlBK,eAAK,CAkBL;AAfP,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC;AAC5C,CAAC;AAED,SAAgB,UAAU;IACxB,OAAO,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;AACtC,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAc;IAChD,OAAO,UAAU,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-next",
3
- "version": "5.2.35",
3
+ "version": "5.2.36",
4
4
  "description": "A Next.js library for automatic internationalization.",
5
5
  "main": "dist/index.server.js",
6
6
  "peerDependencies": {
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@generaltranslation/supported-locales": "^2.0.10",
17
17
  "generaltranslation": "^6.3.2",
18
- "gt-react": "^9.2.25"
18
+ "gt-react": "^9.2.26"
19
19
  },
20
20
  "scripts": {
21
21
  "patch": "npm version patch",
@@ -1,16 +0,0 @@
1
- import { DictionaryTranslationOptions } from 'gt-react/internal';
2
- /**
3
- * Returns the dictionary access function `d()`, which is used to translate an item from the dictionary.
4
- *
5
- * @param {string} [id] - Optional prefix to prepend to the translation keys.
6
- * @returns {Function} A translation function that accepts a key string and returns the translated value.
7
- *
8
- * @example
9
- * const d = await getDict('user');
10
- * console.log(d('name')); // Translates item 'user.name'
11
- *
12
- * const d = await getDict();
13
- * console.log(d('hello')); // Translates item 'hello'
14
- */
15
- export default function getDict(id?: string): Promise<(id: string, options?: DictionaryTranslationOptions) => string>;
16
- //# sourceMappingURL=getDict.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDict.d.ts","sourceRoot":"","sources":["../../../src/server-dir/buildtime/getDict.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAI7B,MAAM,mBAAmB,CAAC;AAiB3B;;;;;;;;;;;;GAYG;AACH,wBAA8B,OAAO,CACnC,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,MAAM,CAAC,CA4JzE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDict.js","sourceRoot":"","sources":["../../../src/server-dir/buildtime/getDict.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,0BA8JC;AAjMD,8CAK2B;AAE3B,iFAA2D;AAC3D,0DAKmC;AACnC,iFAA2D;AAC3D,sEAAgD;AAChD,yDAG4B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