@mobilon-dev/chotto 0.3.121 → 0.3.123

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 (219) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js +4 -29
  3. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +59 -40
  4. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +4 -47
  5. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +82 -55
  6. package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +51 -86
  7. package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue.js +4 -32
  8. package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue2.js +28 -7
  9. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +35 -22
  10. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +2 -30
  11. package/dist/components/1_atoms/LinkPreview/LinkPreview.vue.js +4 -37
  12. package/dist/components/1_atoms/LinkPreview/LinkPreview.vue2.js +21 -7
  13. package/dist/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +19 -30
  14. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +4 -70
  15. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +108 -76
  16. package/dist/components/1_icons/AvatarIcon.vue.js +8 -8
  17. package/dist/components/1_icons/CheckIcon.vue.js +13 -26
  18. package/dist/components/1_icons/CloseButtonIcon.vue.js +10 -16
  19. package/dist/components/1_icons/CloseIcon.vue.js +10 -16
  20. package/dist/components/1_icons/ContactCRMIcon.vue.js +10 -16
  21. package/dist/components/1_icons/DeletedMessageIcon.vue.js +11 -17
  22. package/dist/components/1_icons/MenuIcon.vue.js +10 -16
  23. package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue.js +3 -23
  24. package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue2.js +21 -12
  25. package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue.js +4 -36
  26. package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue2.js +26 -11
  27. package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue.js +3 -23
  28. package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue2.js +21 -12
  29. package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue.js +3 -23
  30. package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue2.js +20 -11
  31. package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue.js +4 -33
  32. package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue2.js +23 -11
  33. package/dist/components/1_icons/SearchIcon.vue.js +17 -29
  34. package/dist/components/1_icons/SettingsIcon.vue.js +8 -8
  35. package/dist/components/1_icons/TelegramIcon.vue.js +20 -32
  36. package/dist/components/1_icons/VerifiedBadge.vue.js +19 -25
  37. package/dist/components/1_icons/WhatsAppIcon.vue.js +20 -32
  38. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +402 -552
  39. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +58 -101
  40. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +8 -14
  41. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelConfirmSpinner.vue.js +7 -7
  42. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelMaxIcon.vue.js +7 -7
  43. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelPhoneIcon.vue.js +13 -19
  44. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSMSIcon.vue.js +10 -16
  45. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuMaxIcon.vue.js +23 -35
  46. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuPhoneIcon.vue.js +20 -32
  47. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuSMSIcon.vue.js +11 -17
  48. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuTelegramIcon.vue.js +8 -8
  49. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js +20 -32
  50. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelTelegramIcon.vue.js +21 -33
  51. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +7 -7
  52. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelWhatsAppIcon.vue.js +8 -8
  53. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +4 -74
  54. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +46 -12
  55. package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue.js +4 -62
  56. package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue2.js +36 -15
  57. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue.js +4 -49
  58. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +45 -22
  59. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue.js +4 -36
  60. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +37 -19
  61. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +4 -62
  62. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +98 -80
  63. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +27 -31
  64. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +2 -13
  65. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +4 -72
  66. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +83 -47
  67. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +21 -19
  68. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +2 -13
  69. package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +45 -76
  70. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +4 -100
  71. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +91 -16
  72. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +4 -79
  73. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +111 -88
  74. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +17 -15
  75. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +2 -13
  76. package/dist/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.js +33 -39
  77. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +4 -220
  78. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +256 -146
  79. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +41 -39
  80. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +2 -13
  81. package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +163 -233
  82. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js +4 -164
  83. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +175 -87
  84. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.js +4 -73
  85. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +58 -32
  86. package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue.js +4 -47
  87. package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue2.js +23 -10
  88. package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue.js +4 -52
  89. package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue2.js +26 -8
  90. package/dist/components/2_chatinput_elements/WABATemplateSelector/WABATemplateSelector.vue.js +220 -299
  91. package/dist/components/2_chatlist_elements/ChatFilter/ChatFilter.vue.js +35 -41
  92. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +4 -306
  93. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +314 -131
  94. package/dist/components/2_chatlist_elements/ChatItem/icons/AudioIcon.vue.js +12 -18
  95. package/dist/components/2_chatlist_elements/ChatItem/icons/FileIcon.vue.js +11 -23
  96. package/dist/components/2_chatlist_elements/ChatItem/icons/ImageIcon.vue.js +7 -7
  97. package/dist/components/2_chatlist_elements/ChatItem/icons/MissedCallIcon.vue.js +22 -34
  98. package/dist/components/2_chatlist_elements/ChatItem/icons/StickerIcon.vue.js +9 -15
  99. package/dist/components/2_chatlist_elements/ChatItem/icons/VideoIcon.vue.js +14 -26
  100. package/dist/components/2_chatlist_elements/ChatItem/icons/VoiceIcon.vue.js +7 -7
  101. package/dist/components/2_chatlist_elements/ChatTabs/ChatTabs.vue.js +24 -52
  102. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +4 -84
  103. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +68 -36
  104. package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +37 -71
  105. package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +62 -83
  106. package/dist/components/2_elements/ChatPanel/ChatPanel.vue.js +29 -41
  107. package/dist/components/2_elements/ContactInfo/ContactInfo.vue.js +115 -176
  108. package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +27 -48
  109. package/dist/components/2_elements/UserProfile/UserProfile.vue.js +28 -58
  110. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +4 -54
  111. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +42 -22
  112. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +4 -460
  113. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +499 -181
  114. package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js +4 -19
  115. package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue2.js +22 -12
  116. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +4 -26
  117. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +39 -26
  118. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +4 -482
  119. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +448 -148
  120. package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue.js +19 -17
  121. package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue2.js +2 -13
  122. package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue.js +19 -17
  123. package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue2.js +2 -13
  124. package/dist/components/2_feed_elements/DateMessage/DateMessage.vue.js +4 -17
  125. package/dist/components/2_feed_elements/DateMessage/DateMessage.vue2.js +7 -7
  126. package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js +3 -16
  127. package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue2.js +7 -7
  128. package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue.js +4 -67
  129. package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue2.js +43 -11
  130. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +4 -47
  131. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +46 -37
  132. package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue.js +4 -22
  133. package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue2.js +15 -8
  134. package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js +4 -43
  135. package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue2.js +25 -10
  136. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +4 -52
  137. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +39 -16
  138. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +4 -270
  139. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +274 -95
  140. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +4 -409
  141. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +422 -143
  142. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js +4 -39
  143. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +22 -12
  144. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +4 -57
  145. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +69 -41
  146. package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js +4 -97
  147. package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue2.js +173 -102
  148. package/dist/components/2_feed_elements/MessageReactions/icons/DeleteIcon.vue.js +20 -32
  149. package/dist/components/2_feed_elements/MessageReactions/icons/EditIcon.vue.js +20 -32
  150. package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +11 -17
  151. package/dist/components/2_feed_elements/MessageReactions/icons/MessageActionsIcon.vue.js +10 -16
  152. package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +11 -17
  153. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +4 -22
  154. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +23 -17
  155. package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +4 -28
  156. package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue2.js +29 -27
  157. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +4 -142
  158. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +121 -33
  159. package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +22 -34
  160. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +4 -55
  161. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +30 -8
  162. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +4 -47
  163. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +25 -9
  164. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +4 -56
  165. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +37 -8
  166. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +4 -72
  167. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +59 -10
  168. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +4 -142
  169. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +118 -34
  170. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +4 -49
  171. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +53 -15
  172. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +4 -94
  173. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +76 -10
  174. package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue.js +4 -18
  175. package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue2.js +17 -9
  176. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -348
  177. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +339 -97
  178. package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue.js +4 -17
  179. package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue2.js +7 -7
  180. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +4 -308
  181. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +299 -89
  182. package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue.js +4 -37
  183. package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue2.js +21 -7
  184. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +4 -321
  185. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +338 -96
  186. package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue.js +4 -64
  187. package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue3.js +45 -10
  188. package/dist/components/2_modals/CreateChat/CreateChat.vue.js +19 -36
  189. package/dist/components/2_modals/CreateChat2/CreateChat2.vue.js +92 -140
  190. package/dist/components/2_modals/CreateDialog/CreateDialog.vue.js +49 -96
  191. package/dist/components/2_modals/Modal/Modal.vue.js +50 -59
  192. package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +38 -51
  193. package/dist/components/2_modals/ModalNoFooter/ModalNoFooter.vue.js +30 -39
  194. package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue.js +4 -155
  195. package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue2.js +121 -49
  196. package/dist/components/2_modals/SelectUser/SelectUser.vue.js +43 -60
  197. package/dist/components/2_modals/SelectUser2/SelectUser2.vue.js +24 -41
  198. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +4 -170
  199. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +336 -239
  200. package/dist/components/3_compounds/ChatInput/icons/ArrowIcon.vue.js +25 -43
  201. package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue.js +21 -25
  202. package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue2.js +2 -13
  203. package/dist/components/3_compounds/ChatList/ChatList.vue.js +166 -256
  204. package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +39 -57
  205. package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +6 -6
  206. package/dist/components/3_compounds/Feed/Feed.vue.js +4 -185
  207. package/dist/components/3_compounds/Feed/Feed.vue2.js +314 -161
  208. package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +19 -17
  209. package/dist/components/3_compounds/SideBar/SideBar.vue.js +202 -279
  210. package/dist/components/4_layouts/AdaptiveExtendedLayout/AdaptiveExtendedLayout.vue.js +36 -43
  211. package/dist/components/4_layouts/BaseLayout/BaseLayout.vue.js +5 -5
  212. package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue.js +4 -32
  213. package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue2.js +29 -7
  214. package/dist/components/4_layouts/ExtendedLayout/ExtendedLayout.vue.js +7 -7
  215. package/dist/components/4_layouts/FeedLayout/FeedLayout.vue.js +8 -8
  216. package/dist/components/5_containers/BaseContainer/BaseContainer.vue.js +18 -33
  217. package/dist/components/5_containers/FloatContainer/FloatContainer.vue.js +59 -90
  218. package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +2 -0
  219. package/package.json +1 -1
