@phonghq/go-chat 1.0.71 → 1.0.73

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 (68) hide show
  1. package/dist/assets/icons/chat/IconMenuDot.vue.js +31 -0
  2. package/dist/assets/icons/customer-appointment/IconChevronRight.vue.d.ts +2 -0
  3. package/dist/assets/icons/customer-appointment/IconChevronRight.vue.js +22 -0
  4. package/dist/assets/icons/global/IconMessageOutline.vue.d.ts +2 -0
  5. package/dist/assets/icons/global/IconMessageOutline.vue.js +22 -0
  6. package/dist/assets/icons/global/IconSms.vue.js +1 -1
  7. package/dist/assets/icons/lib/IconZoomOut.vue.d.ts +5 -0
  8. package/dist/assets/icons/lib/IconZoomOut.vue.js +52 -0
  9. package/dist/chat/App.vue.d.ts +14 -9
  10. package/dist/chat/App.vue.js +410 -514
  11. package/dist/chat/ChatHeader.vue.d.ts +15 -0
  12. package/dist/chat/ChatHeader.vue.js +218 -0
  13. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +8 -1
  14. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +66 -11
  15. package/dist/chat/page/customer-detail/SubInformation.vue.js +41 -9
  16. package/dist/chat/page/home/ChatList.vue.d.ts +6 -0
  17. package/dist/chat/page/home/ChatList.vue.js +65 -32
  18. package/dist/chat/page/home/ChatMessage.vue.js +11 -1
  19. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +1 -0
  20. package/dist/chat/page/home/ChatMessageItem.vue.js +44 -5
  21. package/dist/chat/page/home/Home.vue.d.ts +1 -0
  22. package/dist/chat/page/home/Home.vue.js +134 -123
  23. package/dist/chat/page/home/HomeHeader.vue.js +103 -10
  24. package/dist/chat/page/home/NewCustomer.vue.js +11 -9
  25. package/dist/chat/page/home/PhoneNumpad.vue.d.ts +4 -0
  26. package/dist/chat/page/home/PhoneNumpad.vue.js +39 -21
  27. package/dist/components/chat/call/Calling.vue.js +5 -18
  28. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +4 -4
  29. package/dist/components/common/dropdown/DropdownBase.vue.js +11 -9
  30. package/dist/components/common/select/SelectBase.vue.d.ts +9 -4
  31. package/dist/components/common/select/SelectBase.vue.js +49 -31
  32. package/dist/components/ui/button/c-button.js +1 -1
  33. package/dist/components/ui/dialog/DialogContent.vue.d.ts +2 -2
  34. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +2 -2
  35. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +2 -2
  36. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +3 -3
  37. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +11 -6
  38. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +4 -4
  39. package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
  40. package/dist/components/ui/select/SelectContent.vue.js +7 -2
  41. package/dist/components/ui/select/SelectItem.vue.js +2 -2
  42. package/dist/composable/useInitData.js +2 -0
  43. package/dist/composable/useListConversations.d.ts +5 -1
  44. package/dist/composable/useListConversations.js +42 -31
  45. package/dist/composable/useListentEvent.js +20 -2
  46. package/dist/composable/usePlivo.d.ts +0 -2
  47. package/dist/composable/usePlivo.js +5 -11
  48. package/dist/go-chat.es.js +18061 -16541
  49. package/dist/go-chat.umd.js +23 -23
  50. package/dist/style.css +1 -1
  51. package/dist/types/chat/global.d.ts +35 -10
  52. package/dist/utils/chat/queue.d.ts +7 -0
  53. package/dist/utils/chat/queue.js +30 -0
  54. package/dist/utils/chat/store/conversation.d.ts +1 -0
  55. package/dist/utils/chat/store/conversation.js +4 -0
  56. package/dist/utils/chat/store/message.d.ts +0 -4
  57. package/dist/utils/chat/store/message.js +0 -4
  58. package/dist/utils/chat/store/time-limit.d.ts +5 -0
  59. package/dist/utils/chat/store/time-limit.js +8 -0
  60. package/dist/utils/string-helper.d.ts +1 -0
  61. package/dist/utils/string-helper.js +3 -0
  62. package/dist/views/home/phone-numpad/ConvercationList.vue.d.ts +1 -0
  63. package/dist/views/home/phone-numpad/ConvercationList.vue.js +4 -1
  64. package/dist/views/home/phone-numpad/PhoneNumpad.vue.d.ts +6 -2
  65. package/dist/views/home/phone-numpad/PhoneNumpad.vue.js +43 -17
  66. package/package.json +1 -1
  67. package/dist/assets/icons/call/IconPhoneBase.vue.js +0 -20
  68. /package/dist/assets/icons/{call/IconPhoneBase.vue.d.ts → chat/IconMenuDot.vue.d.ts} +0 -0
