etherpad-webcomponents 0.0.5 → 0.0.6
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/EpDropdown.d.ts +3 -0
- package/dist/EpDropdown.d.ts.map +1 -1
- package/dist/EpDropdown.js +30 -4
- package/dist/EpDropdown.js.map +1 -1
- package/dist/EpEditor.d.ts +108 -0
- package/dist/EpEditor.d.ts.map +1 -0
- package/dist/EpEditor.js +288 -0
- package/dist/EpEditor.js.map +1 -0
- package/dist/editor/AceEditor.d.ts +204 -0
- package/dist/editor/AceEditor.d.ts.map +1 -0
- package/dist/editor/AceEditor.js +2847 -0
- package/dist/editor/AceEditor.js.map +1 -0
- package/dist/editor/AttributeManager.d.ts +25 -0
- package/dist/editor/AttributeManager.d.ts.map +1 -0
- package/dist/editor/AttributeManager.js +236 -0
- package/dist/editor/AttributeManager.js.map +1 -0
- package/dist/editor/AttributeMap.d.ts +13 -0
- package/dist/editor/AttributeMap.d.ts.map +1 -0
- package/dist/editor/AttributeMap.js +37 -0
- package/dist/editor/AttributeMap.js.map +1 -0
- package/dist/editor/AttributePool.d.ts +22 -0
- package/dist/editor/AttributePool.d.ts.map +1 -0
- package/dist/editor/AttributePool.js +101 -0
- package/dist/editor/AttributePool.js.map +1 -0
- package/dist/editor/Builder.d.ts +15 -0
- package/dist/editor/Builder.d.ts.map +1 -0
- package/dist/editor/Builder.js +47 -0
- package/dist/editor/Builder.js.map +1 -0
- package/dist/editor/Changeset.d.ts +61 -0
- package/dist/editor/Changeset.d.ts.map +1 -0
- package/dist/editor/Changeset.js +942 -0
- package/dist/editor/Changeset.js.map +1 -0
- package/dist/editor/ChangesetUtils.d.ts +11 -0
- package/dist/editor/ChangesetUtils.d.ts.map +1 -0
- package/dist/editor/ChangesetUtils.js +30 -0
- package/dist/editor/ChangesetUtils.js.map +1 -0
- package/dist/editor/MergingOpAssembler.d.ts +13 -0
- package/dist/editor/MergingOpAssembler.d.ts.map +1 -0
- package/dist/editor/MergingOpAssembler.js +60 -0
- package/dist/editor/MergingOpAssembler.js.map +1 -0
- package/dist/editor/Op.d.ts +10 -0
- package/dist/editor/Op.d.ts.map +1 -0
- package/dist/editor/Op.js +18 -0
- package/dist/editor/Op.js.map +1 -0
- package/dist/editor/OpAssembler.d.ts +9 -0
- package/dist/editor/OpAssembler.d.ts.map +1 -0
- package/dist/editor/OpAssembler.js +16 -0
- package/dist/editor/OpAssembler.js.map +1 -0
- package/dist/editor/OpIter.d.ts +9 -0
- package/dist/editor/OpIter.d.ts.map +1 -0
- package/dist/editor/OpIter.js +22 -0
- package/dist/editor/OpIter.js.map +1 -0
- package/dist/editor/SmartOpAssembler.d.ts +21 -0
- package/dist/editor/SmartOpAssembler.d.ts.map +1 -0
- package/dist/editor/SmartOpAssembler.js +71 -0
- package/dist/editor/SmartOpAssembler.js.map +1 -0
- package/dist/editor/StringAssembler.d.ts +7 -0
- package/dist/editor/StringAssembler.d.ts.map +1 -0
- package/dist/editor/StringAssembler.js +15 -0
- package/dist/editor/StringAssembler.js.map +1 -0
- package/dist/editor/StringIterator.d.ts +13 -0
- package/dist/editor/StringIterator.d.ts.map +1 -0
- package/dist/editor/StringIterator.js +29 -0
- package/dist/editor/StringIterator.js.map +1 -0
- package/dist/editor/TextLinesMutator.d.ts +31 -0
- package/dist/editor/TextLinesMutator.d.ts.map +1 -0
- package/dist/editor/TextLinesMutator.js +198 -0
- package/dist/editor/TextLinesMutator.js.map +1 -0
- package/dist/editor/ace2_common.d.ts +9 -0
- package/dist/editor/ace2_common.d.ts.map +1 -0
- package/dist/editor/ace2_common.js +31 -0
- package/dist/editor/ace2_common.js.map +1 -0
- package/dist/editor/attributes.d.ts +20 -0
- package/dist/editor/attributes.d.ts.map +1 -0
- package/dist/editor/attributes.js +54 -0
- package/dist/editor/attributes.js.map +1 -0
- package/dist/editor/browser_flags.d.ts +7 -0
- package/dist/editor/browser_flags.d.ts.map +1 -0
- package/dist/editor/browser_flags.js +8 -0
- package/dist/editor/browser_flags.js.map +1 -0
- package/dist/editor/changesettracker.d.ts +54 -0
- package/dist/editor/changesettracker.d.ts.map +1 -0
- package/dist/editor/changesettracker.js +193 -0
- package/dist/editor/changesettracker.js.map +1 -0
- package/dist/editor/colorutils.d.ts +22 -0
- package/dist/editor/colorutils.d.ts.map +1 -0
- package/dist/editor/colorutils.js +81 -0
- package/dist/editor/colorutils.js.map +1 -0
- package/dist/editor/contentcollector.d.ts +52 -0
- package/dist/editor/contentcollector.d.ts.map +1 -0
- package/dist/editor/contentcollector.js +692 -0
- package/dist/editor/contentcollector.js.map +1 -0
- package/dist/editor/core/EventBus.d.ts +187 -0
- package/dist/editor/core/EventBus.d.ts.map +1 -0
- package/dist/editor/core/EventBus.js +169 -0
- package/dist/editor/core/EventBus.js.map +1 -0
- package/dist/editor/cssmanager.d.ts +6 -0
- package/dist/editor/cssmanager.d.ts.map +1 -0
- package/dist/editor/cssmanager.js +35 -0
- package/dist/editor/cssmanager.js.map +1 -0
- package/dist/editor/domline.d.ts +35 -0
- package/dist/editor/domline.d.ts.map +1 -0
- package/dist/editor/domline.js +267 -0
- package/dist/editor/domline.js.map +1 -0
- package/dist/editor/html_escape.d.ts +3 -0
- package/dist/editor/html_escape.d.ts.map +1 -0
- package/dist/editor/html_escape.js +8 -0
- package/dist/editor/html_escape.js.map +1 -0
- package/dist/editor/linestylefilter.d.ts +22 -0
- package/dist/editor/linestylefilter.d.ts.map +1 -0
- package/dist/editor/linestylefilter.js +298 -0
- package/dist/editor/linestylefilter.js.map +1 -0
- package/dist/editor/skiplist.d.ts +51 -0
- package/dist/editor/skiplist.d.ts.map +1 -0
- package/dist/editor/skiplist.js +327 -0
- package/dist/editor/skiplist.js.map +1 -0
- package/dist/editor/types/AText.d.ts +5 -0
- package/dist/editor/types/AText.d.ts.map +1 -0
- package/dist/editor/types/AText.js +2 -0
- package/dist/editor/types/AText.js.map +1 -0
- package/dist/editor/types/Attribute.d.ts +2 -0
- package/dist/editor/types/Attribute.d.ts.map +1 -0
- package/dist/editor/types/Attribute.js +2 -0
- package/dist/editor/types/Attribute.js.map +1 -0
- package/dist/editor/types/ChangeSet.d.ts +7 -0
- package/dist/editor/types/ChangeSet.d.ts.map +1 -0
- package/dist/editor/types/ChangeSet.js +2 -0
- package/dist/editor/types/ChangeSet.js.map +1 -0
- package/dist/editor/types/ChangeSetBuilder.d.ts +7 -0
- package/dist/editor/types/ChangeSetBuilder.d.ts.map +1 -0
- package/dist/editor/types/ChangeSetBuilder.js +2 -0
- package/dist/editor/types/ChangeSetBuilder.js.map +1 -0
- package/dist/editor/types/RepModel.d.ts +25 -0
- package/dist/editor/types/RepModel.d.ts.map +1 -0
- package/dist/editor/types/RepModel.js +2 -0
- package/dist/editor/types/RepModel.js.map +1 -0
- package/dist/editor/undomodule.d.ts +30 -0
- package/dist/editor/undomodule.d.ts.map +1 -0
- package/dist/editor/undomodule.js +266 -0
- package/dist/editor/undomodule.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const colorutils: {
|
|
2
|
+
isCssHex(cssColor: string): boolean;
|
|
3
|
+
css2triple(cssColor: string): number[];
|
|
4
|
+
css2sixhex(cssColor: string): string;
|
|
5
|
+
triple2css(triple: number[]): string;
|
|
6
|
+
clamp(v: number, bot: number, top: number): number;
|
|
7
|
+
min3(a: number, b: number, c: number): number;
|
|
8
|
+
max3(a: number, b: number, c: number): number;
|
|
9
|
+
colorMin(c: number[]): number;
|
|
10
|
+
colorMax(c: number[]): number;
|
|
11
|
+
scale(v: number, bot: number, top: number): number;
|
|
12
|
+
unscale(v: number, bot: number, top: number): number;
|
|
13
|
+
scaleColor(c: number[], bot: number, top: number): number[];
|
|
14
|
+
unscaleColor(c: number[], bot: number, top: number): number[];
|
|
15
|
+
luminosity(c: number[]): number;
|
|
16
|
+
saturate(c: number[]): number[];
|
|
17
|
+
blend(c1: number[], c2: number[], t: number): number[];
|
|
18
|
+
invert(c: number[]): number[];
|
|
19
|
+
complementary(c: number[]): number[];
|
|
20
|
+
textColorFromBackgroundColor(bgcolor: string, _skinName: string): string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=colorutils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorutils.d.ts","sourceRoot":"","sources":["../../src/editor/colorutils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM,GAAG,OAAO;yBAId,MAAM,GAAG,MAAM,EAAE;yBAMjB,MAAM,GAAG,MAAM;uBAMjB,MAAM,EAAE,GAAG,MAAM;aAK3B,MAAM,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM;YAI1C,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG,MAAM;YAIrC,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG,MAAM;gBAIjC,MAAM,EAAE,GAAG,MAAM;gBAIjB,MAAM,EAAE,GAAG,MAAM;aAIpB,MAAM,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM;eAIvC,MAAM,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM;kBAItC,MAAM,EAAE,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM,EAAE;oBAI3C,MAAM,EAAE,OAAO,MAAM,OAAO,MAAM,GAAG,MAAM,EAAE;kBAI/C,MAAM,EAAE,GAAG,MAAM;gBAInB,MAAM,EAAE,GAAG,MAAM,EAAE;cAOrB,MAAM,EAAE,MAAM,MAAM,EAAE,KAAK,MAAM,GAAG,MAAM,EAAE;cAI5C,MAAM,EAAE,GAAG,MAAM,EAAE;qBAIZ,MAAM,EAAE,GAAG,MAAM,EAAE;0CASE,MAAM,aAAa,MAAM,GAAG,MAAM;CAKzE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const colorutils = {
|
|
2
|
+
isCssHex(cssColor) {
|
|
3
|
+
return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(cssColor);
|
|
4
|
+
},
|
|
5
|
+
css2triple(cssColor) {
|
|
6
|
+
const sixHex = colorutils.css2sixhex(cssColor);
|
|
7
|
+
const hexToFloat = (hh) => Number(`0x${hh}`) / 255;
|
|
8
|
+
return [hexToFloat(sixHex.substr(0, 2)), hexToFloat(sixHex.substr(2, 2)), hexToFloat(sixHex.substr(4, 2))];
|
|
9
|
+
},
|
|
10
|
+
css2sixhex(cssColor) {
|
|
11
|
+
let h = /[0-9a-fA-F]+/.exec(cssColor)[0];
|
|
12
|
+
if (h.length !== 6) {
|
|
13
|
+
const a = h.charAt(0);
|
|
14
|
+
const b = h.charAt(1);
|
|
15
|
+
const c = h.charAt(2);
|
|
16
|
+
h = a + a + b + b + c + c;
|
|
17
|
+
}
|
|
18
|
+
return h;
|
|
19
|
+
},
|
|
20
|
+
triple2css(triple) {
|
|
21
|
+
const floatToHex = (n) => { const n2 = colorutils.clamp(Math.round(n * 255), 0, 255); return (`0${n2.toString(16)}`).slice(-2); };
|
|
22
|
+
return `#${floatToHex(triple[0])}${floatToHex(triple[1])}${floatToHex(triple[2])}`;
|
|
23
|
+
},
|
|
24
|
+
clamp(v, bot, top) {
|
|
25
|
+
return v < bot ? bot : (v > top ? top : v);
|
|
26
|
+
},
|
|
27
|
+
min3(a, b, c) {
|
|
28
|
+
return (a < b) ? (a < c ? a : c) : (b < c ? b : c);
|
|
29
|
+
},
|
|
30
|
+
max3(a, b, c) {
|
|
31
|
+
return (a > b) ? (a > c ? a : c) : (b > c ? b : c);
|
|
32
|
+
},
|
|
33
|
+
colorMin(c) {
|
|
34
|
+
return colorutils.min3(c[0], c[1], c[2]);
|
|
35
|
+
},
|
|
36
|
+
colorMax(c) {
|
|
37
|
+
return colorutils.max3(c[0], c[1], c[2]);
|
|
38
|
+
},
|
|
39
|
+
scale(v, bot, top) {
|
|
40
|
+
return colorutils.clamp(bot + v * (top - bot), 0, 1);
|
|
41
|
+
},
|
|
42
|
+
unscale(v, bot, top) {
|
|
43
|
+
return colorutils.clamp((v - bot) / (top - bot), 0, 1);
|
|
44
|
+
},
|
|
45
|
+
scaleColor(c, bot, top) {
|
|
46
|
+
return [colorutils.scale(c[0], bot, top), colorutils.scale(c[1], bot, top), colorutils.scale(c[2], bot, top)];
|
|
47
|
+
},
|
|
48
|
+
unscaleColor(c, bot, top) {
|
|
49
|
+
return [colorutils.unscale(c[0], bot, top), colorutils.unscale(c[1], bot, top), colorutils.unscale(c[2], bot, top)];
|
|
50
|
+
},
|
|
51
|
+
luminosity(c) {
|
|
52
|
+
return c[0] * 0.30 + c[1] * 0.59 + c[2] * 0.11;
|
|
53
|
+
},
|
|
54
|
+
saturate(c) {
|
|
55
|
+
const min = colorutils.colorMin(c);
|
|
56
|
+
const max = colorutils.colorMax(c);
|
|
57
|
+
if (max - min <= 0)
|
|
58
|
+
return [1.0, 1.0, 1.0];
|
|
59
|
+
return colorutils.unscaleColor(c, min, max);
|
|
60
|
+
},
|
|
61
|
+
blend(c1, c2, t) {
|
|
62
|
+
return [colorutils.scale(t, c1[0], c2[0]), colorutils.scale(t, c1[1], c2[1]), colorutils.scale(t, c1[2], c2[2])];
|
|
63
|
+
},
|
|
64
|
+
invert(c) {
|
|
65
|
+
return [1 - c[0], 1 - c[1], 1 - c[2]];
|
|
66
|
+
},
|
|
67
|
+
complementary(c) {
|
|
68
|
+
const inv = colorutils.invert(c);
|
|
69
|
+
return [
|
|
70
|
+
(inv[0] >= c[0]) ? Math.min(inv[0] * 1.30, 1) : (c[0] * 0.30),
|
|
71
|
+
(inv[1] >= c[1]) ? Math.min(inv[1] * 1.59, 1) : (c[1] * 0.59),
|
|
72
|
+
(inv[2] >= c[2]) ? Math.min(inv[2] * 1.11, 1) : (c[2] * 0.11),
|
|
73
|
+
];
|
|
74
|
+
},
|
|
75
|
+
textColorFromBackgroundColor(bgcolor, _skinName) {
|
|
76
|
+
const white = '#fff';
|
|
77
|
+
const black = '#222';
|
|
78
|
+
return colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5 ? white : black;
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=colorutils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorutils.js","sourceRoot":"","sources":["../../src/editor/colorutils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,QAAgB;QACvB,OAAO,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CAAC,QAAgB;QACzB,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,CAAC,EAAU,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;QACnE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7G,CAAC;IAED,UAAU,CAAC,QAAgB;QACzB,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CA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OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACrF,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code is mostly from the old Etherpad. Please help us to comment this code.
|
|
3
|
+
* This helps other people to understand this code better and helps them to improve it.
|
|
4
|
+
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
|
|
5
|
+
*/
|
|
6
|
+
import AttributePool from "./AttributePool.js";
|
|
7
|
+
export declare const sanitizeUnicode: (s: string) => string;
|
|
8
|
+
export declare const supportedElems: Set<string>;
|
|
9
|
+
interface CCState {
|
|
10
|
+
flags: Record<string, number>;
|
|
11
|
+
localAttribs: string[] | null;
|
|
12
|
+
attribs: Record<string, number>;
|
|
13
|
+
attribString: string;
|
|
14
|
+
lineAttributes: Record<string, any>;
|
|
15
|
+
unsupportedElements: Set<string>;
|
|
16
|
+
listNesting?: number;
|
|
17
|
+
start?: number;
|
|
18
|
+
authorLevel?: number;
|
|
19
|
+
author?: string;
|
|
20
|
+
}
|
|
21
|
+
interface SelectionPoint {
|
|
22
|
+
node: Node;
|
|
23
|
+
index: number;
|
|
24
|
+
}
|
|
25
|
+
interface SelectionInfo {
|
|
26
|
+
startPoint?: SelectionPoint;
|
|
27
|
+
endPoint?: SelectionPoint;
|
|
28
|
+
}
|
|
29
|
+
interface ContentCollector {
|
|
30
|
+
startNewLine: (state: CCState | null) => void;
|
|
31
|
+
notifySelection: (sel: SelectionInfo | null) => void;
|
|
32
|
+
doAttrib: (state: CCState, na: string) => void;
|
|
33
|
+
collectContent: (this: ContentCollector, node: Node, state?: CCState) => void;
|
|
34
|
+
notifyNextNode: (node: Node | null) => void;
|
|
35
|
+
getLines: () => string[];
|
|
36
|
+
finish: () => {
|
|
37
|
+
selStart: number[];
|
|
38
|
+
selEnd: number[];
|
|
39
|
+
linesWrapped: number;
|
|
40
|
+
numLinesAfter: number;
|
|
41
|
+
lines: string[];
|
|
42
|
+
lineAttribs: string[];
|
|
43
|
+
};
|
|
44
|
+
incrementFlag: (state: CCState, flagName: string) => void;
|
|
45
|
+
decrementFlag: (state: CCState, flagName: string) => void;
|
|
46
|
+
incrementAttrib: (state: CCState, attribName: string) => void;
|
|
47
|
+
decrementAttrib: (state: CCState, attribName: string) => void;
|
|
48
|
+
breakLine?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const makeContentCollector: (collectStyles: boolean, abrowser: any, apool: AttributePool, className2Author: (cls: string) => string) => ContentCollector;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=contentcollector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentcollector.d.ts","sourceRoot":"","sources":["../../src/editor/contentcollector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,KAAG,MAA4B,CAAC;AAGzE,eAAO,MAAM,cAAc,aAoBzB,CAAC;AAEH,UAAU,OAAO;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAA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