@@ -1,23 +1,33 @@
1
- import { defineComponent as Pe, inject as _e, watch as d, ref as v, computed as p, provide as qe, nextTick as A, unref as ze, onMounted as je, onUnmounted as ke } from "vue";
2
- import { useImmediateDebouncedRef as Ne } from "../../../hooks/useImmediateDebouncedRef.js";
3
- import { MAX_ATTACHED_FILES as ue, resolveMessageDraftStore as Be, useMessageDraft as Oe, getDraftFiles as Ge } from "../../../hooks/useMessageDraft.js";
4
- import { useEmojiNative as Ye } from "../../../hooks/useEmojiNative.js";
1
+ import { defineComponent as Ge, inject as Oe, watch as p, ref as b, computed as v, provide as Ue, nextTick as F, unref as r, onMounted as Ve, onUnmounted as Ye, createElementBlock as g, openBlock as h, normalizeClass as q, toDisplayString as N, Fragment as ie, createElementVNode as f, createVNode as z, createCommentVNode as V, renderList as Xe, createBlock as Je, renderSlot as oe, withDirectives as Qe, withKeys as Ze, vModelText as et } from "vue";
2
+ import { useImmediateDebouncedRef as tt } from "../../../hooks/useImmediateDebouncedRef.js";
3
+ import { MAX_ATTACHED_FILES as se, resolveMessageDraftStore as nt, useMessageDraft as lt, getDraftFiles as it } from "../../../hooks/useMessageDraft.js";
4
+ import { useEmojiNative as ot } from "../../../hooks/useEmojiNative.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
- import { t as y } from "../../../locale/useLocale.js";
7
+ import { t as m } from "../../../locale/useLocale.js";
8
8
  /* empty css */