@@ -20,6 +20,7 @@ import IconAiCheck from '../../../assets/icons/global/IconAiCheck.vue';
20
20
  import TabBase2 from '../../../components/chat/common/tabs/TabBase.vue';
21
21
  import { useListConversations } from '../../../composable/useListConversations';
22
22
  import { phoneNumberFormat } from '../../../utils/string-helper';
23
+ import { AsyncQueue } from '../../../utils/chat/queue';
23
24
  dayjs.extend(updateLocale);
24
25
  dayjs.extend(relativeTime);
25
26
  dayjs.extend(utc);
@@ -59,36 +60,42 @@ const tabs = computed(() => [
59
60
  badge: (listConversationsUnknownUnread.value || '').toString()
60
61
  }
61
62
  ]);
63
+ const addQueueCheckConversationHasCustomer = (data) => {
64
+ return queue.add(() => checkConversationHasCustomer(data));
65
+ };
62
66
  const checkConversationHasCustomer = (data) => {
63
- const index = listConversationsAll.value.findIndex((item) => item.receiver_id == data.receiver_id);
64
- const unknown_index = listConversationsUnknown.value.findIndex((item) => item.receiver_id == data.receiver_id);
65
- if (index > -1) {
66
- listConversationsAll.value[index].last_message = data.last_message;
67
- listConversationsAll.value[index].last_message_time = data.last_message_time;
68
- listConversationsAll.value[index].unread_count = data.unread_count;
69
- listConversationsAll.value[index].id = data.id;
70
- return true;
71
- }
72
- else if (unknown_index > -1) {
73
- listConversationsUnknown.value[index].last_message = data.last_message;
74
- listConversationsUnknown.value[index].last_message_time = data.last_message_time;
75
- listConversationsUnknown.value[index].unread_count = data.unread_count;
76
- listConversationsUnknown.value[index].id = data.id;
77
- return true;
78
- }
79
- return false;
67
+ return new Promise((resolve) => {
68
+ const index = listConversationsAll.value.findIndex((item) => item.receiver_id == data.receiver_id);
69
+ const unknown_index = listConversationsUnknown.value.findIndex((item) => item.receiver_id == data.receiver_id);
70
+ if (index > -1) {
71
+ listConversationsAll.value[index].last_message = data.last_message;
72
+ listConversationsAll.value[index].last_message_time = data.last_message_time;
73
+ listConversationsAll.value[index].unread_count = data.unread_count;
74
+ listConversationsAll.value[index].id = data.id;
75
+ resolve(true);
76
+ }
77
+ else if (unknown_index > -1) {
78
+ listConversationsUnknown.value[index].last_message = data.last_message;
79
+ listConversationsUnknown.value[index].last_message_time = data.last_message_time;
80
+ listConversationsUnknown.value[index].unread_count = data.unread_count;
81
+ listConversationsUnknown.value[index].id = data.id;
82
+ resolve(true);
83
+ }
84
+ resolve(false);
85
+ });
80
86
  };
81
87
  let topic_customer_update = '';
82
88
  const { digibotData, digibotId } = useDigibot();
