isometrik-plugin-chat-sdk 2.0.9 → 2.0.11
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/cjs/attachment-preview_22.cjs.entry.js +253 -36
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +29 -23
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +19 -8
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +129 -3
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +17 -2
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -1
- package/dist/collection/lib/chat/group-title.js +8 -0
- package/dist/collection/lib/chat/group-title.js.map +1 -0
- package/dist/collection/lib/chat/index.js +2 -0
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/mentioned-users.js +59 -0
- package/dist/collection/lib/chat/mentioned-users.js.map +1 -0
- package/dist/components/ChatFooter.js +87 -23
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/WebChatHeader.js +19 -8
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/WebchatRightSide.js +17 -2
- package/dist/components/WebchatRightSide.js.map +1 -1
- package/dist/components/contact-info2.js +138 -5
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/esm/attachment-preview_22.entry.js +253 -36
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/p-2d69086d.entry.js +2 -0
- package/dist/isometrik-webchat/p-2d69086d.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +7 -3
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +15 -0
- package/dist/types/lib/chat/group-title.d.ts +2 -0
- package/dist/types/lib/chat/index.d.ts +2 -0
- package/dist/types/lib/chat/mentioned-users.d.ts +18 -0
- package/package.json +1 -1
- package/dist/isometrik-webchat/p-9f036163.entry.js +0 -2
- package/dist/isometrik-webchat/p-9f036163.entry.js.map +0 -1
|
@@ -12,6 +12,65 @@ import { D as Delete, d as Send, A as Attachment, S as Smile, M as Microphone }
|
|
|
12
12
|
import { P as PlayIcon, D as DocumentsIcon, a as PhotosIcon } from './play.js';
|
|
13
13
|
import { d as defineCustomElement$2 } from './AudioBubble.js';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* API `mentionedUsers` shape for postMessages.
|
|
17
|
+
* Callers (custom UI / HOA) may pass `{ userId, userName }`; we map to
|
|
18
|
+
* `{ userId, wordCount, order }` before send.
|
|
19
|
+
*/
|
|
20
|
+
function wordCountForName(userName) {
|
|
21
|
+
const n = userName.trim().split(/\s+/).filter(Boolean).length;
|
|
22
|
+
return n > 0 ? n : 1;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build API mention list from composer body + picker selections.
|
|
26
|
+
* - Prefers `userName` to locate `@Name` in body and derive wordCount
|
|
27
|
+
* - Drops mentions no longer present in body
|
|
28
|
+
* - One entry per userId (first appearance wins)
|
|
29
|
+
* - `order` is 1-based by appearance in body
|
|
30
|
+
*/
|
|
31
|
+
function toMentionedUsersPayload(body, list) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (!Array.isArray(list) || !list.length)
|
|
34
|
+
return [];
|
|
35
|
+
const text = String(body !== null && body !== void 0 ? body : '');
|
|
36
|
+
const hits = [];
|
|
37
|
+
const seen = new Set();
|
|
38
|
+
for (const raw of list) {
|
|
39
|
+
if (!raw || typeof raw !== 'object')
|
|
40
|
+
continue;
|
|
41
|
+
const userId = String((_a = raw.userId) !== null && _a !== void 0 ? _a : '').trim();
|
|
42
|
+
if (!userId || seen.has(userId))
|
|
43
|
+
continue;
|
|
44
|
+
const userName = String((_b = raw.userName) !== null && _b !== void 0 ? _b : '').trim();
|
|
45
|
+
let wordCount = Number(raw.wordCount);
|
|
46
|
+
let start = -1;
|
|
47
|
+
if (userName) {
|
|
48
|
+
start = text.indexOf(`@${userName}`);
|
|
49
|
+
if (start < 0)
|
|
50
|
+
continue;
|
|
51
|
+
if (!Number.isFinite(wordCount) || wordCount < 1) {
|
|
52
|
+
wordCount = wordCountForName(userName);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (Number.isFinite(wordCount) && wordCount >= 1) {
|
|
56
|
+
// Already API-shaped (no name) — keep relative order via `order`
|
|
57
|
+
const ord = Number(raw.order);
|
|
58
|
+
start = Number.isFinite(ord) ? ord : hits.length + 1;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
seen.add(userId);
|
|
64
|
+
hits.push({ userId, wordCount, start });
|
|
65
|
+
}
|
|
66
|
+
hits.sort((a, b) => a.start - b.start);
|
|
67
|
+
return hits.map((h, i) => ({
|
|
68
|
+
userId: h.userId,
|
|
69
|
+
wordCount: h.wordCount,
|
|
70
|
+
order: i + 1,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
|
|
15
74
|
const cameraSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIE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C0yNS43OTYgMGwtNC45OTcgNC4wNTZ6bTc2LjY2NC0uNzkzYy4wMjctOS44MDQgNy41MTgtMTcuNTQxIDE3LjEyNS0xNy42ODkgOS42MDYtLjE0NyAyNS4yODMuMTQ4IDM1LjAwNC4xNDggOS43MiAwIDE3LjM5NyA4LjUyIDE3LjM5NyAxNy43N3MtLjE3OCAxMTcuODA5LS4xNzggMTI3YzAgOS4xOTItNy42NjQgMTcuMTItMTYuMzIzIDE3LjA3Mi04LjY2LS4wNS0yNi4zNTQgMC0zNC45OTEuMDQ4LTguNjM4LjA1LTE3Ljk4LTguNTgyLTE4LjAwNy0xNy43ODMtLjAyNy05LjIwMS0uMDU1LTExNi43NjMtLjAyNy0xMjYuNTY2em0xNi45MTcuNTU0cy0uMDg5IDExOC4xNDUtLjA4OSAxMjMuNjkyYzAgNS41NDcgMy4xMjMgNS4zMTQgNi40OCA1LjgzMiAzLjM1OS41MTggMjEuNDU1LjQ3IDI0LjQwMi40NyAyLjk0OCAwIDcuMDg2LTEuNjU5IDcuMTY3LTYuMTQxLjA4MS00LjQ4Mi0uMDgtMTE5LjUwNi0uMDgtMTIzLjI0OCAwLTMuNzQyLTQuMy00LjI2NS03LjA4Ny00LjY2LTIuNzg2LS4zOTYtMjUuNzk2IDAtMjUuNzk2IDBsLTQuOTk3IDQuMDU1eiIgZmlsbC1ydWxlPSJldmVub2RkIi8+Cjwvc3ZnPg==';const PauseIcon = pauseSvg;
|
|
@@ -95,7 +154,12 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
95
154
|
};
|
|
96
155
|
this.createLocalMessage = (messageBody, attachments = null, messageId) => {
|
|
97
156
|
var _a;
|
|
98
|
-
|
|
157
|
+
const mentionedUsers = this.mentionedUsersForApi(messageBody);
|
|
158
|
+
return Object.assign(Object.assign(Object.assign({ body: messageBody, messageId: messageId, deliveredToAll: 'pending', senderId: this.userMetaData.userId, messageType: this.replyMessage ? 2 : 0, sentAt: Date.now() }, (attachments && { attachments })), (((_a = this.mentionUserList) === null || _a === void 0 ? void 0 : _a.length) > 0 && {
|
|
159
|
+
mentionedUsers: this.mentionUserList.some(m => m === null || m === void 0 ? void 0 : m.userName)
|
|
160
|
+
? this.mentionUserList
|
|
161
|
+
: mentionedUsers,
|
|
162
|
+
})), (this.replyMessage && { metaData: this.getReplyMetadata() }));
|
|
99
163
|
};
|
|
100
164
|
this.updateMessageWithApiResponse = (messageId, oldMessageId) => {
|
|
101
165
|
const newMessages = [...this.allMessages];
|
|
@@ -511,6 +575,10 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
511
575
|
console.warn('updateConversationListProp is not a function', this.updateConversationListProp);
|
|
512
576
|
}
|
|
513
577
|
}
|
|
578
|
+
/** API payload only — strips userName, sets wordCount + order. */
|
|
579
|
+
mentionedUsersForApi(body) {
|
|
580
|
+
return toMentionedUsersPayload(body, this.mentionUserList);
|
|
581
|
+
}
|
|
514
582
|
clearLinkPreview() {
|
|
515
583
|
this.linkPreview = '';
|
|
516
584
|
this.linkToPreview = '';
|
|
@@ -527,7 +595,6 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
527
595
|
document.removeEventListener('pointerdown', this.closeAttachOutside);
|
|
528
596
|
}
|
|
529
597
|
async sendTextMessage(body, conversationId) {
|
|
530
|
-
var _a;
|
|
531
598
|
this.messageBody = '';
|
|
532
599
|
let messageId = 'localId' + Date.now().toString() + Math.random() * 100;
|
|
533
600
|
const localMessage = this.createLocalMessage(body, null, messageId);
|
|
@@ -542,22 +609,9 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
542
609
|
const urlParams = new URLSearchParams(window.location.search);
|
|
543
610
|
const isGroupcast = urlParams.has('groupcast');
|
|
544
611
|
const groupcastId = urlParams.get('groupcast');
|
|
612
|
+
const mentionedUsers = this.mentionedUsersForApi(body);
|
|
545
613
|
if (isGroupcast) {
|
|
546
|
-
const payloadForGroupcastMessage = {
|
|
547
|
-
showInConversation: true,
|
|
548
|
-
sendPushForNewConversationCreated: true,
|
|
549
|
-
searchableTags: this.generateSearchableTags(body),
|
|
550
|
-
metaData: this.getReplyMetadata(),
|
|
551
|
-
body: body,
|
|
552
|
-
groupcastId: groupcastId,
|
|
553
|
-
readCount: 1,
|
|
554
|
-
notifyOnCompletion: true,
|
|
555
|
-
messageType: this.replyMessage ? 2 : 0,
|
|
556
|
-
hideNewConversationsForSender: true,
|
|
557
|
-
encrypted: true,
|
|
558
|
-
deviceId: this.deviceId,
|
|
559
|
-
deliveryCount: 1,
|
|
560
|
-
};
|
|
614
|
+
const payloadForGroupcastMessage = Object.assign({ showInConversation: true, sendPushForNewConversationCreated: true, searchableTags: this.generateSearchableTags(body), metaData: this.getReplyMetadata(), body: body, groupcastId: groupcastId, readCount: 1, notifyOnCompletion: true, messageType: this.replyMessage ? 2 : 0, hideNewConversationsForSender: true, encrypted: true, deviceId: this.deviceId, deliveryCount: 1 }, (mentionedUsers.length > 0 && { mentionedUsers }));
|
|
561
615
|
try {
|
|
562
616
|
const res = await postGroupCastMessage(payloadForGroupcastMessage);
|
|
563
617
|
this.updateMessageWithApiResponse(res.messageId, messageId);
|
|
@@ -570,6 +624,12 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
570
624
|
position: 'bottom-right',
|
|
571
625
|
});
|
|
572
626
|
}
|
|
627
|
+
finally {
|
|
628
|
+
this.changeMessageSendingState(false);
|
|
629
|
+
this.replyMessage = null;
|
|
630
|
+
this.messageBody = '';
|
|
631
|
+
this.mentionUserList = [];
|
|
632
|
+
}
|
|
573
633
|
}
|
|
574
634
|
else {
|
|
575
635
|
const payload = {
|
|
@@ -584,8 +644,8 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
584
644
|
body: body,
|
|
585
645
|
metaData: this.getReplyMetadata(),
|
|
586
646
|
};
|
|
587
|
-
if (
|
|
588
|
-
payload['mentionedUsers'] =
|
|
647
|
+
if (mentionedUsers.length > 0) {
|
|
648
|
+
payload['mentionedUsers'] = mentionedUsers;
|
|
589
649
|
}
|
|
590
650
|
try {
|
|
591
651
|
const res = await M.getInstance().message.postMessages(payload);
|
|
@@ -603,6 +663,7 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
603
663
|
this.changeMessageSendingState(false);
|
|
604
664
|
this.replyMessage = null;
|
|
605
665
|
this.messageBody = '';
|
|
666
|
+
this.mentionUserList = [];
|
|
606
667
|
}
|
|
607
668
|
}
|
|
608
669
|
}
|
|
@@ -685,7 +746,7 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
685
746
|
}
|
|
686
747
|
}
|
|
687
748
|
async uploadAndSendMedia(presignedUrls, attachments, conversationId, oldMessageId) {
|
|
688
|
-
var _a, _b, _c
|
|
749
|
+
var _a, _b, _c;
|
|
689
750
|
const allPayloads = [];
|
|
690
751
|
const uploadPromises = presignedUrls.map(async (urlDetails, index) => {
|
|
691
752
|
let mediaId, mediaUrl, thumbnailUrl, mediaPresignedUrl;
|
|
@@ -753,8 +814,10 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
753
814
|
metaData: this.getReplyMetadata(),
|
|
754
815
|
};
|
|
755
816
|
let payloadForGroupcastMessage = Object.assign(Object.assign({}, payload), { hideNewConversationsForSender: false, groupcastId: this.groupcastId, notifyOnCompletion: true, sendPushForNewConversationCreated: true });
|
|
756
|
-
|
|
757
|
-
|
|
817
|
+
const mentionedUsers = this.mentionedUsersForApi(caption);
|
|
818
|
+
if (mentionedUsers.length > 0) {
|
|
819
|
+
payload['mentionedUsers'] = mentionedUsers;
|
|
820
|
+
payloadForGroupcastMessage['mentionedUsers'] = mentionedUsers;
|
|
758
821
|
}
|
|
759
822
|
try {
|
|
760
823
|
let sendMessageRes;
|
|
@@ -764,6 +827,7 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
764
827
|
else {
|
|
765
828
|
sendMessageRes = await M.getInstance().message.postMessages(payload);
|
|
766
829
|
}
|
|
830
|
+
this.mentionUserList = [];
|
|
767
831
|
this.updateMessageWithApiResponse(sendMessageRes.messageId, oldMessageId);
|
|
768
832
|
this.replyMessage = null;
|
|
769
833
|
showToast({
|
|
@@ -815,7 +879,7 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
815
879
|
const webChat = findWebChatHost(this.el);
|
|
816
880
|
const hasCustomReply = (webChat ? hasNamedSlot(webChat, 'reply-preview') : false) || hasNamedSlot(this.el, 'reply-preview');
|
|
817
881
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
818
|
-
return (h(Host, { key: '
|
|
882
|
+
return (h(Host, { key: 'de774ccefb329af2fe95f29fc90fa4cad874af9c', class: { 'attachment-open': !!showAttachment } }, h("div", { key: '0e8d6829943505e92e45c38980c827b57366902c', class: "chat-footer-container" }, showAttachment ? (h("slot", { name: "attachment-preview" }, h("attachment-preview", { showCamera: this.showCamera, onClose: this.handleClearAttachment, width: "150px", height: "150px", bgColor: "var(--bg-primary-light)", padding: "3px", margin: "10px 0 0 0", contentType: contentType, content: this.mediaPreviews, onSend: this.handleSendMessage, "onfile-uploaded": this.handleFileUpload, "onattachment-removed": this.handleRemoveAttachment, "oncamera-retake": this.handleCameraRetake, key: this.inputKey, inputValue: this.messageBody, "oninput-change": this.handleInputChange, backgroundColor: "var(--bg-primary-color)", containerBoxShadow: "none", inputFontColor: "var(--text-primary-color)", inputBorderRadius: "10px", conversationDetails: this.conversationDetails, userMetaData: this.userMetaData }))) : (h(Fragment, null, hasCustomReply ? h("slot", { name: "reply-preview" }) : null, h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (h("reply-block", { messageBody: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.body, messageInfo: this.replyMessage, senderName: ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) === ((_d = (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.senderInfo) === null || _d === void 0 ? void 0 : _d.userId)
|
|
819
883
|
? 'You'
|
|
820
884
|
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, h("div", { class: "emoji-panel-header" }, h("span", null, "Emoji"), h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (h("div", { class: "rec-body" }, h("div", { class: "rec-left" }, h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, h("img", { class: "theme-icon", src: Delete, alt: "" })), h("div", { class: "rec-timer-wrap" }, h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), h("div", { class: "rec-wave" }, h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), h("button", { class: { 'rec-icon-btn': true, 'rec-toggle': true, pause: !this.isPaused }, type: "button", title: this.isPaused ? 'Resume recording' : 'Pause recording', "aria-label": this.isPaused ? 'Resume recording' : 'Pause recording', onClick: this.handleRecPauseToggle }, h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, h("img", { src: Send, alt: "" })))) : (h(Fragment, null, h("div", { class: "attach-wrap" }, h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, h("img", { src: Attachment, alt: "" })), this.showAttachMenu ? (h("div", { class: "attach-menu", style: this.attachMenuStyle }, h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, h("img", { src: DocumentsIcon, alt: "" })), h("span", null, "Document")), h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), h("span", null, "Photos & videos")), h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), h("span", null, "Camera")))) : null), h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, h("img", { src: Smile, alt: "" })), h("input", { class: "file-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv,.mp3,.wav,.m4a,.aac,.ogg", ref: el => (this.mediaInputRef = el), onChange: this.handleNativeFileChange }), h("input", { class: "file-input", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.rtf,application/*", ref: el => (this.docInputRef = el), onChange: this.handleNativeFileChange }), h("textarea", { class: "composer-input", rows: 1, placeholder: "Type a message", value: this.messageBody, ref: el => (this.inputRef = el), onInput: this.handleComposerInput, onKeyDown: this.handleComposerKeyDown }), this.messageBody.trim() ? (h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, h("img", { src: Send, alt: "" }))) : (h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, h("img", { src: Microphone, alt: "" })))))))))))));
|
|
821
885
|
}
|