@ray-js/t-agent-ui-ray 0.0.5-beta-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/LICENSE.md +21 -0
- package/README-zh_CN.md +14 -0
- package/README.md +14 -0
- package/dist/ChatContainer/index.d.ts +9 -0
- package/dist/ChatContainer/index.js +124 -0
- package/dist/ChatContainer/index.less +10 -0
- package/dist/CustomCardRender/index.d.ts +8 -0
- package/dist/CustomCardRender/index.js +21 -0
- package/dist/CustomCardRender/index.less +2 -0
- package/dist/EchartsBlockRender/index.js +73 -0
- package/dist/EchartsBlockRender/index.json +3 -0
- package/dist/EchartsBlockRender/index.less +26 -0
- package/dist/EchartsBlockRender/index.rjs +15 -0
- package/dist/EchartsBlockRender/index.tyml +12 -0
- package/dist/EchartsBlockRender/loading.svg +1 -0
- package/dist/LowCodeCardRender/index.d.ts +8 -0
- package/dist/LowCodeCardRender/index.js +14 -0
- package/dist/LowCodeCardRender/index.less +2 -0
- package/dist/MarkdownRender/BlockParser.d.ts +18 -0
- package/dist/MarkdownRender/BlockParser.js +261 -0
- package/dist/MarkdownRender/index.d.ts +14 -0
- package/dist/MarkdownRender/index.js +72 -0
- package/dist/MarkdownRender/index.less +417 -0
- package/dist/MarkdownRender/theme/dark.less +65 -0
- package/dist/MarkdownRender/theme/light.less +64 -0
- package/dist/MessageInput/AsrInput.d.ts +14 -0
- package/dist/MessageInput/AsrInput.js +78 -0
- package/dist/MessageInput/icons/close-circle.svg +1 -0
- package/dist/MessageInput/icons/image.svg +1 -0
- package/dist/MessageInput/icons/loading.svg +1 -0
- package/dist/MessageInput/icons/plus.svg +1 -0
- package/dist/MessageInput/icons/send.svg +1 -0
- package/dist/MessageInput/icons/text.svg +11 -0
- package/dist/MessageInput/icons/video.svg +1 -0
- package/dist/MessageInput/icons/voice-active.svg +9 -0
- package/dist/MessageInput/icons/voice.svg +1 -0
- package/dist/MessageInput/index.d.ts +9 -0
- package/dist/MessageInput/index.js +246 -0
- package/dist/MessageInput/index.less +289 -0
- package/dist/MessageList/index.d.ts +12 -0
- package/dist/MessageList/index.js +61 -0
- package/dist/MessageList/index.less +19 -0
- package/dist/MessageRender/index.d.ts +10 -0
- package/dist/MessageRender/index.js +34 -0
- package/dist/MessageRender/index.less +14 -0
- package/dist/PrivateImage/index.d.ts +8 -0
- package/dist/PrivateImage/index.js +113 -0
- package/dist/TileRender/index.d.ts +11 -0
- package/dist/TileRender/index.js +32 -0
- package/dist/TileRender/index.less +4 -0
- package/dist/cards/WorkflowReplyCard/index.d.ts +11 -0
- package/dist/cards/WorkflowReplyCard/index.js +67 -0
- package/dist/cards/WorkflowReplyCard/index.less +37 -0
- package/dist/cards/map.d.ts +5 -0
- package/dist/cards/map.js +4 -0
- package/dist/contexts.d.ts +11 -0
- package/dist/contexts.js +16 -0
- package/dist/global.d.ts +19 -0
- package/dist/hooks/context.d.ts +11 -0
- package/dist/hooks/context.js +40 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useAsrInput.d.ts +38 -0
- package/dist/hooks/useAsrInput.js +111 -0
- package/dist/hooks/useBlockInput.d.ts +18 -0
- package/dist/hooks/useBlockInput.js +148 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +3 -0
- package/dist/renderOption.d.ts +2 -0
- package/dist/renderOption.js +76 -0
- package/dist/tiles/BubbleTile/Feedback.d.ts +8 -0
- package/dist/tiles/BubbleTile/Feedback.js +39 -0
- package/dist/tiles/BubbleTile/feedback.less +35 -0
- package/dist/tiles/BubbleTile/index.d.ts +6 -0
- package/dist/tiles/BubbleTile/index.js +123 -0
- package/dist/tiles/BubbleTile/index.less +56 -0
- package/dist/tiles/BubbleTile/notice.svg +1 -0
- package/dist/tiles/BubbleTile/thumb-down-empty.svg +1 -0
- package/dist/tiles/BubbleTile/thumb-up-fill.svg +1 -0
- package/dist/tiles/ButtonsTile/index.d.ts +5 -0
- package/dist/tiles/ButtonsTile/index.js +18 -0
- package/dist/tiles/ButtonsTile/index.less +25 -0
- package/dist/tiles/CardTile/index.d.ts +6 -0
- package/dist/tiles/CardTile/index.js +20 -0
- package/dist/tiles/CardTile/index.less +3 -0
- package/dist/tiles/DocumentsTile/index.d.ts +5 -0
- package/dist/tiles/DocumentsTile/index.js +23 -0
- package/dist/tiles/DocumentsTile/index.less +13 -0
- package/dist/tiles/ImageTile/index.d.ts +5 -0
- package/dist/tiles/ImageTile/index.js +37 -0
- package/dist/tiles/ImageTile/index.less +9 -0
- package/dist/tiles/RecommendationsTile/index.d.ts +5 -0
- package/dist/tiles/RecommendationsTile/index.js +31 -0
- package/dist/tiles/RecommendationsTile/index.less +13 -0
- package/dist/tiles/TextTile/index.d.ts +9 -0
- package/dist/tiles/TextTile/index.js +27 -0
- package/dist/tiles/TextTile/index.less +3 -0
- package/dist/tiles/TimeTile/index.d.ts +5 -0
- package/dist/tiles/TimeTile/index.js +35 -0
- package/dist/tiles/TimeTile/index.less +10 -0
- package/dist/tiles/TipTile/index.d.ts +6 -0
- package/dist/tiles/TipTile/index.js +12 -0
- package/dist/tiles/TipTile/index.less +9 -0
- package/dist/tiles/VideoTile/index.d.ts +5 -0
- package/dist/tiles/VideoTile/index.js +49 -0
- package/dist/tiles/VideoTile/index.less +37 -0
- package/dist/tiles/WorkflowTile/index.d.ts +11 -0
- package/dist/tiles/WorkflowTile/index.js +30 -0
- package/dist/tiles/WorkflowTile/index.less +31 -0
- package/dist/tiles/map.d.ts +3 -0
- package/dist/tiles/map.js +24 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.js +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { Asr, AsrDetectResultState } from '@ray-js/t-agent-plugin-assistant';
|
|
4
|
+
export let AsrErrorCode = /*#__PURE__*/function (AsrErrorCode) {
|
|
5
|
+
AsrErrorCode[AsrErrorCode["SHORT_TIME"] = 0] = "SHORT_TIME";
|
|
6
|
+
return AsrErrorCode;
|
|
7
|
+
}({});
|
|
8
|
+
export class AsrError extends Error {
|
|
9
|
+
constructor(errorCode, message) {
|
|
10
|
+
if (!message) {
|
|
11
|
+
switch (errorCode) {
|
|
12
|
+
case AsrErrorCode.SHORT_TIME:
|
|
13
|
+
message = 'Recording time is too short';
|
|
14
|
+
break;
|
|
15
|
+
default:
|
|
16
|
+
message = 'Unknown error';
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
super(message);
|
|
21
|
+
this.errorCode = errorCode;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
init 初始状态,有返回按钮
|
|
26
|
+
recording 按住说话按钮收音,无按钮
|
|
27
|
+
pending 已有文本,待发送,有清除、发送按钮
|
|
28
|
+
|
|
29
|
+
+-------------------------------------------------------+
|
|
30
|
+
| clear/send |
|
|
31
|
+
↓ |
|
|
32
|
+
+--------+ press +------------+ release +---------+
|
|
33
|
+
| init | ----------> | recording | ----------> | pending |
|
|
34
|
+
+--------+ +------------+ +---------+
|
|
35
|
+
^ | ^ |
|
|
36
|
+
| | | |
|
|
37
|
+
| | | |
|
|
38
|
+
| empty release | | press |
|
|
39
|
+
+-------------------------+ +--------------------------+
|
|
40
|
+
*/
|
|
41
|
+
export function useAsrInput(options) {
|
|
42
|
+
const {
|
|
43
|
+
onError
|
|
44
|
+
} = options;
|
|
45
|
+
const asrRef = useRef(null);
|
|
46
|
+
const [text, setText] = useState('');
|
|
47
|
+
const [currentText, setCurrentText] = useState('');
|
|
48
|
+
const [incomingText, setIncomingText] = useState('');
|
|
49
|
+
const [state, setState] = useState('init');
|
|
50
|
+
const startAt = useRef(0);
|
|
51
|
+
return {
|
|
52
|
+
text,
|
|
53
|
+
setText,
|
|
54
|
+
currentText,
|
|
55
|
+
incomingText,
|
|
56
|
+
state,
|
|
57
|
+
clear: () => {
|
|
58
|
+
setState('init');
|
|
59
|
+
setText('');
|
|
60
|
+
setCurrentText('');
|
|
61
|
+
setIncomingText('');
|
|
62
|
+
},
|
|
63
|
+
press: async () => {
|
|
64
|
+
setState('recording');
|
|
65
|
+
startAt.current = Date.now();
|
|
66
|
+
const initial = text;
|
|
67
|
+
let last = initial;
|
|
68
|
+
setCurrentText(initial);
|
|
69
|
+
setIncomingText('');
|
|
70
|
+
|
|
71
|
+
// 开始录音时
|
|
72
|
+
const asr = Asr.detect(async res => {
|
|
73
|
+
if (res.state === AsrDetectResultState.STARTING || res.state === AsrDetectResultState.END) {
|
|
74
|
+
const full = initial + res.text;
|
|
75
|
+
const incoming = full.slice(last.length);
|
|
76
|
+
setIncomingText(incoming);
|
|
77
|
+
setCurrentText(last);
|
|
78
|
+
setText(full);
|
|
79
|
+
last = full;
|
|
80
|
+
}
|
|
81
|
+
if (res.state === AsrDetectResultState.ERROR) {
|
|
82
|
+
onError(new AsrError(res.errorCode));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
await asr.start();
|
|
87
|
+
asrRef.current = asr;
|
|
88
|
+
} catch (error) {
|
|
89
|
+
onError(error);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
release: async () => {
|
|
93
|
+
if (state !== 'recording') {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (text) {
|
|
97
|
+
setState('pending');
|
|
98
|
+
} else {
|
|
99
|
+
onError(new AsrError(AsrErrorCode.SHORT_TIME));
|
|
100
|
+
setState('init');
|
|
101
|
+
}
|
|
102
|
+
if (Date.now() - startAt.current < 1000) {
|
|
103
|
+
onError(new AsrError(AsrErrorCode.SHORT_TIME));
|
|
104
|
+
}
|
|
105
|
+
if (asrRef.current) {
|
|
106
|
+
await asrRef.current.stop();
|
|
107
|
+
asrRef.current = null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputBlock } from '@ray-js/t-agent';
|
|
3
|
+
export interface UploadFile {
|
|
4
|
+
id: string;
|
|
5
|
+
type: 'image' | 'video' | 'loading';
|
|
6
|
+
url?: string;
|
|
7
|
+
thumbUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function useBlockInput(): {
|
|
10
|
+
text: string;
|
|
11
|
+
setText: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
12
|
+
blocks: InputBlock[];
|
|
13
|
+
uploaded: UploadFile[];
|
|
14
|
+
setUploaded: import("react").Dispatch<import("react").SetStateAction<UploadFile[]>>;
|
|
15
|
+
uploading: boolean;
|
|
16
|
+
loadBlocks: (blocks: InputBlock[], append?: boolean) => void;
|
|
17
|
+
upload: (type: 'image' | 'video', count?: any) => Promise<void>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.some.js";
|
|
5
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
6
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
7
|
+
import { chooseImage, chooseVideo, uploadImage, uploadVideo } from '@ray-js/t-agent-plugin-assistant';
|
|
8
|
+
import { generateId } from '@ray-js/t-agent';
|
|
9
|
+
import { useRenderOptions } from './context';
|
|
10
|
+
export function useBlockInput() {
|
|
11
|
+
const [text, setText] = useState('');
|
|
12
|
+
const [uploaded, setUploaded] = useState([]);
|
|
13
|
+
const uploading = useMemo(() => uploaded.some(file => file.type === 'loading'), [uploaded]);
|
|
14
|
+
const blocks = useMemo(() => {
|
|
15
|
+
const blocks = [{
|
|
16
|
+
text,
|
|
17
|
+
type: 'text'
|
|
18
|
+
}];
|
|
19
|
+
if (uploaded.length) {
|
|
20
|
+
for (const uploadFile of uploaded) {
|
|
21
|
+
if (uploadFile.type === 'image') {
|
|
22
|
+
blocks.push({
|
|
23
|
+
type: 'image_url',
|
|
24
|
+
image_url: {
|
|
25
|
+
url: uploadFile.url
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (uploadFile.type === 'video') {
|
|
30
|
+
blocks.push({
|
|
31
|
+
type: 'video_url',
|
|
32
|
+
video_url: {
|
|
33
|
+
url: uploadFile.url,
|
|
34
|
+
thumb_url: uploadFile.thumbUrl
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setUploaded([]);
|
|
40
|
+
}
|
|
41
|
+
return blocks;
|
|
42
|
+
}, [uploaded, text]);
|
|
43
|
+
const loadBlocks = useCallback((blocks, append) => {
|
|
44
|
+
let t = '';
|
|
45
|
+
const uploaded = [];
|
|
46
|
+
for (const block of blocks) {
|
|
47
|
+
if (block.type === 'image_url') {
|
|
48
|
+
uploaded.push({
|
|
49
|
+
id: generateId(),
|
|
50
|
+
type: 'image',
|
|
51
|
+
url: block.image_url.url
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (block.type === 'video_url') {
|
|
55
|
+
uploaded.push({
|
|
56
|
+
id: generateId(),
|
|
57
|
+
type: 'video',
|
|
58
|
+
url: block.video_url.url,
|
|
59
|
+
thumbUrl: block.video_url.thumb_url
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (block.type === 'text') {
|
|
63
|
+
t = block.text;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (append) {
|
|
67
|
+
if (t) {
|
|
68
|
+
setText(t);
|
|
69
|
+
}
|
|
70
|
+
setUploaded(prev => uploaded.length ? [...prev, ...uploaded] : prev);
|
|
71
|
+
} else {
|
|
72
|
+
setText(t);
|
|
73
|
+
setUploaded(uploaded);
|
|
74
|
+
}
|
|
75
|
+
}, []);
|
|
76
|
+
const {
|
|
77
|
+
getStaticResourceBizType
|
|
78
|
+
} = useRenderOptions();
|
|
79
|
+
const upload = useCallback(async function (type) {
|
|
80
|
+
let count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
81
|
+
if (type === 'image') {
|
|
82
|
+
let paths = [];
|
|
83
|
+
try {
|
|
84
|
+
paths = await chooseImage(count);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
await Promise.all(paths.map(async path => {
|
|
89
|
+
const id = generateId();
|
|
90
|
+
try {
|
|
91
|
+
setUploaded(prev => [...prev, {
|
|
92
|
+
id,
|
|
93
|
+
type: 'loading'
|
|
94
|
+
}]);
|
|
95
|
+
const {
|
|
96
|
+
publicUrl
|
|
97
|
+
} = await uploadImage(path, getStaticResourceBizType(path, 'image:upload'));
|
|
98
|
+
setUploaded(prev => prev.map(item => item.id === id ? {
|
|
99
|
+
id,
|
|
100
|
+
type: 'image',
|
|
101
|
+
url: publicUrl
|
|
102
|
+
} : item));
|
|
103
|
+
} catch (error) {
|
|
104
|
+
setUploaded(prev => prev.filter(item => item.id !== id));
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
if (type === 'video') {
|
|
110
|
+
let files = [];
|
|
111
|
+
try {
|
|
112
|
+
files = await chooseVideo(count);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
// pass
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
await Promise.all(files.map(async file => {
|
|
118
|
+
const id = generateId();
|
|
119
|
+
setUploaded(prev => [...prev, {
|
|
120
|
+
id,
|
|
121
|
+
type: 'loading'
|
|
122
|
+
}]);
|
|
123
|
+
try {
|
|
124
|
+
const [thumb, video] = await Promise.all([uploadImage(file.thumbTempFilePath, getStaticResourceBizType(file.thumbTempFilePath, 'videoThumb:upload')), uploadVideo(file.tempFilePath, getStaticResourceBizType(file.tempFilePath, 'video:upload'))]);
|
|
125
|
+
setUploaded(prev => prev.map(item => item.id === id ? {
|
|
126
|
+
id,
|
|
127
|
+
type: 'video',
|
|
128
|
+
url: video.publicUrl,
|
|
129
|
+
thumbUrl: thumb.publicUrl
|
|
130
|
+
} : item));
|
|
131
|
+
} catch (error) {
|
|
132
|
+
setUploaded(prev => prev.filter(item => item.id !== id));
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
}, [getStaticResourceBizType]);
|
|
138
|
+
return {
|
|
139
|
+
text,
|
|
140
|
+
setText,
|
|
141
|
+
blocks,
|
|
142
|
+
uploaded,
|
|
143
|
+
setUploaded,
|
|
144
|
+
uploading,
|
|
145
|
+
loadBlocks,
|
|
146
|
+
upload
|
|
147
|
+
};
|
|
148
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ChatContainer from './ChatContainer';
|
|
2
|
+
import MessageInput from './MessageInput';
|
|
3
|
+
import MessageList from './MessageList';
|
|
4
|
+
import MessageRender from './MessageRender';
|
|
5
|
+
import TileRender from './TileRender';
|
|
6
|
+
import PrivateImage from './PrivateImage';
|
|
7
|
+
import MarkdownRender from './MarkdownRender';
|
|
8
|
+
import { tileMap } from './tiles/map';
|
|
9
|
+
export * from './hooks/context';
|
|
10
|
+
export * from './contexts';
|
|
11
|
+
export * from './renderOption';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './hooks';
|
|
14
|
+
export { ChatContainer, MessageInput, MessageList, MessageRender, MarkdownRender, TileRender, PrivateImage, tileMap, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ChatContainer from './ChatContainer';
|
|
2
|
+
import MessageInput from './MessageInput';
|
|
3
|
+
import MessageList from './MessageList';
|
|
4
|
+
import MessageRender from './MessageRender';
|
|
5
|
+
import TileRender from './TileRender';
|
|
6
|
+
import PrivateImage from './PrivateImage';
|
|
7
|
+
import MarkdownRender from './MarkdownRender';
|
|
8
|
+
import { tileMap } from './tiles/map';
|
|
9
|
+
export * from './hooks/context';
|
|
10
|
+
export * from './contexts';
|
|
11
|
+
export * from './renderOption';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './hooks';
|
|
14
|
+
export { ChatContainer, MessageInput, MessageList, MessageRender, MarkdownRender, TileRender, PrivateImage, tileMap };
|
package/dist/logger.d.ts
ADDED
package/dist/logger.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
const _excluded = ["tile"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { ChatCardType } from '@ray-js/t-agent';
|
|
7
|
+
import TipTile from './tiles/TipTile';
|
|
8
|
+
import { tileMap } from './tiles/map';
|
|
9
|
+
import EchartsBlockRender from './EchartsBlockRender';
|
|
10
|
+
import logger from './logger';
|
|
11
|
+
import LowCodeCardRender from './LowCodeCardRender';
|
|
12
|
+
import { cardMap } from './cards/map';
|
|
13
|
+
import CustomCardRender from './CustomCardRender';
|
|
14
|
+
const defaultChatTileAs = props => {
|
|
15
|
+
const {
|
|
16
|
+
tile
|
|
17
|
+
} = props,
|
|
18
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
const Tile = tileMap[tile.type];
|
|
20
|
+
if (!Tile) {
|
|
21
|
+
logger.warn('Unknown tile type:', tile.type, tile);
|
|
22
|
+
if (tile.fallback) {
|
|
23
|
+
const _tile = _objectSpread(_objectSpread({}, tile), {}, {
|
|
24
|
+
data: tile.fallback
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/React.createElement(TipTile, _extends({
|
|
27
|
+
tile: _tile
|
|
28
|
+
}, rest));
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/React.createElement(Tile, _extends({
|
|
33
|
+
tile: tile
|
|
34
|
+
}, rest));
|
|
35
|
+
};
|
|
36
|
+
const defaultRenderCustomBlockAs = block => {
|
|
37
|
+
if (block.type === 'echarts') {
|
|
38
|
+
return /*#__PURE__*/React.createElement(EchartsBlockRender, {
|
|
39
|
+
content: block.children,
|
|
40
|
+
canvasId: block.id
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
const defaultCustomBlockTypes = ['echarts'];
|
|
46
|
+
const defaultRenderCardAs = card => {
|
|
47
|
+
if (card.cardType === ChatCardType.LOW_CODE) {
|
|
48
|
+
return /*#__PURE__*/React.createElement(LowCodeCardRender, {
|
|
49
|
+
card: card
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (card.cardType === ChatCardType.BUILD_IN) {
|
|
53
|
+
const Card = cardMap[card.cardCode];
|
|
54
|
+
if (!Card) {
|
|
55
|
+
logger.warn('Unknown card type:', card.cardCode, card);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
59
|
+
card: card
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (card.cardType === ChatCardType.CUSTOM) {
|
|
63
|
+
return /*#__PURE__*/React.createElement(CustomCardRender, {
|
|
64
|
+
card: card
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
export const defaultRenderOptions = {
|
|
70
|
+
renderTileAs: defaultChatTileAs,
|
|
71
|
+
renderCustomBlockAs: defaultRenderCustomBlockAs,
|
|
72
|
+
customBlockTypes: defaultCustomBlockTypes,
|
|
73
|
+
renderCardAs: defaultRenderCardAs,
|
|
74
|
+
customCardMap: {},
|
|
75
|
+
getStaticResourceBizType: () => ''
|
|
76
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { View } from '@ray-js/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './feedback.less';
|
|
4
|
+
function Icon(_ref) {
|
|
5
|
+
let {
|
|
6
|
+
type,
|
|
7
|
+
selected,
|
|
8
|
+
onClick
|
|
9
|
+
} = _ref;
|
|
10
|
+
if (type === 'good') {
|
|
11
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
12
|
+
onClick: onClick,
|
|
13
|
+
className: "t-agent-bubble-tile-feedback-icon t-agent-bubble-tile-feedback-icon-good".concat(selected ? '-select' : '')
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
17
|
+
onClick: onClick,
|
|
18
|
+
className: "t-agent-bubble-tile-feedback-icon t-agent-bubble-tile-feedback-icon-bad".concat(selected ? '-select' : '')
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export default function Feedback(props) {
|
|
22
|
+
const {
|
|
23
|
+
value,
|
|
24
|
+
onChange
|
|
25
|
+
} = props;
|
|
26
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
className: "t-agent-bubble-tile-feedback"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
+
type: "good",
|
|
30
|
+
key: "good",
|
|
31
|
+
selected: value === 10,
|
|
32
|
+
onClick: () => onChange(10)
|
|
33
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
34
|
+
type: "bad",
|
|
35
|
+
key: "bad",
|
|
36
|
+
selected: value === 0,
|
|
37
|
+
onClick: () => onChange(0)
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.t-agent-bubble-tile-feedback {
|
|
2
|
+
margin-top: 36rpx;
|
|
3
|
+
text-align: right;
|
|
4
|
+
line-height: 32rpx;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.t-agent-bubble-tile-feedback-icon {
|
|
8
|
+
width: 32rpx;
|
|
9
|
+
height: 32rpx;
|
|
10
|
+
margin-left: 32rpx;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.t-agent-bubble-tile-feedback-icon-good {
|
|
15
|
+
background: url("./thumb-down-empty.svg") no-repeat;
|
|
16
|
+
background-size: contain;
|
|
17
|
+
transform: scale(1, -1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.t-agent-bubble-tile-feedback-icon-good-select {
|
|
21
|
+
background: url("./thumb-up-fill.svg") no-repeat;
|
|
22
|
+
background-size: contain;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
.t-agent-bubble-tile-feedback-icon-bad {
|
|
27
|
+
background: url("./thumb-down-empty.svg") no-repeat;
|
|
28
|
+
background-size: contain;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.t-agent-bubble-tile-feedback-icon-bad-select {
|
|
32
|
+
background: url("./thumb-up-fill.svg") no-repeat;
|
|
33
|
+
background-size: contain;
|
|
34
|
+
transform: scale(1, -1);
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BubbleTileData } from '@ray-js/t-agent';
|
|
4
|
+
import { TileProps } from '../../types';
|
|
5
|
+
declare const _default: React.MemoExoticComponent<(props: TileProps<BubbleTileData, any>) => React.JSX.Element>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import "core-js/modules/es.json.stringify.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
3
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
4
|
+
import './index.less';
|
|
5
|
+
import { Text, View } from '@ray-js/components';
|
|
6
|
+
import React, { useEffect, useState } from 'react';
|
|
7
|
+
import { getStorage, Image, showToast, setStorage } from '@ray-js/ray';
|
|
8
|
+
import { BubbleTileStatus, ChatMessageStatus, safeParseJSON } from '@ray-js/t-agent';
|
|
9
|
+
import { getCurrentHomeInfo, submitEvaluation } from '@ray-js/t-agent-plugin-assistant';
|
|
10
|
+
import TileRender from '../../TileRender';
|
|
11
|
+
import Feedback from './Feedback';
|
|
12
|
+
import noticeSvg from './notice.svg';
|
|
13
|
+
import { useChatAgent } from '../../hooks';
|
|
14
|
+
const BubbleTile = props => {
|
|
15
|
+
var _message$meta$request;
|
|
16
|
+
const agent = useChatAgent();
|
|
17
|
+
const {
|
|
18
|
+
message,
|
|
19
|
+
tile,
|
|
20
|
+
isLatestMessage,
|
|
21
|
+
side
|
|
22
|
+
} = props;
|
|
23
|
+
const {
|
|
24
|
+
status,
|
|
25
|
+
role
|
|
26
|
+
} = message;
|
|
27
|
+
const {
|
|
28
|
+
children,
|
|
29
|
+
data
|
|
30
|
+
} = tile;
|
|
31
|
+
const bubbleStatus = data.status || BubbleTileStatus.NORMAL;
|
|
32
|
+
const loading = status === ChatMessageStatus.START || status === ChatMessageStatus.UPDATING;
|
|
33
|
+
const showFeedback = isLatestMessage && status === ChatMessageStatus.FINISH && role === 'assistant' && ((_message$meta$request = message.meta.requestId) === null || _message$meta$request === void 0 ? void 0 : _message$meta$request.startsWith('AIAssistant')) && bubbleStatus === BubbleTileStatus.NORMAL;
|
|
34
|
+
const [feedbackLoaded, setFeedbackLoaded] = useState(false);
|
|
35
|
+
const [feedbackValue, setFeedbackValue] = useState(null);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
getStorage({
|
|
38
|
+
key: 'latestMessageFeedbackValue',
|
|
39
|
+
success: res => {
|
|
40
|
+
if (res.data) {
|
|
41
|
+
try {
|
|
42
|
+
const {
|
|
43
|
+
requestId,
|
|
44
|
+
value
|
|
45
|
+
} = safeParseJSON(res.data);
|
|
46
|
+
if (requestId === message.meta.requestId) {
|
|
47
|
+
setFeedbackValue(value);
|
|
48
|
+
}
|
|
49
|
+
} catch (e) {
|
|
50
|
+
// noop
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
setFeedbackLoaded(true);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}, []);
|
|
57
|
+
const showInfo = () => {
|
|
58
|
+
if (data.info) {
|
|
59
|
+
ty.showToast({
|
|
60
|
+
title: data.info,
|
|
61
|
+
icon: 'none'
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
66
|
+
className: "t-agent-bubble-tile t-agent-bubble-tile-".concat(side),
|
|
67
|
+
onLongPress: () => {
|
|
68
|
+
showToast({
|
|
69
|
+
title: 'long press'
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, bubbleStatus === BubbleTileStatus.ERROR && side === 'end' && /*#__PURE__*/React.createElement(Image, {
|
|
73
|
+
onClick: showInfo,
|
|
74
|
+
src: noticeSvg,
|
|
75
|
+
className: "t-agent-bubble-tile-error"
|
|
76
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
77
|
+
className: "t-agent-bubble-tile-bubble ".concat(loading ? 't-agent-bubble-tile-bubble-loading' : '')
|
|
78
|
+
}, children.map(t => {
|
|
79
|
+
return /*#__PURE__*/React.createElement(TileRender, {
|
|
80
|
+
side: side,
|
|
81
|
+
tile: t,
|
|
82
|
+
message: message,
|
|
83
|
+
key: t.id,
|
|
84
|
+
isLatestMessage: isLatestMessage
|
|
85
|
+
});
|
|
86
|
+
}), status === ChatMessageStatus.START && /*#__PURE__*/React.createElement(Text, {
|
|
87
|
+
className: "t-agent-bubble-tile-bubble-loader"
|
|
88
|
+
}, "..."), showFeedback && feedbackLoaded && /*#__PURE__*/React.createElement(Feedback, {
|
|
89
|
+
value: feedbackValue,
|
|
90
|
+
onChange: async value => {
|
|
91
|
+
const channel = agent.session.get('AIAssistant.channel');
|
|
92
|
+
if (!message.meta.requestId || !channel) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
setFeedbackValue(value);
|
|
96
|
+
const {
|
|
97
|
+
homeId
|
|
98
|
+
} = await getCurrentHomeInfo();
|
|
99
|
+
await submitEvaluation({
|
|
100
|
+
homeId,
|
|
101
|
+
requestId: message.meta.requestId,
|
|
102
|
+
score: value,
|
|
103
|
+
channel
|
|
104
|
+
});
|
|
105
|
+
setStorage({
|
|
106
|
+
key: 'latestMessageFeedbackValue',
|
|
107
|
+
data: JSON.stringify({
|
|
108
|
+
requestId: message.meta.requestId,
|
|
109
|
+
value
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
showToast({
|
|
113
|
+
title: I18n.t('chat.feedback.success'),
|
|
114
|
+
icon: 'none'
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
})), bubbleStatus === BubbleTileStatus.ERROR && side === 'start' && /*#__PURE__*/React.createElement(Image, {
|
|
118
|
+
onClick: showInfo,
|
|
119
|
+
src: noticeSvg,
|
|
120
|
+
className: "t-agent-bubble-tile-error"
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
123
|
+
export default /*#__PURE__*/React.memo(BubbleTile);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.t-agent-bubble-tile {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.t-agent-bubble-tile-error {
|
|
7
|
+
width: 32rpx;
|
|
8
|
+
height: 32rpx;
|
|
9
|
+
margin: 0 18rpx;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.t-agent-bubble-tile-bubble {
|
|
13
|
+
width: fit-content;
|
|
14
|
+
max-width: 612rpx;
|
|
15
|
+
min-height: 88rpx;
|
|
16
|
+
font-size: 32rpx;
|
|
17
|
+
line-height: 44rpx;
|
|
18
|
+
color: var(--app-M1-N1);
|
|
19
|
+
background-color: var(--app-M1);
|
|
20
|
+
border-radius: 32rpx;
|
|
21
|
+
padding: 24rpx;
|
|
22
|
+
transition: all 0.2s ease-in-out;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.t-agent-bubble-tile-start {
|
|
27
|
+
.t-agent-bubble-tile-bubble {
|
|
28
|
+
border-bottom-left-radius: 4rpx;
|
|
29
|
+
color: var(--app-B3-N1);
|
|
30
|
+
background-color: var(--app-B3);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.t-agent-bubble-tile-end {
|
|
35
|
+
.t-agent-bubble-tile-bubble {
|
|
36
|
+
border-bottom-right-radius: 4rpx;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.t-agent-bubble-tile-start {
|
|
41
|
+
.t-agent-bubble-tile-bubble {
|
|
42
|
+
border-bottom-left-radius: 4rpx;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@keyframes t-agent-bubble-tile-blink {
|
|
47
|
+
0%, 100% {
|
|
48
|
+
opacity: 0.5;
|
|
49
|
+
}
|
|
50
|
+
50% {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.t-agent-bubble-tile-bubble-loader {
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><path d="M8,15Q8.17184,15,8.34347,14.9916Q8.51511,14.9831,8.686119999999999,14.9663Q8.85713,14.9494,9.02711,14.9242Q9.19709,14.899,9.36563,14.8655Q9.53417,14.832,9.70086,14.7902Q9.86755,14.7485,10.03199,14.6986Q10.19643,14.6487,10.35823,14.5908Q10.52002,14.5329,10.67878,14.4672Q10.83754,14.4014,10.99288,14.3279Q11.1482,14.2545,11.2998,14.1734Q11.4513,14.0924,11.5987,14.0041Q11.7461,13.9158,11.889,13.8203Q12.0319,13.7248,12.1699,13.6225Q12.3079,13.5201,12.4408,13.4111Q12.5736,13.3021,12.7009,13.1867Q12.8282,13.0713,12.9497,12.9497Q13.0713,12.8282,13.1867,12.7009Q13.3021,12.5736,13.4111,12.4408Q13.5201,12.3079,13.6225,12.1699Q13.7248,12.0319,13.8203,11.889Q13.9158,11.7461,14.0041,11.5987Q14.0924,11.4513,14.1734,11.2998Q14.2545,11.1482,14.3279,10.99288Q14.4014,10.83754,14.4672,10.67878Q14.5329,10.52002,14.5908,10.35823Q14.6487,10.19643,14.6986,10.03199Q14.7485,9.86755,14.7902,9.70086Q14.832,9.53417,14.8655,9.36563Q14.899,9.19709,14.9242,9.02711Q14.9494,8.85713,14.9663,8.686119999999999Q14.9831,8.51511,14.9916,8.34347Q15,8.17184,15,8Q15,7.82816,14.9916,7.65653Q14.9831,7.48489,14.9663,7.31388Q14.9494,7.14287,14.9242,6.97289Q14.899,6.80291,14.8655,6.63437Q14.832,6.46583,14.7902,6.29914Q14.7485,6.13245,14.6986,5.96801Q14.6487,5.80357,14.5908,5.64177Q14.5329,5.47998,14.4672,5.32122Q14.4014,5.16246,14.3279,5.00711Q14.2545,4.85177,14.1734,4.70022Q14.0924,4.5486699999999995,14.0041,4.40128Q13.9158,4.25389,13.8203,4.11101Q13.7248,3.96813,13.6225,3.8301Q13.5201,3.69208,13.4111,3.55925Q13.3021,3.42641,13.1867,3.29909Q13.0713,3.17176,12.9497,3.05025Q12.8282,2.92874,12.7009,2.81334Q12.5736,2.69794,12.4408,2.58893Q12.3079,2.4799100000000003,12.1699,2.3775500000000003Q12.0319,2.2751799999999998,11.889,2.17971Q11.7461,2.0842400000000003,11.5987,1.9959Q11.4513,1.907556,11.2998,1.826551Q11.1482,1.745546,10.99288,1.672075Q10.83754,1.598604,10.67878,1.532843Q10.52002,1.4670830000000001,10.35823,1.409191Q10.19643,1.3513,10.03199,1.301418Q9.86755,1.251535,9.70086,1.209781Q9.53417,1.168027,9.36563,1.134503Q9.19709,1.100979,9.02711,1.0757644Q8.85713,1.0505502,8.686119999999999,1.0337069Q8.51511,1.0168636,8.34347,1.0084318Q8.17184,1,8,1Q7.82816,1,7.65653,1.0084318Q7.48489,1.0168636,7.31388,1.0337069Q7.14287,1.0505502,6.97289,1.0757644Q6.80291,1.100979,6.63437,1.134503Q6.46583,1.168027,6.29914,1.209781Q6.13245,1.251535,5.96801,1.301418Q5.80357,1.3513,5.64177,1.409191Q5.47998,1.4670830000000001,5.32122,1.532843Q5.16246,1.598604,5.00711,1.672075Q4.85177,1.745546,4.70022,1.826551Q4.5486699999999995,1.907556,4.40128,1.995899Q4.25389,2.0842400000000003,4.11101,2.17971Q3.96813,2.2751799999999998,3.8301,2.3775500000000003Q3.69208,2.4799100000000003,3.55925,2.58893Q3.42641,2.69794,3.29909,2.81334Q3.17176,2.92874,3.05025,3.05025Q2.92874,3.17176,2.81334,3.29909Q2.69794,3.42641,2.58893,3.55925Q2.4799100000000003,3.69208,2.3775500000000003,3.8301Q2.2751799999999998,3.96813,2.17971,4.11101Q2.0842400000000003,4.25389,1.9959,4.40128Q1.907556,4.5486699999999995,1.826551,4.70022Q1.745546,4.85177,1.672075,5.00711Q1.598604,5.16246,1.532843,5.32122Q1.4670830000000001,5.47998,1.409191,5.64177Q1.3513,5.80357,1.301418,5.96801Q1.251535,6.13245,1.209781,6.29914Q1.168027,6.46583,1.134503,6.63437Q1.100979,6.80291,1.0757644,6.97289Q1.0505502,7.14287,1.0337069,7.31388Q1.0168636,7.48489,1.0084318,7.65653Q1,7.82816,1,8Q1,8.17184,1.0084318,8.34347Q1.0168636,8.51511,1.0337069,8.686119999999999Q1.0505502,8.85713,1.0757644,9.02711Q1.100979,9.19709,1.134503,9.36563Q1.168027,9.53417,1.209781,9.70086Q1.251535,9.86755,1.301418,10.03199Q1.3513,10.19643,1.409191,10.35823Q1.4670830000000001,10.52002,1.532843,10.67878Q1.598604,10.83754,1.672075,10.99288Q1.745546,11.1482,1.826551,11.2998Q1.907556,11.4513,1.995899,11.5987Q2.0842400000000003,11.7461,2.17971,11.889Q2.2751799999999998,12.0319,2.3775500000000003,12.1699Q2.4799100000000003,12.3079,2.58893,12.4408Q2.69794,12.5736,2.81334,12.7009Q2.92874,12.8282,3.05025,12.9497Q3.17176,13.0713,3.29909,13.1867Q3.42641,13.3021,3.55925,13.4111Q3.69208,13.5201,3.8301,13.6225Q3.96813,13.7248,4.11101,13.8203Q4.25389,13.9158,4.40128,14.0041Q4.5486699999999995,14.0924,4.70022,14.1734Q4.85177,14.2545,5.00711,14.3279Q5.16246,14.4014,5.32122,14.4672Q5.47998,14.5329,5.64177,14.5908Q5.80357,14.6487,5.96801,14.6986Q6.13245,14.7485,6.29914,14.7902Q6.46583,14.832,6.63437,14.8655Q6.80291,14.899,6.97289,14.9242Q7.14287,14.9494,7.31388,14.9663Q7.48489,14.9831,7.65653,14.9916Q7.82816,15,8,15ZM8.74315,4.39823C8.69349,4.03215,8.3797,3.75,8,3.75C7.58579,3.75,7.25,4.085789999999999,7.25,4.5L7.25,8.5L7.25685,8.60177C7.30651,8.96785,7.6203,9.25,8,9.25C8.41421,9.25,8.75,8.91421,8.75,8.5L8.75,4.5L8.74315,4.39823ZM8,12Q8.09849,12,8.19509,11.9808Q8.29169,11.9616,8.38268,11.9239Q8.47368,11.8862,8.55557,11.8315Q8.63746,11.7767,8.70711,11.7071Q8.77675,11.6375,8.83147,11.5556Q8.88619,11.4737,8.92388,11.3827Q8.96157,11.2917,8.98078,11.1951Q9,11.0985,9,11Q9,10.90151,8.98078,10.80491Q8.96157,10.70831,8.92388,10.61732Q8.88619,10.52632,8.83147,10.44443Q8.77675,10.36254,8.70711,10.29289Q8.63746,10.22325,8.55557,10.16853Q8.47368,10.11381,8.38268,10.07612Q8.29169,10.03843,8.19509,10.01921Q8.09849,10,8,10Q7.90151,10,7.80491,10.01921Q7.70831,10.03843,7.61732,10.07612Q7.52632,10.11381,7.44443,10.16853Q7.36254,10.22325,7.29289,10.29289Q7.22325,10.36254,7.16853,10.44443Q7.11381,10.52632,7.07612,10.61732Q7.03843,10.70831,7.01921,10.80491Q7,10.90151,7,11Q7,11.0985,7.01921,11.1951Q7.03843,11.2917,7.07612,11.3827Q7.11381,11.4737,7.16853,11.5556Q7.22325,11.6375,7.29289,11.7071Q7.36254,11.7767,7.44443,11.8315Q7.52632,11.8862,7.61732,11.9239Q7.70831,11.9616,7.80491,11.9808Q7.90151,12,8,12Z" fill-rule="evenodd" fill="#F04C4C" fill-opacity="1"/></g></g></svg>
|