83
- const { listConversations: listConversationsAll, getData: getDataAll, params: paramsAll, pageCount: pageCountAll, handleReadMessage: handleReadMessageAll, getDataCache: getDataCacheAll } = useListConversations(TAB_VALUE.ALL, dataProfile.value?.user_type === 'tenant', checkConversationHasCustomer);
84
- const { listConversations: listConversationsUnknown, getData: getDataUnknown, params: paramsUnknown, pageCount: pageCountUnknown, handleReadMessage: handleReadMessageUnknown, getDataCache: getDataCacheUnknown } = useListConversations(TAB_VALUE.UNKNOWN, dataProfile.value?.user_type === 'tenant', checkConversationHasCustomer);
89
+ const queue = new AsyncQueue();
90
+ const { listConversations: listConversationsAll, getData: getDataAll, params: paramsAll, pageCount: pageCountAll, handleReadMessage: handleReadMessageAll, getDataCache: getDataCacheAll, insertConversation: insertConversationAll } = useListConversations(TAB_VALUE.ALL, dataProfile.value?.user_type === 'tenant', addQueueCheckConversationHasCustomer);
91
+ const { listConversations: listConversationsUnknown, getData: getDataUnknown, params: paramsUnknown, pageCount: pageCountUnknown, handleReadMessage: handleReadMessageUnknown, getDataCache: getDataCacheUnknown, insertConversation: insertConversationUnknown } = useListConversations(TAB_VALUE.UNKNOWN, dataProfile.value?.user_type === 'tenant', addQueueCheckConversationHasCustomer);
85
92
  onMounted(async () => {
86
93
  try {
87
94
  if (dataProfile.value) {
88
95
  await connectMqtt();
89
96
  topic_customer_update = `tenant/${dataProfile.value?.tenant_id}/customer/+/update`;
90
97
  subscribeToTopic(topic_customer_update);
91
- addHandleMqttMessage('chat-list', topic_customer_update, mqttMessageHandler);
98
+ addHandleMqttMessage('chat-list', topic_customer_update, handleMqttQueue);
92
99
  }
93
100
  }
94
101
  catch (error) {
@@ -151,13 +158,16 @@ const getData = async (data, option) => {
151
158
  isLoadingSearch.value = false;
152
159
  }
153
160
  };
161
+ const handleMqttQueue = (topic, data) => {
162
+ queue.add(() => mqttMessageHandler(topic, data));
163
+ };
154
164
  const mqttMessageHandler = async (topic, data) => {
155
165
  const subParts = TOPIC_CUSTOMER_RELOAD.split('/');
156
166
  const topicParts = topic.split('/');
157
167
  const idIndex = subParts.findIndex((p) => p === '+');
158
168
  const id = topicParts[idIndex];
159
169
  const customer = await getDetailReceiver(id);
160
- // console.log(customer,'aaaaaaaaaaa')
170
+ emit('reloadReceiver', customer);
161
171
  await nextTick();
162
172
  await sleep(500);
163
173
  const isAllTab = customer.is_known == 1;
@@ -167,7 +177,7 @@ const mqttMessageHandler = async (topic, data) => {
167
177
  username: customer.username,
168
178
  phone: customer.phone,
169
179
  avatar: customer.avatar,
170
- color: customer.color,
180
+ color: customer.color
171
181
  };
172
182
  const correctIndex = correctList.findIndex((conversation) => conversation.receiver_id === customer.id);
173
183
  if (correctIndex > -1) {
@@ -215,7 +225,7 @@ const mqttMessageHandler = async (topic, data) => {
215
225
  }
216
226
  }
217
227
  };
218
- const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
228
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
219
229
  const getAllList = async (tab_value) => {
220
230
  if (tab_value == TAB_VALUE.ALL) {
221
231
  while (paramsAll.value.page < pageCountAll.value && !scrollEventRef.value?.canScroll()) {
@@ -231,14 +241,18 @@ const getAllList = async (tab_value) => {
231
241
  }
232
242
  }
233
243
  };
234
- const checkHasReceiveId = () => {
235
- const hasReceiveId = listConversations.value?.some((e) => e.receiver_id === receiver_id.value && receiver_id.value);
244
+ const checkHasReceiveId = (need_select) => {
245
+ const hasReceiveId = listConversations.value?.find((e) => e.receiver_id === receiver_id.value && receiver_id.value);
236
246
  if (props.responsive != 'mobile') {
237
247
  if (!hasReceiveId) {
238
248
  if (listConversations.value?.length) {
239
249
  emit('selectReceiver', listConversations.value[0]);
240
250
  }
241
251
  }
252
+ else if (need_select) {
253
+ emit('selectReceiver', null);
254
+ emit('selectReceiver', hasReceiveId);
255
+ }
242
256
  }
243
257
  };
244
258
  const handleSearch = (value) => {
@@ -291,14 +305,16 @@ const handleTabChange = async (tab, option) => {
291
305
  else if (tab == TAB_VALUE.UNKNOWN && !listConversationsUnknown.value?.length) {
292
306
  await getData({}, { reset: true, tab, ...(option ?? {}) });
293
307
  }
294
- // checkHasReceiveId()
308
+ if (option?.isResponsiveChange) {
309
+ checkHasReceiveId(true);
310
+ }
295
311
  };
296
312
  const getCurrentConversation = () => {
297
313
  return listConversations.value?.find((user) => user.receiver_id == receiver_id.value);
298
314
  };
299
315
  const initData = async (option) => {
300
- if (option?.is_known || option?.is_known == TAB_VALUE.ALL.toString()) {
301
- activeTabs.value = Number(option?.is_known);
316
+ if (option?.is_known || option?.is_known == '0') {
317
+ activeTabs.value = Number(option?.is_known ?? 1);
302
318
  }
303
319
  let hideCheckHasReceiveId = false;
304
320
  if (option?.conversation_id) {
@@ -308,19 +324,36 @@ const initData = async (option) => {
308
324
  selectUser(conversation);
309
325
  }
310
326
  }
311
- handleTabChange(activeTabs.value, { hideCheckHasReceiveId: hideCheckHasReceiveId });
327
+ handleTabChange(activeTabs.value, {
328
+ hideCheckHasReceiveId: hideCheckHasReceiveId,
329
+ isResponsiveChange: option?.isResponsiveChange
330
+ });
312
331
  handleTabChange(activeTabs.value == 1 ? 0 : 1, {
313
- hideCheckHasReceiveId: true,
314
- hideLoading: true
332
+ hideCheckHasReceiveId: hideCheckHasReceiveId,
333
+ hideLoading: true,
334
+ isResponsiveChange: option?.isResponsiveChange
315
335
  });
316
336
  };
337
+ const goToConversationRequest = async (conversation) => {
338
+ if (conversation?.is_known || conversation?.is_known == 0) {
339
+ activeTabs.value = Number(conversation?.is_known ?? 1);
340
+ }
341
+ if (activeTabs.value == TAB_VALUE.ALL) {
342
+ insertConversationAll({ data: conversation, is_full_conversation: true });
343
+ }
344
+ else {
345
+ insertConversationUnknown({ data: conversation, is_full_conversation: true });
346
+ }
347
+ selectUser(conversation);
348
+ };
317
349
  const __VLS_exposed = {
318
350
  handleReadMessage,
319
351
  listConversationsAll,
320
352
  listConversationsUnknown,
321
353
  getCurrentConversation,
322
354
  initData,
323
- handleTabChange
355
+ handleTabChange,
356
+ goToConversationRequest
324
357
  };
325
358
  defineExpose(__VLS_exposed);
326
359
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
@@ -5,6 +5,7 @@ import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
5
5
  import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
6
6
  import ChatMessageItem from '../../../chat/page/home/ChatMessageItem.vue';
7
7
  import dayjs from 'dayjs';
8
+ import { TIME_ZONE_UTC } from '../../../constant/datetime';
8
9
  const props = withDefaults(defineProps(), {});
9
10
  const emit = defineEmits();
10
11
  const scrollEventRef = ref(null);
@@ -40,6 +41,13 @@ const isChatStart = (index) => {
40
41
  const time2 = dayjs(props.message[index].created_at);
41
42
  return time2.diff(time1, 'minute') > 10;
42
43
  };
44
+ const isStartNewDate = (index) => {
45
+ if (index == 0)
46
+ return true;
47
+ const time1 = dayjs.tz(props.message[index - 1].created_at, TIME_ZONE_UTC).local();
48
+ const time2 = dayjs.tz(props.message[index].created_at, TIME_ZONE_UTC).local();
49
+ return time2.diff(time1, 'day') > 0;
50
+ };
43
51
  const handleScrollTop = () => {
44
52
  emit('scrollTop');
45
53
  };
@@ -150,6 +158,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
150
158
  isEndMessage: (__VLS_ctx.isEndMessage(index)),
151
159
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
152
160
  isChatStart: (__VLS_ctx.isChatStart(index)),
161
+ isStartNewDate: (__VLS_ctx.isStartNewDate(index)),
153
162
  }));
154
163
  const __VLS_19 = __VLS_18({
155
164
  ...{ 'onCallAgain': {} },
@@ -163,6 +172,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
163
172
  isEndMessage: (__VLS_ctx.isEndMessage(index)),
164
173
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
165
174
  isChatStart: (__VLS_ctx.isChatStart(index)),
175
+ isStartNewDate: (__VLS_ctx.isStartNewDate(index)),
166
176
  }, ...__VLS_functionalComponentArgsRest(__VLS_18));
167
177
  let __VLS_21;
168
178
  let __VLS_22;
@@ -170,7 +180,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
170
180
  { onCallAgain: (...[$event]) => {
171
181
  __VLS_ctx.emit('callBack');
172
182
  // @ts-ignore
173
- [data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, emit,];
183
+ [data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, isStartNewDate, emit,];
174
184
  } });
175
185
  var __VLS_20;
176
186
  }
@@ -9,6 +9,7 @@ type Props = {
9
9
  shouldShowAvatar: boolean;
10
10
  isChatFinished: boolean;
11
11
  isChatStart: boolean;
12
+ isStartNewDate: boolean;
12
13
  data: IResUser | null;
13
14
  };
14
15
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -9,6 +9,7 @@ import dayjs from 'dayjs';
9
9
  import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
10
10
  import utc from 'dayjs/plugin/utc';
11
11
  import timezone from 'dayjs/plugin/timezone';
12
+ // import IconMenuDot from '@/assets/icons/chat/IconMenuDot.vue'
12
13
  dayjs.extend(utc);
13
14
  dayjs.extend(timezone);
14
15
  const props = withDefaults(defineProps(), {});
@@ -77,6 +78,11 @@ const getFinishTime = (time) => {
77
78
  return '';
78
79
  return dayjs.tz(time, TIME_ZONE_UTC).local().format(DATE_FORMATS.TIME_12_FORMAT);
79
80
  };
81
+ const getStartDate = (time) => {
82
+ if (!dayjs(time).isValid())
83
+ return '';
84
+ return dayjs.tz(time, TIME_ZONE_UTC).local().format('MMM D, YYYY');
85
+ };
80
86
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
81
87
  const __VLS_defaults = {};
82
88
  const __VLS_ctx = {
@@ -89,6 +95,22 @@ const __VLS_ctx = {
89
95
  let __VLS_elements;
90
96
  let __VLS_components;
91
97
  let __VLS_directives;
98
+ if (__VLS_ctx.isStartNewDate) {
99
+ // @ts-ignore
100
+ [isStartNewDate,];
101
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
102
+ ...{ class: "relative flex-center text-chat-haze-200" },
103
+ });
104
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
105
+ ...{ class: "absolute translate-x-1/2 bottom-1/2 right-1/2 w-3/4 h-[1px] bg-chat-haze-200" },
106
+ });
107
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
108
+ ...{ class: "bg-white text-sm px-4 py-2 z-[1]" },
109
+ });
110
+ (__VLS_ctx.getStartDate(__VLS_ctx.message?.created_at));
111
+ // @ts-ignore
112
+ [getStartDate, message,];
113
+ }
92
114
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
93
115
  ...{ class: "flex items-end mt-1 relative" },
