@im-more/dsh-kook 0.0.0-stage → 0.1.0

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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/cordis.patch.yml +12 -0
  3. package/lib/index.js +2380 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/types/bot.d.ts +53 -0
  6. package/lib/types/bot.d.ts.map +1 -0
  7. package/lib/types/bot.js +138 -0
  8. package/lib/types/bot.js.map +1 -0
  9. package/lib/types/config.d.ts +46 -0
  10. package/lib/types/config.d.ts.map +1 -0
  11. package/lib/types/config.js +52 -0
  12. package/lib/types/config.js.map +1 -0
  13. package/lib/types/decode.d.ts +88 -0
  14. package/lib/types/decode.d.ts.map +1 -0
  15. package/lib/types/decode.js +564 -0
  16. package/lib/types/decode.js.map +1 -0
  17. package/lib/types/errors.d.ts +46 -0
  18. package/lib/types/errors.d.ts.map +1 -0
  19. package/lib/types/errors.js +159 -0
  20. package/lib/types/errors.js.map +1 -0
  21. package/lib/types/identity.d.ts +17 -0
  22. package/lib/types/identity.d.ts.map +1 -0
  23. package/lib/types/identity.js +24 -0
  24. package/lib/types/identity.js.map +1 -0
  25. package/lib/types/index.d.ts +15 -0
  26. package/lib/types/index.d.ts.map +1 -0
  27. package/lib/types/index.js +15 -0
  28. package/lib/types/index.js.map +1 -0
  29. package/lib/types/kmarkdown.d.ts +76 -0
  30. package/lib/types/kmarkdown.d.ts.map +1 -0
  31. package/lib/types/kmarkdown.js +201 -0
  32. package/lib/types/kmarkdown.js.map +1 -0
  33. package/lib/types/modes/kmarkdown.d.ts +17 -0
  34. package/lib/types/modes/kmarkdown.d.ts.map +1 -0
  35. package/lib/types/modes/kmarkdown.js +166 -0
  36. package/lib/types/modes/kmarkdown.js.map +1 -0
  37. package/lib/types/modes/shared.d.ts +192 -0
  38. package/lib/types/modes/shared.d.ts.map +1 -0
  39. package/lib/types/modes/shared.js +371 -0
  40. package/lib/types/modes/shared.js.map +1 -0
  41. package/lib/types/request.d.ts +53 -0
  42. package/lib/types/request.d.ts.map +1 -0
  43. package/lib/types/request.js +147 -0
  44. package/lib/types/request.js.map +1 -0
  45. package/lib/types/send.d.ts +57 -0
  46. package/lib/types/send.d.ts.map +1 -0
  47. package/lib/types/send.js +141 -0
  48. package/lib/types/send.js.map +1 -0
  49. package/lib/types/types.d.ts +807 -0
  50. package/lib/types/types.d.ts.map +1 -0
  51. package/lib/types/types.js +168 -0
  52. package/lib/types/types.js.map +1 -0
  53. package/lib/types/webhook.d.ts +35 -0
  54. package/lib/types/webhook.d.ts.map +1 -0
  55. package/lib/types/webhook.js +132 -0
  56. package/lib/types/webhook.js.map +1 -0
  57. package/lib/types/ws.d.ts +54 -0
  58. package/lib/types/ws.d.ts.map +1 -0
  59. package/lib/types/ws.js +358 -0
  60. package/lib/types/ws.js.map +1 -0
  61. package/package.json +61 -3
  62. package/src/bot.ts +217 -0
  63. package/src/config.ts +84 -0
  64. package/src/decode.ts +660 -0
  65. package/src/errors.ts +188 -0
  66. package/src/identity.ts +32 -0
  67. package/src/index.ts +80 -0
  68. package/src/kmarkdown.ts +246 -0
  69. package/src/modes/kmarkdown.ts +204 -0
  70. package/src/modes/shared.ts +498 -0
  71. package/src/request.ts +196 -0
  72. package/src/send.ts +216 -0
  73. package/src/types.ts +764 -0
  74. package/src/webhook.ts +170 -0
  75. package/src/ws.ts +431 -0
  76. package/README.md +0 -3
