@mirai/core 0.1.28 → 0.1.30
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/README.md
CHANGED
|
@@ -38,6 +38,7 @@ The attributes that we can set in this instance are:
|
|
|
38
38
|
|
|
39
39
|
- `data-mirai-id`: the hotel or chain identifier.
|
|
40
40
|
- `data-type`: `hotel` or `chain` instance type (default is `hotel`)
|
|
41
|
+
- `data-hotel`: the hotel identifier (only available when `data-type=chain`)
|
|
41
42
|
- `data-locale`: in case we want to set a different language locale than the default.
|
|
42
43
|
- `data-currency`: in case we want to set a currency than the default.
|
|
43
44
|
|
|
@@ -50,9 +51,15 @@ Here you have an complete example using all these attributes:
|
|
|
50
51
|
</body>
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
For testing purposes only, we can hydrate the instance via url parameters. Let's see an example:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
https://hotel.com/endpoint?miraiId=10030559&type=chain&hotel=100376545
|
|
58
|
+
```
|
|
59
|
+
|
|
53
60
|
## 1.3 Environments
|
|
54
61
|
|
|
55
|
-
Our new core has different execution
|
|
62
|
+
Our new core has different execution enviryonments. These differ for the most part in the way they have been compiled.
|
|
56
63
|
|
|
57
64
|
- `production` (https://static.mirai.com) the bundle has been generated by minifying and obfuscating the largest code base possible.
|
|
58
65
|
- `development` (https://static-pre.mirai.com) the bundle has been generated in development mode with _sourceMaps_ as well as the access to the services is also in development mode.
|
|
@@ -5,13 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.fetchSession = void 0;
|
|
7
7
|
var _dataSources = require("@mirai/data-sources");
|
|
8
|
-
const
|
|
8
|
+
const CACHE_LIMIT = 1000 * 60 * 60 * 24 * 7;
|
|
9
|
+
const SESSION_STORAGE_LEGACY_ID = 'CLUB';
|
|
10
|
+
const SESSION_STORAGE_ID = 'MIRAI:SERVICE:USER:session';
|
|
9
11
|
const fetchSession = function () {
|
|
10
12
|
let urlParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
|
-
|
|
12
|
-
adapter: _dataSources.
|
|
13
|
+
let storage = new _dataSources.Storage({
|
|
14
|
+
adapter: _dataSources.LocalAdapter,
|
|
15
|
+
cache: CACHE_LIMIT
|
|
13
16
|
});
|
|
14
17
|
let session = storage.get(SESSION_STORAGE_ID);
|
|
18
|
+
if (!session) {
|
|
19
|
+
storage = new _dataSources.Storage({
|
|
20
|
+
adapter: _dataSources.SessionAdapter
|
|
21
|
+
});
|
|
22
|
+
session = storage.get(SESSION_STORAGE_LEGACY_ID);
|
|
23
|
+
}
|
|
15
24
|
if (!session && urlParams.session) {
|
|
16
25
|
try {
|
|
17
26
|
session = JSON.parse(urlParams.session);
|
|
@@ -22,18 +31,36 @@ const fetchSession = function () {
|
|
|
22
31
|
}
|
|
23
32
|
const {
|
|
24
33
|
accessToken,
|
|
34
|
+
authorization,
|
|
25
35
|
email,
|
|
26
36
|
firstName,
|
|
27
|
-
lastName
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
lastName,
|
|
38
|
+
country,
|
|
39
|
+
dateOfBirth,
|
|
40
|
+
club: {
|
|
41
|
+
name,
|
|
42
|
+
id,
|
|
43
|
+
level
|
|
44
|
+
} = {},
|
|
45
|
+
subscribed,
|
|
46
|
+
// ? Not sure we should get this data from legacy
|
|
47
|
+
idClub: clubId,
|
|
48
|
+
clubName,
|
|
49
|
+
level: clubLevel
|
|
31
50
|
} = session || {};
|
|
32
|
-
return accessToken ? {
|
|
33
|
-
accessToken,
|
|
51
|
+
return accessToken || authorization ? {
|
|
52
|
+
authorization: authorization || accessToken,
|
|
34
53
|
email,
|
|
35
54
|
firstName,
|
|
36
|
-
lastName
|
|
55
|
+
lastName,
|
|
56
|
+
country,
|
|
57
|
+
dateOfBirth,
|
|
58
|
+
club: {
|
|
59
|
+
name: name || clubName,
|
|
60
|
+
id: id || clubId,
|
|
61
|
+
level: level || clubLevel
|
|
62
|
+
},
|
|
63
|
+
subscribed
|
|
37
64
|
} : undefined;
|
|
38
65
|
};
|
|
39
66
|
exports.fetchSession = fetchSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchSession.js","names":["SESSION_STORAGE_ID","fetchSession","urlParams","storage","Storage","adapter","
|
|
1
|
+
{"version":3,"file":"fetchSession.js","names":["CACHE_LIMIT","SESSION_STORAGE_LEGACY_ID","SESSION_STORAGE_ID","fetchSession","urlParams","storage","Storage","adapter","LocalAdapter","cache","session","get","SessionAdapter","JSON","parse","error","console","accessToken","authorization","email","firstName","lastName","country","dateOfBirth","club","name","id","level","subscribed","idClub","clubId","clubName","clubLevel","undefined"],"sources":["../../src/helpers/fetchSession.js"],"sourcesContent":["import { LocalAdapter, SessionAdapter, Storage } from '@mirai/data-sources';\n\nconst CACHE_LIMIT = 1000 * 60 * 60 * 24 * 7;\nconst SESSION_STORAGE_LEGACY_ID = 'CLUB';\nconst SESSION_STORAGE_ID = 'MIRAI:SERVICE:USER:session';\n\nexport const fetchSession = (urlParams = {}) => {\n let storage = new Storage({ adapter: LocalAdapter, cache: CACHE_LIMIT });\n let session = storage.get(SESSION_STORAGE_ID);\n\n if (!session) {\n storage = new Storage({ adapter: SessionAdapter });\n session = storage.get(SESSION_STORAGE_LEGACY_ID);\n }\n\n if (!session && urlParams.session) {\n try {\n session = JSON.parse(urlParams.session);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('', error);\n }\n }\n\n const {\n accessToken,\n authorization,\n email,\n firstName,\n lastName,\n country,\n dateOfBirth,\n club: { name, id, level } = {},\n subscribed,\n // ? Not sure we should get this data from legacy\n idClub: clubId,\n clubName,\n level: clubLevel,\n } = session || {};\n\n return accessToken || authorization\n ? {\n authorization: authorization || accessToken,\n email,\n firstName,\n lastName,\n country,\n dateOfBirth,\n club: { name: name || clubName, id: id || clubId, level: level || clubLevel },\n subscribed,\n }\n : undefined;\n};\n"],"mappings":";;;;;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ACTC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,IAAI,EAAE;MAAEC,IAAI,EAAEA,IAAI,IAAIM,QAAQ;MAAEL,EAAE,EAAEA,EAAE,IAAII,MAAM;MAAEH,KAAK,EAAEA,KAAK,IAAIK;IAAU,CAAC;IAC7EJ;EACF,CAAC,GACDK,SAAS;AACf,CAAC;AAAC"}
|
|
@@ -6,7 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.findInstance = void 0;
|
|
7
7
|
const NAMESPACE = '[data-mirai-id]';
|
|
8
8
|
const ID_KEY = 'miraiId';
|
|
9
|
-
const
|
|
9
|
+
const INSTANCE_URL_PARAMS = ['type', 'hotel'];
|
|
10
|
+
const findInstance = function () {
|
|
11
|
+
let {
|
|
12
|
+
urlParams = {}
|
|
13
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
14
|
const [el] = document.querySelectorAll(NAMESPACE);
|
|
11
15
|
if (!el) return undefined;
|
|
12
16
|
const properties = Object.keys(el.dataset).reduce((current, name) => {
|
|
@@ -16,6 +20,10 @@ const findInstance = () => {
|
|
|
16
20
|
[key]: el.dataset[name]
|
|
17
21
|
};
|
|
18
22
|
}, {});
|
|
23
|
+
if (urlParams[ID_KEY]) {
|
|
24
|
+
properties.id = urlParams[ID_KEY];
|
|
25
|
+
INSTANCE_URL_PARAMS.filter(key => !!urlParams[key]).forEach(key => properties[key] = urlParams[key]);
|
|
26
|
+
}
|
|
19
27
|
return properties.id ? {
|
|
20
28
|
el,
|
|
21
29
|
...properties,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findInstance.js","names":["NAMESPACE","ID_KEY","findInstance","el","document","querySelectorAll","undefined","properties","Object","keys","dataset","reduce","current","name","key","id","type"],"sources":["../../src/helpers/findInstance.js"],"sourcesContent":["const NAMESPACE = '[data-mirai-id]';\nconst ID_KEY = 'miraiId';\n\nexport const findInstance = () => {\n const [el] = document.querySelectorAll(NAMESPACE);\n if (!el) return undefined;\n\n const properties = Object.keys(el.dataset).reduce((current, name) => {\n const key = name === ID_KEY ? 'id' : name;\n\n return { ...current, [key]: el.dataset[name] };\n }, {});\n\n return properties.id ? { el, ...properties, type: properties.type || 'hotel' } : undefined;\n};\n"],"mappings":";;;;;;AAAA,MAAMA,SAAS,GAAG,iBAAiB;AACnC,MAAMC,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"findInstance.js","names":["NAMESPACE","ID_KEY","INSTANCE_URL_PARAMS","findInstance","urlParams","el","document","querySelectorAll","undefined","properties","Object","keys","dataset","reduce","current","name","key","id","filter","forEach","type"],"sources":["../../src/helpers/findInstance.js"],"sourcesContent":["const NAMESPACE = '[data-mirai-id]';\nconst ID_KEY = 'miraiId';\nconst INSTANCE_URL_PARAMS = ['type', 'hotel'];\n\nexport const findInstance = ({ urlParams = {} } = {}) => {\n const [el] = document.querySelectorAll(NAMESPACE);\n if (!el) return undefined;\n\n const properties = Object.keys(el.dataset).reduce((current, name) => {\n const key = name === ID_KEY ? 'id' : name;\n\n return { ...current, [key]: el.dataset[name] };\n }, {});\n\n if (urlParams[ID_KEY]) {\n properties.id = urlParams[ID_KEY];\n INSTANCE_URL_PARAMS.filter((key) => !!urlParams[key]).forEach((key) => (properties[key] = urlParams[key]));\n }\n\n return properties.id ? { el, ...properties, type: properties.type || 'hotel' } : undefined;\n};\n"],"mappings":";;;;;;AAAA,MAAMA,SAAS,GAAG,iBAAiB;AACnC,MAAMC,MAAM,GAAG,SAAS;AACxB,MAAMC,mBAAmB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AAEtC,MAAMC,YAAY,GAAG,YAA6B;EAAA,IAA5B;IAAEC,SAAS,GAAG,CAAC;EAAE,CAAC,uEAAG,CAAC,CAAC;EAClD,MAAM,CAACC,EAAE,CAAC,GAAGC,QAAQ,CAACC,gBAAgB,CAACP,SAAS,CAAC;EACjD,IAAI,CAACK,EAAE,EAAE,OAAOG,SAAS;EAEzB,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACN,EAAE,CAACO,OAAO,CAAC,CAACC,MAAM,CAAC,CAACC,OAAO,EAAEC,IAAI,KAAK;IACnE,MAAMC,GAAG,GAAGD,IAAI,KAAKd,MAAM,GAAG,IAAI,GAAGc,IAAI;IAEzC,OAAO;MAAE,GAAGD,OAAO;MAAE,CAACE,GAAG,GAAGX,EAAE,CAACO,OAAO,CAACG,IAAI;IAAE,CAAC;EAChD,CAAC,EAAE,CAAC,CAAC,CAAC;EAEN,IAAIX,SAAS,CAACH,MAAM,CAAC,EAAE;IACrBQ,UAAU,CAACQ,EAAE,GAAGb,SAAS,CAACH,MAAM,CAAC;IACjCC,mBAAmB,CAACgB,MAAM,CAAEF,GAAG,IAAK,CAAC,CAACZ,SAAS,CAACY,GAAG,CAAC,CAAC,CAACG,OAAO,CAAEH,GAAG,IAAMP,UAAU,CAACO,GAAG,CAAC,GAAGZ,SAAS,CAACY,GAAG,CAAE,CAAC;EAC5G;EAEA,OAAOP,UAAU,CAACQ,EAAE,GAAG;IAAEZ,EAAE;IAAE,GAAGI,UAAU;IAAEW,IAAI,EAAEX,UAAU,CAACW,IAAI,IAAI;EAAQ,CAAC,GAAGZ,SAAS;AAC5F,CAAC;AAAC"}
|
package/build/index.js
CHANGED
|
@@ -37,7 +37,9 @@ window.Mirai.core = async () => {
|
|
|
37
37
|
if (environment) return;
|
|
38
38
|
|
|
39
39
|
// 3. Find instance
|
|
40
|
-
const instance = (0, _helpers.findInstance)(
|
|
40
|
+
const instance = (0, _helpers.findInstance)({
|
|
41
|
+
urlParams
|
|
42
|
+
});
|
|
41
43
|
if (!instance) return;
|
|
42
44
|
|
|
43
45
|
// 4. Find components
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["window","Mirai","environment","process","env","NODE_ENV","services","booking","SERVICE_BOOKING","club","SERVICE_CLUB","engine","SERVICE_ENGINE","static","SERVICE_STATIC","user","SERVICE_USER","version","core","isProduction","isDevelopment","console","log","name","urlParams","fetchUrlParams","location","search","substring","cookies","fetchCookies","COOKIE_CART","COOKIE_VALUES","session","fetchSession","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","config","fetchConfig","theme","store","consolidateStore","ReactDOM","render","METRICS","el"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { name, version } from '../package.json';\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_VALUES } from './Core.definition';\nimport {\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n theme,\n} from './helpers';\n\nwindow.Mirai = {\n ...window.Mirai,\n environment: process.env.NODE_ENV,\n services: {\n booking: process.env.SERVICE_BOOKING,\n club: process.env.SERVICE_CLUB,\n engine: process.env.SERVICE_ENGINE,\n static: process.env.SERVICE_STATIC,\n user: process.env.SERVICE_USER,\n },\n version,\n};\n\nwindow.Mirai.core = async () => {\n const isProduction = process.env.NODE_ENV === 'production';\n const isDevelopment = process.env.NODE_ENV === 'development';\n\n console.log(`${isProduction ? '🟢' : isDevelopment ? '🟡' : '🔴'} ${name} v${version} [${process.env.NODE_ENV}]`);\n\n // 1. Fetch client-side dataSources\n const urlParams = fetchUrlParams(location.search.substring(1));\n const cookies = fetchCookies([COOKIE_CART, COOKIE_VALUES]);\n const session = fetchSession(urlParams);\n\n // 2. Analize environment\n const environment = urlParams.env && isProduction ? loadEnvironment(urlParams.env) : undefined;\n if (environment) return;\n\n // 3. Find instance\n const instance = findInstance();\n if (!instance) return;\n\n // 4. Find components\n const components = findComponents();\n if (!components.length) return;\n\n // 5. Analize id to fetch its config\n const config = await fetchConfig(instance);\n if (!config) return;\n\n // 6. Theming\n theme();\n\n // 7. Consolidate store\n const store = consolidateStore({ config, cookies, instance, session, urlParams });\n\n // 8. Render components\n ReactDOM.render(\n <React.StrictMode>\n <MetricsProvider token={process.env.METRICS}>\n <StoreProvider value={store}>\n <Core {...{ components }} />\n </StoreProvider>\n </MetricsProvider>\n </React.StrictMode>,\n instance.el,\n );\n};\n\nwindow.Mirai.core();\n"],"mappings":";;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAUmB;AAlBnB;;AAoBAA,MAAM,CAACC,KAAK,GAAG;EACb,GAAGD,MAAM,CAACC,KAAK;EACfC,WAAW,EAAEC,OAAO,CAACC,GAAG,CAACC,QAAQ;EACjCC,QAAQ,EAAE;IACRC,OAAO,EAAEJ,OAAO,CAACC,GAAG,CAACI,eAAe;IACpCC,IAAI,EAAEN,OAAO,CAACC,GAAG,CAACM,YAAY;IAC9BC,MAAM,EAAER,OAAO,CAACC,GAAG,CAACQ,cAAc;IAClCC,MAAM,EAAEV,OAAO,CAACC,GAAG,CAACU,cAAc;IAClCC,IAAI,EAAEZ,OAAO,CAACC,GAAG,CAACY;EACpB,CAAC;EACDC,OAAO,EAAPA;AACF,CAAC;AAEDjB,MAAM,CAACC,KAAK,CAACiB,IAAI,GAAG,YAAY;EAC9B,MAAMC,YAAY,GAAGhB,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;EAC1D,MAAMe,aAAa,GAAGjB,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa;EAE5DgB,OAAO,CAACC,GAAG,CAAE,GAAEH,YAAY,GAAG,IAAI,GAAGC,aAAa,GAAG,IAAI,GAAG,IAAK,IAAGG,aAAK,KAAIN,gBAAQ,KAAId,OAAO,CAACC,GAAG,CAACC,QAAS,GAAE,CAAC;;EAEjH;EACA,MAAMmB,SAAS,GAAG,IAAAC,uBAAc,EAACC,QAAQ,CAACC,MAAM,CAACC,SAAS,CAAC,CAAC,CAAC,CAAC;EAC9D,MAAMC,OAAO,GAAG,IAAAC,qBAAY,EAAC,CAACC,kBAAW,EAAEC,oBAAa,CAAC,CAAC;EAC1D,MAAMC,OAAO,GAAG,IAAAC,qBAAY,EAACV,SAAS,CAAC;;EAEvC;EACA,MAAMtB,WAAW,GAAGsB,SAAS,CAACpB,GAAG,IAAIe,YAAY,GAAG,IAAAgB,wBAAe,EAACX,SAAS,CAACpB,GAAG,CAAC,GAAGgC,SAAS;EAC9F,IAAIlC,WAAW,EAAE;;EAEjB;EACA,MAAMmC,QAAQ,GAAG,IAAAC,qBAAY,
|
|
1
|
+
{"version":3,"file":"index.js","names":["window","Mirai","environment","process","env","NODE_ENV","services","booking","SERVICE_BOOKING","club","SERVICE_CLUB","engine","SERVICE_ENGINE","static","SERVICE_STATIC","user","SERVICE_USER","version","core","isProduction","isDevelopment","console","log","name","urlParams","fetchUrlParams","location","search","substring","cookies","fetchCookies","COOKIE_CART","COOKIE_VALUES","session","fetchSession","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","config","fetchConfig","theme","store","consolidateStore","ReactDOM","render","METRICS","el"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { name, version } from '../package.json';\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_VALUES } from './Core.definition';\nimport {\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n theme,\n} from './helpers';\n\nwindow.Mirai = {\n ...window.Mirai,\n environment: process.env.NODE_ENV,\n services: {\n booking: process.env.SERVICE_BOOKING,\n club: process.env.SERVICE_CLUB,\n engine: process.env.SERVICE_ENGINE,\n static: process.env.SERVICE_STATIC,\n user: process.env.SERVICE_USER,\n },\n version,\n};\n\nwindow.Mirai.core = async () => {\n const isProduction = process.env.NODE_ENV === 'production';\n const isDevelopment = process.env.NODE_ENV === 'development';\n\n console.log(`${isProduction ? '🟢' : isDevelopment ? '🟡' : '🔴'} ${name} v${version} [${process.env.NODE_ENV}]`);\n\n // 1. Fetch client-side dataSources\n const urlParams = fetchUrlParams(location.search.substring(1));\n const cookies = fetchCookies([COOKIE_CART, COOKIE_VALUES]);\n const session = fetchSession(urlParams);\n\n // 2. Analize environment\n const environment = urlParams.env && isProduction ? loadEnvironment(urlParams.env) : undefined;\n if (environment) return;\n\n // 3. Find instance\n const instance = findInstance({ urlParams });\n if (!instance) return;\n\n // 4. Find components\n const components = findComponents();\n if (!components.length) return;\n\n // 5. Analize id to fetch its config\n const config = await fetchConfig(instance);\n if (!config) return;\n\n // 6. Theming\n theme();\n\n // 7. Consolidate store\n const store = consolidateStore({ config, cookies, instance, session, urlParams });\n\n // 8. Render components\n ReactDOM.render(\n <React.StrictMode>\n <MetricsProvider token={process.env.METRICS}>\n <StoreProvider value={store}>\n <Core {...{ components }} />\n </StoreProvider>\n </MetricsProvider>\n </React.StrictMode>,\n instance.el,\n );\n};\n\nwindow.Mirai.core();\n"],"mappings":";;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAUmB;AAlBnB;;AAoBAA,MAAM,CAACC,KAAK,GAAG;EACb,GAAGD,MAAM,CAACC,KAAK;EACfC,WAAW,EAAEC,OAAO,CAACC,GAAG,CAACC,QAAQ;EACjCC,QAAQ,EAAE;IACRC,OAAO,EAAEJ,OAAO,CAACC,GAAG,CAACI,eAAe;IACpCC,IAAI,EAAEN,OAAO,CAACC,GAAG,CAACM,YAAY;IAC9BC,MAAM,EAAER,OAAO,CAACC,GAAG,CAACQ,cAAc;IAClCC,MAAM,EAAEV,OAAO,CAACC,GAAG,CAACU,cAAc;IAClCC,IAAI,EAAEZ,OAAO,CAACC,GAAG,CAACY;EACpB,CAAC;EACDC,OAAO,EAAPA;AACF,CAAC;AAEDjB,MAAM,CAACC,KAAK,CAACiB,IAAI,GAAG,YAAY;EAC9B,MAAMC,YAAY,GAAGhB,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;EAC1D,MAAMe,aAAa,GAAGjB,OAAO,CAACC,GAAG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