94
116
  ...{ class: ({
@@ -101,7 +123,7 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
101
123
  [shouldShowAvatar, isMyMessage, isMyMessage,];
102
124
  if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyMessage) {
103
125
  // @ts-ignore
104
- [isMyMessage, message, MessageState,];
126
+ [message, isMyMessage, MessageState,];
105
127
  if (!__VLS_ctx.isMyMessage) {
106
128
  // @ts-ignore
107
129
  [isMyMessage,];
@@ -123,7 +145,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
123
145
  name: (__VLS_ctx.data?.username),
124
146
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
125
147
  ...{ class: ({
126
- 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile',
148
+ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile'
127
149
  }) },
128
150
  }));
129
151
  const __VLS_1 = __VLS_0({
@@ -133,7 +155,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
133
155
  name: (__VLS_ctx.data?.username),
134
156
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
135
157
  ...{ class: ({
136
- 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile',
158
+ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile'
137
159
  }) },
138
160
  }, ...__VLS_functionalComponentArgsRest(__VLS_0));
139
161
  // @ts-ignore
@@ -150,7 +172,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
150
172
  }
151
173
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
152
174
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
153
- ...{ class: "px-3 py-2 rounded-2xl text-left w-max" },
175
+ ...{ class: "px-3 py-2 rounded-2xl text-left w-max relative group" },
154
176
  ...{ class: ({
155
177
  'rounded-tl-[6px]': !__VLS_ctx.isChatStart && !__VLS_ctx.isMyMessage,
156
178
  'rounded-bl-[6px]': !__VLS_ctx.isChatFinished && !__VLS_ctx.isMyMessage,
@@ -166,7 +188,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
166
188
  }) },
