@curless/hotel-storefront 0.60.1 → 0.61.1
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/dist/account/index.d.ts +9 -2
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +158 -74
- package/dist/account/index.js.map +1 -1
- package/dist/account/mall.d.ts +12 -3
- package/dist/account/mall.d.ts.map +1 -1
- package/dist/account/mall.js +24 -8
- package/dist/account/mall.js.map +1 -1
- package/dist/account/ota-member.d.ts +11 -1
- package/dist/account/ota-member.d.ts.map +1 -1
- package/dist/account/ota-member.js +31 -9
- package/dist/account/ota-member.js.map +1 -1
- package/dist/account/pages.d.ts +37 -10
- package/dist/account/pages.d.ts.map +1 -1
- package/dist/account/pages.js +132 -56
- package/dist/account/pages.js.map +1 -1
- package/dist/account/said.d.ts +14 -0
- package/dist/account/said.d.ts.map +1 -0
- package/dist/account/said.js +96 -0
- package/dist/account/said.js.map +1 -0
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +14 -2
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,16 +6,20 @@
|
|
|
6
6
|
//
|
|
7
7
|
// ⚠️ THE GROUP'S PASSWORD IS IN ONE REQUEST'S MEMORY AND NOWHERE ELSE: the body
|
|
8
8
|
// of one POST to the backend, built here and dropped. Never logged, never kept,
|
|
9
|
-
// never in an error - a failure here carries a code
|
|
9
|
+
// never in an error - a failure here carries a code and the backend's own words
|
|
10
|
+
// for it (`said`, 0.61.1), cleaned by `saidOf`: no email, name or phone of ours
|
|
11
|
+
// in them, and none at all if they hold the password or a token.
|
|
10
12
|
//
|
|
11
13
|
// ⚠️ "SIGNED IN" IS PROVED, NOT TAKEN AT ITS WORD (questions #48): the backend
|
|
12
14
|
// answered `signedIn: true` with a token for a sign-in that sent no credentials
|
|
13
15
|
// at all, the group's own answer being a sign-in form. A link counts only when
|
|
14
16
|
// every part of the answer agrees: success, signed in, the group's own session
|
|
15
17
|
// token, the group asked for, and no form in its place.
|
|
18
|
+
import { msgIn, saidOf } from './said.js';
|
|
16
19
|
export class OtaMemberError extends Error {
|
|
17
20
|
code;
|
|
18
21
|
envelope;
|
|
22
|
+
said;
|
|
19
23
|
constructor(
|
|
20
24
|
/** HTTP's, the envelope's, or ours: `timeout`, `unreachable`, `not_signed_in`, `wrong_group`, `form`. */
|
|
21
25
|
code,
|
|
@@ -24,10 +28,16 @@ export class OtaMemberError extends Error {
|
|
|
24
28
|
* HTTP itself: its envelope says 500 for "wrong password" as the mall's does (apidev) -
|
|
25
29
|
* so that 500 is an answer, not a service that did not answer.
|
|
26
30
|
*/
|
|
27
|
-
envelope = false
|
|
31
|
+
envelope = false,
|
|
32
|
+
/**
|
|
33
|
+
* The backend's `msg` (0.61.1, questions #55), cleaned by `saidOf` - for the
|
|
34
|
+
* log line and, as they wrote it, the page. Never a body.
|
|
35
|
+
*/
|
|
36
|
+
said) {
|
|
28
37
|
super(`the Otaless member service refused (${String(code).slice(0, 24)})`);
|
|
29
38
|
this.code = code;
|
|
30
39
|
this.envelope = envelope;
|
|
40
|
+
this.said = said;
|
|
31
41
|
this.name = 'OtaMemberError';
|
|
32
42
|
}
|
|
33
43
|
}
|
|
@@ -43,7 +53,10 @@ export const makeOtaMembers = (opts) => {
|
|
|
43
53
|
const doFetch = opts.fetch ?? fetch;
|
|
44
54
|
const now = opts.now ?? Date.now;
|
|
45
55
|
const timeoutMs = opts.timeoutMs ?? 15_000;
|
|
46
|
-
const post = async (path, body, auth
|
|
56
|
+
const post = async (path, body, auth,
|
|
57
|
+
/** What the body carries that names someone, and what must never be written (see said.ts). */
|
|
58
|
+
hide = {}) => {
|
|
59
|
+
const said = (msg) => saidOf(msg, hide.shown, [...(hide.secret ?? []), auth]);
|
|
47
60
|
let res;
|
|
48
61
|
try {
|
|
49
62
|
res = await doFetch(`${base}${path}`, {
|
|
@@ -65,8 +78,10 @@ export const makeOtaMembers = (opts) => {
|
|
|
65
78
|
catch (e) {
|
|
66
79
|
throw new OtaMemberError(e?.name === 'TimeoutError' ? 'timeout' : 'unreachable');
|
|
67
80
|
}
|
|
68
|
-
if (!res.ok)
|
|
69
|
-
|
|
81
|
+
if (!res.ok) {
|
|
82
|
+
const text = await res.text().catch(() => '');
|
|
83
|
+
throw new OtaMemberError(res.status, false, said(msgIn(text)));
|
|
84
|
+
}
|
|
70
85
|
let env;
|
|
71
86
|
try {
|
|
72
87
|
env = (await res.json());
|
|
@@ -75,13 +90,13 @@ export const makeOtaMembers = (opts) => {
|
|
|
75
90
|
throw new OtaMemberError('not_json');
|
|
76
91
|
}
|
|
77
92
|
if (env?.code !== 200)
|
|
78
|
-
throw new OtaMemberError(typeof env?.code === 'number' ? env.code : 'envelope', true);
|
|
93
|
+
throw new OtaMemberError(typeof env?.code === 'number' ? env.code : 'envelope', true, said(env?.msg));
|
|
79
94
|
return (env.data ?? {});
|
|
80
95
|
};
|
|
81
96
|
const str = (v) => (typeof v === 'string' ? v.trim() : '');
|
|
82
97
|
return {
|
|
83
98
|
async signIn({ group, identity, password, auth }) {
|
|
84
|
-
const d = await post('/api/v1/ota/sign-in', { providerCode: group, username: identity, password }, auth);
|
|
99
|
+
const d = await post('/api/v1/ota/sign-in', { providerCode: group, username: identity, password }, auth, { shown: [identity], secret: [password] });
|
|
85
100
|
// ⚠️ EVERY PART MUST AGREE (questions #48) - see the top of this file.
|
|
86
101
|
const raw = d.rawPayload;
|
|
87
102
|
const aForm = !!raw &&
|
|
@@ -113,14 +128,21 @@ export const makeOtaMembers = (opts) => {
|
|
|
113
128
|
};
|
|
114
129
|
},
|
|
115
130
|
async register({ group, name, email, password, phone, auth }) {
|
|
116
|
-
const d = await post('/api/v1/ota/member/register', { providerCode: group, name, email, password, ...(phone ? { phone } : {}) }, auth);
|
|
131
|
+
const d = await post('/api/v1/ota/member/register', { providerCode: group, name, email, password, ...(phone ? { phone } : {}) }, auth, { shown: [name, email, phone], secret: [password] });
|
|
117
132
|
if (d.success !== true)
|
|
118
133
|
throw new OtaMemberError('not_registered');
|
|
119
134
|
const memberNo = str(d.memberNo).slice(0, 40);
|
|
120
135
|
return { alreadyRegistered: d.alreadyRegistered === true, ...(memberNo ? { memberNo } : {}) };
|
|
121
136
|
},
|
|
122
137
|
async signOut({ group, session, auth }) {
|
|
123
|
-
await post('/api/v1/ota/sign-out', {
|
|
138
|
+
await post('/api/v1/ota/sign-out', {
|
|
139
|
+
providerCode: group,
|
|
140
|
+
// The 11-10 document wants `mcpToken`, and requires it; apidev may not
|
|
141
|
+
// have that document's build yet, so the old name goes beside it.
|
|
142
|
+
// TODO: drop `sessionToken` once the backend confirms (questions #55,
|
|
143
|
+
// "2026-11-10 新版文档对照").
|
|
144
|
+
...(session ? { mcpToken: session, sessionToken: session } : {}),
|
|
145
|
+
}, auth, { secret: [session] });
|
|
124
146
|
},
|
|
125
147
|
};
|
|
126
148
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ota-member.js","sourceRoot":"","sources":["../../src/account/ota-member.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+CAA+C;AAC/C,gFAAgF;AAChF,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"ota-member.js","sourceRoot":"","sources":["../../src/account/ota-member.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+CAA+C;AAC/C,gFAAgF;AAChF,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,wDAAwD;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM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AAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChG,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;YACpC,MAAM,IAAI,CACR,sBAAsB,EACtB;gBACE,YAAY,EAAE,KAAK;gBACnB,uEAAuE;gBACvE,kEAAkE;gBAClE,sEAAsE;gBACtE,wBAAwB;gBACxB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACjE,EACD,IAAI,EACJ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CACtB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/account/pages.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ declare const WORDS: {
|
|
|
53
53
|
readonly limitedLine: readonly ["请等一分钟再试。", "Wait a minute, then try again."];
|
|
54
54
|
readonly nosessionH: readonly ["请从对话里打开账号", "Open your account from your chat"];
|
|
55
55
|
readonly nosessionLine: readonly ["账号页只在你登录的那个浏览器里打开,登录后 30 分钟内有效。也可以在对话里看账号。", "This page opens only in the browser you signed in with, for 30 minutes after. Your chat shows your account too."];
|
|
56
|
+
readonly sign_in_refused: readonly ["没能登录。", "Could not sign in."];
|
|
57
|
+
readonly register_refused: readonly ["没能创建账号。", "The account could not be created."];
|
|
56
58
|
readonly sign_in_failed: readonly ["用户名或密码不对,没能登录。", "That user name and password did not sign in."];
|
|
57
59
|
readonly register_failed: readonly ["没能创建这个账号。用户名或邮箱可能已经注册过,可以试试直接登录。", "That account could not be created. The user name or email may already be registered: try signing in instead."];
|
|
58
60
|
readonly registered_not_signed_in: readonly ["账号已经创建,但没能自动登录。请用刚才的用户名和密码登录。", "The account was created, but signing in failed. Sign in with that user name and password."];
|
|
@@ -75,12 +77,12 @@ declare const WORDS: {
|
|
|
75
77
|
readonly missing_member: readonly ["请填写会员号和姓。", "Enter the membership number and the surname."];
|
|
76
78
|
readonly member_paused: readonly ["对不上的次数太多,登录暂停 15 分钟。", "Too many that did not match: signing in is paused for 15 minutes."];
|
|
77
79
|
readonly member_busy: readonly ["{0} 的会员核对暂时没有响应,请稍后再试。", "The {0} membership check did not answer just now. Try again shortly."];
|
|
78
|
-
readonly 'Link {0} membership
|
|
80
|
+
readonly 'Link {0} membership': readonly ["关联 {0} 会员", "Link your {0} membership"];
|
|
81
|
+
readonly 'Join {0}': readonly ["注册 {0} 会员", "Join {0}"];
|
|
82
|
+
readonly 'Link to the {0} account {1}': readonly ["关联到 {0} 账号 {1}", "Link your membership to the {0} account {1}"];
|
|
79
83
|
readonly 'Join {0} and link it to the {1} account {2}': readonly ["注册 {0} 会员并关联到 {1} 账号 {2}", "Join {0} and link it to the {1} account {2}"];
|
|
80
84
|
readonly 'First, sign in to your {0} account': readonly ["先登录你的 {0} 账号", "First, sign in to your {0} account"];
|
|
81
|
-
readonly reauthLine: readonly ["这个链接要把 {1} 会员关联到一个 {0} 账号。请先在这个浏览器里登录那个 {0} 账号。", "This link
|
|
82
|
-
readonly linkWarnCard: readonly ["请核对这个码和对话里 {0} 卡片上的码一致。不一致,或者链接是别人发给你的,请关掉这个页面:在这里登录会把你的 {1} 会员交给对方。", "Check that this code matches the code on the {0} card in your chat. If it does not, or if someone sent you this link, close this page: signing in here would give them your {1} membership."];
|
|
83
|
-
readonly linkWarnWords: readonly ["请核对这个码和助手在对话里给你的码一致。不一致,或者链接是别人发给你的,请关掉这个页面:在这里登录会把你的 {1} 会员交给对方。", "Check that this code matches the code the assistant gave you in the chat. If it does not, or if someone sent you this link, close this page: signing in here would give them your {1} membership."];
|
|
85
|
+
readonly reauthLine: readonly ["这个链接要把 {1} 会员关联到一个 {0} 账号。请先在这个浏览器里登录那个 {0} 账号。", "This link is for linking a membership of {1} to the {0} account it was made for. Sign in to that {0} account in this browser first."];
|
|
84
86
|
readonly 'Email or user name': readonly ["邮箱或用户名", "Email or user name"];
|
|
85
87
|
readonly 'Full name': readonly ["姓名", "Full name"];
|
|
86
88
|
readonly fullNameHint: readonly ["和证件上一致", "As on your ID"];
|
|
@@ -92,6 +94,8 @@ declare const WORDS: {
|
|
|
92
94
|
readonly linkPrivacyNote: readonly ["{1} 的密码只从这个页面经 {0} 发到 {1},用一次就丢。助手看不到它,我们也不保存、不记录。", "Your {1} password goes from this page through {0} to {1} once, and is then dropped. The assistant never sees it, and it is not kept or logged."];
|
|
93
95
|
readonly 'Linked: {0}': readonly ["已关联:{0}", "Linked: {0}"];
|
|
94
96
|
readonly linkedLine: readonly ["回到对话:几秒内就会显示 {0} 会员已关联。", "Go back to your chat: it shows your {0} membership linked within a few seconds."];
|
|
97
|
+
readonly link_refused: readonly ["{0} 没有确认这次登录。", "{0} did not confirm this sign-in."];
|
|
98
|
+
readonly join_refused: readonly ["没能注册 {0} 会员。", "That {0} membership could not be made."];
|
|
95
99
|
readonly link_failed: readonly ["没能关联 {0} 会员:邮箱(或用户名)和密码没有通过。", "That {0} membership could not be linked: the email (or user name) and password did not sign in."];
|
|
96
100
|
readonly join_failed: readonly ["没能注册 {0} 会员。这个邮箱可能已经注册过,可以试试直接关联。", "That {0} membership could not be made. The email may already be registered: try linking it instead."];
|
|
97
101
|
readonly joined_not_linked: readonly ["{0}会员已注册,但这次没能关联上。请用刚才的邮箱和密码再关联一次,不用重新注册。", "Your {0} membership is registered, but it could not be linked this time. Link it again with that email and password: there is no need to register again."];
|
|
@@ -104,6 +108,8 @@ declare const WORDS: {
|
|
|
104
108
|
readonly Linked: readonly ["已关联", "Linked"];
|
|
105
109
|
readonly Unlink: readonly ["解除关联", "Unlink"];
|
|
106
110
|
readonly membershipsNote: readonly ["关联后,{0} 上这家的报价会按你的会员身份去问酒店。退出 {0} 账号时会一起解除。", "Once linked, {0} asks that group for prices as you, the member. Signing out of {0} unlinks them all."];
|
|
111
|
+
readonly noPriceYet: readonly ["现在登录不会改变这里的价格。", "Signing in changes no price here yet."];
|
|
112
|
+
readonly memberPriceNote: readonly ["只有酒店集团标明是会员价的价格,才会写“会员价”。", "A price is marked as a member price only where the hotel group says so."];
|
|
107
113
|
};
|
|
108
114
|
export type WordKey = keyof typeof WORDS;
|
|
109
115
|
/**
|
|
@@ -159,13 +165,15 @@ export type LoginValues = {
|
|
|
159
165
|
mobile?: string;
|
|
160
166
|
nickname?: string;
|
|
161
167
|
};
|
|
162
|
-
export declare const loginPage: (b: PageBrand, { lang, short, code, csrf, words, error, form, values, }: {
|
|
168
|
+
export declare const loginPage: (b: PageBrand, { lang, short, code, csrf, words, error, said, form, values, }: {
|
|
163
169
|
lang: Lang;
|
|
164
170
|
short: string;
|
|
165
171
|
code: string;
|
|
166
172
|
csrf: string;
|
|
167
173
|
words: boolean;
|
|
168
174
|
error?: string;
|
|
175
|
+
/** The backend's own words for the refusal (0.61.1), shown under `error`. */
|
|
176
|
+
said?: string;
|
|
169
177
|
form?: "in" | "up";
|
|
170
178
|
values?: LoginValues;
|
|
171
179
|
}) => string;
|
|
@@ -176,13 +184,22 @@ export declare const signedInPage: (b: PageBrand, { lang, name, account }: {
|
|
|
176
184
|
}) => string;
|
|
177
185
|
export type PageMembership = {
|
|
178
186
|
group: string;
|
|
187
|
+
/** The group in the page's language - 「亚朵」 on a Chinese page (0.61.0: it said "Atour"). */
|
|
179
188
|
name: string;
|
|
189
|
+
/** Its logo, by our own path (the CSP takes 'self' alone) - none, its initials. */
|
|
190
|
+
logo?: string;
|
|
180
191
|
linked: boolean;
|
|
181
192
|
label?: string;
|
|
182
193
|
numberMasked?: string;
|
|
183
194
|
signIn: boolean;
|
|
184
195
|
join: boolean;
|
|
185
196
|
};
|
|
197
|
+
/**
|
|
198
|
+
* The account, as the card's account view shows it (0.61.0, robin 11-10: the same
|
|
199
|
+
* parts in the same order, the same words and buttons): who - the name it goes by
|
|
200
|
+
* (the nickname, else the user name), the user name, the email and the phone
|
|
201
|
+
* masked - then the hotel memberships, then the small print; sign out under it.
|
|
202
|
+
*/
|
|
186
203
|
export declare const accountPage: (b: PageBrand, { lang, shown, csrf, memberships, }: {
|
|
187
204
|
lang: Lang;
|
|
188
205
|
shown: AccountShown;
|
|
@@ -218,28 +235,38 @@ export type LinkValues = {
|
|
|
218
235
|
* linked to it (0.58.0, 总线程 11-06): the page is for the browser of the
|
|
219
236
|
* account the link belongs to - one that holds its cookie, or that signs in to
|
|
220
237
|
* it here. ⚠️ NOT WHOSE: nothing of that account is shown before it is proved.
|
|
238
|
+
*
|
|
239
|
+
* ⚠️ NO CODE TO COMPARE (0.61.0, 总线程 11-10): a forwarded link, or one made
|
|
240
|
+
* with a conversation's trip id, links nothing - the page wants the link's own
|
|
241
|
+
* sign-in (its cookie), or that same account signed in to again here; another
|
|
242
|
+
* account is refused (`reauth_other`). The account's own sign-in page keeps its
|
|
243
|
+
* code: there it is all that ties the browser to the chat.
|
|
221
244
|
*/
|
|
222
245
|
export declare const linkReauthPage: (b: PageBrand, o: {
|
|
223
246
|
lang: Lang;
|
|
224
|
-
short: string;
|
|
225
247
|
code: string;
|
|
226
248
|
csrf: string;
|
|
227
|
-
|
|
249
|
+
/** The group in the page's language. */
|
|
228
250
|
group: string;
|
|
251
|
+
logo?: string;
|
|
229
252
|
error?: string;
|
|
253
|
+
/** The backend's own words for the refusal (0.61.1), shown under `error`. */
|
|
254
|
+
said?: string;
|
|
230
255
|
}) => string;
|
|
231
|
-
/** A group's membership: signed in to (`in`) or joined (`up`), and linked to the account named
|
|
256
|
+
/** A group's membership: signed in to (`in`) or joined (`up`), and linked to the account named under its heading. */
|
|
232
257
|
export declare const linkGroupPage: (b: PageBrand, o: {
|
|
233
258
|
lang: Lang;
|
|
234
|
-
short: string;
|
|
235
259
|
code: string;
|
|
236
260
|
csrf: string;
|
|
237
|
-
|
|
261
|
+
/** The group in the page's language. */
|
|
238
262
|
group: string;
|
|
263
|
+
logo?: string;
|
|
239
264
|
/** The account it links to, as its owner sees it - shown only once the browser is proved theirs. */
|
|
240
265
|
accountName: string;
|
|
241
266
|
mode: "in" | "up";
|
|
242
267
|
error?: string;
|
|
268
|
+
/** The backend's own words for the refusal (0.61.1), shown under `error`. */
|
|
269
|
+
said?: string;
|
|
243
270
|
values?: LinkValues;
|
|
244
271
|
}) => string;
|
|
245
272
|
export declare const linkedPage: (b: PageBrand, { lang, group, label }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/account/pages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/account/pages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAuB/C,kFAAkF;AAClF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmOmD,CAAC;AAE/D,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAGzC;;;;GAIG;AACH,eAAO,MAAM,GAAG,GAAI,MAAM,IAAI,EAAE,KAAK,OAAO,EAAE,GAAG,QAAQ,MAAM,EAAE,KAAG,MAWjE,CAAC;AAEJ;;;;;;GAMG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,ieACsc,CAAC;AACje,eAAO,MAAM,kBAAkB,QAAkF,CAAC;AAElH,wCAAwC;AACxC,eAAO,MAAM,qBAAqB,QAAO,MACyH,CAAC;AAEnK,0FAA0F;AAC1F,eAAO,MAAM,Y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