9
9
  import "../../../node_modules/linkifyjs/dist/linkify.js";
10
10
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
11
11
  import "../../../functions/parseMarkdown.js";
12
- import { textToAppleEmojiHtml as Ue, textContainsEmoji as Ve, snapIndexToGrapheme as ce, previousGraphemeIndex as fe, nextGraphemeIndex as de } from "../../../functions/renderAppleEmojis.js";
13
- import { useStartEdit as Xe, hideEditPreview as $e } from "../../../hooks/messages/useStartEdit.js";
14
- import { canStartEditLastSent as Je, isEditableLastSentCandidate as Qe } from "../../../hooks/messages/canStartEditLastSent.js";
15
- import { buildEditPayload as Ze } from "../../../hooks/messages/buildEditPayload.js";
16
- import et from "./icons/SendIcon.vue.js";
17
- import tt from "./icons/ArrowIcon.vue.js";
18
- import nt from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
19
- import ot from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
20
- const K = 40, Tt = /* @__PURE__ */ Pe({
12
+ import { textToAppleEmojiHtml as st, textContainsEmoji as at, previousGraphemeIndex as ae, nextGraphemeIndex as re, snapIndexToGrapheme as ce } from "../../../functions/renderAppleEmojis.js";
13
+ import { useStartEdit as rt, hideEditPreview as ct } from "../../../hooks/messages/useStartEdit.js";
14
+ import { canStartEditLastSent as ut, isEditableLastSentCandidate as dt } from "../../../hooks/messages/canStartEditLastSent.js";
15
+ import { buildEditPayload as ft } from "../../../hooks/messages/buildEditPayload.js";
16
+ import pt from "./icons/SendIcon.vue.js";
17
+ import ue from "./icons/ArrowIcon.vue.js";
18
+ import ht from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
19
+ import mt from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
20
+ const vt = {
21
+ key: 0,
22
+ class: "chat-input__disabled-placeholder",
23
+ "data-testid": "chat-input-disabled-placeholder"
24
+ }, gt = ["id"], yt = ["id"], St = { class: "chat-input__file-counter" }, _t = { class: "chat-input__file-chips-wrap" }, xt = ["aria-label"], bt = ["aria-label"], It = { class: "chat-input__inline-buttons" }, Ct = {
25
+ key: 0,
26
+ class: "chat-input__input chat-input__disabled-placeholder"
27
+ }, Ft = {
28
+ key: 1,
29
+ class: "chat-input__input-wrap"
30
+ }, Tt = ["innerHTML"], Et = ["disabled", "placeholder"], At = ["disabled"], wt = { class: "" }, Mt = { class: "chat-input__third-line" }, Y = 40, Jt = /* @__PURE__ */ Ge({
21
31
  __name: "ChatInput",
22
32
  props: {
23
33
  state: {
@@ -47,7 +57,7 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
47
57
  maxAttachedFiles: {
48
58
  type: Number,
49
59
  required: !1,
50
- default: ue
60
+ default: se
51
61
  },
52
62
  resolveEditLastSentMessage: {
53
63
  type: Function,
@@ -56,46 +66,45 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
56
66
  }
57
67
  },
58
68
  emits: ["send", "typing"],
59
- setup(pe, { expose: me, emit: he }) {
60
- me();
61
- const w = he, E = _e("chatAppId"), G = Be(E), { resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X } = Oe(E), { startEdit: $ } = Xe(E), { isNative: J, emojiSrc: Q } = Ye(E);
62
- let H = l().id;
63
- d(
64
- () => l().id,
69
+ setup(M, { emit: de }) {
70
+ const D = de, I = Oe("chatAppId"), fe = nt(I), { resetMessage: pe, getMessage: o, setMessageText: H, setForceSendMessage: he, resetEdit: me, removeMessageFile: ve } = lt(I), { startEdit: ge } = rt(I), { isNative: ye, emojiSrc: Se } = ot(I);
71
+ let X = o().id;
72
+ p(
73
+ () => o().id,
65
74
  (e) => {
66
- H = e;
75
+ X = e;
67
76
  }
68
77
  );
69
- const o = v(), T = v(), M = v(), S = v(null), F = v(!1), Z = Ne("", 2e3), P = v(!1), _ = v(!1);
70
- let f = null;
71
- const x = p(() => Ge(l()));
72
- function W() {
73
- const e = M.value;
78
+ const l = b(), T = b(), L = b(), E = b(null), R = b(!1), _e = tt("", 2e3), B = b(!1), j = b(!1);
79
+ let y = null;
80
+ const S = v(() => it(o()));
81
+ function K() {
82
+ const e = L.value;
74
83
  if (!e) {
75
- P.value = !1, _.value = !1;
84
+ B.value = !1, j.value = !1;
76
85
  return;
77
86
  }
78
87
  const t = e.scrollWidth - e.clientWidth;
79
- P.value = e.scrollLeft > 1, _.value = t - e.scrollLeft > 1;
88
+ B.value = e.scrollLeft > 1, j.value = t - e.scrollLeft > 1;
80
89
  }
81
- function ee(e) {
90
+ function xe(e) {
82
91
  const t = e.firstElementChild;
83
92
  if (!t) return e.clientWidth;
84
93
  const n = parseFloat(getComputedStyle(e).gap) || 8;
85
94
  return t.offsetWidth + n;
86
95
  }
87
- function ge(e) {
88
- const t = M.value;
96
+ function J(e) {
97
+ const t = L.value;
89
98
  if (!t) return;
90
- const n = ee(t);
99
+ const n = xe(t);
91
100
  t.scrollBy({ left: e === "right" ? n : -n, behavior: "smooth" });
92
101
  }
93
- function q() {
94
- f == null || f.disconnect();
95
- const e = M.value;
96
- e && (f = new ResizeObserver(() => W()), f.observe(e));
102
+ function Q() {
103
+ y == null || y.disconnect();
104
+ const e = L.value;
105
+ e && (y = new ResizeObserver(() => K()), y.observe(e));
97
106
  }
98
- function ve(e) {
107
+ function be(e) {
99
108
  return e.preview ?? {
100
109
  isImage: !1,
101
110
  isVideo: !1,
@@ -104,283 +113,283 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
104
113
  fileSize: ""
105
114
  };
106
115
  }
107
- const ye = p(
108
- () => Ue(l().text || "", S.value, Q.value)
109
- ), L = p(
110
- () => !J.value && Ve(l().text || "")
111
- ), m = () => {
112
- if (!T.value || !o.value) return;
113
- const e = o.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
116
+ const Ie = v(
117
+ () => st(o().text || "", E.value, Se.value)
118
+ ), A = v(
119
+ () => !ye.value && at(o().text || "")
120
+ ), _ = () => {
121
+ if (!T.value || !l.value) return;
122
+ const e = l.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
114
123
  t.style.right = n > 0 ? `${n}px` : "", t.scrollTop = e.scrollTop;
115
124
  };
116
- let h = 0;
117
- function z() {
118
- S.value = null;
125
+ let w = 0;
126
+ function $() {
127
+ E.value = null;
119
128
  }
120
- function te(e = "nearest") {
121
- const t = o.value;
122
- if (!t || !L.value) return;
123
- const n = t.value, s = ce(n, t.selectionStart, e), r = ce(n, t.selectionEnd, e);
124
- (s !== t.selectionStart || r !== t.selectionEnd) && t.setSelectionRange(s, r);
129
+ function Ce(e = "nearest") {
130
+ const t = l.value;
131
+ if (!t || !A.value) return;
132
+ const n = t.value, i = ce(n, t.selectionStart, e), a = ce(n, t.selectionEnd, e);
133
+ (i !== t.selectionStart || a !== t.selectionEnd) && t.setSelectionRange(i, a);
125
134
  }
126
- function ne() {
127
- te("nearest"), I();
135
+ function G() {
136
+ Ce("nearest"), C();
128
137
  }
129
- function oe(e) {
130
- var r, a, u;
131
- const t = l(), n = o.value;
132
- if (!Je({
138
+ function Fe(e) {
139
+ var a, c, u;
140
+ const t = o(), n = l.value;
141
+ if (!ut({
133
142
  key: e.key,
134
143
  altKey: e.altKey,
135
144
  metaKey: e.metaKey,
136
145
  ctrlKey: e.ctrlKey,
137
146
  shiftKey: e.shiftKey,
138
- hasResolver: typeof i.resolveEditLastSentMessage == "function",
139
- disabled: i.state === "disabled",
147
+ hasResolver: typeof s.resolveEditLastSentMessage == "function",
148
+ disabled: s.state === "disabled",
140
149
  isRecording: t.isRecording,
141
150
  draftText: t.text ?? "",
142
- replyMessageId: (r = t.reply) == null ? void 0 : r.messageId,
143
- editMessageId: (a = t.edit) == null ? void 0 : a.messageId,
151
+ replyMessageId: (a = t.reply) == null ? void 0 : a.messageId,
152
+ editMessageId: (c = t.edit) == null ? void 0 : c.messageId,
144
153
  textareaText: (n == null ? void 0 : n.value) ?? t.text ?? "",
145
154
  selectionStart: (n == null ? void 0 : n.selectionStart) ?? 0
146
155
  })) return !1;
147
- const s = (u = i.resolveEditLastSentMessage) == null ? void 0 : u.call(i);
148
- return Qe(s) ? (e.preventDefault(), $(Ze(s)), !0) : !1;
156
+ const i = (u = s.resolveEditLastSentMessage) == null ? void 0 : u.call(s);
157
+ return dt(i) ? (e.preventDefault(), ge(ft(i)), !0) : !1;
149
158
  }
150
- function Se(e) {
151
- if (oe(e) || !L.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
152
- const t = o.value;
159
+ function Te(e) {
160
+ if (Fe(e) || !A.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
161
+ const t = l.value;
153
162
  if (!t) return;
154
- const n = t.value, s = t.selectionStart !== t.selectionEnd;
163
+ const n = t.value, i = t.selectionStart !== t.selectionEnd;
155
164
  if (e.shiftKey) {
156
- requestAnimationFrame(() => ne());
165
+ requestAnimationFrame(() => G());
157
166
  return;
158
167
  }
159
- if (s) {
168
+ if (i) {
160
169
  e.preventDefault();
161
- const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, g = e.key === "ArrowLeft" ? fe(n, u) : de(n, u);
162
- t.setSelectionRange(g, g), I();
170
+ const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, x = e.key === "ArrowLeft" ? ae(n, u) : re(n, u);
171
+ t.setSelectionRange(x, x), C();
163
172
  return;
164
173
  }
165
174
  e.preventDefault();
166
- const r = t.selectionStart, a = e.key === "ArrowLeft" ? fe(n, r) : de(n, r);
167
- t.setSelectionRange(a, a), I();
175
+ const a = t.selectionStart, c = e.key === "ArrowLeft" ? ae(n, a) : re(n, a);
176
+ t.setSelectionRange(c, c), C();
168
177
  }
169
- function I() {
170
- if (!L.value) {
171
- z();
178
+ function C() {
179
+ if (!A.value) {
180
+ $();
172
181
  return;
173
182
  }
174
- h && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
175
- var a;
176
- h = 0;
177
- const e = o.value;
183
+ w && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
184
+ var c;
185
+ w = 0;
186
+ const e = l.value;
178
187
  if (!e) {
179
- z();
188
+ $();
180
189
  return;
181
190
  }
182
191
  const t = e.selectionStart, n = e.selectionEnd;
183
192
  if (t === n) {
184
- S.value !== null && (S.value = null, A(m));
193
+ E.value !== null && (E.value = null, F(_));
185
194
  return;
186
195
  }
187
- const s = S.value;
188
- if (s && s.start === t && s.end === n) return;
189
- const r = ((a = T.value) == null ? void 0 : a.scrollTop) ?? 0;
190
- S.value = { start: t, end: n }, A(() => {
191
- T.value && (T.value.scrollTop = r), m();
196
+ const i = E.value;
197
+ if (i && i.start === t && i.end === n) return;
198
+ const a = ((c = T.value) == null ? void 0 : c.scrollTop) ?? 0;
199
+ E.value = { start: t, end: n }, F(() => {
200
+ T.value && (T.value.scrollTop = a), _();
192
201
  });
193
202
  });
194
203
  }
195
- function xe(e) {
196
- e.buttons && I();
204
+ function Ee(e) {
205
+ e.buttons && C();
197
206
  }
198
- function j() {
199
- document.activeElement === o.value && I();
207
+ function Z() {
208
+ document.activeElement === l.value && C();
200
209
  }
201
- const i = pe, Ie = p(
202
- () => i.state === "disabled" && !!i.disabledPlaceholder
203
- ), k = p(() => {
204
- const e = Number(i.maxAttachedFiles);
205
- return Number.isFinite(e) && e > 0 ? Math.floor(e) : ue;
210
+ const s = M, ee = v(
211
+ () => s.state === "disabled" && !!s.disabledPlaceholder
212
+ ), te = v(() => {
213
+ const e = Number(s.maxAttachedFiles);
214
+ return Number.isFinite(e) && e > 0 ? Math.floor(e) : se;
206
215
  });
207
- qe("maxAttachedFiles", k);
208
- const Ae = p(
209
- () => y("component.ChatInput.FilesSelectedCount").replace("{count}", String(x.value.length)).replace("{max}", String(k.value))
210
- ), Ee = p(() => !!(i.state == "disabled" || l().text == "" && !x.value.length || l().isRecording)), Te = p(() => {
216
+ Ue("maxAttachedFiles", te);
217
+ const Ae = v(
218
+ () => m("component.ChatInput.FilesSelectedCount").replace("{count}", String(S.value.length)).replace("{max}", String(te.value))
219
+ ), we = v(() => !!(s.state == "disabled" || o().text == "" && !S.value.length || o().isRecording)), Me = v(() => {
211
220
  var t;
212
- if (i.inputButtonColor)
213
- return i.inputButtonColor;
214
- if (!((t = i.selectedChannel) != null && t.channelId))
221
+ if (s.inputButtonColor)
222
+ return s.inputButtonColor;
223
+ if (!((t = s.selectedChannel) != null && t.channelId))
215
224
  return "#25D366";
216
- const e = i.selectedChannel.channelId.toLowerCase();
225
+ const e = s.selectedChannel.channelId.toLowerCase();
217
226
  return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
218
- }), Fe = p(() => {
227
+ }), Le = v(() => {
219
228
  var t;
220
- if (!((t = i.selectedChannel) != null && t.channelId))
221
- return y("component.ChatInput.InputPlaceholder");
222
- const e = i.selectedChannel.channelId.toLowerCase();
223
- return e.includes("whatsapp") || e.includes("waba") ? y("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? y("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? y("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? y("component.ChatInput.MaxInputPlaceholder") : y("component.ChatInput.InputPlaceholder");
229
+ if (!((t = s.selectedChannel) != null && t.channelId))
230
+ return m("component.ChatInput.InputPlaceholder");
231
+ const e = s.selectedChannel.channelId.toLowerCase();
232
+ return e.includes("whatsapp") || e.includes("waba") ? m("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? m("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? m("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? m("component.ChatInput.MaxInputPlaceholder") : m("component.ChatInput.InputPlaceholder");
224
233
  });
225
- d(
226
- () => Z.value,
234
+ p(
235
+ () => _e.value,
227
236
  () => {
228
- w("typing");
237
+ D("typing");
229
238
  }
230
239
  );
231
- function N(e = !1) {
232
- A(() => {
233
- if (e && !F.value) return;
234
- const t = o.value;
235
- t && (C(t), e && (F.value = !1), D(t), requestAnimationFrame(() => D(t)));
240
+ function ne(e = !1) {
241
+ F(() => {
242
+ if (e && !R.value) return;
243
+ const t = l.value;
244
+ t && (k(t), e && (R.value = !1), P(t), requestAnimationFrame(() => P(t)));
236
245
  });
237
246
  }
238
- d(
239
- () => l().edit,
247
+ p(
248
+ () => o().edit,
240
249
  (e) => {
241
- (e == null ? void 0 : e.messageId) != null && (F.value = !0, N(!0));
250
+ (e == null ? void 0 : e.messageId) != null && (R.value = !0, ne(!0));
242
251
  }
243
- ), d(
244
- () => l().reply,
252
+ ), p(
253
+ () => o().reply,
245
254
  (e) => {
246
- (e == null ? void 0 : e.messageId) != null && N();
255
+ (e == null ? void 0 : e.messageId) != null && ne();
247
256
  }
248
- ), d(
249
- () => i.focusOnInputArea,
257
+ ), p(
258
+ () => s.focusOnInputArea,
250
259
  () => {
251
- i.focusOnInputArea && A(() => {
252
- const e = ze(o);
260
+ s.focusOnInputArea && F(() => {
261
+ const e = r(l);
253
262
  e == null || e.focus();
254
263
  });
255
264
  },
256
265
  { immediate: !0 }
257
- ), d(
258
- () => l().text,
266
+ ), p(
267
+ () => o().text,
259
268
  () => {
260
- const e = o.value;
261
- e && (C(e), F.value && (F.value = !1, D(e), requestAnimationFrame(() => D(e))));
269
+ const e = l.value;
270
+ e && (k(e), R.value && (R.value = !1, P(e), requestAnimationFrame(() => P(e))));
262
271
  },
263
272
  { immediate: !0, flush: "post" }
264
- ), d(
265
- () => l().id,
273
+ ), p(
274
+ () => o().id,
266
275
  () => {
267
- const e = o.value;
268
- e && (R(e), requestAnimationFrame(() => {
269
- const t = o.value;
270
- t && C(t);
276
+ const e = l.value;
277
+ e && (W(e), requestAnimationFrame(() => {
278
+ const t = l.value;
279
+ t && k(t);
271
280
  }));
272
281
  }
273
- ), d(L, (e) => {
274
- e && A(() => {
275
- const t = o.value;
282
+ ), p(A, (e) => {
283
+ e && F(() => {
284
+ const t = l.value;
276
285
  if (!t) return;
277
286
  const n = t.scrollTop;
278
- C(t), t.scrollTop = n, m(), requestAnimationFrame(m);
287
+ k(t), t.scrollTop = n, _(), requestAnimationFrame(_);
279
288
  });
280
289
  });
281
- function R(e) {
282
- const t = l().inputHeight;
283
- e.style.height = (t || K) + "px", (!t || t <= K) && (e.style.overflowY = "hidden");
290
+ function W(e) {
291
+ const t = o().inputHeight;
292
+ e.style.height = (t || Y) + "px", (!t || t <= Y) && (e.style.overflowY = "hidden");
284
293
  }
285
- function se(e) {
294
+ function Re(e) {
286
295
  const t = parseFloat(e.style.height);
287
- Number.isFinite(t) && (l().inputHeight = t);
296
+ Number.isFinite(t) && (o().inputHeight = t);
288
297
  }
289
- function C(e) {
290
- const t = l().text || "";
298
+ function k(e) {
299
+ const t = o().text || "";
291
300
  if (e.value !== t || e.clientWidth === 0) {
292
- R(e);
301
+ W(e);
293
302
  return;
294
303
  }
295
304
  const n = e.scrollTop;
296
305
  e.style.height = "auto";
297
- const s = getComputedStyle(e), r = parseFloat(s.fontSize) || 16, a = parseFloat(s.lineHeight) || r * 1.4, u = K, g = a * 11, O = e.scrollHeight, Le = t.split(`
298
- `).length > 1, c = document.createElement("div");
299
- c.style.position = "absolute", c.style.visibility = "hidden", c.style.whiteSpace = "nowrap", c.style.font = s.font, c.style.fontSize = s.fontSize, c.style.fontFamily = s.fontFamily, c.style.fontWeight = s.fontWeight, c.style.letterSpacing = s.letterSpacing, c.textContent = t, document.body.appendChild(c);
300
- const Re = c.offsetWidth;
301
- document.body.removeChild(c);
302
- const De = parseFloat(s.paddingLeft) || 0, He = parseFloat(s.paddingRight) || 0, We = e.clientWidth - De - He, Ke = Re > We, ae = Le || Ke;
303
- if (ae && O <= u + 1) {
304
- R(e);
306
+ const i = getComputedStyle(e), a = parseFloat(i.fontSize) || 16, c = parseFloat(i.lineHeight) || a * 1.4, u = Y, x = c * 11, U = e.scrollHeight, qe = t.split(`
307
+ `).length > 1, d = document.createElement("div");
308
+ d.style.position = "absolute", d.style.visibility = "hidden", d.style.whiteSpace = "nowrap", d.style.font = i.font, d.style.fontSize = i.fontSize, d.style.fontFamily = i.fontFamily, d.style.fontWeight = i.fontWeight, d.style.letterSpacing = i.letterSpacing, d.textContent = t, document.body.appendChild(d);
309
+ const Ne = d.offsetWidth;
310
+ document.body.removeChild(d);
311
+ const ze = parseFloat(i.paddingLeft) || 0, Be = parseFloat(i.paddingRight) || 0, je = e.clientWidth - ze - Be, $e = Ne > je, le = qe || $e;
312
+ if (le && U <= u + 1) {
313
+ W(e);
305
314
  return;
306
315
  }
307
- t.trim() && ae ? O <= g ? (e.style.height = O + "px", e.style.overflowY = "hidden") : (e.style.height = g + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), se(e), m(), requestAnimationFrame(m);
316
+ t.trim() && le ? U <= x ? (e.style.height = U + "px", e.style.overflowY = "hidden") : (e.style.height = x + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), Re(e), _(), requestAnimationFrame(_);
308
317
  }
309
- function D(e) {
310
- if (i.state === "disabled" || l().isRecording) return;
318
+ function P(e) {
319
+ if (s.state === "disabled" || o().isRecording) return;
311
320
  const t = e.value.length;
312
- e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, m();
321
+ e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, _();
313
322
  }
314
- d(
315
- () => l().forceSend,
323
+ p(
324
+ () => o().forceSend,
316
325
  () => {
317
- l().forceSend && (B(), U(!1));
326
+ o().forceSend && (O(), he(!1));
318
327
  }
319
328
  );
320
- const Ce = (e) => {
329
+ const ke = (e) => {
321
330
  const t = e.target;
322
- w("typing", t.value), I();
331
+ D("typing", t.value), C();
323
332
  };
324
- d(
325
- x,
333
+ p(
334
+ S,
326
335
  (e, t) => {
327
- A(() => {
328
- q(), W();
329
- const n = M.value;
336
+ F(() => {
337
+ Q(), K();
338
+ const n = L.value;
330
339
  n && e.length > ((t == null ? void 0 : t.length) ?? 0) && n.scrollTo({ left: n.scrollWidth, behavior: "smooth" });
331
340
  });
332
341
  },
333
342
  { flush: "post" }
334
- ), je(() => {
335
- const e = o.value;
336
- e && (R(e), C(e)), q(), W(), document.addEventListener("selectionchange", j);
337
- }), ke(() => {
338
- G.commitChatDraftToList(H), document.removeEventListener("selectionchange", j), f == null || f.disconnect(), h && cancelAnimationFrame(h);
343
+ ), Ve(() => {
344
+ const e = l.value;
345
+ e && (W(e), k(e)), Q(), K(), document.addEventListener("selectionchange", Z);
346
+ }), Ye(() => {
347
+ fe.commitChatDraftToList(X), document.removeEventListener("selectionchange", Z), y == null || y.disconnect(), w && cancelAnimationFrame(w);
339
348
  });
340
- const we = (e) => {
349
+ const De = (e) => {
341
350
  if (e.shiftKey) {
342
- if (o.value instanceof HTMLTextAreaElement) {
343
- let t = o.value.selectionStart;
344
- t && (o.value.setRangeText(`
345
- `, t, t, "end"), b(o.value.value));
351
+ if (l.value instanceof HTMLTextAreaElement) {
352
+ let t = l.value.selectionStart;
353
+ t && (l.value.setRangeText(`
354
+ `, t, t, "end"), H(l.value.value));
346
355
  }
347
356
  e.preventDefault();
348
357
  } else if (e.ctrlKey) {
349
- if (o.value instanceof HTMLTextAreaElement) {
350
- let t = o.value.selectionStart;
351
- t && (o.value.setRangeText(`
352
- `, t, t, "end"), b(o.value.value));
358
+ if (l.value instanceof HTMLTextAreaElement) {
359
+ let t = l.value.selectionStart;
360
+ t && (l.value.setRangeText(`
361
+ `, t, t, "end"), H(l.value.value));
353
362
  }
354
363
  e.preventDefault();
355
364
  } else
356
- e.preventDefault(), B();
357
- }, be = (e) => {
358
- if (o.value) {
359
- const t = o.value.value;
360
- o.value.value = e.newText;
361
- const n = e.newText.length - (t.length - (e.end - e.start)), s = e.start + n;
362
- b(e.newText), A(() => {
363
- o.value && (o.value.setSelectionRange(s, s), o.value.focus());
365
+ e.preventDefault(), O();
366
+ }, He = (e) => {
367
+ if (l.value) {
368
+ const t = l.value.value;
369
+ l.value.value = e.newText;
370
+ const n = e.newText.length - (t.length - (e.end - e.start)), i = e.start + n;
371
+ H(e.newText), F(() => {
372
+ l.value && (l.value.setSelectionRange(i, i), l.value.focus());
364
373
  });
365
374
  }
366
375
  };
367
- function Me(e) {
368
- X(e);
376
+ function Ke(e) {
377
+ ve(e);
369
378
  }
370
- function le() {
371
- V(), b(""), $e(E), o.value && o.value.focus();
379
+ function We() {
380
+ me(), H(""), ct(I), l.value && l.value.focus();
372
381
  }
373
- function ie() {
374
- const e = l();
382
+ function Pe() {
383
+ const e = o();
375
384
  return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
376
385
  }
377
- const B = () => {
378
- const e = v(l());
379
- if (e.value.edit && ie() && !x.value.length) {
380
- le();
386
+ const O = () => {
387
+ const e = b(o());
388
+ if (e.value.edit && Pe() && !S.value.length) {
389
+ We();
381
390
  return;
382
391
  }
383
- if (e.value.text != "" || x.value.length) {
392
+ if (e.value.text != "" || S.value.length) {
384
393
  const t = {
385
394
  type: "",
386
395
  text: "",
@@ -388,46 +397,134 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
388
397
  filename: "",
389
398
  size: "",
390
399
  reply: void 0
391
- }, n = x.value;
400
+ }, n = S.value;
392
401
  if (n.length) {
393
- const s = e.value.text.trim();
394
- n.forEach((r, a) => {
395
- var g;
402
+ const i = e.value.text.trim();
403
+ n.forEach((a, c) => {
404
+ var x;
396
405
  const u = {
397
- type: "message." + r.type,
398
- url: r.url,
399
- filename: r.name,
400
- size: (g = r.size) == null ? void 0 : g.toString(),
401
- text: a === 0 ? s : ""
406
+ type: "message." + a.type,
407
+ url: a.url,
408
+ filename: a.name,
409
+ size: (x = a.size) == null ? void 0 : x.toString(),
410
+ text: c === 0 ? i : ""
402
411
  };
403
- a === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), w("send", u);
412
+ c === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), D("send", u);
404
413
  });
405
414
  } else
406
- t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit), w("send", t);
407
- Y(), o.value && o.value.focus();
415
+ t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit), D("send", t);
416
+ pe(), l.value && l.value.focus();
408
417
  }
409
- }, re = { emit: w, chatAppId: E, messageDraftStore: G, resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X, startEdit: $, isNative: J, emojiSrc: Q, get ownedDraftId() {
410
- return H;
411
- }, set ownedDraftId(e) {
412
- H = e;
413
- }, refInput: o, refMirror: T, refFileChips: M, selectionRange: S, focusAtEndAfterResize: F, typing: Z, canScrollLeft: P, canScrollRight: _, get fileChipsObserver() {
414
- return f;
415
- }, set fileChipsObserver(e) {
416
- f = e;
417
- }, attachedFiles: x, updateFileScrollState: W, getFileScrollStep: ee, scrollFiles: ge, setupFileChipsObserver: q, previewOf: ve, emojiMirrorHtml: ye, useEmojiMirror: L, syncMirrorScroll: m, get selectionSyncRaf() {
418
- return h;
419
- }, set selectionSyncRaf(e) {
420
- h = e;
421
- }, clearSelectionHighlight: z, snapTextareaCaret: te, snapCaretAndUpdateSelection: ne, tryStartEditLastSent: oe, onInputKeydown: Se, updateSelectionState: I, onInputMouseMove: xe, onDocumentSelectionChange: j, props: i, showDisabledNotice: Ie, maxAttachedFiles: k, filesSelectedCount: Ae, disabledSendButton: Ee, sendIconColor: Te, inputPlaceholder: Fe, scheduleInputFocusAtEnd: N, INPUT_MIN_HEIGHT: K, applySavedInputHeight: R, persistInputHeight: se, resizeTextarea: C, applyFocusAtEnd: D, sendTyping: Ce, keyEnter: we, handleFormatApplied: be, removeAttachedFile: Me, cancelEditMode: le, isEditTextUnchanged: ie, sendMessage: B, get t() {
422
- return y;
423
- }, get SendIcon() {
424
- return et;
425
- }, get ArrowIcon() {
426
- return tt;
427
- }, TextFormatToolbar: nt, FilePreview: ot };
428
- return Object.defineProperty(re, "__isScriptSetup", { enumerable: !1, value: !0 }), re;
418
+ };
419
+ return (e, t) => (h(), g("div", {
420
+ class: q(["chat-input__container", { "chat-input__container--disabled-notice": ee.value }]),
421
+ "data-testid": "chat-input"
422
+ }, [
423
+ ee.value ? (h(), g("div", vt, N(M.disabledPlaceholder), 1)) : (h(), g(ie, { key: 1 }, [
424
+ f("div", {
425
+ id: "chat-input-reply-line-" + r(I),
426
+ class: "chat-input__reply-line",
427
+ "data-testid": "chat-input-reply-line"
428
+ }, null, 8, gt),
429
+ f("div", {
430
+ id: "chat-input-file-line-" + r(I),
431
+ class: q(["chat-input__file-line", { "chat-input__file-line--visible": S.value.length > 0 }])
432
+ }, [
433
+ f("span", St, [
434
+ f("span", null, N(r(m)("component.ChatInput.FilesSelected")), 1),
435
+ f("span", null, N(Ae.value), 1)
436
+ ]),
437
+ f("div", _t, [
438
+ B.value ? (h(), g("button", {
439
+ key: 0,
440
+ type: "button",
441
+ class: "chat-input__file-scroll chat-input__file-scroll--left",
442
+ "aria-label": r(m)("component.ChatInput.FilesScrollLeft"),
443
+ onClick: t[0] || (t[0] = (n) => J("left"))
444
+ }, [
445
+ z(r(ue))
446
+ ], 8, xt)) : V("", !0),
447
+ f("div", {
448
+ ref_key: "refFileChips",
449
+ ref: L,
450
+ class: "chat-input__file-chips",
451
+ onScroll: K
452
+ }, [
453
+ (h(!0), g(ie, null, Xe(S.value, (n, i) => (h(), Je(mt, {
454
+ key: (n.url || n.name || "") + "-" + i,
455
+ "file-info": be(n),
456
+ onReset: (a) => Ke(i)
457
+ }, null, 8, ["file-info", "onReset"]))), 128))
458
+ ], 544),
459
+ j.value ? (h(), g("button", {
460
+ key: 1,
461
+ type: "button",
462
+ class: "chat-input__file-scroll chat-input__file-scroll--right",
463
+ "aria-label": r(m)("component.ChatInput.FilesScrollRight"),
464
+ onClick: t[1] || (t[1] = (n) => J("right"))
465
+ }, [
466
+ z(r(ue))
467
+ ], 8, bt)) : V("", !0)
468
+ ])
469
+ ], 10, yt),
470
+ f("div", It, [
471
+ oe(e.$slots, "inline-buttons", {}, void 0, !0)
472
+ ]),
473
+ M.disabledPlaceholder && r(o)().isRecording ? (h(), g("div", Ct, N(M.disabledPlaceholder), 1)) : (h(), g("div", Ft, [
474
+ A.value ? (h(), g("div", {
475
+ key: 0,
476
+ ref_key: "refMirror",
477
+ ref: T,
478
+ class: "chat-input__input-mirror",
479
+ "aria-hidden": "true",
480
+ innerHTML: Ie.value
481
+ }, null, 8, Tt)) : V("", !0),
482
+ Qe(f("textarea", {
483
+ ref_key: "refInput",
484
+ ref: l,
485
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r(o)().text = n),
486
+ rows: "1",
487
+ "data-testid": "chat-input-textarea",
488
+ disabled: M.state == "disabled" || r(o)().isRecording,
489
+ class: q(["chat-input__input", { "chat-input__input--emoji-images": A.value }]),
490
+ placeholder: Le.value,
491
+ onKeydown: [
492
+ Te,
493
+ Ze(De, ["enter"])
494
+ ],
495
+ onInput: ke,
496
+ onScroll: _,
497
+ onSelect: C,
498
+ onMouseup: G,
499
+ onKeyup: G,
500
+ onMousemove: Ee,
501
+ onBlur: $
502
+ }, null, 42, Et), [
503
+ [et, r(o)().text]
504
+ ])
505
+ ])),
506
+ z(ht, {
507
+ textarea: l.value,
508
+ onFormatApplied: He
509
+ }, null, 8, ["textarea"]),
510
+ f("button", {
511
+ type: "button",
512
+ class: q(["chat-input__button", { "chat-input__button-disabled": we.value }]),
513
+ "data-testid": "chat-input-send",
514
+ disabled: r(o)().isRecording,
515
+ onClick: O
516
+ }, [
517
+ f("span", wt, [
518
+ z(r(pt), { color: Me.value }, null, 8, ["color"])
519
+ ])
520
+ ], 10, At),
521
+ f("div", Mt, [
522
+ oe(e.$slots, "buttons", {}, void 0, !0)
523
+ ])
524
+ ], 64))
525
+ ], 2));
429
526
  }
430
527
  });
431
528
  export {
432
- Tt as default
529
+ Jt as default
433
530
  };