167
189
  });
168
190
  // @ts-ignore
169
- [isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, message, message, message, message, message, responsive, responsive, isChatStart, isChatStart, isChatFinished, isChatFinished,];
191
+ [message, message, message, message, message, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, responsive, responsive, isChatStart, isChatStart, isChatFinished, isChatFinished,];
170
192
  if (__VLS_ctx.message.is_call == 1) {
171
193
  // @ts-ignore
172
194
  [message,];
@@ -288,6 +310,21 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
288
310
  }
289
311
  }
290
312
  /** @type {__VLS_StyleScopedClasses['']} */ ;
313
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
314
+ /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
315
+ /** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
316
+ /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
317
+ /** @type {__VLS_StyleScopedClasses['translate-x-1/2']} */ ;
318
+ /** @type {__VLS_StyleScopedClasses['bottom-1/2']} */ ;
319
+ /** @type {__VLS_StyleScopedClasses['right-1/2']} */ ;
320
+ /** @type {__VLS_StyleScopedClasses['w-3/4']} */ ;
321
+ /** @type {__VLS_StyleScopedClasses['h-[1px]']} */ ;
322
+ /** @type {__VLS_StyleScopedClasses['bg-chat-haze-200']} */ ;
323
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
324
+ /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
325
+ /** @type {__VLS_StyleScopedClasses['px-4']} */ ;
326
+ /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
327
+ /** @type {__VLS_StyleScopedClasses['z-[1]']} */ ;
291
328
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
292
329
  /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
293
330
  /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
@@ -307,6 +344,8 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
307
344
  /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
308
345
  /** @type {__VLS_StyleScopedClasses['text-left']} */ ;
309
346
  /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
347
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
348
+ /** @type {__VLS_StyleScopedClasses['group']} */ ;
310
349
  /** @type {__VLS_StyleScopedClasses['rounded-tl-[6px]']} */ ;
311
350
  /** @type {__VLS_StyleScopedClasses['rounded-bl-[6px]']} */ ;
312
351
  /** @type {__VLS_StyleScopedClasses['rounded-tr-[6px]']} */ ;
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<Props, {
13
13
  is_mqtt?: boolean | undefined;
14
14
  } | undefined) => Promise<void>;
