@easy-editor/materials-dashboard-text 0.0.15 → 0.0.16
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 +6 -0
- package/dist/component.min.js +1 -2
- package/dist/index.min.js +1 -2
- package/dist/meta.min.js +1 -2
- package/easypack.config.ts +10 -0
- package/package.json +6 -10
- package/src/assets/plain.png +0 -0
- package/src/component.module.css +58 -0
- package/src/component.tsx +261 -0
- package/src/configure.ts +384 -0
- package/{dist/src/constants.d.ts → src/constants.ts} +17 -16
- package/src/index.tsx +7 -0
- package/src/meta.ts +26 -0
- package/src/snippets.ts +151 -0
- package/src/type.d.ts +8 -0
- package/tsconfig.json +20 -9
- package/.vite/plugins/vite-plugin-external-deps.ts +0 -224
- package/.vite/plugins/vite-plugin-material-dev.ts +0 -218
- package/dist/component.esm.js +0 -134
- package/dist/component.esm.js.map +0 -1
- package/dist/component.js +0 -143
- package/dist/component.js.map +0 -1
- package/dist/component.min.js.map +0 -1
- package/dist/index.cjs +0 -513
- package/dist/index.cjs.map +0 -1
- package/dist/index.esm.js +0 -510
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -518
- package/dist/index.js.map +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist/meta.esm.js +0 -380
- package/dist/meta.esm.js.map +0 -1
- package/dist/meta.js +0 -388
- package/dist/meta.js.map +0 -1
- package/dist/meta.min.js.map +0 -1
- package/dist/src/component.d.ts +0 -48
- package/dist/src/configure.d.ts +0 -6
- package/dist/src/index.d.ts +0 -6
- package/dist/src/meta.d.ts +0 -6
- package/dist/src/snippets.d.ts +0 -6
- package/vite.config.ts +0 -54
package/dist/component.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/* @easy-editor/materials-dashboard-text v0.0.15 (component) */
|
|
2
|
-
(function (global, factory) {
|
|
3
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime')) :
|
|
4
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime'], factory) :
|
|
5
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorMaterialsTextComponent = {}, global.jsxRuntime));
|
|
6
|
-
})(this, (function (exports, jsxRuntime) { 'use strict';
|
|
7
|
-
|
|
8
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
9
|
-
|
|
10
|
-
function cn(...inputs) {
|
|
11
|
-
return clsx(inputs);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function styleInject(css, ref) {
|
|
15
|
-
if (ref === void 0) ref = {};
|
|
16
|
-
var insertAt = ref.insertAt;
|
|
17
|
-
if (typeof document === 'undefined') {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
21
|
-
var style = document.createElement('style');
|
|
22
|
-
style.type = 'text/css';
|
|
23
|
-
if (insertAt === 'top') {
|
|
24
|
-
if (head.firstChild) {
|
|
25
|
-
head.insertBefore(style, head.firstChild);
|
|
26
|
-
} else {
|
|
27
|
-
head.appendChild(style);
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
head.appendChild(style);
|
|
31
|
-
}
|
|
32
|
-
if (style.styleSheet) {
|
|
33
|
-
style.styleSheet.cssText = css;
|
|
34
|
-
} else {
|
|
35
|
-
style.appendChild(document.createTextNode(css));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var css_248z = ".component-module__container___VbZSk{display:flex;height:100%;width:100%}.component-module__text___nFUOn{display:inline-block;word-break:break-word}.component-module__link___20asF{cursor:pointer;text-decoration:none;transition:opacity .2s ease}.component-module__link___20asF:hover{opacity:.8}.component-module__underline___0oAJz{text-decoration:underline}.component-module__alignLeft___IOvpO{justify-content:flex-start;text-align:left}.component-module__alignCenter___EIwIC{justify-content:center;text-align:center}.component-module__alignRight___p3ReL{justify-content:flex-end;text-align:right}.component-module__valignTop___-5DmK{align-items:flex-start}.component-module__valignMiddle___i0are{align-items:center}.component-module__valignBottom___97zzw{align-items:flex-end}";
|
|
40
|
-
var styles = {"container":"component-module__container___VbZSk","text":"component-module__text___nFUOn","link":"component-module__link___20asF","underline":"component-module__underline___0oAJz","alignLeft":"component-module__alignLeft___IOvpO","alignCenter":"component-module__alignCenter___EIwIC","alignRight":"component-module__alignRight___p3ReL","valignTop":"component-module__valignTop___-5DmK","valignMiddle":"component-module__valignMiddle___i0are","valignBottom":"component-module__valignBottom___97zzw"};
|
|
41
|
-
styleInject(css_248z);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Text Component
|
|
45
|
-
* 文本组件 - 支持普通文本、链接、标题、发光效果
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
const getAlignClass = align => {
|
|
49
|
-
switch (align) {
|
|
50
|
-
case 'left':
|
|
51
|
-
return styles.alignLeft;
|
|
52
|
-
case 'center':
|
|
53
|
-
return styles.alignCenter;
|
|
54
|
-
case 'right':
|
|
55
|
-
return styles.alignRight;
|
|
56
|
-
default:
|
|
57
|
-
return styles.alignLeft;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const getValignClass = align => {
|
|
61
|
-
switch (align) {
|
|
62
|
-
case 'top':
|
|
63
|
-
return styles.valignTop;
|
|
64
|
-
case 'middle':
|
|
65
|
-
return styles.valignMiddle;
|
|
66
|
-
case 'bottom':
|
|
67
|
-
return styles.valignBottom;
|
|
68
|
-
default:
|
|
69
|
-
return styles.valignMiddle;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const Text = ({
|
|
73
|
-
ref,
|
|
74
|
-
content = '文本内容',
|
|
75
|
-
fontSize = 16,
|
|
76
|
-
fontWeight = 'normal',
|
|
77
|
-
fontFamily = 'inherit',
|
|
78
|
-
color = '#ffffff',
|
|
79
|
-
textAlign = 'left',
|
|
80
|
-
verticalAlign = 'middle',
|
|
81
|
-
lineHeight = 1.5,
|
|
82
|
-
letterSpacing = 0,
|
|
83
|
-
isLink = false,
|
|
84
|
-
href = '',
|
|
85
|
-
target = '_blank',
|
|
86
|
-
underline = false,
|
|
87
|
-
glowEnable = false,
|
|
88
|
-
glowColor = '#00d4ff',
|
|
89
|
-
glowIntensity = 1,
|
|
90
|
-
style: externalStyle
|
|
91
|
-
}) => {
|
|
92
|
-
// 计算发光效果
|
|
93
|
-
const textShadow = glowEnable ? `0 0 ${10 * glowIntensity}px ${glowColor}, 0 0 ${20 * glowIntensity}px ${glowColor}, 0 0 ${30 * glowIntensity}px ${glowColor}` : undefined;
|
|
94
|
-
const textStyle = {
|
|
95
|
-
fontSize,
|
|
96
|
-
fontWeight,
|
|
97
|
-
fontFamily,
|
|
98
|
-
color,
|
|
99
|
-
lineHeight,
|
|
100
|
-
letterSpacing,
|
|
101
|
-
textShadow
|
|
102
|
-
};
|
|
103
|
-
const containerClass = cn(styles.container, getAlignClass(textAlign), getValignClass(verticalAlign));
|
|
104
|
-
const textClass = cn(styles.text, isLink && styles.link, underline && styles.underline);
|
|
105
|
-
|
|
106
|
-
// 链接模式
|
|
107
|
-
if (isLink && href) {
|
|
108
|
-
const relValue = target === '_blank' ? 'noopener noreferrer' : '';
|
|
109
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
110
|
-
className: containerClass,
|
|
111
|
-
ref: ref,
|
|
112
|
-
style: externalStyle,
|
|
113
|
-
children: /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
114
|
-
className: textClass,
|
|
115
|
-
href: href,
|
|
116
|
-
rel: relValue,
|
|
117
|
-
style: textStyle,
|
|
118
|
-
target: target,
|
|
119
|
-
children: content
|
|
120
|
-
})
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// 普通文本
|
|
125
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
126
|
-
className: containerClass,
|
|
127
|
-
ref: ref,
|
|
128
|
-
style: externalStyle,
|
|
129
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
130
|
-
className: textClass,
|
|
131
|
-
style: textStyle,
|
|
132
|
-
children: [content, " \u65B0\u7248\u672C!"]
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
exports.Text = Text;
|
|
138
|
-
exports.default = Text;
|
|
139
|
-
|
|
140
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
141
|
-
|
|
142
|
-
}));
|
|
143
|
-
//# sourceMappingURL=component.js.map
|
package/dist/component.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../../shared/src/lib/utils.ts","../../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/component.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from 'clsx'\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs)\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Text Component\n * 文本组件 - 支持普通文本、链接、标题、发光效果\n */\n\nimport type { CSSProperties, Ref } from 'react'\nimport { cn } from '@easy-editor/materials-shared'\nimport styles from './component.module.css'\n\nexport type TextAlign = 'left' | 'center' | 'right'\nexport type VerticalAlign = 'top' | 'middle' | 'bottom'\n\nexport interface TextProps {\n ref?: Ref<HTMLDivElement>\n /** 文本内容 */\n content?: string\n /** 字体大小 */\n fontSize?: number\n /** 字体粗细 */\n fontWeight?: number | 'normal' | 'bold'\n /** 字体家族 */\n fontFamily?: string\n /** 颜色 */\n color?: string\n /** 水平对齐 */\n textAlign?: TextAlign\n /** 垂直对齐 */\n verticalAlign?: VerticalAlign\n /** 行高 */\n lineHeight?: number\n /** 字间距 */\n letterSpacing?: number\n /** 是否为链接 */\n isLink?: boolean\n /** 链接地址 */\n href?: string\n /** 链接打开方式 */\n target?: '_self' | '_blank'\n /** 下划线 */\n underline?: boolean\n /** 发光效果 */\n glowEnable?: boolean\n /** 发光颜色 */\n glowColor?: string\n /** 发光强度 */\n glowIntensity?: number\n /** 显隐控制 */\n condition?: boolean\n /** 外部样式 */\n style?: CSSProperties\n}\n\nconst getAlignClass = (align: TextAlign): string => {\n switch (align) {\n case 'left':\n return styles.alignLeft\n case 'center':\n return styles.alignCenter\n case 'right':\n return styles.alignRight\n default:\n return styles.alignLeft\n }\n}\n\nconst getValignClass = (align: VerticalAlign): string => {\n switch (align) {\n case 'top':\n return styles.valignTop\n case 'middle':\n return styles.valignMiddle\n case 'bottom':\n return styles.valignBottom\n default:\n return styles.valignMiddle\n }\n}\n\nexport const Text: React.FC<TextProps> = ({\n ref,\n content = '文本内容',\n fontSize = 16,\n fontWeight = 'normal',\n fontFamily = 'inherit',\n color = '#ffffff',\n textAlign = 'left',\n verticalAlign = 'middle',\n lineHeight = 1.5,\n letterSpacing = 0,\n isLink = false,\n href = '',\n target = '_blank',\n underline = false,\n glowEnable = false,\n glowColor = '#00d4ff',\n glowIntensity = 1,\n style: externalStyle,\n}) => {\n // 计算发光效果\n const textShadow = glowEnable\n ? `0 0 ${10 * glowIntensity}px ${glowColor}, 0 0 ${20 * glowIntensity}px ${glowColor}, 0 0 ${30 * glowIntensity}px ${glowColor}`\n : undefined\n\n const textStyle: CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily,\n color,\n lineHeight,\n letterSpacing,\n textShadow,\n }\n\n const containerClass = cn(styles.container, getAlignClass(textAlign), getValignClass(verticalAlign))\n\n const textClass = cn(styles.text, isLink && styles.link, underline && styles.underline)\n\n // 链接模式\n if (isLink && href) {\n const relValue = target === '_blank' ? 'noopener noreferrer' : ''\n return (\n <div className={containerClass} ref={ref} style={externalStyle}>\n <a className={textClass} href={href} rel={relValue} style={textStyle} target={target}>\n {content}\n </a>\n </div>\n )\n }\n\n // 普通文本\n return (\n <div className={containerClass} ref={ref} style={externalStyle}>\n <span className={textClass} style={textStyle}>\n {content} 新版本!\n </span>\n </div>\n )\n}\n\nexport default Text\n"],"names":["cn","inputs","clsx","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","getAlignClass","align","styles","alignLeft","alignCenter","alignRight","getValignClass","valignTop","valignMiddle","valignBottom","Text","content","fontSize","fontWeight","fontFamily","color","textAlign","verticalAlign","lineHeight","letterSpacing","isLink","href","target","underline","glowEnable","glowColor","glowIntensity","externalStyle","textShadow","undefined","textStyle","containerClass","container","textClass","text","link","relValue","_jsx","className","children","rel","_jsxs"],"mappings":";;;;;;;EAAA,SAAS,CAAC,CAAC,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BACX;OAAM;EAAC,GACJ,CAAC;EAEV;;;;;;;;;;;","x_google_ignoreList":[0,2]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.min.js","sources":["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../../shared/src/lib/utils.ts","../../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/component.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from 'clsx'\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs)\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Text Component\n * 文本组件 - 支持普通文本、链接、标题、发光效果\n */\n\nimport type { CSSProperties, Ref } from 'react'\nimport { cn } from '@easy-editor/materials-shared'\nimport styles from './component.module.css'\n\nexport type TextAlign = 'left' | 'center' | 'right'\nexport type VerticalAlign = 'top' | 'middle' | 'bottom'\n\nexport interface TextProps {\n ref?: Ref<HTMLDivElement>\n /** 文本内容 */\n content?: string\n /** 字体大小 */\n fontSize?: number\n /** 字体粗细 */\n fontWeight?: number | 'normal' | 'bold'\n /** 字体家族 */\n fontFamily?: string\n /** 颜色 */\n color?: string\n /** 水平对齐 */\n textAlign?: TextAlign\n /** 垂直对齐 */\n verticalAlign?: VerticalAlign\n /** 行高 */\n lineHeight?: number\n /** 字间距 */\n letterSpacing?: number\n /** 是否为链接 */\n isLink?: boolean\n /** 链接地址 */\n href?: string\n /** 链接打开方式 */\n target?: '_self' | '_blank'\n /** 下划线 */\n underline?: boolean\n /** 发光效果 */\n glowEnable?: boolean\n /** 发光颜色 */\n glowColor?: string\n /** 发光强度 */\n glowIntensity?: number\n /** 显隐控制 */\n condition?: boolean\n /** 外部样式 */\n style?: CSSProperties\n}\n\nconst getAlignClass = (align: TextAlign): string => {\n switch (align) {\n case 'left':\n return styles.alignLeft\n case 'center':\n return styles.alignCenter\n case 'right':\n return styles.alignRight\n default:\n return styles.alignLeft\n }\n}\n\nconst getValignClass = (align: VerticalAlign): string => {\n switch (align) {\n case 'top':\n return styles.valignTop\n case 'middle':\n return styles.valignMiddle\n case 'bottom':\n return styles.valignBottom\n default:\n return styles.valignMiddle\n }\n}\n\nexport const Text: React.FC<TextProps> = ({\n ref,\n content = '文本内容',\n fontSize = 16,\n fontWeight = 'normal',\n fontFamily = 'inherit',\n color = '#ffffff',\n textAlign = 'left',\n verticalAlign = 'middle',\n lineHeight = 1.5,\n letterSpacing = 0,\n isLink = false,\n href = '',\n target = '_blank',\n underline = false,\n glowEnable = false,\n glowColor = '#00d4ff',\n glowIntensity = 1,\n style: externalStyle,\n}) => {\n // 计算发光效果\n const textShadow = glowEnable\n ? `0 0 ${10 * glowIntensity}px ${glowColor}, 0 0 ${20 * glowIntensity}px ${glowColor}, 0 0 ${30 * glowIntensity}px ${glowColor}`\n : undefined\n\n const textStyle: CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily,\n color,\n lineHeight,\n letterSpacing,\n textShadow,\n }\n\n const containerClass = cn(styles.container, getAlignClass(textAlign), getValignClass(verticalAlign))\n\n const textClass = cn(styles.text, isLink && styles.link, underline && styles.underline)\n\n // 链接模式\n if (isLink && href) {\n const relValue = target === '_blank' ? 'noopener noreferrer' : ''\n return (\n <div className={containerClass} ref={ref} style={externalStyle}>\n <a className={textClass} href={href} rel={relValue} style={textStyle} target={target}>\n {content}\n </a>\n </div>\n )\n }\n\n // 普通文本\n return (\n <div className={containerClass} ref={ref} style={externalStyle}>\n <span className={textClass} style={textStyle}>\n {content} 新版本!\n </span>\n </div>\n )\n}\n\nexport default Text\n"],"names":["r","e","t","f","n","Array","isArray","o","length","cn","inputs","arguments","clsx","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Text","content","fontSize","fontWeight","fontFamily","color","textAlign","verticalAlign","lineHeight","letterSpacing","isLink","href","target","underline","glowEnable","glowColor","glowIntensity","externalStyle","textStyle","textShadow","undefined","containerClass","styles","align","getAlignClass","getValignClass","textClass","relValue","_jsx","className","children","rel","_jsxs"],"mappings":"uUAAA,SAASA,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAE,GAAG,GAAG,iBAAiBH,GAAG,iBAAiBA,EAAEG,GAAGH,OAAO,GAAG,iBAAiBA,EAAE,GAAGI,MAAMC,QAAQL,GAAG,CAAC,IAAIM,EAAEN,EAAEO,OAAO,IAAIN,EAAE,EAAEA,EAAEK,EAAEL,IAAID,EAAEC,KAAKC,EAAEH,EAAEC,EAAEC,OAAOE,IAAIA,GAAG,KAAKA,GAAGD,EAAE,MAAM,IAAIA,KAAKF,EAAEA,EAAEE,KAAKC,IAAIA,GAAG,KAAKA,GAAGD,GAAG,OAAOC,CAAC,CCEzO,SAASK,KAAMC,GACpB,ODHsP,WAAgB,IAAI,IAAIT,EAAEC,EAAEC,EAAE,EAAEC,EAAE,GAAGG,EAAEI,UAAUH,OAAOL,EAAEI,EAAEJ,KAAKF,EAAEU,UAA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