@@ -0,0 +1,166 @@
1
+ /**
2
+ * The single `kmarkdown` mode: KOOK message text with its KMarkdown markup, and a card when the content needs one.
3
+ *
4
+ * Native tags are the ones the upstream encoder renders (`text`, `p`, `br`, `b`, `i`, `u`, `s`, `spoiler`, `code`,
5
+ * `a`, `at`, `channel`, `emoji`) plus the block structure KMarkdown shows as text (headings, lists, quotes, fences, a
6
+ * divider) and the media and buttons that only a card module can carry. A `<button type="input">` is not declared: a
7
+ * click that sends a text as the reader has no card component, so the core fallback renders its label and command.
8
+ * Everything else takes the core fallback, which keeps its text — the platform has no second way to render it.
9
+ */
10
+ import { defineMode, ElementRegistry } from '@deepseek-ai/cordis-plugin-im-core';
11
+ import { isPhrasingContainer } from '@deepseek-ai/satori-element';
12
+ import { escapeKMarkdown } from "../kmarkdown.js";
13
+ import { assembleDraft, BREAK, chunk, KOOK_LIMITS, mediaNode, quoteLines, serializeDraft, textNode, textOf, themeOf, withMark, } from "./shared.js";
14
+ /** Drop the paragraph breaks a container put in front of its content, so a list marker is not followed by a newline. */
15
+ function withoutLeadingBreaks(nodes) {
16
+ let start = 0;
17
+ while (start < nodes.length && nodes[start].type === 'break')
18
+ start += 1;
19
+ return nodes.slice(start);
20
+ }
21
+ /** The nodes of a render without its text runs, for a construct that carries the text in its own markup. */
22
+ function nonText(nodes) {
23
+ return nodes.filter((node) => node.type !== 'text');
24
+ }
25
+ /** A heading: KMarkdown has no heading syntax, so a bold line stands in. */
26
+ function heading(nodes) {
27
+ return [BREAK, ...withMark(nodes, '**'), BREAK];
28
+ }
29
+ /** The action button of one `<button>` element. */
30
+ function actionButton(el, ctx) {
31
+ const label = textOf(ctx.render(el.children)).trim();
32
+ if (el.attrs.type === 'link') {
33
+ return {
34
+ click: 'link',
35
+ value: el.attrs.href,
36
+ text: label === '' ? escapeKMarkdown(el.attrs.href) : label,
37
+ theme: themeOf(el.attrs.theme),
38
+ };
39
+ }
40
+ // `action` and `submit` both report their id back; the input variant never reaches a handler (not declared).
41
+ const id = el.attrs.type === 'input' ? '' : el.attrs.id;
42
+ return {
43
+ click: 'return-val',
44
+ value: id,
45
+ text: label === '' ? escapeKMarkdown(id) : label,
46
+ theme: themeOf(el.attrs.theme),
47
+ };
48
+ }
49
+ /**
50
+ * Build the `kmarkdown` mode.
51
+ * @returns the only mode of this adapter.
52
+ */
53
+ export function createKmarkdownMode() {
54
+ const elements = new ElementRegistry()
55
+ .register('text', (el) => textNode(escapeKMarkdown(el.attrs.content)))
56
+ .register('p', (el, ctx) => [BREAK, ...ctx.render(el.children), BREAK])
57
+ .register('br', () => textNode('\n'))
58
+ .register('b', (el, ctx) => withMark(ctx.render(el.children), '**'))
59
+ .register('i', (el, ctx) => withMark(ctx.render(el.children), '*'))
60
+ .register('u', (el, ctx) => withMark(ctx.render(el.children), '(ins)'))
61
+ .register('s', (el, ctx) => withMark(ctx.render(el.children), '~~'))
62
+ .register('spoiler', (el, ctx) => withMark(ctx.render(el.children), '(spl)'))
63
+ .register('code', (el, ctx) => textNode(`\`${ctx.text(el.children)}\``))
64
+ .register('pre', (el, ctx) => {
65
+ const language = el.attrs.lang ?? '';
66
+ return textNode(`\`\`\`${language}\n${ctx.text(el.children)}\n\`\`\``);
67
+ }, { variants: ['lang'] })
68
+ .register('a', (el, ctx) => {
69
+ const children = ctx.render(el.children);
70
+ const label = textOf(children).trim();
71
+ return [
72
+ textNode(`[${label === '' ? escapeKMarkdown(el.attrs.href) : label}](${el.attrs.href})`),
73
+ ...nonText(children),
74
+ ];
75
+ })
76
+ .register('at', (el) => {
77
+ switch (el.attrs.type) {
78
+ case 'user':
79
+ return el.attrs.id === undefined
80
+ ? textNode(escapeKMarkdown(`@${el.attrs.name ?? ''}`))
81
+ : textNode(`(met)${el.attrs.id}(met)`);
82
+ case 'all':
83
+ return textNode('(met)all(met)');
84
+ case 'here':
85
+ return textNode('(met)here(met)');
86
+ case 'role':
87
+ return el.attrs.id === undefined
88
+ ? textNode(escapeKMarkdown(`@${el.attrs.name ?? ''}`))
89
+ : textNode(`(rol)${el.attrs.id}(rol)`);
90
+ }
91
+ }, { variants: ['user', 'all', 'here', 'role'] })
92
+ .register('channel', (el) => textNode(`(chn)${el.attrs.id}(chn)`))
93
+ .register('emoji', (el) => {
94
+ const name = el.attrs.name ?? '';
95
+ // `(emj)name(emj)[id]` names the guild emoji and falls back to its short code when the id is unknown.
96
+ return el.attrs.id === '' || name === ''
97
+ ? textNode(`:${name}:`)
98
+ : textNode(`(emj)${name}(emj)[${el.attrs.id}]`);
99
+ })
100
+ .register('h1', (el, ctx) => heading(ctx.render(el.children)))
101
+ .register('h2', (el, ctx) => heading(ctx.render(el.children)))
102
+ .register('h3', (el, ctx) => heading(ctx.render(el.children)))
103
+ .register('h4', (el, ctx) => heading(ctx.render(el.children)))
104
+ .register('h5', (el, ctx) => heading(ctx.render(el.children)))
105
+ .register('h6', (el, ctx) => heading(ctx.render(el.children)))
106
+ .register('ul', (el, ctx) => [BREAK, ...ctx.render(el.children), BREAK])
107
+ .register('ol', (el, ctx) => [BREAK, ...ctx.render(el.children), BREAK])
108
+ .register('li', (el, ctx) => {
109
+ const parent = ctx.ancestors[ctx.ancestors.length - 1];
110
+ if (parent?.type !== 'ol') {
111
+ return [
112
+ textNode('• '),
113
+ ...withoutLeadingBreaks(ctx.render(el.children)),
114
+ BREAK,
115
+ ];
116
+ }
117
+ const index = Math.max(parent.children.indexOf(el), 0);
118
+ const start = parent.attrs.start ?? 1;
119
+ return [
120
+ textNode(`${start + index}. `),
121
+ ...withoutLeadingBreaks(ctx.render(el.children)),
122
+ BREAK,
123
+ ];
124
+ })
125
+ .register('blockquote', (el, ctx) => quoteLines(ctx.render(el.children)))
126
+ .register('hr', () => ({ type: 'divider' }))
127
+ .register('img', (el, ctx) => mediaNode(el, ctx), { variants: ['inline'] })
128
+ .register('audio', (el, ctx) => mediaNode(el, ctx))
129
+ .register('video', (el, ctx) => mediaNode(el, ctx))
130
+ .register('file', (el, ctx) => mediaNode(el, ctx))
131
+ // `input` is deliberately not declared: the core fallback keeps the label and command text and reports the
132
+ // dropped interaction.
133
+ .register('button', (el, ctx) => {
134
+ const parent = ctx.ancestors[ctx.ancestors.length - 1];
135
+ if (parent !== undefined && isPhrasingContainer(parent.type)) {
136
+ ctx.report.moved.push({
137
+ tag: 'button',
138
+ reason: 'kook-button-lifted',
139
+ path: ctx.stableId(el),
140
+ });
141
+ }
142
+ return { type: 'buttons', buttons: [actionButton(el, ctx)] };
143
+ }, { variants: ['action', 'link', 'submit', 'theme', 'inline'] })
144
+ .register('button-group', (el, ctx) => {
145
+ const buttons = [];
146
+ for (const node of ctx.render(el.children)) {
147
+ if (node.type === 'buttons')
148
+ buttons.push(...node.buttons);
149
+ }
150
+ return chunk(buttons, KOOK_LIMITS.buttonsPerRow).map((group) => ({
151
+ type: 'buttons',
152
+ buttons: group,
153
+ }));
154
+ });
155
+ return defineMode()({
156
+ id: 'kmarkdown',
157
+ elements,
158
+ limits: {
159
+ 'limit.text.chars': KOOK_LIMITS.textChars,
160
+ 'limit.buttons.row': KOOK_LIMITS.buttonsPerRow,
161
+ },
162
+ assemble: (nodes, _envelope, ctx) => assembleDraft(nodes, ctx),
163
+ serialize: (prepared, ctx) => serializeDraft(prepared, ctx),
164
+ });
165
+ }
166
+ //# sourceMappingURL=kmarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kmarkdown.js","sourceRoot":"","sources":["../../../src/modes/kmarkdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EACL,aAAa,EACb,KAAK,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,GACT,MAAM,aAAa,CAAA;AAGpB,wHAAwH;AACxH,SAAS,oBAAoB,CAAC,KAA0B;IACtD,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAE,CAAC,IAAI,KAAK,OAAO;QAAE,KAAK,IAAI,CAAC,CAAA;IACzE,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC;AAED,4GAA4G;AAC5G,SAAS,OAAO,CAAC,KAA0B;I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AAC,CAAA;QAC5D,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC/D,IAAI,EAAE,SAAkB;YACxB,OAAO,EAAE,KAAK;SACf,CAAC,CAAC,CAAA;IACL,CAAC,CAAC,CAAA;IAEJ,OAAO,UAAU,EAAiB,CAAC;QACjC,EAAE,EAAE,WAAW;QACf,QAAQ;QACR,MAAM,EAAE;YACN,kBAAkB,EAAE,WAAW,CAAC,SAAS;YACzC,mBAAmB,EAAE,WAAW,CAAC,aAAa;SAC/C;QACD,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC;QAC9D,SAAS,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC;KAC5D,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Draft model of the single `kmarkdown` mode: the node stream, the text/card buffers, the documented card budgets, and
3
+ * the exact request body of one platform message.
4
+ *
5
+ * One logical message is either kmarkdown (`type: 9`) or card JSON (`type: 10`), exactly as the upstream encoder
6
+ * flushes: text alone stays a `type: 9` message, and the first element that needs a card module (media, a button, a
7
+ * divider) turns the whole message into a card.
8
+ */
9
+ import type { ModeTypes, Prepared, RenderContext, ResourceRef, SerializeContext, Theme } from '@deepseek-ai/cordis-plugin-im-core';
10
+ import type { Element } from '@deepseek-ai/satori-element';
11
+ /** KOOK's documented bounds; nothing else is a limit. */
12
+ export declare const KOOK_LIMITS: {
13
+ /** `content` of one message ("请不要超过 8000 字符"). */
14
+ readonly textChars: 8000;
15
+ /** kmarkdown text of one section/context module. */
16
+ readonly sectionChars: 5000;
17
+ /** Modules of one card. */
18
+ readonly cardModules: 50;
19
+ /** Buttons of one `action-group`. */
20
+ readonly buttonsPerRow: 4;
21
+ /** Images of one `image-group`. */
22
+ readonly imagesPerGroup: 9;
23
+ /** `page_size` of `/guild/user-list`. */
24
+ readonly membersPageSize: 50;
25
+ };
26
+ /** Button colours the platform defines; `default` becomes `primary` as the upstream encoder chooses. */
27
+ export type KookTheme = 'primary' | 'info' | 'success' | 'warning' | 'danger';
28
+ /** One button collected from `<button>` (or a `<button-group>` child). */
29
+ export interface KookButtonNode {
30
+ /** `link` opens a URL, `return-val` reports the click with `value`. */
31
+ click: 'link' | 'return-val';
32
+ /** `value` of the wire button: the href for a link, the button id for a callback. */
33
+ value: string;
34
+ /** KMarkdown label. */
35
+ text: string;
36
+ theme: KookTheme;
37
+ }
38
+ /** One node a mode handler produces. */
39
+ export type KookNode = {
40
+ type: 'text';
41
+ text: string;
42
+ }
43
+ /** A paragraph boundary: at most one newline, and none at the start of a message. */
44
+ | {
45
+ type: 'break';
46
+ } | {
47
+ type: 'divider';
48
+ } | {
49
+ type: 'image';
50
+ ref: ResourceRef;
51
+ } | {
52
+ type: 'media';
53
+ kind: 'file' | 'audio' | 'video';
54
+ ref: ResourceRef;
55
+ title: string;
56
+ } | {
57
+ type: 'buttons';
58
+ buttons: KookButtonNode[];
59
+ };
60
+ /** One image of a card module, before `prepare` resolves its source. */
61
+ export interface KookImageDraft {
62
+ ref: ResourceRef;
63
+ }
64
+ /** One module of a card draft. */
65
+ export type KookModuleDraft = {
66
+ type: 'section';
67
+ content: string;
68
+ } | {
69
+ type: 'container';
70
+ image: KookImageDraft;
71
+ } | {
72
+ type: 'image-group';
73
+ images: KookImageDraft[];
74
+ } | {
75
+ type: 'buttons';
76
+ buttons: KookButtonNode[];
77
+ } | {
78
+ type: 'divider';
79
+ } | {
80
+ type: 'media';
81
+ kind: 'file' | 'audio' | 'video';
82
+ ref: ResourceRef;
83
+ title: string;
84
+ };
85
+ /** One platform message before resource resolution. */
86
+ export type KookDraft = {
87
+ kind: 'text';
88
+ content: string;
89
+ } | {
90
+ kind: 'card';
91
+ modules: KookModuleDraft[];
92
+ };
93
+ /** Exact request data of one platform message. */
94
+ export type KookPayload = {
95
+ kind: 'text';
96
+ type: 9;
97
+ content: string;
98
+ quote?: string;
99
+ } | {
100
+ kind: 'card';
101
+ type: 10;
102
+ content: string;
103
+ quote?: string;
104
+ };
105
+ /** Mode types of the `kmarkdown` mode. */
106
+ export interface KookModeTypes extends ModeTypes {
107
+ node: KookNode;
108
+ draft: KookDraft;
109
+ payload: KookPayload;
110
+ }
111
+ /** A paragraph break node. */
112
+ export declare const BREAK: KookNode;
113
+ /**
114
+ * One text node holding already encoded kmarkdown.
115
+ * @param text - kmarkdown text.
116
+ * @returns the node.
117
+ */
118
+ export declare function textNode(text: string): KookNode;
119
+ /**
120
+ * Group items into runs of at most `size`.
121
+ * @param items - the items, in order.
122
+ * @param size - maximum run length.
123
+ * @returns the runs, in order.
124
+ */
125
+ export declare function chunk<T>(items: readonly T[], size: number): T[][];
126
+ /**
127
+ * The card `image-group` runs of an image list (1–9 images each; DSH has no album element yet, so only a future
128
+ * caller uses this).
129
+ * @param images - the images, in order.
130
+ * @returns the groups, in order.
131
+ */
132
+ export declare function groupImages(images: readonly KookImageDraft[]): KookImageDraft[][];
133
+ /**
134
+ * The platform colour of a button theme.
135
+ * @param theme - the element's theme, when it declared one.
136
+ * @returns the KOOK button colour.
137
+ */
138
+ export declare function themeOf(theme: Theme | undefined): KookTheme;
139
+ /** The name of an outbound attachment: the declared name, else the last path segment of the source. */
140
+ export declare function fileName(name: string | undefined, src: string): string;
141
+ /** The kmarkdown text of a node list (a button label, a link label). */
142
+ export declare function textOf(nodes: readonly KookNode[]): string;
143
+ /**
144
+ * Wrap every text run of a node list with one kmarkdown construct.
145
+ *
146
+ * Each contiguous text run is wrapped on its own, so a media node between two runs never leaves a marker open across
147
+ * the card module boundary. Nested marks compose (`<b><i>x</i></b>` → `***x***`), as the upstream encoder emits.
148
+ *
149
+ * @param nodes - rendered children.
150
+ * @param open - opening marker.
151
+ * @param close - closing marker, `open` when symmetric.
152
+ * @returns the children with their text runs wrapped.
153
+ */
154
+ export declare function withMark(nodes: readonly KookNode[], open: string, close?: string): KookNode[];
155
+ /**
156
+ * Prefix every line of a node list with the quote marker.
157
+ * @param nodes - rendered children.
158
+ * @returns the children with `> ` at the start of every line.
159
+ */
160
+ export declare function quoteLines(nodes: readonly KookNode[]): KookNode[];
161
+ /**
162
+ * The media node of one attachment element, reporting a phrasing-position attachment as `moved`.
163
+ * @param el - one of `img`/`audio`/`video`/`file`.
164
+ * @param ctx - render context of the mode.
165
+ * @returns the node.
166
+ */
167
+ export declare function mediaNode(el: Element<'img' | 'audio' | 'video' | 'file'>, ctx: RenderContext<KookModeTypes>): KookNode;
168
+ /**
169
+ * Fold the rendered node stream into platform messages.
170
+ *
171
+ * Text accumulates in one buffer; the first media, button or divider element turns the message into a card and every
172
+ * text run becomes a `section`. A card holds at most 50 modules, a section at most 5,000 visible characters, and a
173
+ * kmarkdown message at most 8,000: the buffer is cut at those bounds and each extra platform message is reported as a
174
+ * split. The result is never empty.
175
+ *
176
+ * @param nodes - rendered nodes in document order.
177
+ * @param ctx - render context, for the split and moved report.
178
+ * @returns one draft per platform message.
179
+ */
180
+ export declare function assembleDraft(nodes: readonly KookNode[], ctx: RenderContext<KookModeTypes>): KookDraft[];
181
+ /**
182
+ * Build the exact request body of one draft.
183
+ *
184
+ * Only the first platform message answers the quoted one; `SerializeContext.quote` reaches every part, so the adapter
185
+ * picks the one that carries it.
186
+ *
187
+ * @param prepared - the draft with every resource resolved.
188
+ * @param ctx - serialize context (part index and quote).
189
+ * @returns the request body.
190
+ */
191
+ export declare function serializeDraft(prepared: Prepared<KookDraft>, ctx: SerializeContext): KookPayload;
192
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/modes/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,SAAS,EAC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