15
15
  infoUser: import("vue").ShallowRef<IResUser | null>;
16
+ handleGetDetailReceiverQuickly: (data: IResUser) => void;
16
17
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
18
  call: (value: IResUser) => any;
18
19
  back: () => any;
@@ -128,6 +128,10 @@ const handleScrollTop = async () => {
128
128
  chatMessageRef.value?.hideScrollEvent();
129
129
  chatMessageRef.value?.fixedScroll();
130
130
  };
131
+ const handleGetDetailReceiverQuickly = (data) => {
132
+ if (data?.id == infoUser.value?.id)
133
+ infoUser.value = data;
134
+ };
131
135
  const handleGetDetailReceiver = async (data) => {
132
136
  const id = props.receiverId;
133
137
  if (data)
@@ -261,7 +265,7 @@ const reconcileAndSortMessages = (serverMessages) => {
261
265
  listMessage.value = currentMessages.sort((a, b) => dayjs(b.created_at).valueOf() - dayjs(a.created_at).valueOf());
262
266
  };
263
267
  const handleGetListMqtt = useDebounce(() => handleGetMessage({ is_mqtt: true }), 5000);
264
- const __VLS_exposed = { getData, handleGetMessage, infoUser };
268
+ const __VLS_exposed = { getData, handleGetMessage, infoUser, handleGetDetailReceiverQuickly };
265
269
  defineExpose(__VLS_exposed);
266
270
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
267
271
  const __VLS_defaults = {};
@@ -275,140 +279,147 @@ const __VLS_ctx = {
275
279
  let __VLS_elements;
276
280
  let __VLS_components;
277
281
  let __VLS_directives;
278
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
279
- ...{ class: "h-full flex flex-col overflow-hidden relative" },
280
- });
281
- /** @type {[typeof HomeHeader, ]} */ ;
282
- // @ts-ignore
283
- const __VLS_0 = __VLS_asFunctionalComponent(HomeHeader, new HomeHeader({
284
- ...{ 'onCall': {} },
285
- ...{ 'onBack': {} },
286
- ...{ class: "shrink-0" },
287
- data: (__VLS_ctx.infoUser),
288
- responsive: (__VLS_ctx.responsive),
289
- }));
290
- const __VLS_1 = __VLS_0({
291
- ...{ 'onCall': {} },
292
- ...{ 'onBack': {} },
293
- ...{ class: "shrink-0" },
294
- data: (__VLS_ctx.infoUser),
295
- responsive: (__VLS_ctx.responsive),
296
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
297
- let __VLS_3;
298
- let __VLS_4;
299
- const __VLS_5 = ({ call: {} },
300
- { onCall: (__VLS_ctx.call) });
301
- const __VLS_6 = ({ back: {} },
302
- { onBack: (...[$event]) => {
303
- __VLS_ctx.emit('back');
304
- // @ts-ignore
305
- [infoUser, responsive, call, emit,];
306
- } });
307
- var __VLS_2;
308
- if (__VLS_ctx.listMessage?.length) {
309
- // @ts-ignore
310
- [listMessage,];
311
- /** @type {[typeof ChatMessage, ]} */ ;
312
- // @ts-ignore
313
- const __VLS_8 = __VLS_asFunctionalComponent(ChatMessage, new ChatMessage({
314
- ...{ 'onScrollTop': {} },
315
- ...{ 'onCallBack': {} },
316
- ref: "chatMessageRef",
317
- data: (__VLS_ctx.infoUser),
318
- message: (__VLS_ctx.reversedList),
319
- ...{ class: "grow" },
320
- responsive: (__VLS_ctx.responsive),
321
- showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
322
- isLoading: (__VLS_ctx.isLoading),
323
- }));
324
- const __VLS_9 = __VLS_8({
325
- ...{ 'onScrollTop': {} },
326
- ...{ 'onCallBack': {} },
327
- ref: "chatMessageRef",
328
- data: (__VLS_ctx.infoUser),
329
- message: (__VLS_ctx.reversedList),
330
- ...{ class: "grow" },
331
- responsive: (__VLS_ctx.responsive),
332
- showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
333
- isLoading: (__VLS_ctx.isLoading),
334
- }, ...__VLS_functionalComponentArgsRest(__VLS_8));
335
- let __VLS_11;
336
- let __VLS_12;
337
- const __VLS_13 = ({ scrollTop: {} },
338
- { onScrollTop: (__VLS_ctx.handleScrollTop) });
339
- const __VLS_14 = ({ callBack: {} },
340
- { onCallBack: (__VLS_ctx.call) });
341
- /** @type {typeof __VLS_ctx.chatMessageRef} */ ;
342
- var __VLS_15 = {};
343
- // @ts-ignore
344
- [infoUser, responsive, call, reversedList, page, pageCount, isLoading, handleScrollTop, chatMessageRef,];
345
- var __VLS_10;
346
- }
347
- else if (!__VLS_ctx.isLoading) {
348
- // @ts-ignore
349
- [isLoading,];
350
- /** @type {[typeof NewCustomer, ]} */ ;
282
+ if (__VLS_ctx.infoUser) {
351
283
  // @ts-ignore
352
- const __VLS_18 = __VLS_asFunctionalComponent(NewCustomer, new NewCustomer({
353
- data: (__VLS_ctx.infoUser),
354
- ...{ class: "grow" },
355
- isNew: (!__VLS_ctx.listMessage.length),
356
- }));
357
- const __VLS_19 = __VLS_18({
358
- data: (__VLS_ctx.infoUser),
359
- ...{ class: "grow" },
360
- isNew: (!__VLS_ctx.listMessage.length),
361
- }, ...__VLS_functionalComponentArgsRest(__VLS_18));
362
- // @ts-ignore
363
- [infoUser, listMessage,];
364
- }
365
- else {
366
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
367
- ...{ class: "grow" },
284
+ [infoUser,];
285
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
286
+ ...{ class: "flex flex-col overflow-hidden relative" },
368
287
  });
369
- }
370
- if (__VLS_ctx.receiverId != __VLS_ctx.digibotId) {
371
- // @ts-ignore
372
- [receiverId, digibotId,];
373
- /** @type {[typeof InputChat, ]} */ ;
288
+ /** @type {[typeof HomeHeader, ]} */ ;
374
289
  // @ts-ignore
375
- const __VLS_22 = __VLS_asFunctionalComponent(InputChat, new InputChat({
376
- ...{ 'onSendMessage': {} },
377
- ...{ 'onFocus': {} },
290
+ const __VLS_0 = __VLS_asFunctionalComponent(HomeHeader, new HomeHeader({
291
+ ...{ 'onCall': {} },
292
+ ...{ 'onBack': {} },
293
+ ...{ class: "shrink-0" },
378
294
  data: (__VLS_ctx.infoUser),
379
295
  responsive: (__VLS_ctx.responsive),
380
- conversation: (__VLS_ctx.conversation),
381
- ref: "inputChatRef",
382
- ...{ class: "p-2 sm:p-6" },
383
296
  }));
384
- const __VLS_23 = __VLS_22({
385
- ...{ 'onSendMessage': {} },
386
- ...{ 'onFocus': {} },
297
+ const __VLS_1 = __VLS_0({
298
+ ...{ 'onCall': {} },
299
+ ...{ 'onBack': {} },
300
+ ...{ class: "shrink-0" },
387
301
  data: (__VLS_ctx.infoUser),
388
302
  responsive: (__VLS_ctx.responsive),
389
- conversation: (__VLS_ctx.conversation),
390
- ref: "inputChatRef",
391
- ...{ class: "p-2 sm:p-6" },
392
- }, ...__VLS_functionalComponentArgsRest(__VLS_22));
393
- let __VLS_25;
394
- let __VLS_26;
395
- const __VLS_27 = ({ sendMessage: {} },
396
- { onSendMessage: (__VLS_ctx.handleSendMessage) });
397
- const __VLS_28 = ({ focus: {} },
398
- { onFocus: (...[$event]) => {
399
- if (!(__VLS_ctx.receiverId != __VLS_ctx.digibotId))
303
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
304
+ let __VLS_3;
305
+ let __VLS_4;
306
+ const __VLS_5 = ({ call: {} },
307
+ { onCall: (__VLS_ctx.call) });
308
+ const __VLS_6 = ({ back: {} },
309
+ { onBack: (...[$event]) => {
310
+ if (!(__VLS_ctx.infoUser))
400
311
  return;
401
- __VLS_ctx.emit('inputFocus');
312
+ __VLS_ctx.emit('back');
402
313
  // @ts-ignore
403
- [infoUser, responsive, emit, conversation, handleSendMessage,];
314
+ [infoUser, responsive, call, emit,];
404
315
  } });
405
- /** @type {typeof __VLS_ctx.inputChatRef} */ ;
406
- var __VLS_29 = {};
407
- // @ts-ignore
408
- [inputChatRef,];
409
- var __VLS_24;
316
+ var __VLS_2;
317
+ if (__VLS_ctx.listMessage?.length) {
318
+ // @ts-ignore
319
+ [listMessage,];
320
+ /** @type {[typeof ChatMessage, ]} */ ;
321
+ // @ts-ignore
322
+ const __VLS_8 = __VLS_asFunctionalComponent(ChatMessage, new ChatMessage({
323
+ ...{ 'onScrollTop': {} },
324
+ ...{ 'onCallBack': {} },
325
+ ref: "chatMessageRef",
326
+ data: (__VLS_ctx.infoUser),
327
+ message: (__VLS_ctx.reversedList),
328
+ ...{ class: "grow" },
329
+ responsive: (__VLS_ctx.responsive),
330
+ showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
331
+ isLoading: (__VLS_ctx.isLoading),
332
+ }));
333
+ const __VLS_9 = __VLS_8({
334
+ ...{ 'onScrollTop': {} },
335
+ ...{ 'onCallBack': {} },
336
+ ref: "chatMessageRef",
337
+ data: (__VLS_ctx.infoUser),
338
+ message: (__VLS_ctx.reversedList),
339
+ ...{ class: "grow" },
340
+ responsive: (__VLS_ctx.responsive),
341
+ showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
342
+ isLoading: (__VLS_ctx.isLoading),
343
+ }, ...__VLS_functionalComponentArgsRest(__VLS_8));
344
+ let __VLS_11;
345
+ let __VLS_12;
346
+ const __VLS_13 = ({ scrollTop: {} },
347
+ { onScrollTop: (__VLS_ctx.handleScrollTop) });
348
+ const __VLS_14 = ({ callBack: {} },
349
+ { onCallBack: (__VLS_ctx.call) });
350
+ /** @type {typeof __VLS_ctx.chatMessageRef} */ ;
351
+ var __VLS_15 = {};
352
+ // @ts-ignore
353
+ [infoUser, responsive, call, reversedList, page, pageCount, isLoading, handleScrollTop, chatMessageRef,];
354
+ var __VLS_10;
355
+ }
356
+ else if (!__VLS_ctx.isLoading) {
357
+ // @ts-ignore
358
+ [isLoading,];
359
+ /** @type {[typeof NewCustomer, ]} */ ;
360
+ // @ts-ignore
361
+ const __VLS_18 = __VLS_asFunctionalComponent(NewCustomer, new NewCustomer({
362
+ data: (__VLS_ctx.infoUser),
363
+ ...{ class: "grow" },
364
+ isNew: (!__VLS_ctx.listMessage.length),
365
+ }));
366
+ const __VLS_19 = __VLS_18({
367
+ data: (__VLS_ctx.infoUser),
368
+ ...{ class: "grow" },
369
+ isNew: (!__VLS_ctx.listMessage.length),
370
+ }, ...__VLS_functionalComponentArgsRest(__VLS_18));
371
+ // @ts-ignore
372
+ [infoUser, listMessage,];
373
+ }
374
+ else {
375
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
376
+ ...{ class: "grow" },
377
+ });
378
+ }
379
+ if (__VLS_ctx.receiverId != __VLS_ctx.digibotId) {
380
+ // @ts-ignore
381
+ [receiverId, digibotId,];
382
+ /** @type {[typeof InputChat, ]} */ ;
383
+ // @ts-ignore
384
+ const __VLS_22 = __VLS_asFunctionalComponent(InputChat, new InputChat({
385
+ ...{ 'onSendMessage': {} },
386
+ ...{ 'onFocus': {} },
387
+ data: (__VLS_ctx.infoUser),
388
+ responsive: (__VLS_ctx.responsive),
389
+ conversation: (__VLS_ctx.conversation),
390
+ ref: "inputChatRef",
391
+ ...{ class: "p-2 sm:p-6" },
392
+ }));
393
+ const __VLS_23 = __VLS_22({
394
+ ...{ 'onSendMessage': {} },
395
+ ...{ 'onFocus': {} },
396
+ data: (__VLS_ctx.infoUser),
397
+ responsive: (__VLS_ctx.responsive),
398
+ conversation: (__VLS_ctx.conversation),
399
+ ref: "inputChatRef",
400
+ ...{ class: "p-2 sm:p-6" },
401
+ }, ...__VLS_functionalComponentArgsRest(__VLS_22));
402
+ let __VLS_25;
403
+ let __VLS_26;
404
+ const __VLS_27 = ({ sendMessage: {} },
405
+ { onSendMessage: (__VLS_ctx.handleSendMessage) });
406
+ const __VLS_28 = ({ focus: {} },
407
+ { onFocus: (...[$event]) => {
408
+ if (!(__VLS_ctx.infoUser))
409
+ return;
410
+ if (!(__VLS_ctx.receiverId != __VLS_ctx.digibotId))
411
+ return;
412
+ __VLS_ctx.emit('inputFocus');
413
+ // @ts-ignore
414
+ [infoUser, responsive, emit, conversation, handleSendMessage,];
415
+ } });
416
+ /** @type {typeof __VLS_ctx.inputChatRef} */ ;
417
+ var __VLS_29 = {};
418
+ // @ts-ignore
419
+ [inputChatRef,];
420
+ var __VLS_24;
421
+ }
410
422
  }
411
- /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
412
423
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
413
424
  /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
414
425
  /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;