stream-chat-react 14.3.0 → 14.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/dist/cjs/ReactPlayerWrapper.16cd6fed.js +24 -0
  2. package/dist/cjs/ReactPlayerWrapper.16cd6fed.js.map +1 -0
  3. package/dist/cjs/audioProcessing.22303d69.js +148 -0
  4. package/dist/cjs/audioProcessing.22303d69.js.map +1 -0
  5. package/dist/cjs/emojis.js +211 -226
  6. package/dist/cjs/emojis.js.map +1 -1
  7. package/dist/cjs/index.js +26212 -31082
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/mp3-encoder.js +30 -58
  10. package/dist/cjs/mp3-encoder.js.map +1 -1
  11. package/dist/cjs/useNotificationApi.9ffe5761.js +5516 -0
  12. package/dist/cjs/useNotificationApi.9ffe5761.js.map +1 -0
  13. package/dist/css/index.css +9 -0
  14. package/dist/css/index.css.map +1 -1
  15. package/dist/es/ReactPlayerWrapper.d2ae5941.mjs +22 -0
  16. package/dist/es/ReactPlayerWrapper.d2ae5941.mjs.map +1 -0
  17. package/dist/es/audioProcessing.766ca76c.mjs +107 -0
  18. package/dist/es/audioProcessing.766ca76c.mjs.map +1 -0
  19. package/dist/es/emojis.mjs +207 -205
  20. package/dist/es/emojis.mjs.map +1 -1
  21. package/dist/es/index.mjs +25961 -31417
  22. package/dist/es/index.mjs.map +1 -1
  23. package/dist/es/mp3-encoder.mjs +31 -38
  24. package/dist/es/mp3-encoder.mjs.map +1 -1
  25. package/dist/es/useNotificationApi.88c33caa.mjs +4195 -0
  26. package/dist/es/useNotificationApi.88c33caa.mjs.map +1 -0
  27. package/dist/types/a11y/a11yUtils.d.ts.map +1 -1
  28. package/dist/types/a11y/hooks/useAriaIdentifiers.d.ts.map +1 -1
  29. package/dist/types/a11y/hooks/useResolvedModalAriaProps.d.ts.map +1 -1
  30. package/dist/types/components/AIStateIndicator/AIStateIndicator.d.ts.map +1 -1
  31. package/dist/types/components/AIStateIndicator/hooks/useAIState.d.ts.map +1 -1
  32. package/dist/types/components/Accessibility/AriaLiveRegion.d.ts.map +1 -1
  33. package/dist/types/components/Accessibility/NotificationAnnouncer.d.ts.map +1 -1
  34. package/dist/types/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts.map +1 -1
  35. package/dist/types/components/Accessibility/useAriaLiveAnnouncer.d.ts +0 -1
  36. package/dist/types/components/Accessibility/useAriaLiveAnnouncer.d.ts.map +1 -1
  37. package/dist/types/components/Attachment/Attachment.d.ts.map +1 -1
  38. package/dist/types/components/Attachment/AttachmentActions.d.ts +3 -1
  39. package/dist/types/components/Attachment/AttachmentActions.d.ts.map +1 -1
  40. package/dist/types/components/Attachment/AttachmentContainer.d.ts +1 -1
  41. package/dist/types/components/Attachment/AttachmentContainer.d.ts.map +1 -1
  42. package/dist/types/components/Attachment/Audio.d.ts.map +1 -1
  43. package/dist/types/components/Attachment/FileAttachment.d.ts.map +1 -1
  44. package/dist/types/components/Attachment/Geolocation.d.ts.map +1 -1
  45. package/dist/types/components/Attachment/Giphy.d.ts.map +1 -1
  46. package/dist/types/components/Attachment/Image.d.ts.map +1 -1
  47. package/dist/types/components/Attachment/LinkPreview/Card.d.ts +3 -1
  48. package/dist/types/components/Attachment/LinkPreview/Card.d.ts.map +1 -1
  49. package/dist/types/components/Attachment/LinkPreview/CardAudio.d.ts.map +1 -1
  50. package/dist/types/components/Attachment/LinkPreview/UnableToRenderCard.d.ts +1 -1
  51. package/dist/types/components/Attachment/LinkPreview/UnableToRenderCard.d.ts.map +1 -1
  52. package/dist/types/components/Attachment/ModalGallery.d.ts.map +1 -1
  53. package/dist/types/components/Attachment/VideoAttachment.d.ts.map +1 -1
  54. package/dist/types/components/Attachment/VoiceRecording.d.ts.map +1 -1
  55. package/dist/types/components/Attachment/attachment-sizing.d.ts.map +1 -1
  56. package/dist/types/components/Attachment/audioSampling.d.ts.map +1 -1
  57. package/dist/types/components/Attachment/components/DownloadButton.d.ts.map +1 -1
  58. package/dist/types/components/Attachment/components/FileSizeIndicator.d.ts.map +1 -1
  59. package/dist/types/components/Attachment/icons.d.ts.map +1 -1
  60. package/dist/types/components/Attachment/utils.d.ts.map +1 -1
  61. package/dist/types/components/AudioPlayback/AudioPlayer.d.ts +1 -2
  62. package/dist/types/components/AudioPlayback/AudioPlayer.d.ts.map +1 -1
  63. package/dist/types/components/AudioPlayback/AudioPlayerPool.d.ts +1 -1
  64. package/dist/types/components/AudioPlayback/AudioPlayerPool.d.ts.map +1 -1
  65. package/dist/types/components/AudioPlayback/WithAudioPlayback.d.ts.map +1 -1
  66. package/dist/types/components/AudioPlayback/components/PlaybackRateButton.d.ts.map +1 -1
  67. package/dist/types/components/AudioPlayback/components/ProgressBar.d.ts.map +1 -1
  68. package/dist/types/components/AudioPlayback/components/WaveProgressBar.d.ts.map +1 -1
  69. package/dist/types/components/AudioPlayback/components/formatTime.d.ts +1 -1
  70. package/dist/types/components/AudioPlayback/components/formatTime.d.ts.map +1 -1
  71. package/dist/types/components/AudioPlayback/components/keyboardSeek.d.ts.map +1 -1
  72. package/dist/types/components/AudioPlayback/components/progressBarA11y.d.ts.map +1 -1
  73. package/dist/types/components/AudioPlayback/components/useInteractiveProgressBar.d.ts.map +1 -1
  74. package/dist/types/components/AudioPlayback/plugins/AudioPlayerNotificationsPlugin.d.ts.map +1 -1
  75. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  76. package/dist/types/components/Avatar/ChannelAvatar.d.ts.map +1 -1
  77. package/dist/types/components/Avatar/GroupAvatar.d.ts.map +1 -1
  78. package/dist/types/components/Badge/Badge.d.ts +1 -1
  79. package/dist/types/components/Badge/Badge.d.ts.map +1 -1
  80. package/dist/types/components/Badge/MediaBadge.d.ts.map +1 -1
  81. package/dist/types/components/BaseImage/ImagePlaceholder.d.ts.map +1 -1
  82. package/dist/types/components/BaseImage/toBaseImageDescriptors.d.ts.map +1 -1
  83. package/dist/types/components/Button/PlayButton.d.ts.map +1 -1
  84. package/dist/types/components/Channel/Channel.d.ts +3 -1
  85. package/dist/types/components/Channel/Channel.d.ts.map +1 -1
  86. package/dist/types/components/Channel/channelState.d.ts.map +1 -1
  87. package/dist/types/components/Channel/hooks/useChannelContainerClasses.d.ts +1 -1
  88. package/dist/types/components/Channel/hooks/useChannelContainerClasses.d.ts.map +1 -1
  89. package/dist/types/components/Channel/hooks/useCreateChannelStateContext.d.ts +1 -1
  90. package/dist/types/components/Channel/hooks/useCreateChannelStateContext.d.ts.map +1 -1
  91. package/dist/types/components/Channel/hooks/useCreateTypingContext.d.ts.map +1 -1
  92. package/dist/types/components/Channel/hooks/useEditMessageHandler.d.ts.map +1 -1
  93. package/dist/types/components/Channel/hooks/useIsMounted.d.ts +0 -1
  94. package/dist/types/components/Channel/hooks/useIsMounted.d.ts.map +1 -1
  95. package/dist/types/components/Channel/hooks/useMentionsHandlers.d.ts.map +1 -1
  96. package/dist/types/components/Channel/utils.d.ts +2 -2
  97. package/dist/types/components/Channel/utils.d.ts.map +1 -1
  98. package/dist/types/components/ChannelHeader/ChannelHeader.d.ts.map +1 -1
  99. package/dist/types/components/ChannelList/ChannelList.d.ts +3 -1
  100. package/dist/types/components/ChannelList/ChannelList.d.ts.map +1 -1
  101. package/dist/types/components/ChannelList/ChannelListUI.d.ts.map +1 -1
  102. package/dist/types/components/ChannelList/hooks/useChannelListShape.d.ts.map +1 -1
  103. package/dist/types/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts.map +1 -1
  104. package/dist/types/components/ChannelList/hooks/usePaginatedChannels.d.ts +0 -1
  105. package/dist/types/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
  106. package/dist/types/components/ChannelList/utils.d.ts +3 -3
  107. package/dist/types/components/ChannelList/utils.d.ts.map +1 -1
  108. package/dist/types/components/ChannelListItem/ChannelListItem.d.ts.map +1 -1
  109. package/dist/types/components/ChannelListItem/ChannelListItemActionButtons.defaults.d.ts.map +1 -1
  110. package/dist/types/components/ChannelListItem/ChannelListItemUI.d.ts +3 -1
  111. package/dist/types/components/ChannelListItem/ChannelListItemUI.d.ts.map +1 -1
  112. package/dist/types/components/ChannelListItem/hooks/useChannelDisplayName.d.ts.map +1 -1
  113. package/dist/types/components/ChannelListItem/hooks/useChannelPreviewInfo.d.ts.map +1 -1
  114. package/dist/types/components/ChannelListItem/hooks/useIsChannelMuted.d.ts.map +1 -1
  115. package/dist/types/components/ChannelListItem/hooks/useMessageDeliveryStatus.d.ts.map +1 -1
  116. package/dist/types/components/ChannelListItem/utils.d.ts +2 -2
  117. package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
  118. package/dist/types/components/Chat/Chat.d.ts +3 -0
  119. package/dist/types/components/Chat/Chat.d.ts.map +1 -1
  120. package/dist/types/components/Chat/hooks/useChat.d.ts.map +1 -1
  121. package/dist/types/components/Chat/hooks/useCreateChatClient.d.ts.map +1 -1
  122. package/dist/types/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
  123. package/dist/types/components/Chat/hooks/useSplitActionSet.d.ts +6 -6
  124. package/dist/types/components/Chat/hooks/useSplitActionSet.d.ts.map +1 -1
  125. package/dist/types/components/ChatView/ChatView.a11y.utility.d.ts.map +1 -1
  126. package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
  127. package/dist/types/components/DateSeparator/DateSeparator.d.ts +3 -1
  128. package/dist/types/components/DateSeparator/DateSeparator.d.ts.map +1 -1
  129. package/dist/types/components/Dialog/components/Callout.d.ts.map +1 -1
  130. package/dist/types/components/Dialog/components/ContextMenu.d.ts +3 -3
  131. package/dist/types/components/Dialog/components/ContextMenu.d.ts.map +1 -1
  132. package/dist/types/components/Dialog/components/Prompt.d.ts +1 -1
  133. package/dist/types/components/Dialog/components/Prompt.d.ts.map +1 -1
  134. package/dist/types/components/Dialog/components/Viewer.d.ts +1 -1
  135. package/dist/types/components/Dialog/components/Viewer.d.ts.map +1 -1
  136. package/dist/types/components/Dialog/hooks/useDialog.d.ts +8 -6
  137. package/dist/types/components/Dialog/hooks/useDialog.d.ts.map +1 -1
  138. package/dist/types/components/Dialog/hooks/usePopoverPosition.d.ts +5 -6
  139. package/dist/types/components/Dialog/hooks/usePopoverPosition.d.ts.map +1 -1
  140. package/dist/types/components/Dialog/service/DialogAnchor.d.ts.map +1 -1
  141. package/dist/types/components/Dialog/service/DialogManager.d.ts +1 -1
  142. package/dist/types/components/Dialog/service/DialogManager.d.ts.map +1 -1
  143. package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
  144. package/dist/types/components/DragAndDrop/DragAndDropContainer.d.ts.map +1 -1
  145. package/dist/types/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +3 -1
  146. package/dist/types/components/EmptyStateIndicator/EmptyStateIndicator.d.ts.map +1 -1
  147. package/dist/types/components/EventComponent/EventComponent.d.ts +6 -1
  148. package/dist/types/components/EventComponent/EventComponent.d.ts.map +1 -1
  149. package/dist/types/components/FileIcon/FileIcon.d.ts.map +1 -1
  150. package/dist/types/components/FileIcon/FileIconSet.d.ts.map +1 -1
  151. package/dist/types/components/Form/Dropdown.d.ts.map +1 -1
  152. package/dist/types/components/Form/FieldError.d.ts.map +1 -1
  153. package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
  154. package/dist/types/components/Form/TextInputFieldSet.d.ts.map +1 -1
  155. package/dist/types/components/Gallery/Gallery.d.ts.map +1 -1
  156. package/dist/types/components/Gallery/GalleryContext.d.ts +2 -4
  157. package/dist/types/components/Gallery/GalleryContext.d.ts.map +1 -1
  158. package/dist/types/components/Gallery/GalleryHeader.d.ts.map +1 -1
  159. package/dist/types/components/Icons/BaseIcon.d.ts.map +1 -1
  160. package/dist/types/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
  161. package/dist/types/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts.map +1 -1
  162. package/dist/types/components/InfiniteScrollPaginator/hooks/useCursorPaginator.d.ts.map +1 -1
  163. package/dist/types/components/LoadMore/LoadMoreButton.d.ts +3 -1
  164. package/dist/types/components/LoadMore/LoadMoreButton.d.ts.map +1 -1
  165. package/dist/types/components/LoadMore/LoadMorePaginator.d.ts +1 -1
  166. package/dist/types/components/LoadMore/LoadMorePaginator.d.ts.map +1 -1
  167. package/dist/types/components/Loading/LoadingErrorIndicator.d.ts +6 -1
  168. package/dist/types/components/Loading/LoadingErrorIndicator.d.ts.map +1 -1
  169. package/dist/types/components/Loading/LoadingIndicator.d.ts.map +1 -1
  170. package/dist/types/components/Loading/UploadProgressIndicator.d.ts.map +1 -1
  171. package/dist/types/components/Loading/UploadedSizeIndicator.d.ts.map +1 -1
  172. package/dist/types/components/Loading/progress-indicators.d.ts.map +1 -1
  173. package/dist/types/components/Location/ShareLocationDialog.d.ts.map +1 -1
  174. package/dist/types/components/Location/hooks/useLiveLocationSharingManager.d.ts +1 -1
  175. package/dist/types/components/Location/hooks/useLiveLocationSharingManager.d.ts.map +1 -1
  176. package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.d.ts +1 -1
  177. package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.d.ts.map +1 -1
  178. package/dist/types/components/MediaRecorder/AudioRecorder/RecordingTimer.d.ts.map +1 -1
  179. package/dist/types/components/MediaRecorder/AudioRecorder/hooks/useTimeElapsed.d.ts.map +1 -1
  180. package/dist/types/components/MediaRecorder/AudioRecorder/recordingStateIdentity.d.ts +3 -3
  181. package/dist/types/components/MediaRecorder/AudioRecorder/recordingStateIdentity.d.ts.map +1 -1
  182. package/dist/types/components/MediaRecorder/RecordingPermissionDeniedNotification.d.ts.map +1 -1
  183. package/dist/types/components/MediaRecorder/classes/MediaRecorderController.d.ts +1 -1
  184. package/dist/types/components/MediaRecorder/classes/MediaRecorderController.d.ts.map +1 -1
  185. package/dist/types/components/MediaRecorder/hooks/useMediaRecorder.d.ts.map +1 -1
  186. package/dist/types/components/MediaRecorder/transcode/audioProcessing.d.ts.map +1 -1
  187. package/dist/types/components/MediaRecorder/transcode/index.d.ts.map +1 -1
  188. package/dist/types/components/MediaRecorder/transcode/wav.d.ts.map +1 -1
  189. package/dist/types/components/Message/Message.d.ts.map +1 -1
  190. package/dist/types/components/Message/MessageBubble.d.ts +1 -1
  191. package/dist/types/components/Message/MessageBubble.d.ts.map +1 -1
  192. package/dist/types/components/Message/MessageEditedIndicator.d.ts +3 -1
  193. package/dist/types/components/Message/MessageEditedIndicator.d.ts.map +1 -1
  194. package/dist/types/components/Message/MessageRepliesCountButton.d.ts.map +1 -1
  195. package/dist/types/components/Message/MessageStatus.d.ts +3 -1
  196. package/dist/types/components/Message/MessageStatus.d.ts.map +1 -1
  197. package/dist/types/components/Message/MessageText.d.ts +3 -1
  198. package/dist/types/components/Message/MessageText.d.ts.map +1 -1
  199. package/dist/types/components/Message/MessageTimestamp.d.ts +3 -1
  200. package/dist/types/components/Message/MessageTimestamp.d.ts.map +1 -1
  201. package/dist/types/components/Message/MessageTranslationIndicator.d.ts.map +1 -1
  202. package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
  203. package/dist/types/components/Message/PinIndicator.d.ts.map +1 -1
  204. package/dist/types/components/Message/QuotedMessage.d.ts.map +1 -1
  205. package/dist/types/components/Message/ReminderNotification.d.ts.map +1 -1
  206. package/dist/types/components/Message/StreamedMessageText.d.ts.map +1 -1
  207. package/dist/types/components/Message/emojiRegex.d.ts +15 -0
  208. package/dist/types/components/Message/emojiRegex.d.ts.map +1 -0
  209. package/dist/types/components/Message/hooks/useDeleteHandler.d.ts +1 -1
  210. package/dist/types/components/Message/hooks/useDeleteHandler.d.ts.map +1 -1
  211. package/dist/types/components/Message/hooks/useFlagHandler.d.ts.map +1 -1
  212. package/dist/types/components/Message/hooks/useMarkUnreadHandler.d.ts.map +1 -1
  213. package/dist/types/components/Message/hooks/useMentionsHandler.d.ts.map +1 -1
  214. package/dist/types/components/Message/hooks/useMessageReminder.d.ts.map +1 -1
  215. package/dist/types/components/Message/hooks/useMessageTextStreaming.d.ts.map +1 -1
  216. package/dist/types/components/Message/hooks/useMuteHandler.d.ts.map +1 -1
  217. package/dist/types/components/Message/hooks/useOpenThreadHandler.d.ts.map +1 -1
  218. package/dist/types/components/Message/hooks/usePinHandler.d.ts.map +1 -1
  219. package/dist/types/components/Message/hooks/useReactionHandler.d.ts.map +1 -1
  220. package/dist/types/components/Message/hooks/useRetryHandler.d.ts.map +1 -1
  221. package/dist/types/components/Message/hooks/useUserHandler.d.ts +0 -1
  222. package/dist/types/components/Message/hooks/useUserHandler.d.ts.map +1 -1
  223. package/dist/types/components/Message/hooks/useUserRole.d.ts.map +1 -1
  224. package/dist/types/components/Message/renderText/componentRenderers/Anchor.d.ts +1 -1
  225. package/dist/types/components/Message/renderText/componentRenderers/Anchor.d.ts.map +1 -1
  226. package/dist/types/components/Message/renderText/componentRenderers/Emoji.d.ts.map +1 -1
  227. package/dist/types/components/Message/renderText/componentRenderers/Mention.d.ts.map +1 -1
  228. package/dist/types/components/Message/renderText/regex.d.ts.map +1 -1
  229. package/dist/types/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.d.ts +1 -1
  230. package/dist/types/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.d.ts.map +1 -1
  231. package/dist/types/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +1 -1
  232. package/dist/types/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts.map +1 -1
  233. package/dist/types/components/Message/renderText/remarkPlugins/htmlToTextPlugin.d.ts +3 -1
  234. package/dist/types/components/Message/renderText/remarkPlugins/htmlToTextPlugin.d.ts.map +1 -1
  235. package/dist/types/components/Message/renderText/remarkPlugins/imageToLink.d.ts.map +1 -1
  236. package/dist/types/components/Message/renderText/renderText.d.ts +1 -1
  237. package/dist/types/components/Message/renderText/renderText.d.ts.map +1 -1
  238. package/dist/types/components/Message/utils.d.ts +5 -5
  239. package/dist/types/components/Message/utils.d.ts.map +1 -1
  240. package/dist/types/components/MessageActions/DeleteMessageAlert.d.ts.map +1 -1
  241. package/dist/types/components/MessageActions/DownloadSubmenu.d.ts +3 -0
  242. package/dist/types/components/MessageActions/DownloadSubmenu.d.ts.map +1 -0
  243. package/dist/types/components/MessageActions/MessageActions.defaults.d.ts.map +1 -1
  244. package/dist/types/components/MessageActions/QuickMessageActionButton.d.ts +2 -1
  245. package/dist/types/components/MessageActions/QuickMessageActionButton.d.ts.map +1 -1
  246. package/dist/types/components/MessageActions/downloadUtils.d.ts.map +1 -1
  247. package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts.map +1 -1
  248. package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentPreviewList.d.ts.map +1 -1
  249. package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.d.ts.map +1 -1
  250. package/dist/types/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.d.ts.map +1 -1
  251. package/dist/types/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.d.ts.map +1 -1
  252. package/dist/types/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.d.ts.map +1 -1
  253. package/dist/types/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.d.ts.map +1 -1
  254. package/dist/types/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts.map +1 -1
  255. package/dist/types/components/MessageComposer/AttachmentPreviewList/VoiceRecordingPreviewSlot.d.ts.map +1 -1
  256. package/dist/types/components/MessageComposer/AttachmentPreviewList/utils/AttachmentPreviewRoot.d.ts.map +1 -1
  257. package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts +6 -6
  258. package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts.map +1 -1
  259. package/dist/types/components/MessageComposer/AttachmentSelector/CommandsMenu.d.ts +1 -1
  260. package/dist/types/components/MessageComposer/AttachmentSelector/CommandsMenu.d.ts.map +1 -1
  261. package/dist/types/components/MessageComposer/CommandChip.d.ts.map +1 -1
  262. package/dist/types/components/MessageComposer/EditedMessagePreview.d.ts.map +1 -1
  263. package/dist/types/components/MessageComposer/LinkPreviewList.d.ts.map +1 -1
  264. package/dist/types/components/MessageComposer/MessageComposer.d.ts +3 -1
  265. package/dist/types/components/MessageComposer/MessageComposer.d.ts.map +1 -1
  266. package/dist/types/components/MessageComposer/QuotedMessageIndicator.d.ts.map +1 -1
  267. package/dist/types/components/MessageComposer/QuotedMessagePreview.d.ts.map +1 -1
  268. package/dist/types/components/MessageComposer/RemoveAttachmentPreviewButton.d.ts +1 -1
  269. package/dist/types/components/MessageComposer/RemoveAttachmentPreviewButton.d.ts.map +1 -1
  270. package/dist/types/components/MessageComposer/SendButton.d.ts.map +1 -1
  271. package/dist/types/components/MessageComposer/StopAIGenerationButton.d.ts.map +1 -1
  272. package/dist/types/components/MessageComposer/WithDragAndDropUpload.d.ts.map +1 -1
  273. package/dist/types/components/MessageComposer/hooks/useAttachmentsForPreview.d.ts +7 -7
  274. package/dist/types/components/MessageComposer/hooks/useCreateMessageComposerContext.d.ts.map +1 -1
  275. package/dist/types/components/MessageComposer/hooks/useMessageComposerBindings.d.ts.map +1 -1
  276. package/dist/types/components/MessageComposer/hooks/usePasteHandler.d.ts.map +1 -1
  277. package/dist/types/components/MessageComposer/hooks/useSubmitHandler.d.ts.map +1 -1
  278. package/dist/types/components/MessageComposer/hooks/useTextareaRef.d.ts +0 -1
  279. package/dist/types/components/MessageComposer/hooks/useTextareaRef.d.ts.map +1 -1
  280. package/dist/types/components/MessageComposer/preEditSnapshot.d.ts.map +1 -1
  281. package/dist/types/components/MessageList/CustomNotification.d.ts +3 -1
  282. package/dist/types/components/MessageList/CustomNotification.d.ts.map +1 -1
  283. package/dist/types/components/MessageList/FloatingDateSeparator.d.ts.map +1 -1
  284. package/dist/types/components/MessageList/GiphyPreviewMessage.d.ts.map +1 -1
  285. package/dist/types/components/MessageList/MessageList.d.ts.map +1 -1
  286. package/dist/types/components/MessageList/MessageListMainPanel.d.ts.map +1 -1
  287. package/dist/types/components/MessageList/NewMessageNotification.d.ts +3 -1
  288. package/dist/types/components/MessageList/NewMessageNotification.d.ts.map +1 -1
  289. package/dist/types/components/MessageList/ScrollToLatestMessageButton.d.ts +3 -1
  290. package/dist/types/components/MessageList/ScrollToLatestMessageButton.d.ts.map +1 -1
  291. package/dist/types/components/MessageList/UnreadMessagesNotification.d.ts.map +1 -1
  292. package/dist/types/components/MessageList/UnreadMessagesSeparator.d.ts.map +1 -1
  293. package/dist/types/components/MessageList/VirtualizedMessageListComponents.d.ts +1 -2
  294. package/dist/types/components/MessageList/VirtualizedMessageListComponents.d.ts.map +1 -1
  295. package/dist/types/components/MessageList/hooks/MessageList/scrollInstrumentation.d.ts.map +1 -1
  296. package/dist/types/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts +1 -1
  297. package/dist/types/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts.map +1 -1
  298. package/dist/types/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.d.ts.map +1 -1
  299. package/dist/types/components/MessageList/hooks/MessageList/useMessageListElements.d.ts.map +1 -1
  300. package/dist/types/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts.map +1 -1
  301. package/dist/types/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts.map +1 -1
  302. package/dist/types/components/MessageList/hooks/MessageList/useUnreadMessagesNotification.d.ts.map +1 -1
  303. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useFloatingDateSeparator.d.ts.map +1 -1
  304. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts +0 -1
  305. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts.map +1 -1
  306. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.d.ts.map +1 -1
  307. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +0 -1
  308. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts.map +1 -1
  309. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts.map +1 -1
  310. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.d.ts.map +1 -1
  311. package/dist/types/components/MessageList/hooks/useLastDeliveredData.d.ts.map +1 -1
  312. package/dist/types/components/MessageList/hooks/useLastOwnMessage.d.ts.map +1 -1
  313. package/dist/types/components/MessageList/hooks/useLastReadData.d.ts.map +1 -1
  314. package/dist/types/components/MessageList/hooks/useMarkRead.d.ts.map +1 -1
  315. package/dist/types/components/MessageList/utils.d.ts +0 -1
  316. package/dist/types/components/MessageList/utils.d.ts.map +1 -1
  317. package/dist/types/components/Modal/CloseButtonOnModalOverlay.d.ts +1 -1
  318. package/dist/types/components/Modal/CloseButtonOnModalOverlay.d.ts.map +1 -1
  319. package/dist/types/components/Modal/GlobalModal.d.ts +3 -1
  320. package/dist/types/components/Modal/GlobalModal.d.ts.map +1 -1
  321. package/dist/types/components/Notifications/NotificationConfigurationContext.d.ts +24 -0
  322. package/dist/types/components/Notifications/NotificationConfigurationContext.d.ts.map +1 -0
  323. package/dist/types/components/Notifications/NotificationList.d.ts.map +1 -1
  324. package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -1
  325. package/dist/types/components/Notifications/hooks/useNotifications.d.ts +5 -0
  326. package/dist/types/components/Notifications/hooks/useNotifications.d.ts.map +1 -1
  327. package/dist/types/components/Notifications/hooks/useSystemNotifications.d.ts.map +1 -1
  328. package/dist/types/components/Notifications/index.d.ts +1 -0
  329. package/dist/types/components/Notifications/index.d.ts.map +1 -1
  330. package/dist/types/components/Notifications/notificationTarget.d.ts +3 -3
  331. package/dist/types/components/Notifications/notificationTarget.d.ts.map +1 -1
  332. package/dist/types/components/Poll/Poll.d.ts.map +1 -1
  333. package/dist/types/components/Poll/PollActions/AddCommentPrompt.d.ts.map +1 -1
  334. package/dist/types/components/Poll/PollActions/PollAction.d.ts.map +1 -1
  335. package/dist/types/components/Poll/PollActions/PollActions.d.ts.map +1 -1
  336. package/dist/types/components/Poll/PollActions/PollAnswerList.d.ts.map +1 -1
  337. package/dist/types/components/Poll/PollActions/PollQuestion.d.ts.map +1 -1
  338. package/dist/types/components/Poll/PollActions/PollResults/PollOptionWithVotes.d.ts.map +1 -1
  339. package/dist/types/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts.map +1 -1
  340. package/dist/types/components/Poll/PollActions/PollResults/PollOptionWithVotesList.d.ts.map +1 -1
  341. package/dist/types/components/Poll/PollCreationDialog/PollCreationDialog.d.ts.map +1 -1
  342. package/dist/types/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts.map +1 -1
  343. package/dist/types/components/Poll/PollHeader.d.ts +1 -1
  344. package/dist/types/components/Poll/PollHeader.d.ts.map +1 -1
  345. package/dist/types/components/Poll/PollOptionList.d.ts.map +1 -1
  346. package/dist/types/components/Poll/PollOptionSelector.d.ts.map +1 -1
  347. package/dist/types/components/Poll/PollVote.d.ts.map +1 -1
  348. package/dist/types/components/Poll/constants.d.ts.map +1 -1
  349. package/dist/types/components/Poll/hooks/usePollAnswerPagination.d.ts.map +1 -1
  350. package/dist/types/components/Poll/hooks/usePollOptionVotesPagination.d.ts.map +1 -1
  351. package/dist/types/components/Portal/Portal.d.ts.map +1 -1
  352. package/dist/types/components/ReactFileUtilities/LoadingIndicator.d.ts.map +1 -1
  353. package/dist/types/components/ReactFileUtilities/utils.d.ts.map +1 -1
  354. package/dist/types/components/Reactions/MessageReactions.d.ts +3 -1
  355. package/dist/types/components/Reactions/MessageReactions.d.ts.map +1 -1
  356. package/dist/types/components/Reactions/ReactionSelectorWithButton.d.ts.map +1 -1
  357. package/dist/types/components/Reactions/SpriteImage.d.ts.map +1 -1
  358. package/dist/types/components/Reactions/hooks/useProcessReactions.d.ts.map +1 -1
  359. package/dist/types/components/Reactions/reactionOptions.d.ts +10 -1
  360. package/dist/types/components/Reactions/reactionOptions.d.ts.map +1 -1
  361. package/dist/types/components/Reactions/utils/utils.d.ts.map +1 -1
  362. package/dist/types/components/SafeAnchor/SafeAnchor.d.ts +3 -1
  363. package/dist/types/components/SafeAnchor/SafeAnchor.d.ts.map +1 -1
  364. package/dist/types/components/Search/Search.d.ts.map +1 -1
  365. package/dist/types/components/Search/SearchBar/SearchBar.d.ts.map +1 -1
  366. package/dist/types/components/Search/SearchContext.d.ts.map +1 -1
  367. package/dist/types/components/Search/SearchResults/SearchResultItem.d.ts +1 -1
  368. package/dist/types/components/Search/SearchResults/SearchResultItem.d.ts.map +1 -1
  369. package/dist/types/components/Search/SearchResults/SearchSourceResultList.d.ts.map +1 -1
  370. package/dist/types/components/Search/SearchResults/SearchSourceResults.d.ts.map +1 -1
  371. package/dist/types/components/Search/SearchSourceResultsContext.d.ts.map +1 -1
  372. package/dist/types/components/Search/hooks/useSearchQueriesInProgress.d.ts.map +1 -1
  373. package/dist/types/components/SkipNavigation/SkipNavigation.d.ts.map +1 -1
  374. package/dist/types/components/SummarizedMessagePreview/SummarizedMessagePreview.d.ts.map +1 -1
  375. package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
  376. package/dist/types/components/TextareaComposer/SuggestionList/CommandItem.d.ts.map +1 -1
  377. package/dist/types/components/TextareaComposer/SuggestionList/EmoticonItem.d.ts.map +1 -1
  378. package/dist/types/components/TextareaComposer/SuggestionList/SuggestionList.d.ts.map +1 -1
  379. package/dist/types/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts.map +1 -1
  380. package/dist/types/components/TextareaComposer/SuggestionList/UserItem.d.ts.map +1 -1
  381. package/dist/types/components/TextareaComposer/TextareaComposer.d.ts.map +1 -1
  382. package/dist/types/components/TextareaComposer/hooks/useTextareaPlaceholder.d.ts.map +1 -1
  383. package/dist/types/components/Thread/Thread.d.ts.map +1 -1
  384. package/dist/types/components/Thread/ThreadHead.d.ts.map +1 -1
  385. package/dist/types/components/Thread/ThreadHeader.d.ts.map +1 -1
  386. package/dist/types/components/Threads/ThreadContext.d.ts.map +1 -1
  387. package/dist/types/components/Threads/ThreadList/ThreadList.d.ts.map +1 -1
  388. package/dist/types/components/Threads/ThreadList/ThreadListItem.d.ts.map +1 -1
  389. package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
  390. package/dist/types/components/Threads/UnreadCountBadge.d.ts +1 -1
  391. package/dist/types/components/Threads/UnreadCountBadge.d.ts.map +1 -1
  392. package/dist/types/components/Threads/hooks/useThreadManagerState.d.ts.map +1 -1
  393. package/dist/types/components/Threads/hooks/useThreadState.d.ts.map +1 -1
  394. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  395. package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
  396. package/dist/types/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +1 -1
  397. package/dist/types/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts.map +1 -1
  398. package/dist/types/components/TypingIndicator/TypingIndicator.d.ts +8 -1
  399. package/dist/types/components/TypingIndicator/TypingIndicator.d.ts.map +1 -1
  400. package/dist/types/components/TypingIndicator/TypingIndicatorHeader.d.ts.map +1 -1
  401. package/dist/types/components/TypingIndicator/utils/getTypingStatusMessage.d.ts.map +1 -1
  402. package/dist/types/components/UtilityComponents/useStableId.d.ts +7 -3
  403. package/dist/types/components/UtilityComponents/useStableId.d.ts.map +1 -1
  404. package/dist/types/components/VideoPlayer/ReactPlayerWrapper.d.ts +9 -0
  405. package/dist/types/components/VideoPlayer/ReactPlayerWrapper.d.ts.map +1 -0
  406. package/dist/types/components/VideoPlayer/VideoPlayer.d.ts.map +1 -1
  407. package/dist/types/components/VideoPlayer/VideoThumbnail.d.ts.map +1 -1
  408. package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  409. package/dist/types/components/Window/Window.d.ts +3 -1
  410. package/dist/types/components/Window/Window.d.ts.map +1 -1
  411. package/dist/types/context/AttachmentSelectorContext.d.ts.map +1 -1
  412. package/dist/types/context/ChannelActionContext.d.ts.map +1 -1
  413. package/dist/types/context/ChannelListContext.d.ts.map +1 -1
  414. package/dist/types/context/ChannelStateContext.d.ts.map +1 -1
  415. package/dist/types/context/ChatContext.d.ts.map +1 -1
  416. package/dist/types/context/ComponentContext.d.ts +5 -1
  417. package/dist/types/context/ComponentContext.d.ts.map +1 -1
  418. package/dist/types/context/DialogManagerContext.d.ts.map +1 -1
  419. package/dist/types/context/MessageComposerContext.d.ts.map +1 -1
  420. package/dist/types/context/MessageContext.d.ts.map +1 -1
  421. package/dist/types/context/MessageListContext.d.ts.map +1 -1
  422. package/dist/types/context/MessageTranslationViewContext.d.ts.map +1 -1
  423. package/dist/types/context/ModalContext.d.ts.map +1 -1
  424. package/dist/types/context/PollContext.d.ts.map +1 -1
  425. package/dist/types/context/TranslationContext.d.ts.map +1 -1
  426. package/dist/types/context/TypingContext.d.ts.map +1 -1
  427. package/dist/types/context/VirtualizedMessageListContext.d.ts.map +1 -1
  428. package/dist/types/i18n/Streami18n.d.ts +3 -3
  429. package/dist/types/i18n/Streami18n.d.ts.map +1 -1
  430. package/dist/types/i18n/TranslationBuilder/TranslationBuilder.d.ts.map +1 -1
  431. package/dist/types/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.d.ts.map +1 -1
  432. package/dist/types/i18n/utils.d.ts +2 -2
  433. package/dist/types/i18n/utils.d.ts.map +1 -1
  434. package/dist/types/plugins/Emojis/EmojiPicker.d.ts.map +1 -1
  435. package/dist/types/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts.map +1 -1
  436. package/dist/types/utils/findReverse.d.ts.map +1 -1
  437. package/dist/types/utils/getChannel.d.ts.map +1 -1
  438. package/dist/types/utils/getTextareaCaretRect.d.ts.map +1 -1
  439. package/dist/types/utils/getWholeChar.d.ts.map +1 -1
  440. package/dist/types/utils/mergeDeep.d.ts.map +1 -1
  441. package/dist/types/utils/useStableCallback.d.ts.map +1 -1
  442. package/package.json +84 -66
  443. package/dist/cjs/audioProcessing.56e5db9d.js +0 -123
  444. package/dist/cjs/audioProcessing.56e5db9d.js.map +0 -1
  445. package/dist/cjs/useNotificationApi.f2c7704d.js +0 -4855
  446. package/dist/cjs/useNotificationApi.f2c7704d.js.map +0 -1
  447. package/dist/es/audioProcessing.21cb49e1.mjs +0 -124
  448. package/dist/es/audioProcessing.21cb49e1.mjs.map +0 -1
  449. package/dist/es/useNotificationApi.f91ae46b.mjs +0 -4839
  450. package/dist/es/useNotificationApi.f91ae46b.mjs.map +0 -1
@@ -1,4855 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const React = require("react");
4
- const react = require("@floating-ui/react");
5
- const streamChat = require("stream-chat");
6
- const clsx = require("clsx");
7
- const debounce = require("lodash.debounce");
8
- const throttle = require("lodash.throttle");
9
- const Dayjs = require("dayjs");
10
- const linkify = require("linkifyjs");
11
- const shim = require("use-sync-external-store/shim");
12
- const nanoid = require("nanoid");
13
- const deepequal = require("react-fast-compare");
14
- const emojiRegex = require("emoji-regex");
15
- function _interopNamespaceDefault(e) {
16
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
17
- if (e) {
18
- for (const k in e) {
19
- if (k !== "default") {
20
- const d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: () => e[k]
24
- });
25
- }
26
- }
27
- }
28
- n.default = e;
29
- return Object.freeze(n);
30
- }
31
- const linkify__namespace = /* @__PURE__ */ _interopNamespaceDefault(linkify);
32
- const ChannelActionContext = React.createContext(void 0);
33
- const ChannelActionProvider = ({
34
- children,
35
- value
36
- }) => /* @__PURE__ */ jsxRuntime.jsx(ChannelActionContext.Provider, { value, children });
37
- const useChannelActionContext = (componentName) => {
38
- const contextValue = React.useContext(ChannelActionContext);
39
- if (!contextValue) {
40
- console.warn(
41
- `The useChannelActionContext hook was called outside of the ChannelActionContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${componentName} component.`
42
- );
43
- return {};
44
- }
45
- return contextValue;
46
- };
47
- const ChannelListContext = React.createContext(
48
- void 0
49
- );
50
- const ChannelListContextProvider = ({
51
- children,
52
- value
53
- }) => /* @__PURE__ */ jsxRuntime.jsx(ChannelListContext.Provider, { value, children });
54
- const useChannelListContext = () => {
55
- const contextValue = React.useContext(ChannelListContext);
56
- if (!contextValue) {
57
- return {};
58
- }
59
- return contextValue;
60
- };
61
- const ChannelStateContext = React.createContext(void 0);
62
- const ChannelStateProvider = ({
63
- children,
64
- value
65
- }) => /* @__PURE__ */ jsxRuntime.jsx(ChannelStateContext.Provider, { value, children });
66
- let remainingWarningCount = 1;
67
- const useChannelStateContext = (componentName) => {
68
- const contextValue = React.useContext(ChannelStateContext);
69
- if (!contextValue) {
70
- if (componentName && remainingWarningCount > 0) {
71
- console.warn(
72
- `The useChannelStateContext hook was called outside of the ChannelStateContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${componentName} component.`
73
- );
74
- remainingWarningCount -= 1;
75
- }
76
- return {};
77
- }
78
- return contextValue;
79
- };
80
- const ChatContext = React.createContext(void 0);
81
- const ChatProvider = ({
82
- children,
83
- value
84
- }) => /* @__PURE__ */ jsxRuntime.jsx(ChatContext.Provider, { value, children });
85
- const useChatContext = (componentName) => {
86
- const contextValue = React.useContext(ChatContext);
87
- if (!contextValue) {
88
- console.warn(
89
- `The useChatContext hook was called outside of the ChatContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ${componentName} component.`
90
- );
91
- return {};
92
- }
93
- return contextValue;
94
- };
95
- const ComponentContext = React.createContext({});
96
- const ComponentProvider = ({
97
- children,
98
- value
99
- }) => /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, { value, children });
100
- const useComponentContext = (_componentName) => React.useContext(ComponentContext);
101
- const noop = () => {
102
- };
103
- function useStateStore(store, selector) {
104
- const wrappedSubscription = React.useCallback(
105
- (onStoreChange) => {
106
- const unsubscribe = store?.subscribeWithSelector(selector, onStoreChange);
107
- return unsubscribe ?? noop;
108
- },
109
- [store, selector]
110
- );
111
- const wrappedSnapshot = React.useMemo(() => {
112
- let cachedTuple;
113
- return () => {
114
- const currentValue = store?.getLatestValue();
115
- if (!currentValue) return void 0;
116
- if (cachedTuple && cachedTuple[0] === currentValue) {
117
- return cachedTuple[1];
118
- }
119
- const newlySelected = selector(currentValue);
120
- if (cachedTuple) {
121
- let selectededAreEqualToCached = true;
122
- for (const key in cachedTuple[1]) {
123
- if (cachedTuple[1][key] === newlySelected[key]) continue;
124
- selectededAreEqualToCached = false;
125
- break;
126
- }
127
- if (selectededAreEqualToCached) return cachedTuple[1];
128
- }
129
- cachedTuple = [currentValue, newlySelected];
130
- return cachedTuple[1];
131
- };
132
- }, [store, selector]);
133
- const state = shim.useSyncExternalStore(wrappedSubscription, wrappedSnapshot);
134
- return state;
135
- }
136
- const MessageComposerContext = React.createContext(void 0);
137
- const MessageComposerContextProvider = ({
138
- children,
139
- value
140
- }) => /* @__PURE__ */ jsxRuntime.jsx(
141
- MessageComposerContext.Provider,
142
- {
143
- value,
144
- children
145
- }
146
- );
147
- const useMessageComposerContext = (componentName) => {
148
- const contextValue = React.useContext(MessageComposerContext);
149
- if (!contextValue) {
150
- return {};
151
- }
152
- return contextValue;
153
- };
154
- function getDefaultExportFromCjs(x) {
155
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
156
- }
157
- var calendar$2 = { exports: {} };
158
- var calendar$1 = calendar$2.exports;
159
- var hasRequiredCalendar;
160
- function requireCalendar() {
161
- if (hasRequiredCalendar) return calendar$2.exports;
162
- hasRequiredCalendar = 1;
163
- (function(module2, exports$1) {
164
- !(function(e, t) {
165
- module2.exports = t();
166
- })(calendar$1, function() {
167
- return function(e, t, a) {
168
- var n = "h:mm A", d = { lastDay: "[Yesterday at] " + n, sameDay: "[Today at] " + n, nextDay: "[Tomorrow at] " + n, nextWeek: "dddd [at] " + n, lastWeek: "[Last] dddd [at] " + n, sameElse: "MM/DD/YYYY" };
169
- t.prototype.calendar = function(e2, t2) {
170
- var n2 = t2 || this.$locale().calendar || d, s = a(e2 || void 0).startOf("d"), o = this.diff(s, "d", true), i = o < -6 ? "sameElse" : o < -1 ? "lastWeek" : o < 0 ? "lastDay" : o < 1 ? "sameDay" : o < 2 ? "nextDay" : o < 7 ? "nextWeek" : "sameElse", f = n2[i] || d[i];
171
- return "function" == typeof f ? f.call(this, a()) : this.format(f);
172
- };
173
- };
174
- });
175
- })(calendar$2);
176
- return calendar$2.exports;
177
- }
178
- var calendarExports = requireCalendar();
179
- const calendar = /* @__PURE__ */ getDefaultExportFromCjs(calendarExports);
180
- var localizedFormat$1 = { exports: {} };
181
- var localizedFormat = localizedFormat$1.exports;
182
- var hasRequiredLocalizedFormat;
183
- function requireLocalizedFormat() {
184
- if (hasRequiredLocalizedFormat) return localizedFormat$1.exports;
185
- hasRequiredLocalizedFormat = 1;
186
- (function(module2, exports$1) {
187
- !(function(e, t) {
188
- module2.exports = t();
189
- })(localizedFormat, function() {
190
- var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
191
- return function(t, n, o) {
192
- var r = n.prototype, M = r.format;
193
- o.en.formats = e, r.format = function(t2) {
194
- void 0 === t2 && (t2 = "YYYY-MM-DDTHH:mm:ssZ");
195
- var n2 = this.$locale().formats, o2 = (function(t3, n3) {
196
- return t3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t4, o3, r2) {
197
- var M2 = r2 && r2.toUpperCase();
198
- return o3 || n3[r2] || e[r2] || n3[M2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t5, n4) {
199
- return t5 || n4.slice(1);
200
- });
201
- });
202
- })(t2, void 0 === n2 ? {} : n2);
203
- return M.call(this, o2);
204
- };
205
- };
206
- });
207
- })(localizedFormat$1);
208
- return localizedFormat$1.exports;
209
- }
210
- var localizedFormatExports = requireLocalizedFormat();
211
- const LocalizedFormat = /* @__PURE__ */ getDefaultExportFromCjs(localizedFormatExports);
212
- const isNumberOrString = (output) => typeof output === "string" || typeof output === "number";
213
- const isDayOrMoment = (output) => !!output?.isSame;
214
- const isDate = (output) => output !== null && typeof output === "object" && typeof output.getTime === "function";
215
- const DEFAULT_RELATIVE_COMPACT_MAX_DAYS = 6;
216
- const DEFAULT_RELATIVE_COMPACT_MAX_WEEKS = 3;
217
- function getRelativeCompactDateString(messageCreatedAt, t, tDateTimeParser, maxDays = DEFAULT_RELATIVE_COMPACT_MAX_DAYS, maxWeeks = DEFAULT_RELATIVE_COMPACT_MAX_WEEKS) {
218
- const then = tDateTimeParser(messageCreatedAt);
219
- if (!isDayOrMoment(then)) return null;
220
- const now = tDateTimeParser((/* @__PURE__ */ new Date()).toISOString());
221
- if (!isDayOrMoment(now)) return null;
222
- const diffDays = now.startOf("day").diff(then.startOf("day"), "day");
223
- if (diffDays < 0) {
224
- return then.format("DD/MM/YY");
225
- }
226
- if (diffDays === 0) return t("timestamp/relativeToday");
227
- if (diffDays === 1) return t("timestamp/relativeYesterday");
228
- if (diffDays >= 2 && diffDays <= maxDays)
229
- return t("timestamp/relativeDaysAgo", { count: diffDays });
230
- if (maxWeeks > 0) {
231
- const maxDaysForWeeks = maxWeeks * 7;
232
- if (diffDays >= 7 && diffDays <= maxDaysForWeeks) {
233
- const weeks = Math.ceil(diffDays / 7);
234
- return t("timestamp/relativeWeeksAgo", { count: weeks });
235
- }
236
- }
237
- return then.format("DD/MM/YY");
238
- }
239
- function getDateString({
240
- calendar: calendar2,
241
- calendarFormats,
242
- format,
243
- formatDate,
244
- messageCreatedAt,
245
- relativeCompact,
246
- relativeCompactMaxDays,
247
- relativeCompactMaxWeeks,
248
- t,
249
- tDateTimeParser,
250
- timestampTranslationKey
251
- }) {
252
- if (!messageCreatedAt || typeof messageCreatedAt === "string" && !Date.parse(messageCreatedAt)) {
253
- return null;
254
- }
255
- if (typeof formatDate === "function") {
256
- return formatDate(new Date(messageCreatedAt));
257
- }
258
- if (relativeCompact && t && tDateTimeParser) {
259
- const maxDays = typeof relativeCompactMaxDays === "number" ? relativeCompactMaxDays : typeof relativeCompactMaxDays === "string" ? parseInt(relativeCompactMaxDays, 10) : DEFAULT_RELATIVE_COMPACT_MAX_DAYS;
260
- const maxWeeks = typeof relativeCompactMaxWeeks === "number" ? relativeCompactMaxWeeks : typeof relativeCompactMaxWeeks === "string" ? parseInt(relativeCompactMaxWeeks, 10) : DEFAULT_RELATIVE_COMPACT_MAX_WEEKS;
261
- const result = getRelativeCompactDateString(
262
- messageCreatedAt,
263
- t,
264
- tDateTimeParser,
265
- Number.isNaN(maxDays) ? DEFAULT_RELATIVE_COMPACT_MAX_DAYS : maxDays,
266
- Number.isNaN(maxWeeks) ? DEFAULT_RELATIVE_COMPACT_MAX_WEEKS : maxWeeks
267
- );
268
- if (result) return result;
269
- }
270
- if (t && timestampTranslationKey) {
271
- const options = {};
272
- if (typeof calendar2 !== "undefined" && calendar2 !== null) options.calendar = calendar2;
273
- if (typeof calendarFormats !== "undefined" && calendarFormats !== null)
274
- options.calendarFormats = calendarFormats;
275
- if (typeof format !== "undefined" && format !== null) options.format = format;
276
- const translatedTimestamp = t(timestampTranslationKey, {
277
- ...options,
278
- timestamp: new Date(messageCreatedAt)
279
- });
280
- const translationKeyFound = timestampTranslationKey !== translatedTimestamp;
281
- if (translationKeyFound) return translatedTimestamp;
282
- }
283
- if (!tDateTimeParser) {
284
- return null;
285
- }
286
- const parsedTime = tDateTimeParser(messageCreatedAt);
287
- if (isDayOrMoment(parsedTime)) {
288
- return calendar2 && parsedTime.calendar ? parsedTime.calendar(void 0, calendarFormats || void 0) : parsedTime.format(format || void 0);
289
- }
290
- if (isDate(parsedTime)) {
291
- return parsedTime.toDateString();
292
- }
293
- if (isNumberOrString(parsedTime)) {
294
- return parsedTime;
295
- }
296
- return null;
297
- }
298
- const predefinedFormatters = {
299
- durationFormatter: (streamI18n) => (value, _, { format, withSuffix }) => {
300
- if (format && Dayjs.isDayjs(streamI18n.DateTimeParser)) {
301
- return streamI18n.DateTimeParser.duration(value).format(
302
- format
303
- );
304
- }
305
- return streamI18n.DateTimeParser.duration(value).humanize(!!withSuffix);
306
- },
307
- timestampFormatter: (streamI18n) => (value, _, {
308
- calendarFormats,
309
- ...options
310
- }) => {
311
- let parsedCalendarFormats;
312
- try {
313
- if (!options.calendar) {
314
- parsedCalendarFormats = {};
315
- } else if (typeof calendarFormats === "string") {
316
- parsedCalendarFormats = JSON.parse(calendarFormats);
317
- } else if (typeof calendarFormats === "object") {
318
- parsedCalendarFormats = calendarFormats;
319
- }
320
- } catch (e) {
321
- console.error("[TIMESTAMP FORMATTER]", e);
322
- }
323
- const result = getDateString({
324
- ...options,
325
- calendarFormats: parsedCalendarFormats,
326
- messageCreatedAt: value,
327
- t: streamI18n.t,
328
- tDateTimeParser: streamI18n.tDateTimeParser
329
- });
330
- if (!result || typeof result === "number") {
331
- return JSON.stringify(value);
332
- }
333
- return result;
334
- }
335
- };
336
- const defaultTranslatorFunction = ((key) => key);
337
- const defaultDateTimeParser = (input) => Dayjs(input);
338
- const isLanguageSupported = (language) => {
339
- const translations = [
340
- "de",
341
- "en",
342
- "es",
343
- "fr",
344
- "hi",
345
- "it",
346
- "ja",
347
- "ko",
348
- "nl",
349
- "pt",
350
- "ru",
351
- "tr"
352
- ];
353
- return translations.some((translation) => language === translation);
354
- };
355
- Dayjs.extend(calendar);
356
- Dayjs.extend(LocalizedFormat);
357
- const TranslationContext = React.createContext({
358
- t: defaultTranslatorFunction,
359
- tDateTimeParser: defaultDateTimeParser,
360
- userLanguage: "en"
361
- });
362
- const TranslationProvider = ({
363
- children,
364
- value
365
- }) => /* @__PURE__ */ jsxRuntime.jsx(TranslationContext.Provider, { value, children });
366
- const useTranslationContext = (componentName) => {
367
- const contextValue = React.useContext(TranslationContext);
368
- if (!contextValue) {
369
- console.warn(
370
- `The useTranslationContext hook was called outside of the TranslationContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ${componentName} component.`
371
- );
372
- return {};
373
- }
374
- return contextValue;
375
- };
376
- const TypingContext = React.createContext(
377
- void 0
378
- );
379
- const TypingProvider = ({
380
- children,
381
- value
382
- }) => /* @__PURE__ */ jsxRuntime.jsx(TypingContext.Provider, { value, children });
383
- const useTypingContext = (componentName) => {
384
- const contextValue = React.useContext(TypingContext);
385
- if (!contextValue) {
386
- console.warn(
387
- `The useTypingContext hook was called outside of the TypingContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${componentName} component.`
388
- );
389
- return {};
390
- }
391
- return contextValue;
392
- };
393
- const NOTIFICATION_TARGET_PANELS = [
394
- "channel",
395
- "thread",
396
- "channel-list",
397
- "thread-list"
398
- ];
399
- const isNotificationTargetPanel = (value) => typeof value === "string" && NOTIFICATION_TARGET_PANELS.includes(value);
400
- const getNotificationTargetPanel = (notification) => {
401
- const targetTag = notification.tags?.find((tag) => tag.startsWith("target:"));
402
- if (targetTag) {
403
- const candidate = targetTag.slice("target:".length);
404
- if (isNotificationTargetPanel(candidate)) return candidate;
405
- }
406
- const panel = notification.origin.context?.panel;
407
- return isNotificationTargetPanel(panel) ? panel : void 0;
408
- };
409
- const getNotificationTargetPanels = (notification) => {
410
- const targetPanels = (notification.tags ?? []).filter((tag) => tag.startsWith("target:")).map((tag) => tag.slice("target:".length)).filter(
411
- (value) => isNotificationTargetPanel(value)
412
- );
413
- if (targetPanels.length > 0) {
414
- return Array.from(new Set(targetPanels));
415
- }
416
- const panel = notification.origin.context?.panel;
417
- return isNotificationTargetPanel(panel) ? [panel] : [];
418
- };
419
- const getNotificationTargetTag = (panel) => `target:${panel}`;
420
- const addNotificationTargetTag = (panel, tags) => {
421
- if (!panel) return tags ?? [];
422
- return Array.from(/* @__PURE__ */ new Set([getNotificationTargetTag(panel), ...tags ?? []]));
423
- };
424
- const isNotificationForPanel = (notification, panel, options) => {
425
- const explicitTargetPanels = getNotificationTargetPanels(notification);
426
- if (explicitTargetPanels.length > 0) {
427
- return explicitTargetPanels.includes(panel);
428
- }
429
- const resolvedPanel = options?.fallbackPanel ?? "channel";
430
- return resolvedPanel === panel;
431
- };
432
- const variantToClass = {
433
- danger: "str-chat__button--destructive",
434
- primary: "str-chat__button--primary",
435
- secondary: "str-chat__button--secondary"
436
- };
437
- const appearanceToClass = {
438
- ghost: "str-chat__button--ghost",
439
- outline: "str-chat__button--outline",
440
- solid: "str-chat__button--solid"
441
- };
442
- const sizeToClass = {
443
- lg: "str-chat__button--size-lg",
444
- md: "str-chat__button--size-md",
445
- sm: "str-chat__button--size-sm",
446
- xs: "str-chat__button--size-xs"
447
- };
448
- const Button = React.forwardRef(function Button2({ appearance, children, circular, className, inverseTheme, size, variant, ...props }, ref) {
449
- return /* @__PURE__ */ jsxRuntime.jsx(
450
- "button",
451
- {
452
- ref,
453
- type: "button",
454
- ...props,
455
- className: clsx(
456
- "str-chat__button",
457
- variant != null && variantToClass[variant],
458
- appearance != null && appearanceToClass[appearance],
459
- circular && "str-chat__button--circular",
460
- inverseTheme && "str-chat__theme-inverse",
461
- size != null && sizeToClass[size],
462
- className
463
- ),
464
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__button__content", children })
465
- }
466
- );
467
- });
468
- const BaseIcon = ({ className, decorative = true, ...props }) => {
469
- const ariaHidden = props["aria-hidden"] ?? (decorative ? true : void 0);
470
- const focusable = props.focusable ?? (decorative ? false : void 0);
471
- return /* @__PURE__ */ jsxRuntime.jsx(
472
- "svg",
473
- {
474
- viewBox: "0 0 20 20",
475
- xmlns: "http://www.w3.org/2000/svg",
476
- ...props,
477
- "aria-hidden": ariaHidden,
478
- className: clsx("str-chat__icon", className),
479
- focusable
480
- }
481
- );
482
- };
483
- function toIconClass(name) {
484
- return "str-chat__icon--" + name.replace(/^Icon/, "").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Za-z])(\d)/g, "$1-$2").replace(/(\d)([A-Za-z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
485
- }
486
- function createIcon(name, content, defaultProps) {
487
- const iconClass = toIconClass(name);
488
- const Icon = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { ...defaultProps, ...props, className: clsx(iconClass, className), children: content });
489
- Icon.displayName = name;
490
- return Icon;
491
- }
492
- const IconLeave = createIcon(
493
- "IconLeave",
494
- /* @__PURE__ */ jsxRuntime.jsx(
495
- "path",
496
- {
497
- d: "M8.75 3.125H3.75V16.875H8.75M8.75 10H17.5M17.5 10L14.375 6.875M17.5 10L14.375 13.125",
498
- fill: "none",
499
- stroke: "currentColor",
500
- strokeLinecap: "round",
501
- strokeLinejoin: "round",
502
- strokeWidth: "1.5"
503
- }
504
- )
505
- );
506
- const IconArrowDown = createIcon(
507
- "IconArrowDown",
508
- /* @__PURE__ */ jsxRuntime.jsx(
509
- "path",
510
- {
511
- d: "M10 3.125V16.875M10 16.875L4.375 11.25M10 16.875L15.625 11.25",
512
- fill: "none",
513
- stroke: "currentColor",
514
- strokeLinecap: "round",
515
- strokeLinejoin: "round",
516
- strokeWidth: "1.5"
517
- }
518
- )
519
- );
520
- const IconArrowDownCircle = createIcon(
521
- "IconArrowDownCircle",
522
- /* @__PURE__ */ jsxRuntime.jsx(
523
- "path",
524
- {
525
- d: "M7.5 10.625L10 13.125M10 13.125L12.5 10.625M10 13.125V6.875M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
526
- fill: "none",
527
- stroke: "currentColor",
528
- strokeLinecap: "round",
529
- strokeLinejoin: "round",
530
- strokeWidth: "1.5"
531
- }
532
- )
533
- );
534
- const IconArrowLeft = createIcon(
535
- "IconArrowLeft",
536
- /* @__PURE__ */ jsxRuntime.jsx(
537
- "path",
538
- {
539
- d: "M16.875 10H3.125M3.125 10L8.75 4.375M3.125 10L8.75 15.625",
540
- fill: "none",
541
- stroke: "currentColor",
542
- strokeLinecap: "round",
543
- strokeLinejoin: "round",
544
- strokeWidth: "1.5"
545
- }
546
- ),
547
- { "data-rtl-mirror": "" }
548
- );
549
- const IconArrowUpRight = createIcon(
550
- "IconArrowUpRight",
551
- /* @__PURE__ */ jsxRuntime.jsx(
552
- "path",
553
- {
554
- d: "M5 15L15 5M15 5H6.875M15 5V13.125",
555
- fill: "none",
556
- stroke: "currentColor",
557
- strokeLinecap: "round",
558
- strokeLinejoin: "round",
559
- strokeWidth: "1.5"
560
- }
561
- ),
562
- { "data-rtl-mirror": "" }
563
- );
564
- const IconRetry = createIcon(
565
- "IconRetry",
566
- /* @__PURE__ */ jsxRuntime.jsx(
567
- "path",
568
- {
569
- d: "M14.3751 8.12481H18.1251M18.1251 8.12481V4.37481M18.1251 8.12481L14.8618 5.13809C13.9063 4.18263 12.6904 3.52991 11.3661 3.26151C10.0418 2.9931 8.66771 3.12091 7.41561 3.62896C6.1635 4.137 5.08887 5.00276 4.32599 6.11806C3.5631 7.23336 3.1458 8.54875 3.12621 9.89986C3.10662 11.251 3.48562 12.5779 4.21585 13.7148C4.94609 14.8518 5.99517 15.7483 7.23202 16.2925C8.46887 16.8366 9.83865 17.0042 11.1702 16.7743C12.5018 16.5444 13.736 15.9272 14.7188 14.9998",
570
- fill: "none",
571
- stroke: "currentColor",
572
- strokeLinecap: "round",
573
- strokeLinejoin: "round",
574
- strokeWidth: "1.5"
575
- }
576
- )
577
- );
578
- const IconRefresh = createIcon(
579
- "IconRefresh",
580
- /* @__PURE__ */ jsxRuntime.jsx(
581
- "path",
582
- {
583
- d: "M13.125 7.49978H16.875M16.875 7.49978V3.74978M16.875 7.49978L14.6656 5.29041C13.3861 4.01095 11.6538 3.2875 9.84437 3.27697C8.03494 3.26644 6.29431 3.96968 5 5.23416M6.875 12.4998H3.125M3.125 12.4998V16.2498M3.125 12.4998L5.33437 14.7092C6.61388 15.9886 8.34621 16.7121 10.1556 16.7226C11.9651 16.7331 13.7057 16.0299 15 14.7654",
584
- fill: "none",
585
- stroke: "currentColor",
586
- strokeLinecap: "round",
587
- strokeLinejoin: "round",
588
- strokeWidth: "1.5"
589
- }
590
- )
591
- );
592
- const IconReply = createIcon(
593
- "IconReply",
594
- /* @__PURE__ */ jsxRuntime.jsx(
595
- "path",
596
- {
597
- d: "M17.5812 15.525C16.2953 14.1555 12.9195 11.25 8.12265 11.25V15L1.87265 8.75L8.12265 2.5V6.25C12.2476 6.25 17.5359 10.1914 18.1226 15.2766C18.1308 15.3424 18.1177 15.4091 18.0854 15.4671C18.0531 15.525 18.0031 15.5712 17.9428 15.5988C17.8825 15.6265 17.815 15.6343 17.75 15.621C17.685 15.6077 17.6259 15.5741 17.5812 15.525Z",
598
- fill: "none",
599
- stroke: "currentColor",
600
- strokeLinecap: "round",
601
- strokeLinejoin: "round",
602
- strokeWidth: "1.5"
603
- }
604
- ),
605
- { "data-rtl-mirror": "" }
606
- );
607
- const IconArrowUp = createIcon(
608
- "IconArrowUp",
609
- /* @__PURE__ */ jsxRuntime.jsx(
610
- "path",
611
- {
612
- d: "M10 16.875V3.125M10 3.125L4.375 8.75M10 3.125L15.625 8.75",
613
- fill: "none",
614
- stroke: "currentColor",
615
- strokeLinecap: "round",
616
- strokeLinejoin: "round",
617
- strokeWidth: "1.5"
618
- }
619
- )
620
- );
621
- const IconBell = createIcon(
622
- "IconBell",
623
- /* @__PURE__ */ jsxRuntime.jsx(
624
- "path",
625
- {
626
- d: "M7.50015 15C7.50015 15.663 7.76354 16.2989 8.23238 16.7678C8.70122 17.2366 9.33711 17.5 10.0001 17.5C10.6632 17.5 11.2991 17.2366 11.7679 16.7678C12.2368 16.2989 12.5001 15.663 12.5001 15M4.37515 8.125C4.37515 6.63316 4.96778 5.20242 6.02267 4.14752C7.07756 3.09263 8.5083 2.5 10.0001 2.5C11.492 2.5 12.9227 3.09263 13.9776 4.14752C15.0325 5.20242 15.6251 6.63316 15.6251 8.125C15.6251 10.9234 16.2736 13.1719 16.7892 14.0625C16.844 14.1574 16.8728 14.2649 16.8729 14.3745C16.873 14.484 16.8444 14.5916 16.7898 14.6865C16.7352 14.7815 16.6566 14.8604 16.5619 14.9154C16.4672 14.9705 16.3597 14.9996 16.2501 15H3.75015C3.64076 14.9993 3.53345 14.97 3.43896 14.9149C3.34448 14.8597 3.26611 14.7808 3.2117 14.6859C3.15729 14.591 3.12874 14.4835 3.12891 14.3741C3.12907 14.2647 3.15795 14.1572 3.21265 14.0625C3.72749 13.1719 4.37515 10.9227 4.37515 8.125Z",
627
- fill: "none",
628
- stroke: "currentColor",
629
- strokeLinecap: "round",
630
- strokeLinejoin: "round",
631
- strokeWidth: "1.5"
632
- }
633
- )
634
- );
635
- const IconBellOff = createIcon(
636
- "IconBellOff",
637
- /* @__PURE__ */ jsxRuntime.jsx(
638
- "path",
639
- {
640
- d: "M3.75015 3.12492L10.0001 9.99992C10.0001 9.99992 13.8094 14.1901 16.2501 16.8749M7.50015 14.9999C7.50015 15.663 7.76354 16.2988 8.23238 16.7677C8.70122 17.2365 9.33711 17.4999 10.0001 17.4999C10.6632 17.4999 11.2991 17.2365 11.7679 16.7677C12.2368 16.2988 12.5001 15.663 12.5001 14.9999M7.22515 3.23117C8.0809 2.74583 9.04899 2.49341 10.0328 2.49912C11.0166 2.50482 11.9817 2.76845 12.8317 3.26369C13.6818 3.75893 14.3871 4.46846 14.8773 5.32147C15.3674 6.17447 15.6253 7.14111 15.6251 8.12492C15.6251 10.3984 16.0533 12.3093 16.49 13.4218M14.5455 14.9999H3.75015C3.64076 14.9993 3.53345 14.9699 3.43896 14.9148C3.34448 14.8597 3.26611 14.7807 3.2117 14.6858C3.15729 14.5909 3.12874 14.4834 3.12891 14.374C3.12907 14.2646 3.15795 14.1572 3.21265 14.0624C3.72749 13.1718 4.37515 10.9226 4.37515 8.12492C4.37327 6.97806 4.72371 5.85829 5.37905 4.91711",
641
- fill: "none",
642
- stroke: "currentColor",
643
- strokeLinecap: "round",
644
- strokeLinejoin: "round",
645
- strokeWidth: "1.5"
646
- }
647
- )
648
- );
649
- const IconBookmark = createIcon(
650
- "IconBookmark",
651
- /* @__PURE__ */ jsxRuntime.jsx(
652
- "path",
653
- {
654
- d: "M15 17.5L10 14.375L5 17.5V3.75C5 3.58424 5.06585 3.42527 5.18306 3.30806C5.30027 3.19085 5.45924 3.125 5.625 3.125H14.375C14.5408 3.125 14.6997 3.19085 14.8169 3.30806C14.9342 3.42527 15 3.58424 15 3.75V17.5Z",
655
- fill: "none",
656
- stroke: "currentColor",
657
- strokeLinecap: "round",
658
- strokeLinejoin: "round",
659
- strokeWidth: "1.5"
660
- }
661
- )
662
- );
663
- const IconBookmarkRemove = createIcon(
664
- "IconBookmarkRemove",
665
- /* @__PURE__ */ jsxRuntime.jsx(
666
- "path",
667
- {
668
- d: "M5 6.49074V17.5L10 14.375L15 17.5V16M5.125 3.125H14.375C14.5408 3.125 14.6997 3.19085 14.8169 3.30806C14.9342 3.42527 15 3.58424 15 3.75V13M5.125 3.125L3.5 1.5M5.125 3.125L15 13M15 13L17.5 15.5",
669
- fill: "none",
670
- stroke: "currentColor",
671
- strokeLinecap: "round",
672
- strokeLinejoin: "round",
673
- strokeWidth: "1.5"
674
- }
675
- )
676
- );
677
- const IconMessageBubbles = createIcon(
678
- "IconMessageBubbles",
679
- /* @__PURE__ */ jsxRuntime.jsx(
680
- "path",
681
- {
682
- d: "M12.8076 6.25836C13.7525 6.30974 14.6692 6.59868 15.4728 7.09845C16.2764 7.59821 16.941 8.29265 17.4049 9.11746C17.8688 9.94227 18.1172 10.8708 18.1269 11.8171C18.1367 12.7634 17.9075 13.6968 17.4607 14.531L18.0982 16.6998C18.1298 16.8075 18.1319 16.9217 18.1041 17.0304C18.0764 17.1392 18.0198 17.2385 17.9405 17.3178C17.8611 17.3972 17.7618 17.4537 17.6531 17.4815C17.5443 17.5092 17.4301 17.5072 17.3224 17.4756L15.156 16.8357C14.4404 17.2184 13.6504 17.4419 12.8404 17.4907C12.0303 17.5396 11.2192 17.4127 10.4628 17.1188C9.70632 16.8249 9.02237 16.3708 8.45781 15.7878C7.89325 15.2049 7.46143 14.5067 7.19195 13.7412M2.53882 10.781C1.90215 9.59158 1.71418 8.21294 2.00918 6.89647C2.30419 5.58 3.06253 4.41341 4.14591 3.60942C5.22929 2.80543 6.56555 2.4176 7.91103 2.51665C9.2565 2.6157 10.5216 3.19503 11.4755 4.149C12.4295 5.10297 13.0088 6.36803 13.1079 7.7135C13.2069 9.05898 12.8191 10.3952 12.0151 11.4786C11.2111 12.562 10.0445 13.3203 8.72806 13.6153C7.41159 13.9104 6.03295 13.7224 4.84351 13.0857L2.67476 13.7232C2.56707 13.7548 2.45285 13.7569 2.3441 13.7291C2.23535 13.7014 2.13608 13.6448 2.05671 13.5655C1.97735 13.4861 1.92082 13.3868 1.89307 13.2781C1.86531 13.1693 1.86735 13.0551 1.89898 12.9474L2.53882 10.781Z",
683
- fill: "none",
684
- stroke: "currentColor",
685
- strokeLinecap: "round",
686
- strokeLinejoin: "round",
687
- strokeWidth: "1.5"
688
- }
689
- )
690
- );
691
- const IconMessageBubble = createIcon(
692
- "IconMessageBubble",
693
- /* @__PURE__ */ jsxRuntime.jsx(
694
- "path",
695
- {
696
- d: "M6.24431 16.4932C7.81972 17.405 9.67297 17.7127 11.4585 17.359C13.2441 17.0053 14.84 16.0143 15.9489 14.5708C17.0578 13.1273 17.6038 11.3298 17.4852 9.51341C17.3667 7.69704 16.5916 5.98577 15.3045 4.69866C14.0174 3.41156 12.3061 2.63646 10.4897 2.51789C8.67333 2.39932 6.87582 2.94537 5.43231 4.05422C3.9888 5.16308 2.99781 6.75906 2.64412 8.54461C2.29042 10.3302 2.59815 12.1834 3.50993 13.7588L2.53259 16.6768C2.49586 16.7869 2.49053 16.9051 2.5172 17.0181C2.54386 17.131 2.60146 17.2344 2.68355 17.3165C2.76563 17.3985 2.86895 17.4561 2.98194 17.4828C3.09492 17.5095 3.21309 17.5041 3.32321 17.4674L6.24431 16.4932Z",
697
- fill: "none",
698
- stroke: "currentColor",
699
- strokeLinecap: "round",
700
- strokeLinejoin: "round",
701
- strokeWidth: "1.5"
702
- }
703
- )
704
- );
705
- const IconMessageBubbleFill = createIcon(
706
- "IconMessageBubbleFill",
707
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.125 10.0001C18.1253 11.4028 17.7624 12.7818 17.0717 14.0027C16.381 15.2236 15.3859 16.2449 14.1834 16.9671C12.9808 17.6894 11.6118 18.088 10.2095 18.1242C8.80719 18.1603 7.41942 17.8328 6.18125 17.1735L3.52109 18.0602C3.30085 18.1337 3.0645 18.1444 2.83854 18.091C2.61257 18.0377 2.40593 17.9225 2.24176 17.7583C2.07759 17.5942 1.96239 17.3875 1.90906 17.1615C1.85573 16.9356 1.86639 16.6992 1.93984 16.479L2.82656 13.8188C2.24699 12.7292 1.92328 11.5218 1.88 10.2883C1.83672 9.0549 2.075 7.8278 2.57677 6.70019C3.07854 5.57258 3.8306 4.57411 4.77587 3.78055C5.72114 2.98699 6.83478 2.41921 8.03224 2.1203C9.22971 1.82139 10.4795 1.79922 11.6868 2.05545C12.8942 2.31169 14.0272 2.8396 15.0001 3.59912C15.9729 4.35865 16.7599 5.32981 17.3014 6.43891C17.8428 7.548 18.1245 8.76588 18.125 10.0001Z" })
708
- );
709
- const IconThread = createIcon(
710
- "IconThread",
711
- /* @__PURE__ */ jsxRuntime.jsx(
712
- "path",
713
- {
714
- d: "M7.5 8.75H12.8125M7.5 11.25H12.8125M10.3125 16.875H3.75C3.58424 16.875 3.42527 16.8092 3.30806 16.6919C3.19085 16.5747 3.125 16.4158 3.125 16.25V9.6875C3.125 7.78126 3.88225 5.95309 5.23017 4.60517C6.57809 3.25725 8.40626 2.5 10.3125 2.5C11.2564 2.5 12.191 2.68591 13.063 3.04712C13.9351 3.40832 14.7274 3.93775 15.3948 4.60517C16.0623 5.27259 16.5917 6.06493 16.9529 6.93696C17.3141 7.80899 17.5 8.74362 17.5 9.6875C17.5 10.6314 17.3141 11.566 16.9529 12.438C16.5917 13.3101 16.0623 14.1024 15.3948 14.7698C14.7274 15.4373 13.9351 15.9667 13.063 16.3279C12.191 16.6891 11.2564 16.875 10.3125 16.875Z",
715
- fill: "none",
716
- stroke: "currentColor",
717
- strokeLinecap: "round",
718
- strokeLinejoin: "round",
719
- strokeWidth: "1.5"
720
- }
721
- )
722
- );
723
- const IconThreadFill = createIcon(
724
- "IconThreadFill",
725
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.3125 1.875C8.24119 1.87727 6.25538 2.70111 4.79074 4.16574C3.32611 5.63038 2.50227 7.61619 2.5 9.6875V16.25C2.5 16.5815 2.6317 16.8995 2.86612 17.1339C3.10054 17.3683 3.41848 17.5 3.75 17.5H10.3125C12.3845 17.5 14.3716 16.6769 15.8368 15.2118C17.3019 13.7466 18.125 11.7595 18.125 9.6875C18.125 7.6155 17.3019 5.62836 15.8368 4.16323C14.3716 2.6981 12.3845 1.875 10.3125 1.875ZM12.8125 11.875H7.5C7.33424 11.875 7.17527 11.8092 7.05806 11.6919C6.94085 11.5747 6.875 11.4158 6.875 11.25C6.875 11.0842 6.94085 10.9253 7.05806 10.8081C7.17527 10.6908 7.33424 10.625 7.5 10.625H12.8125C12.9783 10.625 13.1372 10.6908 13.2544 10.8081C13.3717 10.9253 13.4375 11.0842 13.4375 11.25C13.4375 11.4158 13.3717 11.5747 13.2544 11.6919C13.1372 11.8092 12.9783 11.875 12.8125 11.875ZM12.8125 9.375H7.5C7.33424 9.375 7.17527 9.30915 7.05806 9.19194C6.94085 9.07473 6.875 8.91576 6.875 8.75C6.875 8.58424 6.94085 8.42527 7.05806 8.30806C7.17527 8.19085 7.33424 8.125 7.5 8.125H12.8125C12.9783 8.125 13.1372 8.19085 13.2544 8.30806C13.3717 8.42527 13.4375 8.58424 13.4375 8.75C13.4375 8.91576 13.3717 9.07473 13.2544 9.19194C13.1372 9.30915 12.9783 9.375 12.8125 9.375Z" })
726
- );
727
- const IconNotification = createIcon(
728
- "IconNotification",
729
- /* @__PURE__ */ jsxRuntime.jsx(
730
- "path",
731
- {
732
- d: "M16.25 10V16.25C16.25 16.4158 16.1842 16.5747 16.0669 16.6919C15.9497 16.8092 15.7908 16.875 15.625 16.875H3.75C3.58424 16.875 3.42527 16.8092 3.30806 16.6919C3.19085 16.5747 3.125 16.4158 3.125 16.25V4.375C3.125 4.20924 3.19085 4.05027 3.30806 3.93306C3.42527 3.81585 3.58424 3.75 3.75 3.75H10M17.5 4.6875C17.5 5.89562 16.5206 6.875 15.3125 6.875C14.1044 6.875 13.125 5.89562 13.125 4.6875C13.125 3.47938 14.1044 2.5 15.3125 2.5C16.5206 2.5 17.5 3.47938 17.5 4.6875Z",
733
- fill: "none",
734
- stroke: "currentColor",
735
- strokeLinecap: "round",
736
- strokeLinejoin: "round",
737
- strokeWidth: "1.5"
738
- }
739
- )
740
- );
741
- const IconCamera = createIcon(
742
- "IconCamera",
743
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
744
- /* @__PURE__ */ jsxRuntime.jsx(
745
- "path",
746
- {
747
- d: "M16.25 16.25H3.75C3.41848 16.25 3.10054 16.1183 2.86612 15.8839C2.6317 15.6495 2.5 15.3315 2.5 15V6.25C2.5 5.91848 2.6317 5.60054 2.86612 5.36612C3.10054 5.1317 3.41848 5 3.75 5H6.25L7.5 3.125H12.5L13.75 5H16.25C16.5815 5 16.8995 5.1317 17.1339 5.36612C17.3683 5.60054 17.5 5.91848 17.5 6.25V15C17.5 15.3315 17.3683 15.6495 17.1339 15.8839C16.8995 16.1183 16.5815 16.25 16.25 16.25Z",
748
- fill: "none",
749
- stroke: "currentColor",
750
- strokeLinecap: "round",
751
- strokeLinejoin: "round",
752
- strokeWidth: "1.5"
753
- }
754
- ),
755
- /* @__PURE__ */ jsxRuntime.jsx(
756
- "path",
757
- {
758
- d: "M10 13.125C11.5533 13.125 12.8125 11.8658 12.8125 10.3125C12.8125 8.7592 11.5533 7.5 10 7.5C8.4467 7.5 7.1875 8.7592 7.1875 10.3125C7.1875 11.8658 8.4467 13.125 10 13.125Z",
759
- fill: "none",
760
- stroke: "currentColor",
761
- strokeLinecap: "round",
762
- strokeLinejoin: "round",
763
- strokeWidth: "1.5"
764
- }
765
- )
766
- ] })
767
- );
768
- const IconLink = createIcon(
769
- "IconLink",
770
- /* @__PURE__ */ jsxRuntime.jsx(
771
- "path",
772
- {
773
- d: "M7.49989 12.4999L12.4999 7.49989M8.74989 5.94598L11.0983 3.60223C11.8035 2.90843 12.7543 2.52139 13.7436 2.52542C14.7328 2.52945 15.6804 2.92422 16.3799 3.62374C17.0795 4.32326 17.4742 5.27086 17.4783 6.26012C17.4823 7.24938 17.0953 8.20016 16.4015 8.90536L14.053 11.2499M5.94598 8.74989L3.60223 11.0983C2.90843 11.8035 2.52139 12.7543 2.52542 13.7436C2.52945 14.7328 2.92422 15.6804 3.62374 16.3799C4.32326 17.0795 5.27086 17.4742 6.26012 17.4783C7.24938 17.4823 8.20016 17.0953 8.90536 16.4015L11.2499 14.053",
774
- fill: "none",
775
- stroke: "currentColor",
776
- strokeLinecap: "round",
777
- strokeLinejoin: "round",
778
- strokeWidth: "1.5"
779
- }
780
- )
781
- );
782
- const IconPoll = createIcon(
783
- "IconPoll",
784
- /* @__PURE__ */ jsxRuntime.jsx(
785
- "path",
786
- {
787
- d: "M3.75 16.25V10.625H7.5M17.5 16.25H2.5M7.5 16.25V6.875H11.875M11.875 16.25V3.125H16.25V16.25",
788
- fill: "none",
789
- stroke: "currentColor",
790
- strokeLinecap: "round",
791
- strokeLinejoin: "round",
792
- strokeWidth: "1.5"
793
- }
794
- )
795
- );
796
- const IconCheckmark1Small = createIcon(
797
- "IconCheckmark1Small",
798
- /* @__PURE__ */ jsxRuntime.jsx(
799
- "path",
800
- {
801
- d: "M3.125 11.25L7.5 15.625L17.5 5.625",
802
- fill: "none",
803
- stroke: "currentColor",
804
- strokeLinecap: "round",
805
- strokeLinejoin: "round",
806
- strokeWidth: "1.5"
807
- }
808
- )
809
- );
810
- const IconCheckmark = createIcon(
811
- "IconCheckmark",
812
- /* @__PURE__ */ jsxRuntime.jsx(
813
- "path",
814
- {
815
- d: "M3.125 11.25L7.5 15.625L17.5 5.625",
816
- fill: "none",
817
- stroke: "currentColor",
818
- strokeLinecap: "round",
819
- strokeLinejoin: "round",
820
- strokeWidth: "1.5"
821
- }
822
- )
823
- );
824
- const IconChevronDown = createIcon(
825
- "IconChevronDown",
826
- /* @__PURE__ */ jsxRuntime.jsx(
827
- "path",
828
- {
829
- d: "M16.25 7.5L10 13.75L3.75 7.5",
830
- fill: "none",
831
- stroke: "currentColor",
832
- strokeLinecap: "round",
833
- strokeLinejoin: "round",
834
- strokeWidth: "1.5"
835
- }
836
- )
837
- );
838
- const IconChevronLeft = createIcon(
839
- "IconChevronLeft",
840
- /* @__PURE__ */ jsxRuntime.jsx(
841
- "path",
842
- {
843
- d: "M12.5 16.25L6.25 10L12.5 3.75",
844
- fill: "none",
845
- stroke: "currentColor",
846
- strokeLinecap: "round",
847
- strokeLinejoin: "round",
848
- strokeWidth: "1.5"
849
- }
850
- ),
851
- { "data-rtl-mirror": "" }
852
- );
853
- const IconChevronRight = createIcon(
854
- "IconChevronRight",
855
- /* @__PURE__ */ jsxRuntime.jsx(
856
- "path",
857
- {
858
- d: "M7.5 3.75L13.75 10L7.5 16.25",
859
- fill: "none",
860
- stroke: "currentColor",
861
- strokeLinecap: "round",
862
- strokeLinejoin: "round",
863
- strokeWidth: "1.5"
864
- }
865
- ),
866
- { "data-rtl-mirror": "" }
867
- );
868
- const IconNoSign = createIcon(
869
- "IconNoSign",
870
- /* @__PURE__ */ jsxRuntime.jsx(
871
- "path",
872
- {
873
- d: "M15.3031 15.3031L4.69688 4.69688M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
874
- fill: "none",
875
- stroke: "currentColor",
876
- strokeLinecap: "round",
877
- strokeMiterlimit: "10",
878
- strokeWidth: "1.5"
879
- }
880
- )
881
- );
882
- const IconMinusCircle = createIcon(
883
- "IconMinusCircle",
884
- /* @__PURE__ */ jsxRuntime.jsx(
885
- "path",
886
- {
887
- d: "M6.875 10H13.125M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
888
- fill: "none",
889
- stroke: "currentColor",
890
- strokeLinecap: "round",
891
- strokeMiterlimit: "10",
892
- strokeWidth: "1.5"
893
- }
894
- )
895
- );
896
- const IconMinus = createIcon(
897
- "IconMinus",
898
- /* @__PURE__ */ jsxRuntime.jsx(
899
- "path",
900
- {
901
- d: "M16.875 9.40039C17.2064 9.40039 17.4746 9.66863 17.4746 10C17.4746 10.3314 17.2064 10.5996 16.875 10.5996H3.125C2.79363 10.5996 2.52539 10.3314 2.52539 10C2.52539 9.66863 2.79363 9.40039 3.125 9.40039H16.875Z",
902
- fill: "currentColor"
903
- }
904
- )
905
- );
906
- const IconXCircle = createIcon(
907
- "IconXCircle",
908
- /* @__PURE__ */ jsxRuntime.jsx(
909
- "path",
910
- {
911
- d: "M12.5 7.5L7.5 12.5M7.5 7.5L12.5 12.5M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
912
- fill: "none",
913
- stroke: "currentColor",
914
- strokeLinecap: "round",
915
- strokeLinejoin: "round",
916
- strokeWidth: "1.5"
917
- }
918
- )
919
- );
920
- const IconClock = createIcon(
921
- "IconClock",
922
- /* @__PURE__ */ jsxRuntime.jsx(
923
- "path",
924
- {
925
- d: "M10 5.625V10H14.375M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
926
- fill: "none",
927
- stroke: "currentColor",
928
- strokeLinecap: "round",
929
- strokeLinejoin: "round",
930
- strokeWidth: "1.5"
931
- }
932
- )
933
- );
934
- const IconQuote = createIcon(
935
- "IconQuote",
936
- /* @__PURE__ */ jsxRuntime.jsx(
937
- "path",
938
- {
939
- d: "M8.4375 11.25H3.125C2.95924 11.25 2.80027 11.1842 2.68306 11.0669C2.56585 10.9497 2.5 10.7908 2.5 10.625V5.625C2.5 5.45924 2.56585 5.30027 2.68306 5.18306C2.80027 5.06585 2.95924 5 3.125 5H7.8125C7.97826 5 8.13723 5.06585 8.25444 5.18306C8.37165 5.30027 8.4375 5.45924 8.4375 5.625V12.5C8.4375 13.3288 8.10826 14.1237 7.52221 14.7097C6.93616 15.2958 6.1413 15.625 5.3125 15.625M17.5 11.25H12.1875C12.0217 11.25 11.8628 11.1842 11.7456 11.0669C11.6283 10.9497 11.5625 10.7908 11.5625 10.625V5.625C11.5625 5.45924 11.6283 5.30027 11.7456 5.18306C11.8628 5.06585 12.0217 5 12.1875 5H16.875C17.0408 5 17.1997 5.06585 17.3169 5.18306C17.4342 5.30027 17.5 5.45924 17.5 5.625V12.5C17.5 13.3288 17.1708 14.1237 16.5847 14.7097C15.9987 15.2958 15.2038 15.625 14.375 15.625",
940
- fill: "none",
941
- stroke: "currentColor",
942
- strokeLinecap: "round",
943
- strokeLinejoin: "round",
944
- strokeWidth: "1.5"
945
- }
946
- )
947
- );
948
- const IconXmark = createIcon(
949
- "IconXmark",
950
- /* @__PURE__ */ jsxRuntime.jsx(
951
- "path",
952
- {
953
- d: "M15.625 4.375L4.375 15.625M15.625 15.625L4.375 4.375",
954
- fill: "none",
955
- stroke: "currentColor",
956
- strokeLinecap: "round",
957
- strokeLinejoin: "round",
958
- strokeWidth: "2"
959
- }
960
- )
961
- );
962
- const IconXmarkSmall = createIcon(
963
- "IconXmarkSmall",
964
- /* @__PURE__ */ jsxRuntime.jsx(
965
- "path",
966
- {
967
- d: "M13.5 6.5L6.5 13.5M13.5 13.5L6.5 6.5",
968
- fill: "none",
969
- stroke: "currentColor",
970
- strokeLinecap: "round",
971
- strokeLinejoin: "round",
972
- strokeWidth: "1.5"
973
- }
974
- )
975
- );
976
- const IconMore = createIcon(
977
- "IconMore",
978
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
979
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 11.25C10.6904 11.25 11.25 10.6904 11.25 10C11.25 9.30964 10.6904 8.75 10 8.75C9.30964 8.75 8.75 9.30964 8.75 10C8.75 10.6904 9.30964 11.25 10 11.25Z" }),
980
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.6875 11.25C5.37786 11.25 5.9375 10.6904 5.9375 10C5.9375 9.30964 5.37786 8.75 4.6875 8.75C3.99714 8.75 3.4375 9.30964 3.4375 10C3.4375 10.6904 3.99714 11.25 4.6875 11.25Z" }),
981
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.3125 11.25C16.0029 11.25 16.5625 10.6904 16.5625 10C16.5625 9.30964 16.0029 8.75 15.3125 8.75C14.6221 8.75 14.0625 9.30964 14.0625 10C14.0625 10.6904 14.6221 11.25 15.3125 11.25Z" })
982
- ] })
983
- );
984
- const IconReorder = createIcon(
985
- "IconReorder",
986
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.875 15.3125C8.875 16.2445 8.11948 17 7.1875 17C6.25552 17 5.5 16.2445 5.5 15.3125C5.5 14.3805 6.25552 13.625 7.1875 13.625C8.11948 13.625 8.875 14.3805 8.875 15.3125ZM14.5 15.3125C14.5 16.2445 13.7445 17 12.8125 17C11.8805 17 11.125 16.2445 11.125 15.3125C11.125 14.3805 11.8805 13.625 12.8125 13.625C13.7445 13.625 14.5 14.3805 14.5 15.3125ZM8.875 10C8.875 10.932 8.11948 11.6875 7.1875 11.6875C6.25552 11.6875 5.5 10.932 5.5 10C5.5 9.06802 6.25552 8.3125 7.1875 8.3125C8.11948 8.3125 8.875 9.06802 8.875 10ZM14.5 10C14.5 10.932 13.7445 11.6875 12.8125 11.6875C11.8805 11.6875 11.125 10.932 11.125 10C11.125 9.06802 11.8805 8.3125 12.8125 8.3125C13.7445 8.3125 14.5 9.06802 14.5 10ZM8.875 4.6875C8.875 5.61948 8.11948 6.375 7.1875 6.375C6.25552 6.375 5.5 5.61948 5.5 4.6875C5.5 3.75552 6.25552 3 7.1875 3C8.11948 3 8.875 3.75552 8.875 4.6875ZM14.5 4.6875C14.5 5.61948 13.7445 6.375 12.8125 6.375C11.8805 6.375 11.125 5.61948 11.125 4.6875C11.125 3.75552 11.8805 3 12.8125 3C13.7445 3 14.5 3.75552 14.5 4.6875Z" })
987
- );
988
- const IconChecks = createIcon(
989
- "IconChecks",
990
- /* @__PURE__ */ jsxRuntime.jsx(
991
- "path",
992
- {
993
- d: "M1.5 10.5724L4.98387 13.9936L13.1129 6.00977M10.371 13.9936L18.5 6.00977",
994
- fill: "none",
995
- stroke: "currentColor",
996
- strokeLinecap: "round",
997
- strokeLinejoin: "round",
998
- strokeWidth: "1.5"
999
- }
1000
- )
1001
- );
1002
- const IconDownload = createIcon(
1003
- "IconDownload",
1004
- /* @__PURE__ */ jsxRuntime.jsx(
1005
- "path",
1006
- {
1007
- d: "M2.375 11.25C2.375 10.8358 2.71079 10.5 3.125 10.5C3.53921 10.5 3.875 10.8358 3.875 11.25V15.5H16.125V11.25C16.125 10.8358 16.4608 10.5 16.875 10.5C17.2892 10.5 17.625 10.8358 17.625 11.25V16.25C17.625 16.6642 17.2892 17 16.875 17H3.125C2.71079 17 2.375 16.6642 2.375 16.25V11.25ZM9.25 2.5C9.25 2.08579 9.58579 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5V9.43945L12.5947 7.59473C12.8876 7.30183 13.3624 7.30183 13.6553 7.59473C13.9482 7.88762 13.9482 8.36238 13.6553 8.65527L10.5303 11.7803C10.2374 12.0732 9.76262 12.0732 9.46973 11.7803L6.34473 8.65527C6.05183 8.36238 6.05183 7.88762 6.34473 7.59473C6.63762 7.30183 7.11238 7.30183 7.40527 7.59473L9.25 9.43945V2.5Z",
1008
- fill: "currentColor"
1009
- }
1010
- )
1011
- );
1012
- const IconEdit = createIcon(
1013
- "IconEdit",
1014
- /* @__PURE__ */ jsxRuntime.jsx(
1015
- "path",
1016
- {
1017
- d: "M10.625 5.0001L15 9.3751M7.24141 16.8751H3.75C3.58424 16.8751 3.42527 16.8093 3.30806 16.692C3.19085 16.5748 3.125 16.4159 3.125 16.2501V12.7587C3.12508 12.5932 3.19082 12.4344 3.30781 12.3173L12.9422 2.68291C13.0594 2.56579 13.2183 2.5 13.384 2.5C13.5497 2.5 13.7086 2.56579 13.8258 2.68291L17.3172 6.17198C17.4343 6.28917 17.5001 6.44808 17.5001 6.61377C17.5001 6.77946 17.4343 6.93837 17.3172 7.05557L7.68281 16.6923C7.56569 16.8093 7.40695 16.875 7.24141 16.8751Z",
1018
- fill: "none",
1019
- stroke: "currentColor",
1020
- strokeLinecap: "round",
1021
- strokeLinejoin: "round",
1022
- strokeWidth: "1.5"
1023
- }
1024
- )
1025
- );
1026
- const IconEmoji = createIcon(
1027
- "IconEmoji",
1028
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1029
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.75 10C16.75 6.27208 13.7279 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z" }),
1030
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z" }),
1031
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z" }),
1032
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z" })
1033
- ] })
1034
- );
1035
- const IconEmojiAdd = createIcon(
1036
- "IconEmojiAdd",
1037
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1038
- /* @__PURE__ */ jsxRuntime.jsx(
1039
- "path",
1040
- {
1041
- d: "M1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5C10.75 2.91421 10.4142 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10C16.75 9.58579 17.0858 9.25 17.5 9.25C17.9142 9.25 18.25 9.58579 18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10Z",
1042
- fill: "currentColor"
1043
- }
1044
- ),
1045
- /* @__PURE__ */ jsxRuntime.jsx(
1046
- "path",
1047
- {
1048
- d: "M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z",
1049
- fill: "currentColor"
1050
- }
1051
- ),
1052
- /* @__PURE__ */ jsxRuntime.jsx(
1053
- "path",
1054
- {
1055
- d: "M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z",
1056
- fill: "currentColor"
1057
- }
1058
- ),
1059
- /* @__PURE__ */ jsxRuntime.jsx(
1060
- "path",
1061
- {
1062
- d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z",
1063
- fill: "currentColor"
1064
- }
1065
- ),
1066
- /* @__PURE__ */ jsxRuntime.jsx(
1067
- "path",
1068
- {
1069
- d: "M15.083 6.87524V4.91626H13.125C12.7108 4.91626 12.375 4.58047 12.375 4.16626C12.3752 3.7522 12.7109 3.41626 13.125 3.41626H15.083V1.45825C15.083 1.04415 15.4189 0.708427 15.833 0.708252C16.2472 0.708252 16.583 1.04404 16.583 1.45825V3.41626H18.542C18.9559 3.41644 19.2918 3.7523 19.292 4.16626C19.292 4.58036 18.9561 4.91608 18.542 4.91626H16.583V6.87524C16.5828 7.28931 16.2471 7.62524 15.833 7.62524C15.4191 7.62507 15.0832 7.2892 15.083 6.87524Z",
1070
- fill: "currentColor"
1071
- }
1072
- )
1073
- ] })
1074
- );
1075
- const IconExclamationMarkFill = createIcon(
1076
- "IconExclamationMarkFill",
1077
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1078
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 16.875C10.6904 16.875 11.25 16.3154 11.25 15.625C11.25 14.9346 10.6904 14.375 10 14.375C9.30964 14.375 8.75 14.9346 8.75 15.625C8.75 16.3154 9.30964 16.875 10 16.875Z" }),
1079
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 11.875V3.75C9 3.19772 9.44772 2.75 10 2.75C10.5523 2.75 11 3.19772 11 3.75V11.875C11 12.4273 10.5523 12.875 10 12.875C9.44772 12.875 9 12.4273 9 11.875Z" })
1080
- ] })
1081
- );
1082
- const IconExclamationCircleFill = createIcon(
1083
- "IconExclamationCircleFill",
1084
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 1.875C8.39303 1.875 6.82214 2.35152 5.486 3.24431C4.14985 4.1371 3.10844 5.40605 2.49348 6.8907C1.87852 8.37535 1.71762 10.009 2.03112 11.5851C2.34463 13.1612 3.11846 14.6089 4.25476 15.7452C5.39106 16.8815 6.8388 17.6554 8.41489 17.9689C9.99099 18.2824 11.6247 18.1215 13.1093 17.5065C14.594 16.8916 15.8629 15.8502 16.7557 14.514C17.6485 13.1779 18.125 11.607 18.125 10C18.1227 7.84581 17.266 5.78051 15.7427 4.25727C14.2195 2.73403 12.1542 1.87727 10 1.875ZM9.375 6.25C9.375 6.08424 9.44085 5.92527 9.55806 5.80806C9.67527 5.69085 9.83424 5.625 10 5.625C10.1658 5.625 10.3247 5.69085 10.4419 5.80806C10.5592 5.92527 10.625 6.08424 10.625 6.25V10.625C10.625 10.7908 10.5592 10.9497 10.4419 11.0669C10.3247 11.1842 10.1658 11.25 10 11.25C9.83424 11.25 9.67527 11.1842 9.55806 11.0669C9.44085 10.9497 9.375 10.7908 9.375 10.625V6.25ZM10 14.375C9.81458 14.375 9.63333 14.32 9.47916 14.217C9.32499 14.114 9.20482 13.9676 9.13387 13.7963C9.06291 13.625 9.04434 13.4365 9.08052 13.2546C9.11669 13.0727 9.20598 12.9057 9.33709 12.7746C9.4682 12.6435 9.63525 12.5542 9.81711 12.518C9.99896 12.4818 10.1875 12.5004 10.3588 12.5714C10.5301 12.6423 10.6765 12.7625 10.7795 12.9167C10.8825 13.0708 10.9375 13.2521 10.9375 13.4375C10.9375 13.6861 10.8387 13.9246 10.6629 14.1004C10.4871 14.2762 10.2486 14.375 10 14.375Z" })
1085
- );
1086
- const IconExclamationMark = createIcon(
1087
- "IconExclamationMark",
1088
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1089
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.75 10C16.75 6.27208 13.7279 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z" }),
1090
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.25 10.625V6.25C9.25 5.83579 9.58579 5.5 10 5.5C10.4142 5.5 10.75 5.83579 10.75 6.25V10.625C10.75 11.0392 10.4142 11.375 10 11.375C9.58579 11.375 9.25 11.0392 9.25 10.625Z" }),
1091
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 14.375C10.5178 14.375 10.9375 13.9553 10.9375 13.4375C10.9375 12.9197 10.5178 12.5 10 12.5C9.48223 12.5 9.0625 12.9197 9.0625 13.4375C9.0625 13.9553 9.48223 14.375 10 14.375Z" })
1092
- ] })
1093
- );
1094
- const IconExclamationTriangleFill = createIcon(
1095
- "IconExclamationTriangleFill",
1096
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.4999 14.6946L11.6678 2.82974C11.4971 2.53906 11.2534 2.29803 10.9608 2.13057C10.6682 1.9631 10.337 1.875 9.99986 1.875C9.66275 1.875 9.33149 1.9631 9.03892 2.13057C8.74635 2.29803 8.50262 2.53906 8.33189 2.82974L1.49986 14.6946C1.33559 14.9757 1.24902 15.2955 1.24902 15.6211C1.24902 15.9468 1.33559 16.2665 1.49986 16.5477C1.6684 16.8401 1.91171 17.0825 2.20483 17.2498C2.49795 17.4172 2.83032 17.5036 3.16783 17.5001H16.8319C17.1691 17.5033 17.5012 17.4168 17.794 17.2494C18.0868 17.0821 18.3299 16.8399 18.4983 16.5477C18.6628 16.2667 18.7496 15.947 18.7499 15.6214C18.7502 15.2957 18.6639 14.9759 18.4999 14.6946ZM9.37486 8.12505C9.37486 7.95929 9.44071 7.80032 9.55792 7.68311C9.67513 7.5659 9.8341 7.50005 9.99986 7.50005C10.1656 7.50005 10.3246 7.5659 10.4418 7.68311C10.559 7.80032 10.6249 7.95929 10.6249 8.12505V11.2501C10.6249 11.4158 10.559 11.5748 10.4418 11.692C10.3246 11.8092 10.1656 11.8751 9.99986 11.8751C9.8341 11.8751 9.67513 11.8092 9.55792 11.692C9.44071 11.5748 9.37486 11.4158 9.37486 11.2501V8.12505ZM9.99986 15.0001C9.81444 15.0001 9.63319 14.9451 9.47901 14.8421C9.32484 14.739 9.20468 14.5926 9.13372 14.4213C9.06277 14.25 9.0442 14.0615 9.08038 13.8797C9.11655 13.6978 9.20584 13.5308 9.33695 13.3996C9.46806 13.2685 9.63511 13.1792 9.81696 13.1431C9.99882 13.1069 10.1873 13.1255 10.3586 13.1964C10.5299 13.2674 10.6764 13.3875 10.7794 13.5417C10.8824 13.6959 10.9374 13.8771 10.9374 14.0626C10.9374 14.3112 10.8386 14.5496 10.6628 14.7255C10.487 14.9013 10.2485 15.0001 9.99986 15.0001Z" })
1097
- );
1098
- const IconEyeFill = createIcon(
1099
- "IconEyeFill",
1100
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19.3211 9.74688C19.2937 9.68516 18.632 8.21719 17.1609 6.74609C15.2008 4.78594 12.725 3.75 9.99999 3.75C7.27499 3.75 4.79921 4.78594 2.83905 6.74609C1.36796 8.21719 0.703118 9.6875 0.678899 9.74688C0.643362 9.82681 0.625 9.91331 0.625 10.0008C0.625 10.0883 0.643362 10.1748 0.678899 10.2547C0.706243 10.3164 1.36796 11.7836 2.83905 13.2547C4.79921 15.2141 7.27499 16.25 9.99999 16.25C12.725 16.25 15.2008 15.2141 17.1609 13.2547C18.632 11.7836 19.2937 10.3164 19.3211 10.2547C19.3566 10.1748 19.375 10.0883 19.375 10.0008C19.375 9.91331 19.3566 9.82681 19.3211 9.74688ZM9.99999 13.125C9.38193 13.125 8.77774 12.9417 8.26384 12.5983C7.74993 12.255 7.34939 11.7669 7.11287 11.1959C6.87634 10.6249 6.81446 9.99653 6.93504 9.39034C7.05562 8.78415 7.35324 8.22733 7.79028 7.79029C8.22732 7.35325 8.78414 7.05562 9.39033 6.93505C9.99652 6.81447 10.6249 6.87635 11.1959 7.11288C11.7669 7.3494 12.255 7.74994 12.5983 8.26384C12.9417 8.77775 13.125 9.38193 13.125 10C13.125 10.8288 12.7958 11.6237 12.2097 12.2097C11.6236 12.7958 10.8288 13.125 9.99999 13.125Z" })
1101
- );
1102
- const IconUnsupportedAttachment = createIcon(
1103
- "IconUnsupportedAttachment",
1104
- /* @__PURE__ */ jsxRuntime.jsx(
1105
- "path",
1106
- {
1107
- d: "M4.5 16.75H15.5V7.625H11.875C11.4608 7.625 11.125 7.28921 11.125 6.875V3.25H4.5V16.75ZM11.3447 9.46973C11.6376 9.17683 12.1124 9.17683 12.4053 9.46973C12.6982 9.76262 12.6982 10.2374 12.4053 10.5303L11.0605 11.875L12.4053 13.2197C12.6982 13.5126 12.6982 13.9874 12.4053 14.2803C12.1124 14.5732 11.6376 14.5732 11.3447 14.2803L10 12.9355L8.65527 14.2803C8.36238 14.5732 7.88762 14.5732 7.59473 14.2803C7.30183 13.9874 7.30183 13.5126 7.59473 13.2197L8.93945 11.875L7.59473 10.5303C7.30183 10.2374 7.30183 9.76262 7.59473 9.46973C7.88762 9.17683 8.36238 9.17683 8.65527 9.46973L10 10.8145L11.3447 9.46973ZM12.625 6.125H14.4395L12.625 4.31055V6.125ZM17 16.875C17 17.2397 16.8555 17.5898 16.5977 17.8477C16.3398 18.1055 15.9897 18.25 15.625 18.25H4.375C4.01033 18.25 3.66021 18.1055 3.40234 17.8477C3.14448 17.5898 3 17.2397 3 16.875V3.125C3 2.76033 3.14448 2.41021 3.40234 2.15234L3.50391 2.06152C3.74856 1.86111 4.05597 1.75 4.375 1.75H11.875C12.0739 1.75 12.2646 1.82907 12.4053 1.96973L16.7803 6.34473C16.9209 6.48538 17 6.67609 17 6.875V16.875Z",
1108
- fill: "currentColor"
1109
- }
1110
- )
1111
- );
1112
- const IconUpload = createIcon(
1113
- "IconUpload",
1114
- /* @__PURE__ */ jsxRuntime.jsx(
1115
- "path",
1116
- {
1117
- d: "M11.875 2.5H4.375C4.20924 2.5 4.05027 2.56585 3.93306 2.68306C3.81585 2.80027 3.75 2.95924 3.75 3.125V16.875C3.75 17.0408 3.81585 17.1997 3.93306 17.3169C4.05027 17.4342 4.20924 17.5 4.375 17.5H15.625C15.7908 17.5 15.9497 17.4342 16.0669 17.3169C16.1842 17.1997 16.25 17.0408 16.25 16.875V6.875M11.875 2.5L16.25 6.875M11.875 2.5V6.875H16.25M8.125 11.25L10 9.375M10 9.375L11.875 11.25M10 9.375V14.375",
1118
- fill: "none",
1119
- stroke: "currentColor",
1120
- strokeLinecap: "round",
1121
- strokeLinejoin: "round",
1122
- strokeWidth: "1.5"
1123
- }
1124
- )
1125
- );
1126
- const IconFile = createIcon(
1127
- "IconFile",
1128
- /* @__PURE__ */ jsxRuntime.jsx(
1129
- "path",
1130
- {
1131
- d: "M11.875 2.5H4.375C4.20924 2.5 4.05027 2.56585 3.93306 2.68306C3.81585 2.80027 3.75 2.95924 3.75 3.125V16.875C3.75 17.0408 3.81585 17.1997 3.93306 17.3169C4.05027 17.4342 4.20924 17.5 4.375 17.5H15.625C15.7908 17.5 15.9497 17.4342 16.0669 17.3169C16.1842 17.1997 16.25 17.0408 16.25 16.875V6.875M11.875 2.5L16.25 6.875M11.875 2.5V6.875H16.25",
1132
- fill: "none",
1133
- stroke: "currentColor",
1134
- strokeLinecap: "round",
1135
- strokeLinejoin: "round",
1136
- strokeWidth: "1.5"
1137
- }
1138
- )
1139
- );
1140
- const IconFlag = createIcon(
1141
- "IconFlag",
1142
- /* @__PURE__ */ jsxRuntime.jsx(
1143
- "path",
1144
- {
1145
- d: "M3.75 17.5001V4.3751C8.75 0.0446299 12.5 8.70557 17.5 4.3751V13.7501C12.5 18.0806 8.75 9.41963 3.75 13.7501",
1146
- fill: "none",
1147
- stroke: "currentColor",
1148
- strokeLinecap: "round",
1149
- strokeLinejoin: "round",
1150
- strokeWidth: "1.5"
1151
- }
1152
- )
1153
- );
1154
- const IconImage = createIcon(
1155
- "IconImage",
1156
- /* @__PURE__ */ jsxRuntime.jsx(
1157
- "path",
1158
- {
1159
- d: "M4.42891 16.875L12.9953 8.30781C13.0534 8.2497 13.1223 8.2036 13.1982 8.17215C13.274 8.1407 13.3554 8.12451 13.4375 8.12451C13.5196 8.12451 13.601 8.1407 13.6768 8.17215C13.7527 8.2036 13.8216 8.2497 13.8797 8.30781L16.875 11.3039M3.75 3.125H16.25C16.5952 3.125 16.875 3.40482 16.875 3.75V16.25C16.875 16.5952 16.5952 16.875 16.25 16.875H3.75C3.40482 16.875 3.125 16.5952 3.125 16.25V3.75C3.125 3.40482 3.40482 3.125 3.75 3.125ZM8.75 7.5C8.75 8.19036 8.19036 8.75 7.5 8.75C6.80964 8.75 6.25 8.19036 6.25 7.5C6.25 6.80964 6.80964 6.25 7.5 6.25C8.19036 6.25 8.75 6.80964 8.75 7.5Z",
1160
- fill: "none",
1161
- stroke: "currentColor",
1162
- strokeLinecap: "round",
1163
- strokeLinejoin: "round",
1164
- strokeWidth: "1.5"
1165
- }
1166
- )
1167
- );
1168
- const IconSearch = createIcon(
1169
- "IconSearch",
1170
- /* @__PURE__ */ jsxRuntime.jsx(
1171
- "path",
1172
- {
1173
- d: "M13.1695 13.1695L17.5 17.5M15 8.75C15 12.2018 12.2018 15 8.75 15C5.29822 15 2.5 12.2018 2.5 8.75C2.5 5.29822 5.29822 2.5 8.75 2.5C12.2018 2.5 15 5.29822 15 8.75Z",
1174
- fill: "none",
1175
- stroke: "currentColor",
1176
- strokeLinecap: "round",
1177
- strokeLinejoin: "round",
1178
- strokeWidth: "1.5"
1179
- }
1180
- ),
1181
- { "data-rtl-mirror": "" }
1182
- );
1183
- const IconLocation = createIcon(
1184
- "IconLocation",
1185
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1186
- /* @__PURE__ */ jsxRuntime.jsx(
1187
- "path",
1188
- {
1189
- d: "M10 10.625C11.3807 10.625 12.5 9.50571 12.5 8.125C12.5 6.74429 11.3807 5.625 10 5.625C8.61929 5.625 7.5 6.74429 7.5 8.125C7.5 9.50571 8.61929 10.625 10 10.625Z",
1190
- fill: "none",
1191
- stroke: "currentColor",
1192
- strokeLinecap: "round",
1193
- strokeLinejoin: "round",
1194
- strokeWidth: "1.5"
1195
- }
1196
- ),
1197
- /* @__PURE__ */ jsxRuntime.jsx(
1198
- "path",
1199
- {
1200
- d: "M16.25 8.125C16.25 13.75 10 18.125 10 18.125C10 18.125 3.75 13.75 3.75 8.125C3.75 6.4674 4.40848 4.87769 5.58058 3.70558C6.75269 2.53348 8.3424 1.875 10 1.875C11.6576 1.875 13.2473 2.53348 14.4194 3.70558C15.5915 4.87769 16.25 6.4674 16.25 8.125Z",
1201
- fill: "none",
1202
- stroke: "currentColor",
1203
- strokeLinecap: "round",
1204
- strokeLinejoin: "round",
1205
- strokeWidth: "1.5"
1206
- }
1207
- )
1208
- ] })
1209
- );
1210
- const IconVoice = createIcon(
1211
- "IconVoice",
1212
- /* @__PURE__ */ jsxRuntime.jsx(
1213
- "path",
1214
- {
1215
- d: "M10 15.625V18.75M10 15.625C11.4918 15.625 12.9226 15.0324 13.9775 13.9775C15.0324 12.9226 15.625 11.4918 15.625 10M10 15.625C8.50816 15.625 7.07742 15.0324 6.02252 13.9775C4.96763 12.9226 4.375 11.4918 4.375 10M10 1.875C11.7259 1.875 13.125 3.27411 13.125 5V10C13.125 11.7259 11.7259 13.125 10 13.125C8.27411 13.125 6.875 11.7259 6.875 10V5C6.875 3.27411 8.27411 1.875 10 1.875Z",
1216
- fill: "none",
1217
- stroke: "currentColor",
1218
- strokeLinecap: "round",
1219
- strokeLinejoin: "round",
1220
- strokeWidth: "1.5"
1221
- }
1222
- )
1223
- );
1224
- const IconMicrophoneSolid = createIcon(
1225
- "IconMicrophoneSolid",
1226
- /* @__PURE__ */ jsxRuntime.jsx(
1227
- "path",
1228
- {
1229
- d: "M6.25 10V5C6.25 4.00544 6.64509 3.05161 7.34835 2.34835C8.05161 1.64509 9.00544 1.25 10 1.25C10.9946 1.25 11.9484 1.64509 12.6517 2.34835C13.3549 3.05161 13.75 4.00544 13.75 5V10C13.75 10.9946 13.3549 11.9484 12.6517 12.6517C11.9484 13.3549 10.9946 13.75 10 13.75C9.00544 13.75 8.05161 13.3549 7.34835 12.6517C6.64509 11.9484 6.25 10.9946 6.25 10ZM16.25 10C16.25 9.83424 16.1842 9.67527 16.0669 9.55806C15.9497 9.44085 15.7908 9.375 15.625 9.375C15.4592 9.375 15.3003 9.44085 15.1831 9.55806C15.0658 9.67527 15 9.83424 15 10C15 11.3261 14.4732 12.5979 13.5355 13.5355C12.5979 14.4732 11.3261 15 10 15C8.67392 15 7.40215 14.4732 6.46447 13.5355C5.52678 12.5979 5 11.3261 5 10C5 9.83424 4.93415 9.67527 4.81694 9.55806C4.69973 9.44085 4.54076 9.375 4.375 9.375C4.20924 9.375 4.05027 9.44085 3.93306 9.55806C3.81585 9.67527 3.75 9.83424 3.75 10C3.7519 11.5489 4.32806 13.042 5.36707 14.1907C6.40607 15.3393 7.83409 16.062 9.375 16.2188V18.75C9.375 18.9158 9.44085 19.0747 9.55806 19.1919C9.67527 19.3092 9.83424 19.375 10 19.375C10.1658 19.375 10.3247 19.3092 10.4419 19.1919C10.5592 19.0747 10.625 18.9158 10.625 18.75V16.2188C12.1659 16.062 13.5939 15.3393 14.6329 14.1907C15.6719 13.042 16.2481 11.5489 16.25 10Z",
1230
- fill: "currentColor"
1231
- }
1232
- )
1233
- );
1234
- const IconMute = createIcon(
1235
- "IconMute",
1236
- /* @__PURE__ */ jsxRuntime.jsx(
1237
- "path",
1238
- {
1239
- d: "M15.625 8.125V11.875M18.125 6.875V13.125M4.375 3.125L16.875 16.875M9.38672 4.92109L12.5 2.5V8.34609M12.5 12.0625V17.5L6.875 13.125H3.125C2.95924 13.125 2.80027 13.0592 2.68306 12.9419C2.56585 12.8247 2.5 12.6658 2.5 12.5V7.5C2.5 7.33424 2.56585 7.17527 2.68306 7.05806C2.80027 6.94085 2.95924 6.875 3.125 6.875H7.78437",
1240
- fill: "none",
1241
- stroke: "currentColor",
1242
- strokeLinecap: "round",
1243
- strokeLinejoin: "round",
1244
- strokeWidth: "1.5"
1245
- }
1246
- ),
1247
- { "data-rtl-mirror": "" }
1248
- );
1249
- const IconSend = createIcon(
1250
- "IconSend",
1251
- /* @__PURE__ */ jsxRuntime.jsx(
1252
- "path",
1253
- {
1254
- d: "M11.2498 10H6.24982M6.24982 10L3.7881 2.71328C3.74537 2.59349 3.7402 2.4635 3.7733 2.34069C3.80639 2.21788 3.87616 2.10808 3.9733 2.02597C4.07044 1.94386 4.19032 1.89335 4.31693 1.88117C4.44353 1.86899 4.57084 1.89573 4.68185 1.95781L17.8069 9.4461C17.9045 9.50015 17.986 9.57937 18.0427 9.67555C18.0994 9.77172 18.1293 9.88133 18.1293 9.99297C18.1293 10.1046 18.0994 10.2142 18.0427 10.3104C17.986 10.4066 17.9045 10.4858 17.8069 10.5398L4.68185 18.0469C4.57051 18.1096 4.4426 18.1367 4.31537 18.1245C4.18815 18.1123 4.06772 18.0614 3.97032 17.9787C3.87292 17.8959 3.80323 17.7853 3.77065 17.6617C3.73807 17.5381 3.74416 17.4075 3.7881 17.2875L6.24982 10Z",
1255
- fill: "none",
1256
- stroke: "currentColor",
1257
- strokeLinecap: "round",
1258
- strokeLinejoin: "round",
1259
- strokeWidth: "1.5"
1260
- }
1261
- ),
1262
- { "data-rtl-mirror": "" }
1263
- );
1264
- const IconAttachment = createIcon(
1265
- "IconAttachment",
1266
- /* @__PURE__ */ jsxRuntime.jsx(
1267
- "path",
1268
- {
1269
- d: "M12.4999 6.24998L5.9913 12.8664C5.76258 13.102 5.63576 13.4181 5.63823 13.7465C5.6407 14.0748 5.77227 14.389 6.00451 14.6211C6.23674 14.8533 6.55099 14.9847 6.87934 14.987C7.20769 14.9894 7.52376 14.8624 7.75927 14.6336L15.5179 6.76795C15.9868 6.29905 16.2502 5.6631 16.2502 4.99998C16.2502 4.33686 15.9868 3.70091 15.5179 3.23201C15.049 2.76312 14.413 2.49969 13.7499 2.49969C13.0868 2.49969 12.4508 2.76312 11.9819 3.23201L4.22333 11.0984C3.52953 11.8036 3.14249 12.7544 3.14652 13.7437C3.15054 14.7329 3.54531 15.6805 4.24483 16.38C4.94435 17.0796 5.89195 17.4743 6.88121 17.4784C7.87048 17.4824 8.82126 17.0953 9.52645 16.4015L15.9374 9.99998",
1270
- fill: "none",
1271
- stroke: "currentColor",
1272
- strokeLinecap: "round",
1273
- strokeLinejoin: "round",
1274
- strokeWidth: "1.5"
1275
- }
1276
- )
1277
- );
1278
- const IconPauseFill = createIcon(
1279
- "IconPauseFill",
1280
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.875 3.75V16.25C16.875 16.5815 16.7433 16.8995 16.5089 17.1339C16.2745 17.3683 15.9565 17.5 15.625 17.5H12.5C12.1685 17.5 11.8505 17.3683 11.6161 17.1339C11.3817 16.8995 11.25 16.5815 11.25 16.25V3.75C11.25 3.41848 11.3817 3.10054 11.6161 2.86612C11.8505 2.6317 12.1685 2.5 12.5 2.5H15.625C15.9565 2.5 16.2745 2.6317 16.5089 2.86612C16.7433 3.10054 16.875 3.41848 16.875 3.75ZM7.5 2.5H4.375C4.04348 2.5 3.72554 2.6317 3.49112 2.86612C3.2567 3.10054 3.125 3.41848 3.125 3.75V16.25C3.125 16.5815 3.2567 16.8995 3.49112 17.1339C3.72554 17.3683 4.04348 17.5 4.375 17.5H7.5C7.83152 17.5 8.14946 17.3683 8.38388 17.1339C8.6183 16.8995 8.75 16.5815 8.75 16.25V3.75C8.75 3.41848 8.6183 3.10054 8.38388 2.86612C8.14946 2.6317 7.83152 2.5 7.5 2.5Z" })
1281
- );
1282
- const IconUser = createIcon(
1283
- "IconUser",
1284
- /* @__PURE__ */ jsxRuntime.jsx(
1285
- "path",
1286
- {
1287
- d: "M10 12.5C12.7614 12.5 15 10.2614 15 7.5C15 4.73858 12.7614 2.5 10 2.5C7.23858 2.5 5 4.73858 5 7.5C5 10.2614 7.23858 12.5 10 12.5ZM10 12.5C6.76172 12.5 4.01328 14.2602 2.5 16.875M10 12.5C13.2383 12.5 15.9867 14.2602 17.5 16.875",
1288
- fill: "none",
1289
- stroke: "currentColor",
1290
- strokeLinecap: "round",
1291
- strokeLinejoin: "round",
1292
- strokeWidth: "1.5"
1293
- }
1294
- )
1295
- );
1296
- const IconUserAdd = createIcon(
1297
- "IconUserAdd",
1298
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1299
- /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_14246_498359)", children: /* @__PURE__ */ jsxRuntime.jsx(
1300
- "path",
1301
- {
1302
- d: "M15.625 10.625H19.375M17.5 8.75V12.5M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625",
1303
- fill: "none",
1304
- stroke: "currentColor",
1305
- strokeLinecap: "round",
1306
- strokeLinejoin: "round",
1307
- strokeWidth: "1.5"
1308
- }
1309
- ) }),
1310
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_14246_498359", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "20", width: "20" }) }) })
1311
- ] })
1312
- );
1313
- const IconUserCheck = createIcon(
1314
- "IconUserCheck",
1315
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1316
- /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_14236_425131)", children: /* @__PURE__ */ jsxRuntime.jsx(
1317
- "path",
1318
- {
1319
- d: "M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625M15.625 11.25L16.875 12.5L19.375 10",
1320
- fill: "none",
1321
- stroke: "currentColor",
1322
- strokeLinecap: "round",
1323
- strokeLinejoin: "round",
1324
- strokeWidth: "1.5"
1325
- }
1326
- ) }),
1327
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_14236_425131", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "20", width: "20" }) }) })
1328
- ] })
1329
- );
1330
- const IconUserRemove = createIcon(
1331
- "IconUserRemove",
1332
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1333
- /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_14246_434209)", children: /* @__PURE__ */ jsxRuntime.jsx(
1334
- "path",
1335
- {
1336
- d: "M15.625 10.625H19.375M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625",
1337
- fill: "none",
1338
- stroke: "currentColor",
1339
- strokeLinecap: "round",
1340
- strokeLinejoin: "round",
1341
- strokeWidth: "1.5"
1342
- }
1343
- ) }),
1344
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_14246_434209", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "20", width: "20" }) }) })
1345
- ] })
1346
- );
1347
- const IconPin = createIcon(
1348
- "IconPin",
1349
- /* @__PURE__ */ jsxRuntime.jsx(
1350
- "path",
1351
- {
1352
- d: "M7.52271 12.4773L3.75006 16.25M17.9422 7.68279C18.0594 7.56559 18.1252 7.40668 18.1252 7.24099C18.1252 7.0753 18.0594 6.9164 17.9422 6.7992L13.2032 2.05779C13.086 1.94067 12.9271 1.87488 12.7614 1.87488C12.5957 1.87488 12.4368 1.94067 12.3196 2.05779L7.84303 6.54685C7.84303 6.54685 5.67506 5.46326 3.35943 7.33201C3.29077 7.38697 3.23447 7.45581 3.19424 7.53402C3.154 7.61224 3.13072 7.69806 3.12593 7.78589C3.12114 7.87371 3.13493 7.96156 3.16642 8.04369C3.19791 8.12581 3.24637 8.20037 3.30865 8.26248L11.7383 16.6914C11.8015 16.7541 11.8773 16.8025 11.9606 16.8336C12.044 16.8646 12.133 16.8775 12.2218 16.8713C12.3105 16.8652 12.3969 16.8402 12.4752 16.798C12.5535 16.7558 12.6219 16.6973 12.6758 16.6265C13.3313 15.7547 14.361 13.9633 13.4657 12.1734L17.9422 7.68279Z",
1353
- fill: "none",
1354
- stroke: "currentColor",
1355
- strokeLinecap: "round",
1356
- strokeLinejoin: "round",
1357
- strokeWidth: "1.5"
1358
- }
1359
- )
1360
- );
1361
- const IconPlayFill = createIcon(
1362
- "IconPlayFill",
1363
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.75 10C18.7505 10.2122 18.6961 10.4209 18.5921 10.6059C18.488 10.7908 18.3379 10.9457 18.1562 11.0555L6.9 17.9414C6.71022 18.0576 6.49287 18.1211 6.27037 18.1252C6.04788 18.1293 5.82832 18.0739 5.63438 17.9648C5.44227 17.8574 5.28225 17.7008 5.17075 17.511C5.05926 17.3213 5.00032 17.1052 5 16.8852V3.11484C5.00032 2.89475 5.05926 2.67872 5.17075 2.48896C5.28225 2.2992 5.44227 2.14257 5.63438 2.03516C5.82832 1.92605 6.04788 1.87071 6.27037 1.87483C6.49287 1.87895 6.71022 1.94239 6.9 2.05859L18.1562 8.94453C18.3379 9.05428 18.488 9.20916 18.5921 9.39411C18.6961 9.57906 18.7505 9.78779 18.75 10Z" })
1364
- );
1365
- const IconPlus = createIcon(
1366
- "IconPlus",
1367
- /* @__PURE__ */ jsxRuntime.jsx(
1368
- "path",
1369
- {
1370
- d: "M3.125 10H16.875M10 3.125V16.875",
1371
- fill: "none",
1372
- stroke: "currentColor",
1373
- strokeLinecap: "round",
1374
- strokeLinejoin: "round",
1375
- strokeWidth: "2"
1376
- }
1377
- )
1378
- );
1379
- const IconPlusSmall = createIcon(
1380
- "IconPlusSmall",
1381
- /* @__PURE__ */ jsxRuntime.jsx(
1382
- "path",
1383
- {
1384
- d: "M3.125 10H16.875M10 3.125V16.875",
1385
- fill: "none",
1386
- stroke: "currentColor",
1387
- strokeLinecap: "round",
1388
- strokeLinejoin: "round",
1389
- strokeWidth: "1.5"
1390
- }
1391
- )
1392
- );
1393
- const IconCommand = createIcon(
1394
- "IconCommand",
1395
- /* @__PURE__ */ jsxRuntime.jsx(
1396
- "path",
1397
- {
1398
- d: "M6.25 7.5L9.375 10L6.25 12.5M10.625 12.5H13.75M3.125 3.75H16.875C17.2202 3.75 17.5 4.02982 17.5 4.375V15.625C17.5 15.9702 17.2202 16.25 16.875 16.25H3.125C2.77982 16.25 2.5 15.9702 2.5 15.625V4.375C2.5 4.02982 2.77982 3.75 3.125 3.75Z",
1399
- fill: "none",
1400
- stroke: "currentColor",
1401
- strokeLinecap: "round",
1402
- strokeLinejoin: "round",
1403
- strokeWidth: "1.5"
1404
- }
1405
- )
1406
- );
1407
- const IconCopy = createIcon(
1408
- "IconCopy",
1409
- /* @__PURE__ */ jsxRuntime.jsx(
1410
- "path",
1411
- {
1412
- d: "M13.125 13.125H16.875V3.125H6.875V6.875M3.125 6.875H13.125V16.875H3.125V6.875Z",
1413
- fill: "none",
1414
- stroke: "currentColor",
1415
- strokeLinecap: "round",
1416
- strokeLinejoin: "round",
1417
- strokeWidth: "1.5"
1418
- }
1419
- )
1420
- );
1421
- const IconBolt = createIcon(
1422
- "IconBolt",
1423
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.7071 9.80157L7.95711 19.1766C7.86438 19.2755 7.74198 19.3416 7.60839 19.3649C7.47479 19.3882 7.33724 19.3674 7.2165 19.3057C7.09576 19.244 6.99837 19.1446 6.93904 19.0227C6.8797 18.9007 6.86164 18.7628 6.88757 18.6297L8.03289 12.9008L3.53054 11.2102C3.43385 11.174 3.34762 11.1144 3.27956 11.0368C3.2115 10.9592 3.16373 10.8659 3.14052 10.7653C3.1173 10.6647 3.11937 10.5599 3.14653 10.4603C3.17369 10.3607 3.2251 10.2694 3.29617 10.1945L12.0462 0.819538C12.1389 0.720581 12.2613 0.654468 12.3949 0.631176C12.5285 0.607884 12.666 0.628675 12.7868 0.690414C12.9075 0.752152 13.0049 0.851488 13.0642 0.97343C13.1236 1.09537 13.1416 1.2333 13.1157 1.36641L11.9673 7.10157L16.4696 8.78985C16.5656 8.82626 16.6511 8.88576 16.7187 8.96307C16.7862 9.04039 16.8336 9.13315 16.8568 9.23316C16.88 9.33317 16.8781 9.43734 16.8515 9.53648C16.8248 9.63562 16.7742 9.72666 16.704 9.80157H16.7071Z" })
1424
- );
1425
- const IconTranslate = createIcon(
1426
- "IconTranslate",
1427
- /* @__PURE__ */ jsxRuntime.jsx(
1428
- "path",
1429
- {
1430
- d: "M18.75 16.875L14.375 8.125L10 16.875M11.25 14.375H17.5M7.5 2.5V4.375M2.5 4.375H12.5M10 4.375C10 6.36412 9.20982 8.27178 7.8033 9.6783C6.39678 11.0848 4.48912 11.875 2.5 11.875M5.42734 6.875C5.94442 8.33751 6.90226 9.60371 8.16893 10.4992C9.4356 11.3947 10.9488 11.8753 12.5 11.875",
1431
- fill: "none",
1432
- stroke: "currentColor",
1433
- strokeLinecap: "round",
1434
- strokeLinejoin: "round",
1435
- strokeWidth: "1.5"
1436
- }
1437
- )
1438
- );
1439
- const IconDelete = createIcon(
1440
- "IconDelete",
1441
- /* @__PURE__ */ jsxRuntime.jsx(
1442
- "path",
1443
- {
1444
- d: "M16.875 4.375H3.125M8.125 8.125V13.125M11.875 8.125V13.125M15.625 4.375V16.25C15.625 16.4158 15.5592 16.5747 15.4419 16.6919C15.3247 16.8092 15.1658 16.875 15 16.875H5C4.83424 16.875 4.67527 16.8092 4.55806 16.6919C4.44085 16.5747 4.375 16.4158 4.375 16.25V4.375M13.125 4.375V3.125C13.125 2.79348 12.9933 2.47554 12.7589 2.24112C12.5245 2.0067 12.2065 1.875 11.875 1.875H8.125C7.79348 1.875 7.47554 2.0067 7.24112 2.24112C7.0067 2.47554 6.875 2.79348 6.875 3.125V4.375",
1445
- fill: "none",
1446
- stroke: "currentColor",
1447
- strokeLinecap: "round",
1448
- strokeLinejoin: "round",
1449
- strokeWidth: "1.5"
1450
- }
1451
- )
1452
- );
1453
- const IconTrophy = createIcon(
1454
- "IconTrophy",
1455
- /* @__PURE__ */ jsxRuntime.jsx(
1456
- "path",
1457
- {
1458
- d: "M7.5 17.5H12.5M10 14.375V17.5M4.53125 10H3.75C3.08696 10 2.45107 9.73661 1.98223 9.26777C1.51339 8.79893 1.25 8.16304 1.25 7.5V6.25C1.25 6.08424 1.31585 5.92527 1.43306 5.80806C1.55027 5.69085 1.70924 5.625 1.875 5.625H4.375M15.4688 10H16.25C16.913 10 17.5489 9.73661 18.0178 9.26777C18.4866 8.79893 18.75 8.16304 18.75 7.5V6.25C18.75 6.08424 18.6842 5.92527 18.5669 5.80806C18.4497 5.69085 18.2908 5.625 18.125 5.625H15.625M4.375 3.75H15.625V8.67969C15.625 11.7812 13.1445 14.3516 10.043 14.375C9.30068 14.3807 8.5646 14.2394 7.87718 13.9592C7.18975 13.6791 6.56458 13.2656 6.03769 12.7427C5.5108 12.2198 5.09262 11.5978 4.80725 10.9126C4.52188 10.2273 4.37498 9.49231 4.375 8.75V3.75Z",
1459
- fill: "none",
1460
- stroke: "currentColor",
1461
- strokeLinecap: "round",
1462
- strokeLinejoin: "round",
1463
- strokeWidth: "1.5"
1464
- }
1465
- )
1466
- );
1467
- const IconUnpin = createIcon(
1468
- "IconUnpin",
1469
- /* @__PURE__ */ jsxRuntime.jsx(
1470
- "path",
1471
- {
1472
- d: "M7.52271 12.4773L3.75006 16.25M3.75006 3.12498L16.2501 16.875M14.4532 11.1828L17.9415 7.68279C18.0586 7.56559 18.1244 7.40668 18.1244 7.24099C18.1244 7.0753 18.0586 6.9164 17.9415 6.7992L13.2032 2.05779C13.086 1.94067 12.9271 1.87488 12.7614 1.87488C12.5957 1.87488 12.4368 1.94067 12.3196 2.05779L9.09615 5.28904M6.58756 6.24998C5.74537 6.18435 4.57271 6.3531 3.35943 7.33201C3.29077 7.38697 3.23447 7.45581 3.19424 7.53402C3.154 7.61224 3.13072 7.69806 3.12593 7.78589C3.12114 7.87371 3.13493 7.96156 3.16642 8.04369C3.19791 8.12581 3.24637 8.20037 3.30865 8.26248L11.7383 16.6914C11.8015 16.7541 11.8773 16.8025 11.9606 16.8336C12.044 16.8646 12.133 16.8775 12.2218 16.8713C12.3105 16.8652 12.3969 16.8402 12.4752 16.798C12.5535 16.7558 12.6219 16.6973 12.6758 16.6265C13.0829 16.0851 13.6344 15.1898 13.779 14.1594",
1473
- fill: "none",
1474
- stroke: "currentColor",
1475
- strokeLinecap: "round",
1476
- strokeLinejoin: "round",
1477
- strokeWidth: "1.5"
1478
- }
1479
- )
1480
- );
1481
- const IconVideo = createIcon(
1482
- "IconVideo",
1483
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1484
- /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_14111_491476)", children: /* @__PURE__ */ jsxRuntime.jsx(
1485
- "path",
1486
- {
1487
- d: "M15.625 8.75L19.375 6.25V13.75L15.625 11.25M2.5 5H15C15.3452 5 15.625 5.27982 15.625 5.625V14.375C15.625 14.7202 15.3452 15 15 15H2.5C2.15482 15 1.875 14.7202 1.875 14.375V5.625C1.875 5.27982 2.15482 5 2.5 5Z",
1488
- fill: "none",
1489
- stroke: "currentColor",
1490
- strokeLinecap: "round",
1491
- strokeLinejoin: "round",
1492
- strokeWidth: "1.5"
1493
- }
1494
- ) }),
1495
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_14111_491476", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "20", width: "20" }) }) })
1496
- ] }),
1497
- { "data-rtl-mirror": "" }
1498
- );
1499
- const IconVideoFill = createIcon(
1500
- "IconVideoFill",
1501
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1502
- /* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_14064_467281)", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5.625V14.375C15 14.7065 14.8683 15.0245 14.6339 15.2589C14.3995 15.4933 14.0815 15.625 13.75 15.625H2.5C2.16848 15.625 1.85054 15.4933 1.61612 15.2589C1.3817 15.0245 1.25 14.7065 1.25 14.375V5.625C1.25 5.29348 1.3817 4.97554 1.61612 4.74112C1.85054 4.5067 2.16848 4.375 2.5 4.375H13.75C14.0815 4.375 14.3995 4.5067 14.6339 4.74112C14.8683 4.97554 15 5.29348 15 5.625ZM19.5312 5.64453C19.4431 5.62295 19.3513 5.62029 19.2621 5.63672C19.1728 5.65315 19.088 5.68829 19.0133 5.73984L16.3891 7.48906C16.3463 7.51762 16.3112 7.55631 16.2869 7.6017C16.2626 7.64708 16.25 7.69776 16.25 7.74922V12.2508C16.25 12.3022 16.2626 12.3529 16.2869 12.3983C16.3112 12.4437 16.3463 12.4824 16.3891 12.5109L19.0281 14.2703C19.1269 14.3362 19.2424 14.3726 19.3611 14.3752C19.4798 14.3779 19.5968 14.3466 19.6984 14.2852C19.7924 14.2254 19.8695 14.1425 19.9223 14.0444C19.9751 13.9464 20.0019 13.8364 20 13.725V6.25C20.0001 6.11139 19.9541 5.97668 19.8692 5.86708C19.7843 5.75747 19.6655 5.67918 19.5312 5.64453Z" }) }),
1503
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_14064_467281", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "20", width: "20" }) }) })
1504
- ] }),
1505
- { "data-rtl-mirror": "" }
1506
- );
1507
- const IconAudio = createIcon(
1508
- "IconAudio",
1509
- /* @__PURE__ */ jsxRuntime.jsx(
1510
- "path",
1511
- {
1512
- d: "M15.625 8.125V11.875M18.125 6.875V13.125M6.875 13.125H3.125C2.95924 13.125 2.80027 13.0592 2.68306 12.9419C2.56585 12.8247 2.5 12.6658 2.5 12.5V7.5C2.5 7.33424 2.56585 7.17527 2.68306 7.05806C2.80027 6.94085 2.95924 6.875 3.125 6.875H6.875L12.5 2.5V17.5L6.875 13.125Z",
1513
- fill: "none",
1514
- stroke: "currentColor",
1515
- strokeLinecap: "round",
1516
- strokeLinejoin: "round",
1517
- strokeWidth: "1.5"
1518
- }
1519
- ),
1520
- { "data-rtl-mirror": "" }
1521
- );
1522
- const IconArchive = createIcon(
1523
- "IconArchive",
1524
- /* @__PURE__ */ jsxRuntime.jsx(
1525
- "path",
1526
- {
1527
- d: "M16.875 7.5V15C16.875 15.1658 16.8092 15.3247 16.6919 15.4419C16.5747 15.5592 16.4158 15.625 16.25 15.625H3.75C3.58424 15.625 3.42527 15.5592 3.30806 15.4419C3.19085 15.3247 3.125 15.1658 3.125 15V7.5M8.125 10.625H11.875M2.5 4.375H17.5C17.8452 4.375 18.125 4.65482 18.125 5V6.875C18.125 7.22018 17.8452 7.5 17.5 7.5H2.5C2.15482 7.5 1.875 7.22018 1.875 6.875V5C1.875 4.65482 2.15482 4.375 2.5 4.375Z",
1528
- fill: "none",
1529
- stroke: "currentColor",
1530
- strokeLinecap: "round",
1531
- strokeLinejoin: "round",
1532
- strokeWidth: "1.5"
1533
- }
1534
- )
1535
- );
1536
- const IconLoading = createIcon(
1537
- "IconLoading",
1538
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1539
- /* @__PURE__ */ jsxRuntime.jsx(
1540
- "path",
1541
- {
1542
- d: "M17.5 10C17.5 14.1422 14.1422 17.5 10 17.5C5.85787 17.5 2.5 14.1422 2.5 10C2.5 5.85787 5.85787 2.5 10 2.5C14.1422 2.5 17.5 5.85787 17.5 10Z",
1543
- fill: "none",
1544
- stroke: "currentColor",
1545
- strokeOpacity: "0.3",
1546
- strokeWidth: "2"
1547
- }
1548
- ),
1549
- /* @__PURE__ */ jsxRuntime.jsx(
1550
- "path",
1551
- {
1552
- d: "M17.4544 10.8334C17.0701 14.3097 14.3098 17.07 10.8335 17.4543",
1553
- fill: "none",
1554
- stroke: "currentColor",
1555
- strokeLinecap: "round",
1556
- strokeWidth: "2"
1557
- }
1558
- )
1559
- ] })
1560
- );
1561
- const IconGiphy = createIcon(
1562
- "IconGiphy",
1563
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1564
- /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "black", height: "20", rx: "10", width: "20" }),
1565
- /* @__PURE__ */ jsxRuntime.jsx(
1566
- "path",
1567
- {
1568
- clipRule: "evenodd",
1569
- d: "M6.5997 5.50024H13.4008V14.4999H6.59912L6.5997 5.50024Z",
1570
- fill: "black",
1571
- fillRule: "evenodd"
1572
- }
1573
- ),
1574
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.24023 5.1665H6.59998V14.8335H5.24023V5.1665Z", fill: "#04FF8E" }),
1575
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.4004 7.8335H14.7601V14.8335H13.4004V7.8335Z", fill: "#8E2EFF" }),
1576
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.24023 14.4998H14.7602V15.8333H5.24023V14.4998Z", fill: "#00C5FF" }),
1577
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.24023 4.16675H10.6804V5.50025H5.24023V4.16675Z", fill: "#FFF152" }),
1578
- /* @__PURE__ */ jsxRuntime.jsx(
1579
- "path",
1580
- {
1581
- d: "M13.4003 6.83316V5.50025H12.0399V4.16675H10.6802V8.16666H14.76V6.83316",
1582
- fill: "#FF5B5B"
1583
- }
1584
- ),
1585
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.4004 9.5V8.1665H14.7601", fill: "#551C99" }),
1586
- /* @__PURE__ */ jsxRuntime.jsx(
1587
- "path",
1588
- {
1589
- clipRule: "evenodd",
1590
- d: "M10.6802 4.16675V5.50025H9.31982",
1591
- fill: "#999131",
1592
- fillRule: "evenodd"
1593
- }
1594
- )
1595
- ] })
1596
- );
1597
- const UnMemoizedEmptyStateIndicator = (props) => {
1598
- const { listType, messageText } = props;
1599
- const { t } = useTranslationContext("EmptyStateIndicator");
1600
- if (listType === "thread") return null;
1601
- if (listType === "channel") {
1602
- const text = t("No conversations yet");
1603
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__channel-list-empty", children: [
1604
- /* @__PURE__ */ jsxRuntime.jsx(IconMessageBubbles, {}),
1605
- /* @__PURE__ */ jsxRuntime.jsx("p", { role: "listitem", children: text })
1606
- ] });
1607
- }
1608
- if (listType === "message") {
1609
- const text = t(messageText || "Send a message to start the conversation");
1610
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__empty-channel", children: [
1611
- /* @__PURE__ */ jsxRuntime.jsx(IconMessageBubble, {}),
1612
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "str-chat__empty-channel-text", role: "listitem", children: text })
1613
- ] });
1614
- }
1615
- return /* @__PURE__ */ jsxRuntime.jsx("p", { children: t("No items exist") });
1616
- };
1617
- const EmptyStateIndicator = React.memo(
1618
- UnMemoizedEmptyStateIndicator
1619
- );
1620
- const makeChannelReducer = () => (state, action) => {
1621
- switch (action.type) {
1622
- case "closeThread": {
1623
- return {
1624
- ...state,
1625
- thread: null,
1626
- threadLoadingMore: false,
1627
- threadMessages: []
1628
- };
1629
- }
1630
- case "copyMessagesFromChannel": {
1631
- const { channel, parentId } = action;
1632
- return {
1633
- ...state,
1634
- messages: [...channel.state.messages],
1635
- pinnedMessages: [...channel.state.pinnedMessages],
1636
- // copying messages from channel happens with new message - this resets the suppressAutoscroll
1637
- suppressAutoscroll: false,
1638
- threadMessages: parentId ? { ...channel.state.threads }[parentId] || [] : state.threadMessages
1639
- };
1640
- }
1641
- case "copyStateFromChannelOnEvent": {
1642
- const { channel } = action;
1643
- return {
1644
- ...state,
1645
- members: { ...channel.state.members },
1646
- messages: [...channel.state.messages],
1647
- pinnedMessages: [...channel.state.pinnedMessages],
1648
- read: { ...channel.state.read },
1649
- watcherCount: channel.state.watcher_count,
1650
- watchers: { ...channel.state.watchers }
1651
- };
1652
- }
1653
- case "initStateFromChannel": {
1654
- const { channel, hasMore } = action;
1655
- return {
1656
- ...state,
1657
- hasMore,
1658
- loading: false,
1659
- members: { ...channel.state.members },
1660
- messages: [...channel.state.messages],
1661
- pinnedMessages: [...channel.state.pinnedMessages],
1662
- read: { ...channel.state.read },
1663
- watcherCount: channel.state.watcher_count,
1664
- watchers: { ...channel.state.watchers }
1665
- };
1666
- }
1667
- case "jumpToLatestMessageFinished": {
1668
- const { hasMore, hasMoreNewer, messages } = action;
1669
- return {
1670
- ...state,
1671
- hasMore,
1672
- hasMoreNewer,
1673
- highlightedMessageId: void 0,
1674
- loading: false,
1675
- messages,
1676
- suppressAutoscroll: false
1677
- };
1678
- }
1679
- case "jumpToMessageFinished": {
1680
- return {
1681
- ...state,
1682
- hasMore: action.channel.state.messagePagination.hasPrev,
1683
- hasMoreNewer: action.channel.state.messagePagination.hasNext,
1684
- highlightedMessageId: action.highlightedMessageId,
1685
- loadingMore: false,
1686
- loadingMoreForJumpToChannelMessage: false,
1687
- messages: action.channel.state.messages,
1688
- suppressAutoscroll: false
1689
- };
1690
- }
1691
- case "clearHighlightedMessage": {
1692
- return {
1693
- ...state,
1694
- highlightedMessageId: void 0
1695
- };
1696
- }
1697
- case "loadMoreFinished": {
1698
- const { hasMore, messages } = action;
1699
- return {
1700
- ...state,
1701
- hasMore,
1702
- loadingMore: false,
1703
- messages,
1704
- suppressAutoscroll: false
1705
- };
1706
- }
1707
- case "loadMoreNewerFinished": {
1708
- const { hasMoreNewer, messages } = action;
1709
- return {
1710
- ...state,
1711
- hasMoreNewer,
1712
- loadingMoreNewer: false,
1713
- messages
1714
- };
1715
- }
1716
- case "loadMoreThreadFinished": {
1717
- const { threadHasMore, threadMessages } = action;
1718
- return {
1719
- ...state,
1720
- threadHasMore,
1721
- threadLoadingMore: false,
1722
- threadMessages
1723
- };
1724
- }
1725
- case "openThread": {
1726
- const { channel, message } = action;
1727
- return {
1728
- ...state,
1729
- thread: message,
1730
- threadHasMore: true,
1731
- threadMessages: message.id ? { ...channel.state.threads }[message.id] || [] : [],
1732
- threadSuppressAutoscroll: false
1733
- };
1734
- }
1735
- case "setError": {
1736
- const { error } = action;
1737
- return { ...state, error };
1738
- }
1739
- case "setLoadingMore": {
1740
- const { loadingMore } = action;
1741
- return { ...state, loadingMore, suppressAutoscroll: loadingMore };
1742
- }
1743
- case "setLoadingMoreForJumpToChannelMessage": {
1744
- const { loadingMoreForJumpToChannelMessage } = action;
1745
- return {
1746
- ...state,
1747
- loadingMoreForJumpToChannelMessage,
1748
- suppressAutoscroll: loadingMoreForJumpToChannelMessage
1749
- };
1750
- }
1751
- case "setLoadingMoreNewer": {
1752
- const { loadingMoreNewer } = action;
1753
- return { ...state, loadingMoreNewer };
1754
- }
1755
- case "setThread": {
1756
- const { message } = action;
1757
- return { ...state, thread: message };
1758
- }
1759
- case "setTyping": {
1760
- const { channel } = action;
1761
- return {
1762
- ...state,
1763
- typing: { ...channel.state.typing }
1764
- };
1765
- }
1766
- case "startLoadingThread": {
1767
- return {
1768
- ...state,
1769
- threadLoadingMore: true,
1770
- threadSuppressAutoscroll: true
1771
- };
1772
- }
1773
- case "updateThreadOnEvent": {
1774
- const { channel, message } = action;
1775
- if (!state.thread) return state;
1776
- return {
1777
- ...state,
1778
- thread: message?.id === state.thread.id ? channel.state.formatMessage(message) : state.thread,
1779
- threadMessages: state.thread?.id ? { ...channel.state.threads }[state.thread.id] || [] : []
1780
- };
1781
- }
1782
- default:
1783
- return state;
1784
- }
1785
- };
1786
- const initialState = {
1787
- error: null,
1788
- hasMore: true,
1789
- hasMoreNewer: false,
1790
- loading: true,
1791
- loadingMore: false,
1792
- loadingMoreForJumpToChannelMessage: false,
1793
- members: {},
1794
- messages: [],
1795
- pinnedMessages: [],
1796
- read: {},
1797
- suppressAutoscroll: false,
1798
- thread: null,
1799
- threadHasMore: true,
1800
- threadLoadingMore: false,
1801
- threadMessages: [],
1802
- threadSuppressAutoscroll: false,
1803
- typing: {},
1804
- watcherCount: 0,
1805
- watchers: {}
1806
- };
1807
- const useCreateChannelStateContext = (value) => {
1808
- const {
1809
- channel,
1810
- channelCapabilitiesArray = [],
1811
- channelConfig,
1812
- channelUnreadUiState,
1813
- error,
1814
- giphyVersion,
1815
- hasMore,
1816
- hasMoreNewer,
1817
- highlightedMessageId,
1818
- imageAttachmentSizeHandler,
1819
- loading,
1820
- loadingMore,
1821
- loadingMoreForJumpToChannelMessage,
1822
- members,
1823
- messages = [],
1824
- mutes,
1825
- notifications,
1826
- pinnedMessages,
1827
- read = {},
1828
- shouldGenerateVideoThumbnail,
1829
- skipMessageDataMemoization,
1830
- suppressAutoscroll,
1831
- thread,
1832
- threadHasMore,
1833
- threadLoadingMore,
1834
- threadMessages = [],
1835
- videoAttachmentSizeHandler,
1836
- watcher_count,
1837
- watcherCount,
1838
- watchers
1839
- } = value;
1840
- const channelId = channel.cid;
1841
- const lastRead = channel.initialized && channel.lastRead()?.getTime();
1842
- const membersLength = Object.keys(members || []).length;
1843
- const notificationsLength = notifications.length;
1844
- const readUsers = Object.values(read);
1845
- const readUsersLength = readUsers.length;
1846
- const readUsersLastReadDateStrings = [];
1847
- for (const { last_read } of readUsers) {
1848
- if (!lastRead) continue;
1849
- readUsersLastReadDateStrings.push(last_read?.toISOString());
1850
- }
1851
- const readUsersLastReads = readUsersLastReadDateStrings.join();
1852
- const threadMessagesLength = threadMessages?.length;
1853
- const channelCapabilities = {};
1854
- channelCapabilitiesArray.forEach((capability) => {
1855
- channelCapabilities[capability] = true;
1856
- });
1857
- const memoizedMessageData = skipMessageDataMemoization ? messages : messages.map(
1858
- ({
1859
- deleted_at,
1860
- latest_reactions,
1861
- pinned,
1862
- reply_count,
1863
- status,
1864
- type,
1865
- updated_at,
1866
- user
1867
- }) => `${type}${deleted_at}${latest_reactions ? latest_reactions.map(({ type: type2 }) => type2).join() : ""}${pinned}${reply_count}${status}${updated_at && (isDayOrMoment(updated_at) || isDate(updated_at)) ? updated_at.toISOString() : updated_at || ""}${user?.updated_at}`
1868
- ).join();
1869
- const memoizedThreadMessageData = threadMessages.map(
1870
- ({ deleted_at, latest_reactions, pinned, status, updated_at, user }) => `${deleted_at}${latest_reactions ? latest_reactions.map(({ type }) => type).join() : ""}${pinned}${status}${updated_at && (isDayOrMoment(updated_at) || isDate(updated_at)) ? updated_at.toISOString() : updated_at || ""}${user?.updated_at}`
1871
- ).join();
1872
- const channelStateContext = React.useMemo(
1873
- () => ({
1874
- channel,
1875
- channelCapabilities,
1876
- channelConfig,
1877
- channelUnreadUiState,
1878
- error,
1879
- giphyVersion,
1880
- hasMore,
1881
- hasMoreNewer,
1882
- highlightedMessageId,
1883
- imageAttachmentSizeHandler,
1884
- loading,
1885
- loadingMore,
1886
- loadingMoreForJumpToChannelMessage,
1887
- members,
1888
- messages,
1889
- mutes,
1890
- notifications,
1891
- pinnedMessages,
1892
- read,
1893
- shouldGenerateVideoThumbnail,
1894
- suppressAutoscroll,
1895
- thread,
1896
- threadHasMore,
1897
- threadLoadingMore,
1898
- threadMessages,
1899
- videoAttachmentSizeHandler,
1900
- watcher_count,
1901
- watcherCount,
1902
- watchers
1903
- }),
1904
- // eslint-disable-next-line react-hooks/exhaustive-deps
1905
- [
1906
- channel.data?.name,
1907
- // otherwise ChannelHeader will not be updated
1908
- channelId,
1909
- channelUnreadUiState,
1910
- error,
1911
- hasMore,
1912
- hasMoreNewer,
1913
- highlightedMessageId,
1914
- lastRead,
1915
- loading,
1916
- loadingMore,
1917
- loadingMoreForJumpToChannelMessage,
1918
- membersLength,
1919
- memoizedMessageData,
1920
- memoizedThreadMessageData,
1921
- notificationsLength,
1922
- readUsersLength,
1923
- readUsersLastReads,
1924
- shouldGenerateVideoThumbnail,
1925
- skipMessageDataMemoization,
1926
- suppressAutoscroll,
1927
- thread,
1928
- threadHasMore,
1929
- threadLoadingMore,
1930
- threadMessagesLength,
1931
- watcherCount
1932
- ]
1933
- );
1934
- return channelStateContext;
1935
- };
1936
- const useCreateTypingContext = (value) => {
1937
- const { typing } = value;
1938
- const typingValue = Object.keys(typing || {}).join();
1939
- const typingContext = React.useMemo(
1940
- () => ({
1941
- typing
1942
- }),
1943
- // eslint-disable-next-line react-hooks/exhaustive-deps
1944
- [typingValue]
1945
- );
1946
- return typingContext;
1947
- };
1948
- const useEditMessageHandler = (doUpdateMessageRequest) => {
1949
- const { channel, client } = useChatContext("useEditMessageHandler");
1950
- return (updatedMessage, options) => {
1951
- if (doUpdateMessageRequest && channel) {
1952
- return Promise.resolve(
1953
- doUpdateMessageRequest(channel.cid, updatedMessage, options)
1954
- );
1955
- }
1956
- return client.updateMessage(updatedMessage, void 0, options);
1957
- };
1958
- };
1959
- const useIsMounted = () => {
1960
- const isMounted = React.useRef(false);
1961
- React.useEffect(() => {
1962
- isMounted.current = true;
1963
- return () => {
1964
- isMounted.current = false;
1965
- };
1966
- }, []);
1967
- return isMounted;
1968
- };
1969
- const useMentionsHandlers = (onMentionsHover, onMentionsClick) => React.useCallback(
1970
- (event, mentioned_users) => {
1971
- if (!onMentionsHover && !onMentionsClick || !(event.target instanceof HTMLElement)) {
1972
- return;
1973
- }
1974
- const target = event.target;
1975
- const textContent = target.innerHTML.replace("*", "");
1976
- if (textContent[0] === "@") {
1977
- const userName = textContent.replace("@", "");
1978
- const user = mentioned_users?.find(
1979
- ({ id, name }) => name === userName || id === userName
1980
- );
1981
- if (onMentionsHover && typeof onMentionsHover === "function" && event.type === "mouseover") {
1982
- onMentionsHover(event, user);
1983
- }
1984
- if (onMentionsClick && event.type === "click" && typeof onMentionsClick === "function") {
1985
- onMentionsClick(event, user);
1986
- }
1987
- }
1988
- },
1989
- [onMentionsClick, onMentionsHover]
1990
- );
1991
- const LoadingMessage = ({
1992
- bubbleSize,
1993
- metadataSize,
1994
- outgoing = false
1995
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
1996
- "div",
1997
- {
1998
- className: `str-chat__loading-channel-message ${outgoing ? "str-chat__loading-channel-message--outgoing" : "str-chat__loading-channel-message--incoming"}`,
1999
- children: [
2000
- !outgoing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__loading-channel-message-avatar" }) : null,
2001
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__loading-channel-message-content", children: [
2002
- /* @__PURE__ */ jsxRuntime.jsx(
2003
- "div",
2004
- {
2005
- className: `str-chat__loading-channel-message-bubble str-chat__loading-channel-message-bubble--${bubbleSize}`
2006
- }
2007
- ),
2008
- /* @__PURE__ */ jsxRuntime.jsx(
2009
- "div",
2010
- {
2011
- className: `str-chat__loading-channel-message-metadata str-chat__loading-channel-message-metadata--${metadataSize}`
2012
- }
2013
- )
2014
- ] })
2015
- ]
2016
- }
2017
- );
2018
- const LoadingMessageInput = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__message-composer-container str-chat__message-composer-container--loading", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__message-composer", children: [
2019
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__loading-channel-message-input-button" }),
2020
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__loading-channel-message-input-pill" })
2021
- ] }) });
2022
- const LoadingChannelHeader = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__channel-header str-chat__channel-header--loading", children: [
2023
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__channel-header__data str-chat__channel-header__data--loading", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__loading-channel-header-name" }) }),
2024
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__loading-channel-header-avatar" })
2025
- ] });
2026
- const LoadingChannel = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__loading-channel", children: [
2027
- /* @__PURE__ */ jsxRuntime.jsx(LoadingChannelHeader, {}),
2028
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__message-list str-chat__message-list--loading", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__message-list-scroll", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__loading-channel-message-list", children: [
2029
- /* @__PURE__ */ jsxRuntime.jsx(LoadingMessage, { bubbleSize: "lg", metadataSize: "md" }),
2030
- /* @__PURE__ */ jsxRuntime.jsx(LoadingMessage, { bubbleSize: "md", metadataSize: "sm", outgoing: true }),
2031
- /* @__PURE__ */ jsxRuntime.jsx(LoadingMessage, { bubbleSize: "lg", metadataSize: "md" })
2032
- ] }) }) }),
2033
- /* @__PURE__ */ jsxRuntime.jsx(LoadingMessageInput, {})
2034
- ] });
2035
- const UnMemoizedLoadingErrorIndicator = ({ error }) => {
2036
- const { t } = useTranslationContext("LoadingErrorIndicator");
2037
- if (!error) return null;
2038
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("Error: {{ errorMessage }}", { errorMessage: error.message }) });
2039
- };
2040
- const LoadingErrorIndicator = React.memo(
2041
- UnMemoizedLoadingErrorIndicator,
2042
- (prevProps, nextProps) => prevProps.error?.message === nextProps.error?.message
2043
- );
2044
- const CHANNEL_CONTAINER_ID = "str-chat__channel";
2045
- const DEFAULT_NEXT_CHANNEL_PAGE_SIZE = 25;
2046
- const DEFAULT_JUMP_TO_PAGE_SIZE = 25;
2047
- const DEFAULT_THREAD_PAGE_SIZE = 25;
2048
- const DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD = 250;
2049
- const DEFAULT_HIGHLIGHT_DURATION = 500;
2050
- const validateAndGetMessage = (func, args) => {
2051
- if (!func || typeof func !== "function") return null;
2052
- if (!Array.isArray(args)) {
2053
- args = [args];
2054
- }
2055
- const returnValue = func(...args);
2056
- if (typeof returnValue !== "string") return null;
2057
- return returnValue;
2058
- };
2059
- const isUserMuted = (message, mutes) => {
2060
- if (!mutes || !message) return false;
2061
- const userMuted = mutes.filter((el) => el.target.id === message.user?.id);
2062
- return !!userMuted.length;
2063
- };
2064
- const OPTIONAL_MESSAGE_ACTIONS = {
2065
- deleteForMe: "deleteForMe"
2066
- };
2067
- const MESSAGE_ACTIONS = {
2068
- delete: "delete",
2069
- download: "download",
2070
- edit: "edit",
2071
- flag: "flag",
2072
- markUnread: "markUnread",
2073
- mute: "mute",
2074
- pin: "pin",
2075
- quote: "quote",
2076
- react: "react",
2077
- remindMe: "remindMe",
2078
- reply: "reply",
2079
- saveForLater: "saveForLater"
2080
- };
2081
- const getMessageActions = (actions, {
2082
- canDelete,
2083
- canEdit,
2084
- canFlag,
2085
- canMarkUnread,
2086
- canMute,
2087
- canPin,
2088
- canQuote,
2089
- canReact,
2090
- canReply
2091
- }, channelConfig) => {
2092
- const messageActionsAfterPermission = [];
2093
- let messageActions = [];
2094
- if (actions && typeof actions === "boolean") {
2095
- messageActions = Object.keys(MESSAGE_ACTIONS);
2096
- } else if (actions && Array.isArray(actions) && actions.length > 0) {
2097
- messageActions = [...actions];
2098
- } else {
2099
- return [];
2100
- }
2101
- if (canDelete && messageActions.indexOf(MESSAGE_ACTIONS.delete) > -1) {
2102
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.delete);
2103
- }
2104
- if (messageActions.indexOf(MESSAGE_ACTIONS.download) > -1) {
2105
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.download);
2106
- }
2107
- if (canDelete && messageActions.indexOf(OPTIONAL_MESSAGE_ACTIONS.deleteForMe) > -1) {
2108
- messageActionsAfterPermission.push(OPTIONAL_MESSAGE_ACTIONS.deleteForMe);
2109
- }
2110
- if (canEdit && messageActions.indexOf(MESSAGE_ACTIONS.edit) > -1) {
2111
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.edit);
2112
- }
2113
- if (canFlag && messageActions.indexOf(MESSAGE_ACTIONS.flag) > -1) {
2114
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.flag);
2115
- }
2116
- if (canMarkUnread && messageActions.indexOf(MESSAGE_ACTIONS.markUnread) > -1) {
2117
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.markUnread);
2118
- }
2119
- if (canMute && messageActions.indexOf(MESSAGE_ACTIONS.mute) > -1) {
2120
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.mute);
2121
- }
2122
- if (canPin && messageActions.indexOf(MESSAGE_ACTIONS.pin) > -1) {
2123
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.pin);
2124
- }
2125
- if (canQuote && messageActions.indexOf(MESSAGE_ACTIONS.quote) > -1) {
2126
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.quote);
2127
- }
2128
- if (canReact && messageActions.indexOf(MESSAGE_ACTIONS.react) > -1) {
2129
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.react);
2130
- }
2131
- if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.remindMe) > -1) {
2132
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.remindMe);
2133
- }
2134
- if (canReply && messageActions.indexOf(MESSAGE_ACTIONS.reply) > -1) {
2135
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.reply);
2136
- }
2137
- if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.saveForLater) > -1) {
2138
- messageActionsAfterPermission.push(MESSAGE_ACTIONS.saveForLater);
2139
- }
2140
- return messageActionsAfterPermission;
2141
- };
2142
- const ACTIONS_NOT_WORKING_IN_THREAD = [
2143
- MESSAGE_ACTIONS.pin,
2144
- MESSAGE_ACTIONS.reply,
2145
- MESSAGE_ACTIONS.markUnread
2146
- ];
2147
- function areMessagesEqual(prevMessage, nextMessage) {
2148
- const areBaseMessagesEqual = (prevMessage2, nextMessage2) => prevMessage2.deleted_at === nextMessage2.deleted_at && prevMessage2.latest_reactions?.length === nextMessage2.latest_reactions?.length && prevMessage2.own_reactions?.length === nextMessage2.own_reactions?.length && prevMessage2.pinned === nextMessage2.pinned && prevMessage2.reply_count === nextMessage2.reply_count && prevMessage2.show_in_channel === nextMessage2.show_in_channel && prevMessage2.status === nextMessage2.status && prevMessage2.text === nextMessage2.text && prevMessage2.type === nextMessage2.type && prevMessage2.updated_at === nextMessage2.updated_at && prevMessage2.user?.updated_at === nextMessage2.user?.updated_at;
2149
- return areBaseMessagesEqual(prevMessage, nextMessage) && Boolean(prevMessage.quoted_message) === Boolean(nextMessage.quoted_message) && (!prevMessage.quoted_message && !nextMessage.quoted_message || areBaseMessagesEqual(
2150
- prevMessage.quoted_message,
2151
- nextMessage.quoted_message
2152
- ));
2153
- }
2154
- const areMessagePropsEqual = (prevProps, nextProps) => {
2155
- const { message: prevMessage, Message: prevMessageUI } = prevProps;
2156
- const { message: nextMessage, Message: nextMessageUI } = nextProps;
2157
- if (prevMessageUI !== nextMessageUI) return false;
2158
- if (nextProps.showDetailedReactions !== prevProps.showDetailedReactions) {
2159
- return false;
2160
- }
2161
- if (nextProps.closeReactionSelectorOnClick !== prevProps.closeReactionSelectorOnClick) {
2162
- return false;
2163
- }
2164
- const messagesAreEqual = areMessagesEqual(prevMessage, nextMessage);
2165
- if (!messagesAreEqual) return false;
2166
- const deepEqualProps = deepequal(nextProps.messageActions, prevProps.messageActions) && deepequal(nextProps.readBy, prevProps.readBy) && deepequal(nextProps.deliveredTo, prevProps.deliveredTo) && deepequal(nextProps.highlighted, prevProps.highlighted) && deepequal(nextProps.groupStyles, prevProps.groupStyles) && // last 3 messages can have different group styles
2167
- deepequal(nextProps.mutes, prevProps.mutes) && deepequal(nextProps.lastReceivedId, prevProps.lastReceivedId);
2168
- if (!deepEqualProps) return false;
2169
- return prevProps.messageListRect === nextProps.messageListRect;
2170
- };
2171
- const areMessageUIPropsEqual = (prevProps, nextProps) => {
2172
- const { lastReceivedId: prevLastReceivedId, message: prevMessage } = prevProps;
2173
- const { lastReceivedId: nextLastReceivedId, message: nextMessage } = nextProps;
2174
- if (prevProps.highlighted !== nextProps.highlighted) return false;
2175
- if (prevProps.threadList !== nextProps.threadList) return false;
2176
- if (prevProps.endOfGroup !== nextProps.endOfGroup) return false;
2177
- if (prevProps.mutes?.length !== nextProps.mutes?.length) return false;
2178
- if (prevProps.readBy?.length !== nextProps.readBy?.length) return false;
2179
- if (prevProps.deliveredTo?.length !== nextProps.deliveredTo?.length) return false;
2180
- if (prevProps.groupStyles !== nextProps.groupStyles) return false;
2181
- if (prevProps.showDetailedReactions !== nextProps.showDetailedReactions) {
2182
- return false;
2183
- }
2184
- if ((prevMessage.id === prevLastReceivedId || prevMessage.id === nextLastReceivedId) && prevLastReceivedId !== nextLastReceivedId) {
2185
- return false;
2186
- }
2187
- return areMessagesEqual(prevMessage, nextMessage);
2188
- };
2189
- const messageHasReactions = (message) => Object.values(message?.reaction_groups ?? {}).some(({ count }) => count > 0);
2190
- const messageHasQuotedMessage = (message) => !!message?.quoted_message;
2191
- const messageHasAttachments = (message) => !!message?.attachments && !!message.attachments.length;
2192
- const messageHasSingleAttachment = (message) => message?.attachments?.length === 1;
2193
- const messageHasGiphyAttachment = (message) => !!message?.attachments?.some((att) => att.type === "giphy");
2194
- const getImages = (message) => {
2195
- if (!message?.attachments) {
2196
- return [];
2197
- }
2198
- return message.attachments.filter((item) => item.type === "image");
2199
- };
2200
- const getNonImageAttachments = (message) => {
2201
- if (!message?.attachments) {
2202
- return [];
2203
- }
2204
- return message.attachments.filter((item) => item.type !== "image");
2205
- };
2206
- const mapToUserNameOrId = (user) => user.name || user.id;
2207
- const getReadByTooltipText = (users, t, client, tooltipUserNameMapper) => {
2208
- let outStr = "";
2209
- if (!t) {
2210
- throw new Error(
2211
- "getReadByTooltipText was called, but translation function is not available"
2212
- );
2213
- }
2214
- if (!tooltipUserNameMapper) {
2215
- throw new Error(
2216
- "getReadByTooltipText was called, but tooltipUserNameMapper function is not available"
2217
- );
2218
- }
2219
- const otherUsers = users.filter((item) => item && client?.user && item.id !== client.user.id).map(tooltipUserNameMapper);
2220
- const slicedArr = otherUsers.slice(0, 5);
2221
- const restLength = otherUsers.length - slicedArr.length;
2222
- if (slicedArr.length === 1) {
2223
- outStr = `${slicedArr[0]} `;
2224
- } else if (slicedArr.length === 2) {
2225
- outStr = t("{{ firstUser }} and {{ secondUser }}", {
2226
- firstUser: slicedArr[0],
2227
- secondUser: slicedArr[1]
2228
- });
2229
- } else if (slicedArr.length > 2) {
2230
- if (restLength === 0) {
2231
- const lastUser = slicedArr.splice(slicedArr.length - 1, 1);
2232
- outStr = t("{{ commaSeparatedUsers }}, and {{ lastUser }}", {
2233
- commaSeparatedUsers: slicedArr.join(", "),
2234
- lastUser
2235
- });
2236
- } else {
2237
- outStr = t("{{ commaSeparatedUsers }} and {{ moreCount }} more", {
2238
- commaSeparatedUsers: slicedArr.join(", "),
2239
- moreCount: restLength
2240
- });
2241
- }
2242
- }
2243
- return outStr;
2244
- };
2245
- const countEmojis = (text) => {
2246
- const matches = text?.match(emojiRegex());
2247
- return matches ? matches.length : 0;
2248
- };
2249
- const messageTextHasEmojisOnly = (message) => {
2250
- if (!message.text) return false;
2251
- const noEmojis = message.text.replace(emojiRegex(), "");
2252
- const noSpace = noEmojis.replace(/[\s\n]/gm, "");
2253
- return !noSpace;
2254
- };
2255
- const isMessageErrorRetryable = (message) => message.status === "failed" && message.error?.status !== 403;
2256
- const isNetworkSendFailure = (message) => message.status === "failed" && message.error?.status === 0;
2257
- const isMessageBounced = (message) => message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_BOUNCE" || message.moderation?.action === "bounce");
2258
- const isMessageBlocked = (message) => message.shadowed || message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_REMOVE" || message.moderation?.action === "remove");
2259
- const isMessageDeleted = (message) => Boolean(message.deleted_at || message.type === "deleted" || message.deleted_for_me);
2260
- const isMessageEdited = (message) => !!message.message_text_updated_at;
2261
- const hasResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
2262
- function autoMiddlewareFor(p) {
2263
- if (!String(p).startsWith("auto")) return null;
2264
- const alignment = p === "auto-start" ? "start" : p === "auto-end" ? "end" : void 0;
2265
- return react.autoPlacement({ alignment });
2266
- }
2267
- function toOffsetMw(opt) {
2268
- if (opt == null) return null;
2269
- if (Array.isArray(opt)) {
2270
- const [crossAxis, mainAxis] = opt;
2271
- return react.offset({ crossAxis, mainAxis });
2272
- }
2273
- if (typeof opt === "number") return react.offset(opt);
2274
- return react.offset(opt);
2275
- }
2276
- function usePopoverPosition({
2277
- allowFlip = true,
2278
- allowShift = true,
2279
- autoUpdateOptions,
2280
- fitAvailableSpace = false,
2281
- freeze = false,
2282
- offset,
2283
- placement = "bottom-start",
2284
- shiftOptions
2285
- }) {
2286
- const autoMw = autoMiddlewareFor(placement);
2287
- const offsetMiddleware = toOffsetMw(offset);
2288
- const isSidePlacement = placement.startsWith("left") || placement.startsWith("right");
2289
- const mergedShiftOptions = shiftOptions ? { padding: 8, ...shiftOptions } : { padding: 8 };
2290
- const middleware = [
2291
- // offset first (mirrors common Popper setups)
2292
- ...offsetMiddleware ? [offsetMiddleware] : [],
2293
- // choose between autoPlacement (Popper's "auto*") OR flip()
2294
- // only allow flip when not explicitly 'left*' or 'right*'
2295
- ...autoMw ? [autoMw] : allowFlip && !isSidePlacement ? [react.flip()] : [],
2296
- // viewport collision adjustments
2297
- ...allowShift ? [react.shift(mergedShiftOptions)] : [],
2298
- // optional size constraining
2299
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2300
- ...fitAvailableSpace ? [react.size({ apply: () => {
2301
- } })] : []
2302
- ];
2303
- const seedPlacement = String(placement).startsWith("auto") ? "bottom" : placement;
2304
- return react.useFloating({
2305
- middleware,
2306
- placement: seedPlacement,
2307
- strategy: "fixed",
2308
- whileElementsMounted: freeze ? void 0 : (reference, floating, update) => react.autoUpdate(reference, floating, update, {
2309
- ancestorResize: true,
2310
- ancestorScroll: true,
2311
- animationFrame: false,
2312
- elementResize: hasResizeObserver,
2313
- ...autoUpdateOptions
2314
- })
2315
- });
2316
- }
2317
- const LegacyThreadContext = React.createContext({ legacyThread: void 0 });
2318
- const useLegacyThreadContext = () => React.useContext(LegacyThreadContext);
2319
- const DEFAULT_PLAYBACK_RATES = [1, 1.5, 2];
2320
- const isSeekable = (audioElement) => !(audioElement.duration === Infinity || isNaN(audioElement.duration));
2321
- const defaultRegisterAudioPlayerError = ({
2322
- error
2323
- } = {}) => {
2324
- if (!error) return;
2325
- console.error("[AUDIO PLAYER]", error);
2326
- };
2327
- const elementIsPlaying = (audioElement) => audioElement && !(audioElement.paused || audioElement.ended);
2328
- class AudioPlayer {
2329
- constructor({
2330
- durationSeconds,
2331
- fileSize,
2332
- id,
2333
- mimeType,
2334
- playbackRates: customPlaybackRates,
2335
- plugins,
2336
- pool,
2337
- src,
2338
- title,
2339
- waveformData
2340
- }) {
2341
- this._plugins = /* @__PURE__ */ new Map();
2342
- this.playTimeout = void 0;
2343
- this.unsubscribeEventListeners = null;
2344
- this._disposed = false;
2345
- this._metadataProbe = null;
2346
- this._restoringPosition = false;
2347
- this._removalTimeout = void 0;
2348
- this.setDurationSeconds = (durationSeconds2) => {
2349
- this._data.durationSeconds = durationSeconds2;
2350
- this.state.partialNext({ durationSeconds: durationSeconds2 });
2351
- };
2352
- this.setPlaybackStartSafetyTimeout = () => {
2353
- clearTimeout(this.playTimeout);
2354
- this.playTimeout = setTimeout(() => {
2355
- if (!this.elementRef) return;
2356
- try {
2357
- this.elementRef.pause();
2358
- this.state.partialNext({ isPlaying: false });
2359
- } catch (e) {
2360
- this.registerError({ errCode: "failed-to-start" });
2361
- }
2362
- }, 2e3);
2363
- };
2364
- this.updateDurationFromElement = (element) => {
2365
- const duration = element.duration;
2366
- if (typeof duration !== "number" || isNaN(duration) || !isFinite(duration) || duration <= 0) {
2367
- return;
2368
- }
2369
- this.setDurationSeconds(duration);
2370
- };
2371
- this.clearMetadataProbe = () => {
2372
- const probe = this._metadataProbe;
2373
- this._metadataProbe = null;
2374
- this._metadataProbePromise = void 0;
2375
- if (!probe) return;
2376
- try {
2377
- probe.pause();
2378
- } catch {
2379
- }
2380
- probe.removeAttribute("src");
2381
- try {
2382
- probe.load();
2383
- } catch {
2384
- }
2385
- };
2386
- this.preloadMetadata = () => {
2387
- if (this._disposed || this.durationSeconds != null || !this.src || this._metadataProbePromise || typeof document === "undefined") {
2388
- return;
2389
- }
2390
- const probe = document.createElement("audio");
2391
- probe.preload = "metadata";
2392
- this._metadataProbe = probe;
2393
- this._metadataProbePromise = new Promise((resolve) => {
2394
- const cleanup = () => {
2395
- probe.removeEventListener("loadedmetadata", handleLoadedMetadata);
2396
- probe.removeEventListener("error", handleError);
2397
- if (this._metadataProbe === probe) {
2398
- this.clearMetadataProbe();
2399
- } else {
2400
- this._metadataProbePromise = void 0;
2401
- }
2402
- resolve();
2403
- };
2404
- const handleLoadedMetadata = () => {
2405
- this.updateDurationFromElement(probe);
2406
- cleanup();
2407
- };
2408
- const handleError = () => {
2409
- cleanup();
2410
- };
2411
- probe.addEventListener("loadedmetadata", handleLoadedMetadata, { once: true });
2412
- probe.addEventListener("error", handleError, { once: true });
2413
- probe.src = this.src;
2414
- try {
2415
- probe.load();
2416
- } catch {
2417
- cleanup();
2418
- }
2419
- });
2420
- };
2421
- this.clearPlaybackStartSafetyTimeout = () => {
2422
- if (!this.elementRef) return;
2423
- clearTimeout(this.playTimeout);
2424
- this.playTimeout = void 0;
2425
- };
2426
- this.clearPendingLoadedMeta = () => {
2427
- const pending = this._pendingLoadedMeta;
2428
- if (pending?.element && pending.onLoaded) {
2429
- pending.element.removeEventListener("loadedmetadata", pending.onLoaded);
2430
- }
2431
- this._pendingLoadedMeta = void 0;
2432
- };
2433
- this.restoreSavedPosition = (elementRef) => {
2434
- const saved = this.secondsElapsed;
2435
- if (!saved || saved <= 0) return;
2436
- const apply = () => {
2437
- const duration = elementRef.duration;
2438
- const clamped = typeof duration === "number" && !isNaN(duration) && isFinite(duration) ? Math.min(saved, duration) : saved;
2439
- try {
2440
- if (elementRef.currentTime === clamped) return;
2441
- elementRef.currentTime = clamped;
2442
- this.setSecondsElapsed(clamped);
2443
- } catch {
2444
- }
2445
- };
2446
- if (elementRef.readyState < 1) {
2447
- this.clearPendingLoadedMeta();
2448
- this._restoringPosition = true;
2449
- const onLoaded = () => {
2450
- if (this._pendingLoadedMeta?.onLoaded !== onLoaded) return;
2451
- this._pendingLoadedMeta = void 0;
2452
- if (this.elementRef !== elementRef) {
2453
- this._restoringPosition = false;
2454
- return;
2455
- }
2456
- apply();
2457
- this._restoringPosition = false;
2458
- };
2459
- elementRef.addEventListener("loadedmetadata", onLoaded, { once: true });
2460
- this._pendingLoadedMeta = { element: elementRef, onLoaded };
2461
- } else {
2462
- this._restoringPosition = true;
2463
- apply();
2464
- this._restoringPosition = false;
2465
- }
2466
- };
2467
- this.elementIsReady = () => {
2468
- if (this._elementIsReadyPromise) return this._elementIsReadyPromise;
2469
- this._elementIsReadyPromise = new Promise((resolve) => {
2470
- if (!this.elementRef) return resolve(false);
2471
- const element = this.elementRef;
2472
- const handleLoaded = () => {
2473
- element.removeEventListener("loadedmetadata", handleLoaded);
2474
- resolve(element.readyState > 0);
2475
- };
2476
- element.addEventListener("loadedmetadata", handleLoaded);
2477
- });
2478
- return this._elementIsReadyPromise;
2479
- };
2480
- this.setRef = (elementRef) => {
2481
- if (elementIsPlaying(this.elementRef)) {
2482
- this.releaseElement({ resetState: false });
2483
- }
2484
- this.clearPendingLoadedMeta();
2485
- this.clearMetadataProbe();
2486
- this._restoringPosition = false;
2487
- this._elementIsReadyPromise = void 0;
2488
- this.state.partialNext({ elementRef });
2489
- if (elementRef) {
2490
- this.registerSubscriptions();
2491
- }
2492
- };
2493
- this.setSecondsElapsed = (secondsElapsed) => {
2494
- const duration = this.elementRef?.duration ?? this.durationSeconds;
2495
- this.state.partialNext({
2496
- progressPercent: duration && secondsElapsed ? secondsElapsed / duration * 100 : 0,
2497
- secondsElapsed
2498
- });
2499
- };
2500
- this.canPlayMimeType = (mimeType2) => {
2501
- if (!mimeType2) return false;
2502
- if (this.elementRef) return !!this.elementRef.canPlayType(mimeType2);
2503
- return !!new Audio().canPlayType(mimeType2);
2504
- };
2505
- this.play = async (params) => {
2506
- if (this._disposed) return;
2507
- const elementRef = this.ensureElementRef();
2508
- if (elementIsPlaying(this.elementRef)) {
2509
- if (this.isPlaying) return;
2510
- this.state.partialNext({ isPlaying: true });
2511
- return;
2512
- }
2513
- const { currentPlaybackRate, playbackRates: playbackRates2 } = {
2514
- currentPlaybackRate: this.currentPlaybackRate,
2515
- playbackRates: this.playbackRates,
2516
- ...params
2517
- };
2518
- if (!this.canPlayRecord) {
2519
- this.registerError({ errCode: "not-playable" });
2520
- return;
2521
- }
2522
- this.restoreSavedPosition(elementRef);
2523
- elementRef.playbackRate = currentPlaybackRate ?? this.currentPlaybackRate;
2524
- this.setPlaybackStartSafetyTimeout();
2525
- try {
2526
- await elementRef.play();
2527
- this.state.partialNext({
2528
- currentPlaybackRate,
2529
- isPlaying: true,
2530
- playbackRates: playbackRates2
2531
- });
2532
- this._pool.setActiveAudioPlayer(this);
2533
- } catch (e) {
2534
- this.registerError({ error: e });
2535
- this.state.partialNext({ isPlaying: false });
2536
- } finally {
2537
- this.clearPlaybackStartSafetyTimeout();
2538
- }
2539
- };
2540
- this.pause = () => {
2541
- if (!elementIsPlaying(this.elementRef)) return;
2542
- this.clearPlaybackStartSafetyTimeout();
2543
- this.elementRef.pause();
2544
- this.state.partialNext({ isPlaying: false });
2545
- };
2546
- this.stop = () => {
2547
- this.pause();
2548
- this.state.partialNext({ isPlaying: false });
2549
- this.setSecondsElapsed(0);
2550
- if (this.elementRef) this.elementRef.currentTime = 0;
2551
- };
2552
- this.togglePlay = async () => this.isPlaying ? this.pause() : await this.play();
2553
- this.increasePlaybackRate = () => {
2554
- let currentPlaybackRateIndex = this.state.getLatestValue().playbackRates.findIndex((rate) => rate === this.currentPlaybackRate);
2555
- if (currentPlaybackRateIndex === -1) {
2556
- currentPlaybackRateIndex = 0;
2557
- }
2558
- const nextIndex = currentPlaybackRateIndex === this.playbackRates.length - 1 ? 0 : currentPlaybackRateIndex + 1;
2559
- const currentPlaybackRate = this.playbackRates[nextIndex];
2560
- this.state.partialNext({ currentPlaybackRate });
2561
- if (this.elementRef) {
2562
- this.elementRef.playbackRate = currentPlaybackRate;
2563
- }
2564
- };
2565
- this.seek = throttle(async ({ clientX, currentTarget }) => {
2566
- let element = this.elementRef;
2567
- if (!this.elementRef) {
2568
- element = this.ensureElementRef();
2569
- const isReady = await this.elementIsReady();
2570
- if (!isReady) return;
2571
- }
2572
- if (!currentTarget || !element) return;
2573
- if (!isSeekable(element)) {
2574
- this.registerError({ errCode: "seek-not-supported" });
2575
- return;
2576
- }
2577
- const { width, x } = currentTarget.getBoundingClientRect();
2578
- const ratio = (clientX - x) / width;
2579
- if (ratio > 1 || ratio < 0) return;
2580
- const currentTime = ratio * element.duration;
2581
- this.setSecondsElapsed(currentTime);
2582
- element.currentTime = currentTime;
2583
- }, 16);
2584
- this.registerError = (params) => {
2585
- defaultRegisterAudioPlayerError(params);
2586
- this.plugins.forEach(({ onError }) => onError?.({ player: this, ...params }));
2587
- };
2588
- this.requestRemoval = () => {
2589
- this._disposed = true;
2590
- this.cancelScheduledRemoval();
2591
- this.clearPendingLoadedMeta();
2592
- this.clearMetadataProbe();
2593
- this._restoringPosition = false;
2594
- this.releaseElement({ resetState: true });
2595
- this.unsubscribeEventListeners?.();
2596
- this.unsubscribeEventListeners = null;
2597
- this.plugins.forEach(({ onRemove }) => onRemove?.({ player: this }));
2598
- this._pool.deregister(this.id);
2599
- };
2600
- this.cancelScheduledRemoval = () => {
2601
- clearTimeout(this._removalTimeout);
2602
- this._removalTimeout = void 0;
2603
- };
2604
- this.scheduleRemoval = (ms = 0) => {
2605
- this.cancelScheduledRemoval();
2606
- this._removalTimeout = setTimeout(() => {
2607
- if (this.disposed) return;
2608
- this.requestRemoval();
2609
- }, ms);
2610
- };
2611
- this.releaseElementForHandoff = () => {
2612
- if (!this.elementRef) return;
2613
- this.releaseElement({ resetState: false });
2614
- this.unsubscribeEventListeners?.();
2615
- this.unsubscribeEventListeners = null;
2616
- };
2617
- this.registerSubscriptions = () => {
2618
- this.unsubscribeEventListeners?.();
2619
- const audioElement = this.elementRef;
2620
- if (!audioElement) return;
2621
- const handleEnded = () => {
2622
- if (audioElement) {
2623
- this.updateDurationFromElement(audioElement);
2624
- }
2625
- this.stop();
2626
- };
2627
- const handleError = (e) => {
2628
- const audio = e.currentTarget;
2629
- const state = { isPlaying: false };
2630
- if (!audio?.error?.code) {
2631
- this.state.partialNext(state);
2632
- return;
2633
- }
2634
- if (audio.error.code === 4) {
2635
- state.canPlayRecord = false;
2636
- this.state.partialNext(state);
2637
- }
2638
- const errorMsg = [
2639
- void 0,
2640
- "MEDIA_ERR_ABORTED: fetch aborted by user",
2641
- "MEDIA_ERR_NETWORK: network failed while fetching",
2642
- "MEDIA_ERR_DECODE: audio fetched but couldn’t decode",
2643
- "MEDIA_ERR_SRC_NOT_SUPPORTED: source not supported"
2644
- ][audio?.error?.code];
2645
- if (!errorMsg) return;
2646
- defaultRegisterAudioPlayerError({ error: new Error(errorMsg + ` (${audio.src})`) });
2647
- };
2648
- const handleTimeupdate = () => {
2649
- const t = audioElement?.currentTime ?? 0;
2650
- if (this._restoringPosition && t === 0) return;
2651
- if (!this.isPlaying && t === 0 && this.secondsElapsed > 0) return;
2652
- this.setSecondsElapsed(t);
2653
- };
2654
- const handleLoadedMetadata = () => {
2655
- if (audioElement) {
2656
- this.updateDurationFromElement(audioElement);
2657
- }
2658
- };
2659
- audioElement.addEventListener("ended", handleEnded);
2660
- audioElement.addEventListener("error", handleError);
2661
- audioElement.addEventListener("loadedmetadata", handleLoadedMetadata);
2662
- audioElement.addEventListener("timeupdate", handleTimeupdate);
2663
- this.unsubscribeEventListeners = () => {
2664
- audioElement.pause();
2665
- audioElement.removeEventListener("ended", handleEnded);
2666
- audioElement.removeEventListener("error", handleError);
2667
- audioElement.removeEventListener("loadedmetadata", handleLoadedMetadata);
2668
- audioElement.removeEventListener("timeupdate", handleTimeupdate);
2669
- };
2670
- };
2671
- this._data = {
2672
- durationSeconds,
2673
- fileSize,
2674
- id,
2675
- mimeType,
2676
- src,
2677
- title,
2678
- waveformData
2679
- };
2680
- this._pool = pool;
2681
- this.setPlugins(() => plugins ?? []);
2682
- const playbackRates = customPlaybackRates?.length ? customPlaybackRates : DEFAULT_PLAYBACK_RATES;
2683
- const canPlayRecord = mimeType ? !!new Audio().canPlayType(mimeType) : true;
2684
- this.state = new streamChat.StateStore({
2685
- canPlayRecord,
2686
- currentPlaybackRate: playbackRates[0],
2687
- durationSeconds,
2688
- elementRef: null,
2689
- isPlaying: false,
2690
- playbackError: null,
2691
- playbackRates,
2692
- progressPercent: 0,
2693
- secondsElapsed: 0
2694
- });
2695
- this.plugins.forEach((p) => p.onInit?.({ player: this }));
2696
- this.preloadMetadata();
2697
- }
2698
- get plugins() {
2699
- return Array.from(this._plugins.values());
2700
- }
2701
- get canPlayRecord() {
2702
- return this.state.getLatestValue().canPlayRecord;
2703
- }
2704
- get elementRef() {
2705
- return this.state.getLatestValue().elementRef;
2706
- }
2707
- get isPlaying() {
2708
- return this.state.getLatestValue().isPlaying;
2709
- }
2710
- get currentPlaybackRate() {
2711
- return this.state.getLatestValue().currentPlaybackRate;
2712
- }
2713
- get playbackRates() {
2714
- return this.state.getLatestValue().playbackRates;
2715
- }
2716
- get durationSeconds() {
2717
- return this.state.getLatestValue().durationSeconds;
2718
- }
2719
- get fileSize() {
2720
- return this._data.fileSize;
2721
- }
2722
- get id() {
2723
- return this._data.id;
2724
- }
2725
- get src() {
2726
- return this._data.src;
2727
- }
2728
- get mimeType() {
2729
- return this._data.mimeType;
2730
- }
2731
- get title() {
2732
- return this._data.title;
2733
- }
2734
- get waveformData() {
2735
- return this._data.waveformData;
2736
- }
2737
- get secondsElapsed() {
2738
- return this.state.getLatestValue().secondsElapsed;
2739
- }
2740
- get progressPercent() {
2741
- return this.state.getLatestValue().progressPercent;
2742
- }
2743
- get disposed() {
2744
- return this._disposed;
2745
- }
2746
- ensureElementRef() {
2747
- if (this._disposed) {
2748
- throw new Error("AudioPlayer is disposed");
2749
- }
2750
- if (!this.elementRef) {
2751
- const el = this._pool.acquireElement({
2752
- ownerId: this.id,
2753
- src: this.src
2754
- });
2755
- this.setRef(el);
2756
- }
2757
- return this.elementRef;
2758
- }
2759
- setDescriptor(descriptor) {
2760
- const previousSrc = this.src;
2761
- this._data = { ...this._data, ...descriptor };
2762
- if (descriptor.src !== previousSrc && this.elementRef) {
2763
- this.elementRef.src = descriptor.src;
2764
- }
2765
- if (descriptor.src && descriptor.src !== previousSrc) {
2766
- this.clearMetadataProbe();
2767
- if (descriptor.durationSeconds == null) {
2768
- this.setDurationSeconds(void 0);
2769
- this.preloadMetadata();
2770
- } else {
2771
- this.setDurationSeconds(descriptor.durationSeconds);
2772
- }
2773
- return;
2774
- }
2775
- if (descriptor.durationSeconds != null) {
2776
- this.setDurationSeconds(descriptor.durationSeconds);
2777
- }
2778
- }
2779
- releaseElement({ resetState }) {
2780
- this.clearPendingLoadedMeta();
2781
- this.clearMetadataProbe();
2782
- this._restoringPosition = false;
2783
- if (resetState) {
2784
- this.stop();
2785
- } else {
2786
- this.state.partialNext({ isPlaying: false });
2787
- if (this.elementRef) {
2788
- try {
2789
- this.elementRef.pause();
2790
- } catch {
2791
- }
2792
- }
2793
- }
2794
- if (this.elementRef) {
2795
- this._pool.releaseElement(this.id);
2796
- this.setRef(null);
2797
- }
2798
- }
2799
- setPlugins(setter) {
2800
- this._plugins = setter(this.plugins).reduce((acc, plugin) => {
2801
- if (plugin.id) {
2802
- acc.set(plugin.id, plugin);
2803
- }
2804
- return acc;
2805
- }, /* @__PURE__ */ new Map());
2806
- }
2807
- }
2808
- class AudioPlayerPool {
2809
- constructor(config) {
2810
- this.state = new streamChat.StateStore({
2811
- activeAudioPlayer: null
2812
- });
2813
- this.pool = /* @__PURE__ */ new Map();
2814
- this.audios = /* @__PURE__ */ new Map();
2815
- this.sharedAudio = null;
2816
- this.sharedOwnerId = null;
2817
- this.getOrAdd = (params) => {
2818
- const { playbackRates, plugins, ...descriptor } = params;
2819
- let player = this.pool.get(params.id);
2820
- if (player) {
2821
- if (!player.disposed) {
2822
- player.setDescriptor(descriptor);
2823
- return player;
2824
- }
2825
- this.deregister(params.id);
2826
- }
2827
- player = new AudioPlayer({
2828
- playbackRates,
2829
- plugins,
2830
- ...descriptor,
2831
- pool: this
2832
- });
2833
- this.pool.set(params.id, player);
2834
- return player;
2835
- };
2836
- this.acquireElement = ({ ownerId, src }) => {
2837
- if (!this.allowConcurrentPlayback) {
2838
- if (!this.sharedAudio) {
2839
- this.sharedAudio = new Audio();
2840
- }
2841
- if (this.sharedOwnerId && this.sharedOwnerId !== ownerId) {
2842
- const previous = this.pool.get(this.sharedOwnerId);
2843
- previous?.pause();
2844
- previous?.releaseElementForHandoff();
2845
- }
2846
- this.sharedOwnerId = ownerId;
2847
- if (this.sharedAudio.src !== src) {
2848
- this.sharedAudio.src = src;
2849
- }
2850
- return this.sharedAudio;
2851
- }
2852
- let audio = this.audios.get(ownerId);
2853
- if (!audio) {
2854
- audio = new Audio();
2855
- this.audios.set(ownerId, audio);
2856
- }
2857
- if (audio.src !== src) {
2858
- audio.src = src;
2859
- }
2860
- return audio;
2861
- };
2862
- this.releaseElement = (ownerId) => {
2863
- if (!this.allowConcurrentPlayback) {
2864
- if (this.sharedOwnerId !== ownerId) return;
2865
- const el2 = this.sharedAudio;
2866
- if (el2) {
2867
- try {
2868
- el2.pause();
2869
- } catch {
2870
- }
2871
- el2.removeAttribute("src");
2872
- el2.load();
2873
- }
2874
- this.sharedOwnerId = null;
2875
- return;
2876
- }
2877
- const el = this.audios.get(ownerId);
2878
- if (!el) return;
2879
- try {
2880
- el.pause();
2881
- } catch {
2882
- }
2883
- el.removeAttribute("src");
2884
- el.load();
2885
- this.audios.delete(ownerId);
2886
- };
2887
- this.setActiveAudioPlayer = (activeAudioPlayer) => {
2888
- if (this.allowConcurrentPlayback) return;
2889
- this.state.partialNext({ activeAudioPlayer });
2890
- };
2891
- this.remove = (id) => {
2892
- const player = this.pool.get(id);
2893
- if (!player) return;
2894
- player.requestRemoval();
2895
- };
2896
- this.clear = () => {
2897
- this.players.forEach((player) => {
2898
- this.remove(player.id);
2899
- });
2900
- };
2901
- this.registerSubscriptions = () => {
2902
- this.players.forEach((p) => {
2903
- if (p.elementRef) {
2904
- p.registerSubscriptions();
2905
- }
2906
- });
2907
- };
2908
- this.allowConcurrentPlayback = !!config?.allowConcurrentPlayback;
2909
- }
2910
- get players() {
2911
- return Array.from(this.pool.values());
2912
- }
2913
- get activeAudioPlayer() {
2914
- return this.state.getLatestValue().activeAudioPlayer;
2915
- }
2916
- /** Removes the AudioPlayer instance from the pool of players */
2917
- deregister(id) {
2918
- if (this.pool.has(id)) {
2919
- this.pool.delete(id);
2920
- }
2921
- if (this.activeAudioPlayer?.id === id) {
2922
- this.setActiveAudioPlayer(null);
2923
- }
2924
- }
2925
- }
2926
- const SEEK_NOT_SUPPORTED_NOTIFICATION_DEBOUNCE_INTERVAL_MS = 1e3;
2927
- const audioPlayerNotificationsPluginFactory = ({
2928
- addNotification,
2929
- panel = "channel",
2930
- t
2931
- }) => {
2932
- const errors = {
2933
- "failed-to-start": new Error(t("Failed to play the recording")),
2934
- "not-playable": new Error(
2935
- t("Recording format is not supported and cannot be reproduced")
2936
- ),
2937
- "seek-not-supported": new Error(t("Cannot seek in the recording"))
2938
- };
2939
- let lastSeekNotSupportedNotificationAt;
2940
- return {
2941
- id: "AudioPlayerNotificationsPlugin",
2942
- onError: ({ errCode, error: e }) => {
2943
- if (errCode === "seek-not-supported") {
2944
- const now = Date.now();
2945
- if (typeof lastSeekNotSupportedNotificationAt === "number" && now - lastSeekNotSupportedNotificationAt < SEEK_NOT_SUPPORTED_NOTIFICATION_DEBOUNCE_INTERVAL_MS) {
2946
- return;
2947
- }
2948
- lastSeekNotSupportedNotificationAt = now;
2949
- }
2950
- const error = (errCode && errors[errCode]) ?? e ?? new Error(t("Error reproducing the recording"));
2951
- addNotification({
2952
- emitter: "AudioPlayer",
2953
- error,
2954
- message: error.message,
2955
- severity: "error",
2956
- targetPanels: [panel],
2957
- type: "browser:audio:playback:error"
2958
- });
2959
- }
2960
- };
2961
- };
2962
- const AudioPlayerContext = React.createContext({
2963
- audioPlayers: null
2964
- });
2965
- const WithAudioPlayback = ({
2966
- allowConcurrentPlayback,
2967
- children
2968
- }) => {
2969
- const [audioPlayers] = React.useState(() => new AudioPlayerPool({ allowConcurrentPlayback }));
2970
- React.useEffect(
2971
- () => () => {
2972
- audioPlayers.clear();
2973
- },
2974
- [audioPlayers]
2975
- );
2976
- return /* @__PURE__ */ jsxRuntime.jsx(AudioPlayerContext.Provider, { value: { audioPlayers }, children });
2977
- };
2978
- const makeAudioPlayerId = ({ requester, src }) => `${requester ?? "requester-unknown"}:${src}`;
2979
- const useAudioPlayer = ({
2980
- durationSeconds,
2981
- fileSize,
2982
- mimeType,
2983
- playbackRates,
2984
- plugins,
2985
- requester = "",
2986
- src,
2987
- title,
2988
- waveformData
2989
- }) => {
2990
- const { addNotification } = useNotificationApi();
2991
- const panel = useNotificationTarget();
2992
- const { t } = useTranslationContext();
2993
- const { audioPlayers } = React.useContext(AudioPlayerContext);
2994
- const audioPlayer = src && audioPlayers ? audioPlayers.getOrAdd({
2995
- durationSeconds,
2996
- fileSize,
2997
- id: makeAudioPlayerId({ requester, src }),
2998
- mimeType,
2999
- playbackRates,
3000
- plugins,
3001
- src,
3002
- title,
3003
- waveformData
3004
- }) : void 0;
3005
- React.useEffect(() => {
3006
- if (!audioPlayer) return;
3007
- const notificationsPlugin = audioPlayerNotificationsPluginFactory({
3008
- addNotification,
3009
- panel,
3010
- t
3011
- });
3012
- audioPlayer.setPlugins((currentPlugins) => [
3013
- ...currentPlugins.filter((plugin) => plugin.id !== notificationsPlugin.id),
3014
- notificationsPlugin
3015
- ]);
3016
- }, [addNotification, audioPlayer, panel, t]);
3017
- return audioPlayer;
3018
- };
3019
- const activeAudioPlayerSelector = ({ activeAudioPlayer }) => ({
3020
- activeAudioPlayer
3021
- });
3022
- const useActiveAudioPlayer = () => {
3023
- const { audioPlayers } = React.useContext(AudioPlayerContext);
3024
- const { activeAudioPlayer } = useStateStore(audioPlayers?.state, activeAudioPlayerSelector) ?? {};
3025
- return activeAudioPlayer;
3026
- };
3027
- const cooldownTimerStateSelector = (state) => ({
3028
- isCooldownActive: !!state.cooldownRemaining
3029
- });
3030
- const useIsCooldownActive = () => {
3031
- const { channel } = useChannelStateContext();
3032
- return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector).isCooldownActive;
3033
- };
3034
- const queueCache = new streamChat.FixedSizeQueueCache(64);
3035
- const useMessageComposerController = () => {
3036
- const { client } = useChatContext();
3037
- const { channel } = useChannelStateContext();
3038
- const { legacyThread: parentMessage } = useLegacyThreadContext();
3039
- const threadInstance = useThreadContext();
3040
- const cachedParentMessage = React.useMemo(() => {
3041
- if (!parentMessage) return void 0;
3042
- return parentMessage;
3043
- }, [parentMessage?.id]);
3044
- const messageComposer = React.useMemo(() => {
3045
- if (threadInstance) {
3046
- return threadInstance.messageComposer;
3047
- } else if (cachedParentMessage) {
3048
- const compositionContext = {
3049
- ...cachedParentMessage,
3050
- legacyThreadId: cachedParentMessage.id
3051
- };
3052
- const tag = streamChat.MessageComposer.constructTag(compositionContext);
3053
- const cachedComposer = queueCache.get(tag);
3054
- if (cachedComposer) return cachedComposer;
3055
- return new streamChat.MessageComposer({
3056
- client,
3057
- compositionContext
3058
- });
3059
- } else {
3060
- return channel.messageComposer;
3061
- }
3062
- }, [cachedParentMessage, channel, client, threadInstance]);
3063
- if (["legacy_thread", "message"].includes(
3064
- messageComposer.contextType
3065
- ) && !queueCache.peek(messageComposer.tag)) {
3066
- queueCache.add(messageComposer.tag, messageComposer);
3067
- }
3068
- React.useEffect(() => {
3069
- const unsubscribe = messageComposer.registerSubscriptions();
3070
- return () => {
3071
- unsubscribe();
3072
- };
3073
- }, [messageComposer]);
3074
- return messageComposer;
3075
- };
3076
- const CUSTOM_MESSAGE_TYPE = {
3077
- date: "message.date",
3078
- intro: "channel.intro"
3079
- };
3080
- const processMessages = (params) => {
3081
- const { messages, reviewProcessedMessage, setGiphyPreviewMessage, ...context } = params;
3082
- const {
3083
- enableDateSeparator,
3084
- hideDeletedMessages,
3085
- hideNewMessageSeparator,
3086
- lastRead,
3087
- userId
3088
- } = context;
3089
- let unread = false;
3090
- let ephemeralMessagePresent = false;
3091
- let lastDateSeparator;
3092
- const newMessages = [];
3093
- for (let i = 0; i < messages.length; i += 1) {
3094
- const message = messages[i];
3095
- if (hideDeletedMessages && message.type === "deleted") {
3096
- continue;
3097
- }
3098
- if (setGiphyPreviewMessage && message.type === "ephemeral" && message.command === "giphy") {
3099
- ephemeralMessagePresent = true;
3100
- setGiphyPreviewMessage(message);
3101
- continue;
3102
- }
3103
- const changes = [];
3104
- const messageDate = message.created_at && isDate(message.created_at) && message.created_at.toDateString() || "";
3105
- const previousMessage = messages[i - 1];
3106
- let prevMessageDate = messageDate;
3107
- if (enableDateSeparator && previousMessage?.created_at && isDate(previousMessage.created_at)) {
3108
- prevMessageDate = previousMessage.created_at.toDateString();
3109
- }
3110
- if (!unread && !hideNewMessageSeparator) {
3111
- unread = lastRead && message.created_at && new Date(lastRead) < message.created_at || false;
3112
- if (enableDateSeparator && unread && message.user?.id !== userId) {
3113
- changes.push({
3114
- customType: CUSTOM_MESSAGE_TYPE.date,
3115
- date: message.created_at,
3116
- id: makeDateMessageId(message.created_at),
3117
- unread
3118
- });
3119
- }
3120
- }
3121
- if (enableDateSeparator && (i === 0 || // always put date separator before the first message
3122
- messageDate !== prevMessageDate || // add date separator btw. 2 messages created on different date
3123
- // if hiding deleted messages replace the previous deleted message(s) with A separator if the last rendered message was created on different date
3124
- hideDeletedMessages && previousMessage?.type === "deleted" && lastDateSeparator !== messageDate) && !isDateSeparatorMessage(changes[changes.length - 1])) {
3125
- lastDateSeparator = messageDate;
3126
- changes.push(
3127
- {
3128
- customType: CUSTOM_MESSAGE_TYPE.date,
3129
- date: message.created_at,
3130
- id: makeDateMessageId(message.created_at)
3131
- },
3132
- message
3133
- );
3134
- } else {
3135
- changes.push(message);
3136
- }
3137
- newMessages.push(
3138
- ...reviewProcessedMessage?.({
3139
- changes,
3140
- context,
3141
- index: i,
3142
- messages,
3143
- processedMessages: newMessages
3144
- }) || changes
3145
- );
3146
- }
3147
- if (setGiphyPreviewMessage && !ephemeralMessagePresent) {
3148
- setGiphyPreviewMessage(void 0);
3149
- }
3150
- return newMessages;
3151
- };
3152
- const makeIntroMessage = () => ({
3153
- customType: CUSTOM_MESSAGE_TYPE.intro,
3154
- id: nanoid.nanoid()
3155
- });
3156
- const makeDateMessageId = (date) => {
3157
- let idSuffix;
3158
- try {
3159
- idSuffix = !date ? nanoid.nanoid() : date instanceof Date ? date.toISOString() : date;
3160
- } catch (e) {
3161
- idSuffix = nanoid.nanoid();
3162
- }
3163
- return `${CUSTOM_MESSAGE_TYPE.date}-${idSuffix}`;
3164
- };
3165
- const getLastReceived = (messages) => {
3166
- for (let i = messages.length - 1; i > 0; i -= 1) {
3167
- if (messages[i].status === "received") {
3168
- return messages[i].id;
3169
- }
3170
- }
3171
- return null;
3172
- };
3173
- const insertIntro = (messages, headerPosition) => {
3174
- const newMessages = messages;
3175
- const intro = makeIntroMessage();
3176
- if (!headerPosition) {
3177
- newMessages.unshift(intro);
3178
- return newMessages;
3179
- }
3180
- if (!newMessages.length) {
3181
- newMessages.unshift(intro);
3182
- return newMessages;
3183
- }
3184
- for (let i = 0; i < messages.length; i += 1) {
3185
- const messageTime = isDate(messages[i].created_at) ? messages[i].created_at.getTime() : null;
3186
- const nextMessageTime = isDate(messages[i + 1].created_at) ? messages[i + 1].created_at.getTime() : null;
3187
- if (messageTime && messageTime < headerPosition) {
3188
- if (nextMessageTime && nextMessageTime < headerPosition) {
3189
- if (messages[i + 1] && isDateSeparatorMessage(messages[i + 1])) continue;
3190
- if (!nextMessageTime) {
3191
- newMessages.push(intro);
3192
- return newMessages;
3193
- }
3194
- } else {
3195
- newMessages.splice(i + 1, 0, intro);
3196
- return newMessages;
3197
- }
3198
- }
3199
- }
3200
- return newMessages;
3201
- };
3202
- const getGroupStyles = (message, previousMessage, nextMessage, noGroupByUser, maxTimeBetweenGroupedMessages) => {
3203
- if (isDateSeparatorMessage(message) || isIntroMessage(message)) return "";
3204
- if (noGroupByUser || message.attachments?.length !== 0) return "single";
3205
- const isTopMessage = !previousMessage || isIntroMessage(previousMessage) || isDateSeparatorMessage(previousMessage) || previousMessage.type === "system" || previousMessage.type === "error" || previousMessage.attachments?.length !== 0 || message.user?.id !== previousMessage.user?.id || message.reaction_groups && Object.keys(message.reaction_groups).length > 0 || isMessageEdited(previousMessage) || maxTimeBetweenGroupedMessages !== void 0 && previousMessage.created_at && message.created_at && new Date(message.created_at).getTime() - new Date(previousMessage.created_at).getTime() > maxTimeBetweenGroupedMessages;
3206
- const isBottomMessage = !nextMessage || isIntroMessage(nextMessage) || isDateSeparatorMessage(nextMessage) || nextMessage.type === "system" || nextMessage.type === "error" || nextMessage.attachments?.length !== 0 || message.user?.id !== nextMessage.user?.id || nextMessage.reaction_groups && Object.keys(nextMessage.reaction_groups).length > 0 || isMessageEdited(message) || maxTimeBetweenGroupedMessages !== void 0 && nextMessage.created_at && message.created_at && new Date(nextMessage.created_at).getTime() - new Date(message.created_at).getTime() > maxTimeBetweenGroupedMessages;
3207
- if (!isTopMessage && !isBottomMessage) {
3208
- if (message.type === "error") return "single";
3209
- return "middle";
3210
- }
3211
- if (isBottomMessage) {
3212
- if (isTopMessage || message.type === "error") return "single";
3213
- return "bottom";
3214
- }
3215
- if (isTopMessage) return "top";
3216
- return "";
3217
- };
3218
- const hasMoreMessagesProbably = (returnedCountMessages, limit) => returnedCountMessages >= limit;
3219
- function isIntroMessage(message) {
3220
- return message.customType === CUSTOM_MESSAGE_TYPE.intro;
3221
- }
3222
- function isDateSeparatorMessage(message) {
3223
- return message !== null && typeof message === "object" && message.customType === CUSTOM_MESSAGE_TYPE.date && isDate(message.date);
3224
- }
3225
- function isLocalMessage(message) {
3226
- return !isDateSeparatorMessage(message) && !isIntroMessage(message);
3227
- }
3228
- const getIsFirstUnreadMessage = ({
3229
- firstUnreadMessageId,
3230
- isFirstMessage,
3231
- lastReadDate,
3232
- lastReadMessageId,
3233
- message,
3234
- previousMessage,
3235
- unreadMessageCount = 0
3236
- }) => {
3237
- if (message.parent_id) return false;
3238
- const createdAtTimestamp = message.created_at && new Date(message.created_at).getTime();
3239
- const lastReadTimestamp = lastReadDate?.getTime();
3240
- const messageIsUnread = !!createdAtTimestamp && !!lastReadTimestamp && createdAtTimestamp > lastReadTimestamp;
3241
- const previousMessageIsLastRead = !!lastReadMessageId && lastReadMessageId === previousMessage?.id;
3242
- return firstUnreadMessageId === message.id || !!unreadMessageCount && messageIsUnread && (isFirstMessage || previousMessageIsLastRead);
3243
- };
3244
- const useImageFlagEmojisOnWindowsClass = () => {
3245
- const { useImageFlagEmojisOnWindows } = useChatContext("Channel");
3246
- return useImageFlagEmojisOnWindows && navigator.userAgent.match(/Win/) ? "str-chat--windows-flags" : "";
3247
- };
3248
- const getChatContainerClass = (customClass) => customClass ?? "str-chat__container";
3249
- const useChannelContainerClasses = ({
3250
- customClasses
3251
- }) => {
3252
- const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
3253
- return {
3254
- channelClass: customClasses?.channel ?? "str-chat__channel",
3255
- chatClass: customClasses?.chat ?? "str-chat",
3256
- chatContainerClass: getChatContainerClass(customClasses?.chatContainer),
3257
- windowsEmojiClass
3258
- };
3259
- };
3260
- const findInMsgSetById = (targetId, msgSet) => {
3261
- for (let i = msgSet.length - 1; i >= 0; i--) {
3262
- const item = msgSet[i];
3263
- if (item.id === targetId) {
3264
- return {
3265
- index: i,
3266
- target: item
3267
- };
3268
- }
3269
- }
3270
- return {
3271
- index: -1
3272
- };
3273
- };
3274
- const findInMsgSetByDate = (targetDate, msgSet, exact = false) => {
3275
- const targetTimestamp = targetDate.getTime();
3276
- let left = 0;
3277
- let middle = 0;
3278
- let right = msgSet.length - 1;
3279
- while (left <= right) {
3280
- middle = Math.floor((right + left) / 2);
3281
- const middleTimestamp = new Date(
3282
- msgSet[middle].created_at
3283
- ).getTime();
3284
- const middleLeftTimestamp = msgSet[middle - 1]?.created_at && new Date(msgSet[middle - 1].created_at).getTime();
3285
- const middleRightTimestamp = msgSet[middle + 1]?.created_at && new Date(msgSet[middle + 1].created_at).getTime();
3286
- if (middleTimestamp === targetTimestamp || middleLeftTimestamp && middleRightTimestamp && middleLeftTimestamp < targetTimestamp && targetTimestamp < middleRightTimestamp) {
3287
- return { index: middle, target: msgSet[middle] };
3288
- }
3289
- if (middleTimestamp < targetTimestamp) left = middle + 1;
3290
- else right = middle - 1;
3291
- }
3292
- if (!exact || new Date(msgSet[left].created_at).getTime() === targetTimestamp) {
3293
- return { index: left, target: msgSet[left] };
3294
- }
3295
- return { index: -1 };
3296
- };
3297
- const adaptMessageSendErrorToErrorFromResponse = (error) => {
3298
- if (error instanceof streamChat.ErrorFromResponse) {
3299
- return error;
3300
- }
3301
- const fallbackMessage = error instanceof Error ? error.message : "Message send failed";
3302
- let message = fallbackMessage;
3303
- let status = 0;
3304
- let code = null;
3305
- if (typeof error === "object" && error !== null) {
3306
- const maybeAxiosError = error;
3307
- if (maybeAxiosError.name === "AxiosError" && maybeAxiosError.code === "ERR_NETWORK") {
3308
- message = typeof maybeAxiosError.message === "string" ? maybeAxiosError.message : "Network Error";
3309
- status = maybeAxiosError.response?.status ?? 0;
3310
- return new streamChat.ErrorFromResponse(message, {
3311
- code: null,
3312
- response: maybeAxiosError.response ?? {
3313
- // Compatibility shim: this is an intentionally incomplete AxiosResponse-like object.
3314
- data: {
3315
- duration: "",
3316
- message,
3317
- more_info: "",
3318
- StatusCode: status
3319
- },
3320
- status
3321
- },
3322
- status
3323
- });
3324
- }
3325
- try {
3326
- const stringError = JSON.stringify(error);
3327
- const parsedError = stringError ? JSON.parse(stringError) : {};
3328
- if (typeof parsedError.message === "string") {
3329
- message = parsedError.message;
3330
- }
3331
- if (typeof parsedError.status === "number") {
3332
- status = parsedError.status;
3333
- }
3334
- if (typeof parsedError.code === "number") {
3335
- code = parsedError.code;
3336
- }
3337
- } catch {
3338
- }
3339
- }
3340
- return new streamChat.ErrorFromResponse(message, {
3341
- code,
3342
- response: {
3343
- // Compatibility shim: this is an intentionally incomplete AxiosResponse-like object.
3344
- data: {
3345
- duration: "",
3346
- message,
3347
- more_info: "",
3348
- StatusCode: status
3349
- },
3350
- status
3351
- },
3352
- status
3353
- });
3354
- };
3355
- const WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL = {};
3356
- const getChannel = async ({
3357
- channel,
3358
- client,
3359
- id,
3360
- members,
3361
- options,
3362
- type
3363
- }) => {
3364
- if (!channel && !type) {
3365
- throw new Error("Channel or channel type have to be provided to query a channel.");
3366
- }
3367
- const theChannel = channel || client.channel(type, id, { members });
3368
- const originalCid = theChannel?.id ? theChannel.cid : members && members.length ? generateChannelTempCid(theChannel.type, members) : void 0;
3369
- if (!originalCid) {
3370
- throw new Error(
3371
- "Channel ID or channel members array have to be provided to query a channel."
3372
- );
3373
- }
3374
- const queryPromise = WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
3375
- if (queryPromise) {
3376
- await queryPromise;
3377
- } else {
3378
- try {
3379
- WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch(options);
3380
- await WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
3381
- } finally {
3382
- delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid];
3383
- }
3384
- }
3385
- return theChannel;
3386
- };
3387
- const generateChannelTempCid = (channelType, members) => {
3388
- if (!members) return;
3389
- const membersStr = [...members].sort().join(",");
3390
- return `${channelType}:!members-${membersStr}`;
3391
- };
3392
- const getImageAttachmentConfiguration = (attachment, element) => {
3393
- let newUrl = void 0;
3394
- const urlToTest = attachment.image_url || attachment.thumb_url || "";
3395
- if (linkify__namespace.test(urlToTest, "url")) {
3396
- const url = new URL(urlToTest);
3397
- const resizeDimensions = getSizingRestrictions(url, element);
3398
- if (resizeDimensions) {
3399
- resizeDimensions.height *= 2;
3400
- resizeDimensions.width *= 2;
3401
- addResizingParamsToUrl(resizeDimensions, url);
3402
- }
3403
- newUrl = url.href;
3404
- }
3405
- return {
3406
- url: newUrl || ""
3407
- };
3408
- };
3409
- const getVideoAttachmentConfiguration = (attachment, element, shouldGenerateVideoThumbnail) => {
3410
- let thumbUrl = void 0;
3411
- if (attachment.thumb_url && shouldGenerateVideoThumbnail && linkify__namespace.test(attachment.thumb_url, "url")) {
3412
- const url = new URL(attachment.thumb_url);
3413
- const resizeDimensions = getSizingRestrictions(url, element);
3414
- if (resizeDimensions) {
3415
- resizeDimensions.height *= 2;
3416
- resizeDimensions.width *= 2;
3417
- addResizingParamsToUrl(resizeDimensions, url);
3418
- }
3419
- thumbUrl = url.href;
3420
- }
3421
- return {
3422
- thumbUrl,
3423
- url: attachment.asset_url || ""
3424
- };
3425
- };
3426
- const getSizingRestrictions = (url, htmlElement) => {
3427
- const urlParams = url.searchParams;
3428
- const originalHeight = Number(urlParams.get("oh")) || 1;
3429
- const originalWidth = Number(urlParams.get("ow")) || 1;
3430
- const cssSizeRestriction = getCSSSizeRestrictions(htmlElement);
3431
- let resizeDimensions;
3432
- if ((cssSizeRestriction.maxHeight || cssSizeRestriction.height) && cssSizeRestriction.maxWidth) {
3433
- resizeDimensions = getResizeDimensions(
3434
- originalHeight,
3435
- originalWidth,
3436
- /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
3437
- cssSizeRestriction.maxHeight || cssSizeRestriction.height,
3438
- cssSizeRestriction.maxWidth
3439
- );
3440
- } else {
3441
- resizeDimensions = void 0;
3442
- }
3443
- return resizeDimensions;
3444
- };
3445
- const getResizeDimensions = (originalHeight, originalWidth, maxHeight, maxWidth) => ({
3446
- height: Math.round(Math.max(maxHeight, maxWidth / originalWidth * originalHeight)),
3447
- width: Math.round(Math.max(maxHeight, maxWidth / originalHeight * originalWidth))
3448
- });
3449
- const getCSSSizeRestrictions = (htmlElement) => {
3450
- const computedStylesheet = getComputedStyle(htmlElement);
3451
- const height = getValueRepresentationOfCSSProperty(
3452
- computedStylesheet.getPropertyValue("height")
3453
- );
3454
- const maxHeight = getValueRepresentationOfCSSProperty(
3455
- computedStylesheet.getPropertyValue("max-height")
3456
- );
3457
- const maxWidth = getValueRepresentationOfCSSProperty(
3458
- computedStylesheet.getPropertyValue("max-width")
3459
- );
3460
- if (!((height || maxHeight) && maxWidth)) {
3461
- console.warn(
3462
- `Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/react/message-components/attachment/#image-and-video-sizing`
3463
- );
3464
- }
3465
- return { height, maxHeight, maxWidth };
3466
- };
3467
- const getValueRepresentationOfCSSProperty = (property) => {
3468
- if (!property.endsWith("px")) {
3469
- return void 0;
3470
- }
3471
- const number = parseFloat(property);
3472
- return isNaN(number) ? void 0 : number;
3473
- };
3474
- const addResizingParamsToUrl = (resizeDimensions, url) => {
3475
- url.searchParams.set("h", resizeDimensions.height.toString());
3476
- url.searchParams.set("w", resizeDimensions.width.toString());
3477
- };
3478
- const searchControllerStateSelector = (nextValue) => ({
3479
- focusedMessage: nextValue.focusedMessage
3480
- });
3481
- const useSearchFocusedMessage = () => {
3482
- const { searchController } = useChatContext("Channel");
3483
- const { focusedMessage } = useStateStore(
3484
- searchController._internalState,
3485
- searchControllerStateSelector
3486
- );
3487
- return focusedMessage;
3488
- };
3489
- const ChannelContainer = ({
3490
- children,
3491
- className: additionalClassName,
3492
- ...props
3493
- }) => {
3494
- const { customClasses, theme } = useChatContext("Channel");
3495
- const { channelClass, chatClass } = useChannelContainerClasses({
3496
- customClasses
3497
- });
3498
- const className = clsx(chatClass, theme, channelClass, additionalClassName);
3499
- return /* @__PURE__ */ jsxRuntime.jsx("div", { id: CHANNEL_CONTAINER_ID, ...props, className, children });
3500
- };
3501
- const UnMemoizedChannel = (props) => {
3502
- const { channel: propsChannel, EmptyPlaceholder } = props;
3503
- const {
3504
- EmptyStateIndicator: EmptyStateIndicator$1 = EmptyStateIndicator,
3505
- LoadingErrorIndicator: LoadingErrorIndicator2,
3506
- LoadingIndicator = LoadingChannel
3507
- } = useComponentContext();
3508
- const { channel: contextChannel, channelsQueryState } = useChatContext("Channel");
3509
- const channel = propsChannel || contextChannel;
3510
- const emptyPlaceholder = "EmptyPlaceholder" in props ? EmptyPlaceholder : EmptyStateIndicator$1 && /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIndicator$1, { listType: "message" });
3511
- if (channelsQueryState.queryInProgress === "reload" && LoadingIndicator) {
3512
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingIndicator, {}) });
3513
- }
3514
- if (channelsQueryState.error && !channel && LoadingErrorIndicator2) {
3515
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingErrorIndicator2, { error: channelsQueryState.error }) });
3516
- }
3517
- if (channelsQueryState.error && !channel) {
3518
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, {});
3519
- }
3520
- if (!channel?.cid) {
3521
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: emptyPlaceholder });
3522
- }
3523
- return /* @__PURE__ */ React.createElement(ChannelInner, { ...props, channel, key: channel.cid });
3524
- };
3525
- const ChannelInner = (props) => {
3526
- const {
3527
- activeUnreadHandler,
3528
- allowConcurrentAudioPlayback,
3529
- channel,
3530
- channelQueryOptions,
3531
- children,
3532
- doDeleteMessageRequest,
3533
- doMarkReadRequest,
3534
- doSendMessageRequest,
3535
- doUpdateMessageRequest,
3536
- initializeOnMount = true,
3537
- markReadOnMount = true,
3538
- onMentionsClick,
3539
- onMentionsHover,
3540
- skipMessageDataMemoization
3541
- } = props;
3542
- const {
3543
- LoadingErrorIndicator: LoadingErrorIndicator$1 = LoadingErrorIndicator,
3544
- LoadingIndicator = LoadingChannel
3545
- } = useComponentContext();
3546
- const { client, customClasses, latestMessageDatesByChannels, mutes, searchController } = useChatContext("Channel");
3547
- const { addNotification } = useNotificationApi();
3548
- const { t } = useTranslationContext("Channel");
3549
- const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
3550
- const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
3551
- const thread = useThreadContext();
3552
- const [channelConfig, setChannelConfig] = React.useState(channel.getConfig());
3553
- const [channelUnreadUiState, _setChannelUnreadUiState] = React.useState();
3554
- const channelReducer = React.useMemo(() => makeChannelReducer(), []);
3555
- const [state, dispatch] = React.useReducer(
3556
- channelReducer,
3557
- // channel.initialized === false if client.channel().query() was not called, e.g. ChannelList is not used
3558
- // => Channel will call channel.watch() in useLayoutEffect => state.loading is used to signal the watch() call state
3559
- {
3560
- ...initialState,
3561
- hasMore: channel.state.messagePagination.hasPrev,
3562
- loading: !channel.initialized,
3563
- messages: channel.state.messages
3564
- }
3565
- );
3566
- const jumpToMessageFromSearch = useSearchFocusedMessage();
3567
- const isMounted = useIsMounted();
3568
- const originalTitle = React.useRef("");
3569
- const lastRead = React.useRef(void 0);
3570
- const online = React.useRef(true);
3571
- const clearHighlightedMessageTimeoutId = React.useRef(
3572
- null
3573
- );
3574
- const channelCapabilitiesArray = channel.data?.own_capabilities;
3575
- const throttledCopyStateFromChannel = throttle(
3576
- () => dispatch({ channel, type: "copyStateFromChannelOnEvent" }),
3577
- 500,
3578
- {
3579
- leading: true,
3580
- trailing: true
3581
- }
3582
- );
3583
- const setChannelUnreadUiState = React.useMemo(
3584
- () => throttle(_setChannelUnreadUiState, 200, {
3585
- leading: true,
3586
- trailing: false
3587
- }),
3588
- []
3589
- );
3590
- const markRead = React.useMemo(
3591
- () => throttle(
3592
- async (options) => {
3593
- const { updateChannelUiUnreadState = true } = options ?? {};
3594
- if (channel.disconnected || !channelConfig?.read_events) {
3595
- return;
3596
- }
3597
- lastRead.current = /* @__PURE__ */ new Date();
3598
- try {
3599
- if (doMarkReadRequest) {
3600
- doMarkReadRequest(
3601
- channel,
3602
- updateChannelUiUnreadState ? setChannelUnreadUiState : void 0
3603
- );
3604
- } else {
3605
- const markReadResponse = await channel.markRead();
3606
- if (updateChannelUiUnreadState && markReadResponse?.event) {
3607
- _setChannelUnreadUiState({
3608
- last_read: lastRead.current,
3609
- last_read_message_id: markReadResponse.event.last_read_message_id,
3610
- unread_messages: 0
3611
- });
3612
- }
3613
- }
3614
- if (activeUnreadHandler) {
3615
- activeUnreadHandler(0, originalTitle.current);
3616
- } else if (originalTitle.current) {
3617
- document.title = originalTitle.current;
3618
- }
3619
- } catch (e) {
3620
- console.error(t("Failed to mark channel as read"));
3621
- }
3622
- },
3623
- 500,
3624
- { leading: true, trailing: false }
3625
- ),
3626
- [
3627
- activeUnreadHandler,
3628
- channel,
3629
- channelConfig,
3630
- doMarkReadRequest,
3631
- setChannelUnreadUiState,
3632
- t
3633
- ]
3634
- );
3635
- const handleEvent = async (event) => {
3636
- if (event.message) {
3637
- dispatch({
3638
- channel,
3639
- message: event.message,
3640
- type: "updateThreadOnEvent"
3641
- });
3642
- }
3643
- if (event.type === "user.messages.deleted" && event.cid && event.cid !== channel.cid)
3644
- return;
3645
- if (event.type === "user.watching.start" || event.type === "user.watching.stop")
3646
- return;
3647
- if (event.type === "typing.start" || event.type === "typing.stop") {
3648
- return dispatch({ channel, type: "setTyping" });
3649
- }
3650
- if (event.type === "connection.changed" && typeof event.online === "boolean") {
3651
- online.current = event.online;
3652
- }
3653
- if (event.type === "message.new") {
3654
- const mainChannelUpdated = !event.message?.parent_id || event.message?.show_in_channel;
3655
- if (mainChannelUpdated) {
3656
- if (document.hidden && channelConfig?.read_events && !channel.muteStatus().muted) {
3657
- const unread = channel.countUnread(lastRead.current);
3658
- if (activeUnreadHandler) {
3659
- activeUnreadHandler(unread, originalTitle.current);
3660
- } else {
3661
- document.title = `(${unread}) ${originalTitle.current}`;
3662
- }
3663
- }
3664
- }
3665
- if (event.message?.user?.id === client.userID && event?.message?.created_at && event?.message?.cid) {
3666
- const messageDate = new Date(event.message.created_at);
3667
- const cid = event.message.cid;
3668
- if (!latestMessageDatesByChannels[cid] || latestMessageDatesByChannels[cid].getTime() < messageDate.getTime()) {
3669
- latestMessageDatesByChannels[cid] = messageDate;
3670
- }
3671
- }
3672
- }
3673
- if (event.type === "user.deleted") {
3674
- const oldestID = channel.state?.messages?.[0]?.id;
3675
- await channel.query({
3676
- messages: { id_lt: oldestID, limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE },
3677
- watchers: { limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE }
3678
- });
3679
- }
3680
- if (event.type === "notification.mark_unread")
3681
- _setChannelUnreadUiState((prev) => {
3682
- if (!(event.last_read_at && event.user)) return prev;
3683
- return {
3684
- first_unread_message_id: event.first_unread_message_id,
3685
- last_read: new Date(event.last_read_at),
3686
- last_read_message_id: event.last_read_message_id,
3687
- unread_messages: event.unread_messages ?? 0
3688
- };
3689
- });
3690
- if (event.type === "channel.truncated" && event.cid === channel.cid) {
3691
- _setChannelUnreadUiState(void 0);
3692
- }
3693
- throttledCopyStateFromChannel();
3694
- };
3695
- React.useLayoutEffect(() => {
3696
- let errored = false;
3697
- let done = false;
3698
- (async () => {
3699
- if (!channel.initialized && initializeOnMount) {
3700
- try {
3701
- const members = [];
3702
- if (!channel.id && channel.data?.members) {
3703
- for (const member of channel.data.members) {
3704
- let userId;
3705
- if (typeof member === "string") {
3706
- userId = member;
3707
- } else if (typeof member === "object") {
3708
- const { user, user_id } = member;
3709
- userId = user_id || user?.id;
3710
- }
3711
- if (userId) {
3712
- members.push(userId);
3713
- }
3714
- }
3715
- }
3716
- await getChannel({ channel, client, members, options: channelQueryOptions });
3717
- const config = channel.getConfig();
3718
- setChannelConfig(config);
3719
- } catch (e) {
3720
- dispatch({ error: e, type: "setError" });
3721
- errored = true;
3722
- }
3723
- }
3724
- done = true;
3725
- originalTitle.current = document.title;
3726
- if (!errored) {
3727
- dispatch({
3728
- channel,
3729
- hasMore: channel.state.messagePagination.hasPrev,
3730
- type: "initStateFromChannel"
3731
- });
3732
- if (client.user?.id && channel.state.read[client.user.id]) {
3733
- const { user, ...ownReadState } = channel.state.read[client.user.id];
3734
- _setChannelUnreadUiState(ownReadState);
3735
- }
3736
- if (channel.countUnread() > 0 && markReadOnMount)
3737
- markRead({ updateChannelUiUnreadState: false });
3738
- client.on("connection.changed", handleEvent);
3739
- client.on("connection.recovered", handleEvent);
3740
- client.on("user.updated", handleEvent);
3741
- client.on("user.deleted", handleEvent);
3742
- client.on("user.messages.deleted", handleEvent);
3743
- channel.on(handleEvent);
3744
- }
3745
- })();
3746
- return () => {
3747
- if (errored || !done) return;
3748
- channel?.off(handleEvent);
3749
- client.off("connection.changed", handleEvent);
3750
- client.off("connection.recovered", handleEvent);
3751
- client.off("user.deleted", handleEvent);
3752
- };
3753
- }, [
3754
- channel.cid,
3755
- channelQueryOptions,
3756
- doMarkReadRequest,
3757
- channelConfig?.read_events,
3758
- initializeOnMount
3759
- ]);
3760
- React.useEffect(() => {
3761
- if (!state.thread) return;
3762
- const message = state.messages?.find((m) => m.id === state.thread?.id);
3763
- if (message) dispatch({ message, type: "setThread" });
3764
- }, [state.messages, state.thread]);
3765
- const handleHighlightedMessageChange = React.useCallback(
3766
- ({
3767
- highlightDuration,
3768
- highlightedMessageId
3769
- }) => {
3770
- dispatch({
3771
- channel,
3772
- highlightedMessageId,
3773
- type: "jumpToMessageFinished"
3774
- });
3775
- if (clearHighlightedMessageTimeoutId.current) {
3776
- clearTimeout(clearHighlightedMessageTimeoutId.current);
3777
- }
3778
- clearHighlightedMessageTimeoutId.current = setTimeout(() => {
3779
- if (searchController._internalState.getLatestValue().focusedMessage) {
3780
- searchController._internalState.partialNext({ focusedMessage: void 0 });
3781
- }
3782
- clearHighlightedMessageTimeoutId.current = null;
3783
- dispatch({ type: "clearHighlightedMessage" });
3784
- }, highlightDuration ?? DEFAULT_HIGHLIGHT_DURATION);
3785
- },
3786
- [channel, searchController]
3787
- );
3788
- React.useEffect(() => {
3789
- if (!jumpToMessageFromSearch?.id) return;
3790
- handleHighlightedMessageChange({ highlightedMessageId: jumpToMessageFromSearch.id });
3791
- }, [jumpToMessageFromSearch, handleHighlightedMessageChange]);
3792
- const notifyJumpToFirstUnreadError = React.useCallback(() => {
3793
- addNotification({
3794
- context: { feature: "jumpToFirstUnread" },
3795
- emitter: "Channel",
3796
- message: t("Failed to jump to the first unread message"),
3797
- severity: "error",
3798
- targetPanels: ["channel"],
3799
- type: "channel:jumpToFirstUnread:failed"
3800
- });
3801
- }, [addNotification, t]);
3802
- const loadMoreFinished = React.useCallback(
3803
- debounce(
3804
- (hasMore, messages) => {
3805
- if (!isMounted.current) return;
3806
- dispatch({ hasMore, messages, type: "loadMoreFinished" });
3807
- },
3808
- 2e3,
3809
- { leading: true, trailing: true }
3810
- ),
3811
- []
3812
- );
3813
- const finishLoadMore = React.useCallback(
3814
- (hasMore, messages) => {
3815
- if (!isMounted.current) return;
3816
- dispatch({ hasMore, messages, type: "loadMoreFinished" });
3817
- },
3818
- [isMounted]
3819
- );
3820
- const loadMore = async (limit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE) => {
3821
- if (!online.current || !window.navigator.onLine || !channel.state.messagePagination.hasPrev)
3822
- return 0;
3823
- const oldestMessage = state?.messages?.[0];
3824
- if (state.loadingMore || state.loadingMoreNewer || oldestMessage?.status !== "received") {
3825
- return 0;
3826
- }
3827
- dispatch({ loadingMore: true, type: "setLoadingMore" });
3828
- const oldestID = oldestMessage?.id;
3829
- const perPage = limit;
3830
- let queryResponse;
3831
- try {
3832
- queryResponse = await channel.query({
3833
- messages: { id_lt: oldestID, limit: perPage },
3834
- watchers: { limit: perPage }
3835
- });
3836
- } catch (e) {
3837
- console.warn("message pagination request failed with error", e);
3838
- dispatch({ loadingMore: false, type: "setLoadingMore" });
3839
- return 0;
3840
- }
3841
- loadMoreFinished.cancel();
3842
- finishLoadMore(channel.state.messagePagination.hasPrev, channel.state.messages);
3843
- return queryResponse.messages.length;
3844
- };
3845
- const loadMoreNewer = async (limit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE) => {
3846
- if (!online.current || !window.navigator.onLine || !channel.state.messagePagination.hasNext)
3847
- return 0;
3848
- const newestMessage = state?.messages?.[state?.messages?.length - 1];
3849
- if (state.loadingMore || state.loadingMoreNewer) return 0;
3850
- dispatch({ loadingMoreNewer: true, type: "setLoadingMoreNewer" });
3851
- const newestId = newestMessage?.id;
3852
- const perPage = limit;
3853
- let queryResponse;
3854
- try {
3855
- queryResponse = await channel.query({
3856
- messages: { id_gt: newestId, limit: perPage },
3857
- watchers: { limit: perPage }
3858
- });
3859
- } catch (e) {
3860
- console.warn("message pagination request failed with error", e);
3861
- dispatch({ loadingMoreNewer: false, type: "setLoadingMoreNewer" });
3862
- return 0;
3863
- }
3864
- dispatch({
3865
- hasMoreNewer: channel.state.messagePagination.hasNext,
3866
- messages: channel.state.messages,
3867
- type: "loadMoreNewerFinished"
3868
- });
3869
- return queryResponse.messages.length;
3870
- };
3871
- const jumpToMessage = React.useCallback(
3872
- async (messageId, messageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
3873
- dispatch({
3874
- loadingMoreForJumpToChannelMessage: true,
3875
- type: "setLoadingMoreForJumpToChannelMessage"
3876
- });
3877
- loadMoreFinished.cancel();
3878
- try {
3879
- await channel.state.loadMessageIntoState(messageId, void 0, messageLimit);
3880
- handleHighlightedMessageChange({
3881
- highlightDuration,
3882
- highlightedMessageId: messageId
3883
- });
3884
- } catch (error) {
3885
- dispatch({
3886
- loadingMoreForJumpToChannelMessage: false,
3887
- type: "setLoadingMoreForJumpToChannelMessage"
3888
- });
3889
- throw error;
3890
- }
3891
- },
3892
- [channel, handleHighlightedMessageChange, loadMoreFinished]
3893
- );
3894
- const jumpToLatestMessage = React.useCallback(async () => {
3895
- loadMoreFinished.cancel();
3896
- await channel.state.loadMessageIntoState("latest");
3897
- dispatch({
3898
- hasMore: channel.state.messagePagination.hasPrev,
3899
- hasMoreNewer: channel.state.messagePagination.hasNext,
3900
- messages: channel.state.messages,
3901
- type: "jumpToLatestMessageFinished"
3902
- });
3903
- }, [channel, loadMoreFinished]);
3904
- const jumpToFirstUnreadMessage = React.useCallback(
3905
- async (queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
3906
- if (!channelUnreadUiState?.unread_messages) return;
3907
- let lastReadMessageId = channelUnreadUiState?.last_read_message_id;
3908
- let firstUnreadMessageId = channelUnreadUiState?.first_unread_message_id;
3909
- let isInCurrentMessageSet = false;
3910
- if (firstUnreadMessageId) {
3911
- const result = findInMsgSetById(firstUnreadMessageId, channel.state.messages);
3912
- isInCurrentMessageSet = result.index !== -1;
3913
- } else if (lastReadMessageId) {
3914
- const result = findInMsgSetById(lastReadMessageId, channel.state.messages);
3915
- isInCurrentMessageSet = !!result.target;
3916
- firstUnreadMessageId = result.index > -1 ? channel.state.messages[result.index + 1]?.id : void 0;
3917
- } else {
3918
- const lastReadTimestamp = channelUnreadUiState.last_read.getTime();
3919
- const { index: lastReadMessageIndex, target: lastReadMessage } = findInMsgSetByDate(
3920
- channelUnreadUiState.last_read,
3921
- channel.state.messages,
3922
- true
3923
- );
3924
- if (lastReadMessage) {
3925
- firstUnreadMessageId = channel.state.messages[lastReadMessageIndex + 1]?.id;
3926
- isInCurrentMessageSet = !!firstUnreadMessageId;
3927
- lastReadMessageId = lastReadMessage.id;
3928
- } else {
3929
- dispatch({ loadingMore: true, type: "setLoadingMore" });
3930
- let messages;
3931
- try {
3932
- messages = (await channel.query(
3933
- {
3934
- messages: {
3935
- created_at_around: channelUnreadUiState.last_read.toISOString(),
3936
- limit: queryMessageLimit
3937
- }
3938
- },
3939
- "new"
3940
- )).messages;
3941
- } catch (e) {
3942
- notifyJumpToFirstUnreadError();
3943
- finishLoadMore(
3944
- channel.state.messagePagination.hasPrev,
3945
- channel.state.messages
3946
- );
3947
- return;
3948
- }
3949
- const firstMessageWithCreationDate = messages.find((msg) => msg.created_at);
3950
- if (!firstMessageWithCreationDate) {
3951
- notifyJumpToFirstUnreadError();
3952
- finishLoadMore(
3953
- channel.state.messagePagination.hasPrev,
3954
- channel.state.messages
3955
- );
3956
- return;
3957
- }
3958
- const firstMessageTimestamp = new Date(
3959
- firstMessageWithCreationDate.created_at
3960
- ).getTime();
3961
- if (lastReadTimestamp < firstMessageTimestamp) {
3962
- firstUnreadMessageId = firstMessageWithCreationDate.id;
3963
- } else {
3964
- const result = findInMsgSetByDate(channelUnreadUiState.last_read, messages);
3965
- lastReadMessageId = result.target?.id;
3966
- }
3967
- finishLoadMore(
3968
- channel.state.messagePagination.hasPrev,
3969
- channel.state.messages
3970
- );
3971
- }
3972
- }
3973
- if (!firstUnreadMessageId && !lastReadMessageId) {
3974
- notifyJumpToFirstUnreadError();
3975
- return;
3976
- }
3977
- if (!isInCurrentMessageSet) {
3978
- dispatch({ loadingMore: true, type: "setLoadingMore" });
3979
- try {
3980
- const targetId = firstUnreadMessageId ?? lastReadMessageId;
3981
- await channel.state.loadMessageIntoState(
3982
- targetId,
3983
- void 0,
3984
- queryMessageLimit
3985
- );
3986
- const indexOfTarget = channel.state.messages.findIndex(
3987
- (message) => message.id === targetId
3988
- );
3989
- finishLoadMore(
3990
- channel.state.messagePagination.hasPrev,
3991
- channel.state.messages
3992
- );
3993
- firstUnreadMessageId = firstUnreadMessageId ?? channel.state.messages[indexOfTarget + 1]?.id;
3994
- } catch (e) {
3995
- notifyJumpToFirstUnreadError();
3996
- finishLoadMore(
3997
- channel.state.messagePagination.hasPrev,
3998
- channel.state.messages
3999
- );
4000
- return;
4001
- }
4002
- }
4003
- if (!firstUnreadMessageId) {
4004
- notifyJumpToFirstUnreadError();
4005
- return;
4006
- }
4007
- if (!channelUnreadUiState.first_unread_message_id)
4008
- _setChannelUnreadUiState({
4009
- ...channelUnreadUiState,
4010
- first_unread_message_id: firstUnreadMessageId,
4011
- last_read_message_id: lastReadMessageId
4012
- });
4013
- handleHighlightedMessageChange({
4014
- highlightDuration,
4015
- highlightedMessageId: firstUnreadMessageId
4016
- });
4017
- },
4018
- [
4019
- channel,
4020
- finishLoadMore,
4021
- handleHighlightedMessageChange,
4022
- notifyJumpToFirstUnreadError,
4023
- channelUnreadUiState
4024
- ]
4025
- );
4026
- const deleteMessage = React.useCallback(
4027
- async (message, options) => {
4028
- if (!message?.id) {
4029
- throw new Error("Cannot delete a message - missing message ID.");
4030
- }
4031
- let deletedMessage;
4032
- if (doDeleteMessageRequest) {
4033
- deletedMessage = await doDeleteMessageRequest(message, options);
4034
- } else {
4035
- const result = await client.deleteMessage(message.id, options);
4036
- deletedMessage = result.message;
4037
- }
4038
- return deletedMessage;
4039
- },
4040
- [client, doDeleteMessageRequest]
4041
- );
4042
- const updateMessage = (updatedMessage) => {
4043
- channel.state.addMessageSorted(updatedMessage, true);
4044
- dispatch({
4045
- channel,
4046
- parentId: state.thread && updatedMessage.parent_id,
4047
- type: "copyMessagesFromChannel"
4048
- });
4049
- };
4050
- const doSendMessage = async ({
4051
- localMessage,
4052
- message,
4053
- options
4054
- }) => {
4055
- try {
4056
- let messageResponse;
4057
- if (doSendMessageRequest) {
4058
- messageResponse = await doSendMessageRequest(channel, message, options);
4059
- } else {
4060
- messageResponse = await channel.sendMessage(message, options);
4061
- }
4062
- let existingMessage = void 0;
4063
- for (let i = channel.state.messages.length - 1; i >= 0; i--) {
4064
- const msg = channel.state.messages[i];
4065
- if (msg.id && msg.id === message.id) {
4066
- existingMessage = msg;
4067
- break;
4068
- }
4069
- }
4070
- const responseTimestamp = new Date(
4071
- messageResponse?.message?.updated_at || 0
4072
- ).getTime();
4073
- const existingMessageTimestamp = existingMessage?.updated_at?.getTime() || 0;
4074
- const responseIsTheNewest = responseTimestamp > existingMessageTimestamp;
4075
- if (messageResponse?.message && (responseIsTheNewest || existingMessage?.status === "sending")) {
4076
- updateMessage({
4077
- ...messageResponse.message,
4078
- status: "received"
4079
- });
4080
- }
4081
- } catch (error) {
4082
- const parsedError = adaptMessageSendErrorToErrorFromResponse(error);
4083
- if (parsedError.code === 4 && error instanceof Error && error.message.includes("already exists")) {
4084
- updateMessage({
4085
- ...localMessage,
4086
- status: "received"
4087
- });
4088
- } else {
4089
- updateMessage({
4090
- ...localMessage,
4091
- error: parsedError,
4092
- status: "failed"
4093
- });
4094
- thread?.upsertReplyLocally({
4095
- message: {
4096
- ...localMessage,
4097
- error: parsedError,
4098
- status: "failed"
4099
- }
4100
- });
4101
- }
4102
- }
4103
- };
4104
- const sendMessage = async ({
4105
- localMessage,
4106
- message,
4107
- options
4108
- }) => {
4109
- channel.state.filterErrorMessages();
4110
- thread?.upsertReplyLocally({
4111
- message: localMessage
4112
- });
4113
- updateMessage(localMessage);
4114
- await doSendMessage({ localMessage, message, options });
4115
- };
4116
- const retrySendMessage = async (localMessage) => {
4117
- const type = localMessage.type === "error" ? "regular" : localMessage.type;
4118
- updateMessage({
4119
- ...localMessage,
4120
- error: void 0,
4121
- status: "sending",
4122
- type
4123
- });
4124
- await doSendMessage({
4125
- localMessage,
4126
- message: streamChat.localMessageToNewMessagePayload({ ...localMessage, type })
4127
- });
4128
- };
4129
- const removeMessage = (message) => {
4130
- channel.state.removeMessage(message);
4131
- dispatch({
4132
- channel,
4133
- parentId: state.thread && message.parent_id,
4134
- type: "copyMessagesFromChannel"
4135
- });
4136
- };
4137
- const openThread = (message, event) => {
4138
- event?.preventDefault();
4139
- dispatch({ channel, message, type: "openThread" });
4140
- };
4141
- const closeThread = (event) => {
4142
- event?.preventDefault();
4143
- dispatch({ type: "closeThread" });
4144
- };
4145
- const loadMoreThreadFinished = React.useCallback(
4146
- debounce(
4147
- (threadHasMore, threadMessages) => {
4148
- dispatch({
4149
- threadHasMore,
4150
- threadMessages,
4151
- type: "loadMoreThreadFinished"
4152
- });
4153
- },
4154
- 2e3,
4155
- { leading: true, trailing: true }
4156
- ),
4157
- []
4158
- );
4159
- const loadMoreThread = async (limit = DEFAULT_THREAD_PAGE_SIZE) => {
4160
- if (state.threadLoadingMore || !state.thread || !state.threadHasMore) return;
4161
- dispatch({ type: "startLoadingThread" });
4162
- const parentId = state.thread.id;
4163
- if (!parentId) {
4164
- return dispatch({ type: "closeThread" });
4165
- }
4166
- const oldMessages = channel.state.threads[parentId] || [];
4167
- const oldestMessageId = oldMessages[0]?.id;
4168
- try {
4169
- const queryResponse = await channel.getReplies(parentId, {
4170
- id_lt: oldestMessageId,
4171
- limit
4172
- });
4173
- const threadHasMoreMessages = hasMoreMessagesProbably(
4174
- queryResponse.messages.length,
4175
- limit
4176
- );
4177
- const newThreadMessages = channel.state.threads[parentId] || [];
4178
- loadMoreThreadFinished(threadHasMoreMessages, newThreadMessages);
4179
- } catch (e) {
4180
- loadMoreThreadFinished(false, oldMessages);
4181
- }
4182
- };
4183
- const onMentionsHoverOrClick = useMentionsHandlers(onMentionsHover, onMentionsClick);
4184
- const editMessage = useEditMessageHandler(doUpdateMessageRequest);
4185
- const { typing, ...restState } = state;
4186
- const channelStateContextValue = useCreateChannelStateContext({
4187
- ...restState,
4188
- channel,
4189
- channelCapabilitiesArray,
4190
- channelConfig,
4191
- channelUnreadUiState,
4192
- giphyVersion: props.giphyVersion || "fixed_height",
4193
- imageAttachmentSizeHandler: props.imageAttachmentSizeHandler || getImageAttachmentConfiguration,
4194
- mutes,
4195
- notifications: [],
4196
- shouldGenerateVideoThumbnail: props.shouldGenerateVideoThumbnail ?? true,
4197
- videoAttachmentSizeHandler: props.videoAttachmentSizeHandler || getVideoAttachmentConfiguration,
4198
- watcher_count: state.watcherCount
4199
- });
4200
- const channelActionContextValue = React.useMemo(
4201
- () => ({
4202
- closeThread,
4203
- deleteMessage,
4204
- dispatch,
4205
- editMessage,
4206
- jumpToFirstUnreadMessage,
4207
- jumpToLatestMessage,
4208
- jumpToMessage,
4209
- loadMore,
4210
- loadMoreNewer,
4211
- loadMoreThread,
4212
- markRead,
4213
- onMentionsClick: onMentionsHoverOrClick,
4214
- onMentionsHover: onMentionsHoverOrClick,
4215
- openThread,
4216
- removeMessage,
4217
- retrySendMessage,
4218
- sendMessage,
4219
- setChannelUnreadUiState,
4220
- skipMessageDataMemoization,
4221
- updateMessage
4222
- }),
4223
- // eslint-disable-next-line react-hooks/exhaustive-deps
4224
- [
4225
- channel.cid,
4226
- deleteMessage,
4227
- loadMore,
4228
- loadMoreNewer,
4229
- markRead,
4230
- jumpToFirstUnreadMessage,
4231
- jumpToMessage,
4232
- jumpToLatestMessage,
4233
- setChannelUnreadUiState
4234
- ]
4235
- );
4236
- const typingContextValue = useCreateTypingContext({
4237
- typing
4238
- });
4239
- if (state.error) {
4240
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingErrorIndicator$1, { error: state.error }) });
4241
- }
4242
- if (state.loading) {
4243
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingIndicator, {}) });
4244
- }
4245
- if (!channel.watch) {
4246
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("Channel Missing") }) });
4247
- }
4248
- return /* @__PURE__ */ jsxRuntime.jsx(ChannelContainer, { className: windowsEmojiClass, children: /* @__PURE__ */ jsxRuntime.jsx(ChannelStateProvider, { value: channelStateContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ChannelActionProvider, { value: channelActionContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TypingProvider, { value: typingContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(WithAudioPlayback, { allowConcurrentPlayback: allowConcurrentAudioPlayback, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx(chatContainerClass), children }) }) }) }) }) });
4249
- };
4250
- const Channel = React.memo(UnMemoizedChannel);
4251
- const ThreadContext = React.createContext(void 0);
4252
- const useThreadContext = () => React.useContext(ThreadContext);
4253
- const ThreadProvider = ({
4254
- children,
4255
- thread
4256
- }) => /* @__PURE__ */ jsxRuntime.jsx(ThreadContext.Provider, { value: thread, children: /* @__PURE__ */ jsxRuntime.jsx(Channel, { channel: thread?.channel, children }) });
4257
- const UnreadCountBadge = ({
4258
- children,
4259
- count,
4260
- position
4261
- }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__unread-count-badge-container", children: [
4262
- children,
4263
- count > 0 && /* @__PURE__ */ jsxRuntime.jsx(
4264
- "div",
4265
- {
4266
- className: clsx(
4267
- "str-chat__unread-count-badge",
4268
- position && `str-chat__unread-count-badge--${position}`
4269
- ),
4270
- children: count
4271
- }
4272
- )
4273
- ] });
4274
- const DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE = {
4275
- chatViewPanelIds: {
4276
- channels: "str-chat__chat-view-panel-channels",
4277
- threads: "str-chat__chat-view-panel-threads"
4278
- },
4279
- chatViewTabIds: {
4280
- channels: "str-chat__chat-view-tab-channels",
4281
- threads: "str-chat__chat-view-tab-threads"
4282
- }
4283
- };
4284
- const createChatViewA11yContextValue = (chatViewId) => ({
4285
- // Keep IDs unique per ChatView instance so ARIA references do not collide.
4286
- chatViewPanelIds: {
4287
- channels: `str-chat__chat-view-${chatViewId}-panel-channels`,
4288
- threads: `str-chat__chat-view-${chatViewId}-panel-threads`
4289
- },
4290
- chatViewTabIds: {
4291
- channels: `str-chat__chat-view-${chatViewId}-tab-channels`,
4292
- threads: `str-chat__chat-view-${chatViewId}-tab-threads`
4293
- }
4294
- });
4295
- const ChatViewContext = React.createContext(void 0);
4296
- const ChatViewA11yContext = React.createContext(
4297
- DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE
4298
- );
4299
- const useChatViewContext = () => {
4300
- const value = React.useContext(ChatViewContext);
4301
- if (!value) {
4302
- console.warn(
4303
- "The useChatViewContext hook was called outside of the ChatView provider."
4304
- );
4305
- return {};
4306
- }
4307
- return value;
4308
- };
4309
- const useChatViewA11yContext = () => React.useContext(ChatViewA11yContext);
4310
- const ChatView = ({ children }) => {
4311
- const [activeChatView, setActiveChatView] = React.useState("channels");
4312
- const chatViewId = React.useId().replace(/:/g, "");
4313
- const { theme } = useChatContext();
4314
- const a11yValue = React.useMemo(
4315
- () => createChatViewA11yContextValue(chatViewId),
4316
- [chatViewId]
4317
- );
4318
- const value = React.useMemo(() => ({ activeChatView, setActiveChatView }), [activeChatView]);
4319
- return /* @__PURE__ */ jsxRuntime.jsx(ChatViewA11yContext.Provider, { value: a11yValue, children: /* @__PURE__ */ jsxRuntime.jsx(ChatViewContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx("str-chat", theme, "str-chat__chat-view"), children }) }) });
4320
- };
4321
- const ChannelsView = ({ children }) => {
4322
- const { activeChatView } = useChatViewContext();
4323
- const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
4324
- const isActive = activeChatView === "channels";
4325
- if (!isActive) return null;
4326
- return /* @__PURE__ */ jsxRuntime.jsx(
4327
- "div",
4328
- {
4329
- "aria-labelledby": chatViewTabIds.channels,
4330
- className: "str-chat__chat-view__channels",
4331
- id: chatViewPanelIds.channels,
4332
- role: "tabpanel",
4333
- children
4334
- }
4335
- );
4336
- };
4337
- const ThreadsViewContext = React.createContext({
4338
- activeThread: void 0,
4339
- setActiveThread: () => void 0
4340
- });
4341
- const useThreadsViewContext = () => React.useContext(ThreadsViewContext);
4342
- const ThreadsView = ({ children }) => {
4343
- const { activeChatView } = useChatViewContext();
4344
- const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
4345
- const [activeThread, setActiveThread] = React.useState(void 0);
4346
- const value = React.useMemo(() => ({ activeThread, setActiveThread }), [activeThread]);
4347
- const isActive = activeChatView === "threads";
4348
- if (!isActive) return null;
4349
- return /* @__PURE__ */ jsxRuntime.jsx(ThreadsViewContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
4350
- "div",
4351
- {
4352
- "aria-labelledby": chatViewTabIds.threads,
4353
- className: "str-chat__chat-view__threads",
4354
- id: chatViewPanelIds.threads,
4355
- role: "tabpanel",
4356
- children
4357
- }
4358
- ) });
4359
- };
4360
- const useActiveThread = ({ activeThread }) => {
4361
- React.useEffect(() => {
4362
- if (!activeThread) return;
4363
- const handleVisibilityChange = () => {
4364
- if (document.visibilityState === "visible" && document.hasFocus()) {
4365
- activeThread.activate();
4366
- }
4367
- if (document.visibilityState === "hidden" || !document.hasFocus()) {
4368
- activeThread.deactivate();
4369
- }
4370
- };
4371
- handleVisibilityChange();
4372
- window.addEventListener("focus", handleVisibilityChange);
4373
- window.addEventListener("blur", handleVisibilityChange);
4374
- return () => {
4375
- activeThread.deactivate();
4376
- window.addEventListener("blur", handleVisibilityChange);
4377
- window.removeEventListener("focus", handleVisibilityChange);
4378
- };
4379
- }, [activeThread]);
4380
- };
4381
- const ThreadAdapter = ({ children }) => {
4382
- const { client } = useChatContext("ThreadAdapter");
4383
- const { EmptyStateIndicator: EmptyStateIndicator$1 = EmptyStateIndicator } = useComponentContext();
4384
- const { activeThread } = useThreadsViewContext();
4385
- const { t } = useTranslationContext("ThreadAdapter");
4386
- const { isLoading, ready } = useStateStore(
4387
- client.threads.state,
4388
- threadAdapterSelector
4389
- ) ?? {
4390
- isLoading: false,
4391
- ready: false
4392
- };
4393
- useActiveThread({ activeThread });
4394
- if (!activeThread && ready && !isLoading && EmptyStateIndicator$1) {
4395
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__thread-container str-chat__thread", children: /* @__PURE__ */ jsxRuntime.jsx(
4396
- EmptyStateIndicator$1,
4397
- {
4398
- listType: "message",
4399
- messageText: t("Select a thread to continue the conversation")
4400
- }
4401
- ) });
4402
- }
4403
- return /* @__PURE__ */ jsxRuntime.jsx(ThreadProvider, { thread: activeThread, children });
4404
- };
4405
- const ChatViewSelectorButton = ({
4406
- ActiveIcon,
4407
- children,
4408
- className,
4409
- Icon,
4410
- iconOnly = true,
4411
- isActive,
4412
- text,
4413
- ...props
4414
- }) => {
4415
- const SelectorIcon = isActive && ActiveIcon ? ActiveIcon : Icon;
4416
- const shouldShowTooltip = !!text && iconOnly;
4417
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "str-chat__chat-view__selector-button-container", children: [
4418
- /* @__PURE__ */ jsxRuntime.jsxs(
4419
- Button,
4420
- {
4421
- appearance: "ghost",
4422
- "aria-label": props["aria-label"] ?? (shouldShowTooltip ? text : void 0),
4423
- className: clsx("str-chat__chat-view__selector-button", className),
4424
- role: "tab",
4425
- variant: "secondary",
4426
- ...props,
4427
- children: [
4428
- children ?? (SelectorIcon && /* @__PURE__ */ jsxRuntime.jsx(SelectorIcon, {})),
4429
- !iconOnly && text && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__chat-view__selector-button-text", children: text })
4430
- ]
4431
- }
4432
- ),
4433
- shouldShowTooltip && /* @__PURE__ */ jsxRuntime.jsx(
4434
- "div",
4435
- {
4436
- "aria-hidden": "true",
4437
- className: "str-chat__chat-view__selector-button-tooltip str-chat__tooltip",
4438
- children: text
4439
- }
4440
- )
4441
- ] });
4442
- };
4443
- const threadAdapterSelector = ({ pagination, ready }) => ({
4444
- isLoading: pagination.isLoading,
4445
- ready
4446
- });
4447
- const unreadThreadCountSelector = ({ unreadThreadCount }) => ({
4448
- unreadThreadCount
4449
- });
4450
- const ChatViewChannelsSelectorButton = ({
4451
- iconOnly = true
4452
- }) => {
4453
- const { activeChatView, setActiveChatView } = useChatViewContext();
4454
- const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
4455
- const { t } = useTranslationContext();
4456
- const isActive = activeChatView === "channels";
4457
- return /* @__PURE__ */ jsxRuntime.jsx(
4458
- ChatViewSelectorButton,
4459
- {
4460
- ActiveIcon: IconMessageBubbleFill,
4461
- "aria-controls": chatViewPanelIds.channels,
4462
- "aria-selected": isActive,
4463
- Icon: IconMessageBubble,
4464
- iconOnly,
4465
- id: chatViewTabIds.channels,
4466
- isActive,
4467
- onClick: () => setActiveChatView("channels"),
4468
- onPointerDown: () => setActiveChatView("channels"),
4469
- tabIndex: 0,
4470
- text: t("Channels")
4471
- }
4472
- );
4473
- };
4474
- const ChatViewThreadsSelectorButton = ({
4475
- iconOnly = true
4476
- }) => {
4477
- const { client } = useChatContext();
4478
- const { unreadThreadCount } = useStateStore(
4479
- client.threads.state,
4480
- unreadThreadCountSelector
4481
- ) ?? {
4482
- unreadThreadCount: 0
4483
- };
4484
- const { activeChatView, setActiveChatView } = useChatViewContext();
4485
- const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
4486
- const { t } = useTranslationContext();
4487
- const isActive = activeChatView === "threads";
4488
- return /* @__PURE__ */ jsxRuntime.jsx(
4489
- ChatViewSelectorButton,
4490
- {
4491
- ActiveIcon: IconThreadFill,
4492
- "aria-controls": chatViewPanelIds.threads,
4493
- "aria-selected": isActive,
4494
- Icon: IconThread,
4495
- iconOnly,
4496
- id: chatViewTabIds.threads,
4497
- isActive,
4498
- onClick: () => setActiveChatView("threads"),
4499
- onPointerDown: () => setActiveChatView("threads"),
4500
- tabIndex: 0,
4501
- text: t("Threads"),
4502
- children: /* @__PURE__ */ jsxRuntime.jsx(UnreadCountBadge, { count: unreadThreadCount, position: "top-right", children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(IconThreadFill, {}) : /* @__PURE__ */ jsxRuntime.jsx(IconThread, {}) })
4503
- }
4504
- );
4505
- };
4506
- const defaultChatViewSelectorItemSet = [
4507
- {
4508
- Component: ChatViewChannelsSelectorButton,
4509
- type: "channels"
4510
- },
4511
- {
4512
- Component: ChatViewThreadsSelectorButton,
4513
- type: "threads"
4514
- }
4515
- ];
4516
- const ChatViewSelector = ({
4517
- iconOnly = true,
4518
- itemSet = defaultChatViewSelectorItemSet
4519
- }) => {
4520
- const { t } = useTranslationContext();
4521
- return /* @__PURE__ */ jsxRuntime.jsx(
4522
- "div",
4523
- {
4524
- "aria-label": t("aria/Chat view tabs"),
4525
- className: "str-chat__chat-view__selector",
4526
- role: "tablist",
4527
- children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsxRuntime.jsx(Component, { iconOnly }, type))
4528
- }
4529
- );
4530
- };
4531
- ChatView.Channels = ChannelsView;
4532
- ChatView.Threads = ThreadsView;
4533
- ChatView.ThreadAdapter = ThreadAdapter;
4534
- ChatView.Selector = ChatViewSelector;
4535
- const useNotificationTarget = () => {
4536
- const chatViewContext = React.useContext(ChatViewContext);
4537
- const { channels } = useChannelListContext();
4538
- const { channel } = useChannelStateContext();
4539
- const threadInstance = useThreadContext();
4540
- const { legacyThread } = useLegacyThreadContext();
4541
- if (threadInstance || legacyThread) return "thread";
4542
- if (channel) return "channel";
4543
- if (chatViewContext?.activeChatView === "threads") return "thread-list";
4544
- if (channels) return "channel-list";
4545
- return void 0;
4546
- };
4547
- const SYSTEM_NOTIFICATION_TAG = "system";
4548
- const hasSystemNotificationTag = (notification) => notification.tags?.includes(SYSTEM_NOTIFICATION_TAG) ?? false;
4549
- const getTargetTags = (targetPanels, inferredPanel, tags) => {
4550
- if (targetPanels) {
4551
- return Array.from(
4552
- /* @__PURE__ */ new Set([...targetPanels.map(getNotificationTargetTag), ...tags ?? []])
4553
- );
4554
- }
4555
- return addNotificationTargetTag(inferredPanel, tags);
4556
- };
4557
- const getTypeFromIncident = ({
4558
- incident,
4559
- severity,
4560
- type
4561
- }) => {
4562
- if (type) return type;
4563
- if (!incident) return void 0;
4564
- const status = incident.status ?? (severity === "error" ? "failed" : severity === "success" ? "success" : severity);
4565
- return [incident.domain, incident.entity, incident.operation, status].filter((segment) => !!segment).join(":");
4566
- };
4567
- const useNotificationApi = () => {
4568
- const { client } = useChatContext();
4569
- const inferredPanel = useNotificationTarget();
4570
- const addNotification = React.useCallback(
4571
- ({
4572
- actions,
4573
- context,
4574
- duration,
4575
- emitter,
4576
- error,
4577
- incident,
4578
- message,
4579
- severity,
4580
- tags,
4581
- targetPanels,
4582
- type
4583
- }) => {
4584
- const notificationTags = getTargetTags(targetPanels, inferredPanel, tags);
4585
- const resolvedType = getTypeFromIncident({ incident, severity, type });
4586
- const origin = context ? { context, emitter } : { emitter };
4587
- const options = {
4588
- ...actions ? { actions } : {},
4589
- ...typeof duration === "number" ? { duration } : {},
4590
- ...error ? { originalError: error } : {},
4591
- ...notificationTags.length > 0 ? { tags: notificationTags } : {},
4592
- ...severity ? { severity } : {},
4593
- ...resolvedType ? { type: resolvedType } : {}
4594
- };
4595
- client.notifications.add({
4596
- message,
4597
- options,
4598
- origin
4599
- });
4600
- },
4601
- [client, inferredPanel]
4602
- );
4603
- const addSystemNotification = React.useCallback(
4604
- ({
4605
- actions,
4606
- context,
4607
- duration,
4608
- emitter,
4609
- error,
4610
- incident,
4611
- message,
4612
- severity,
4613
- tags,
4614
- type
4615
- }) => {
4616
- const notificationTags = Array.from(
4617
- /* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []])
4618
- );
4619
- const resolvedType = getTypeFromIncident({ incident, severity, type });
4620
- const origin = context ? { context, emitter } : { emitter };
4621
- const options = {
4622
- ...actions ? { actions } : {},
4623
- ...typeof duration === "number" ? { duration } : {},
4624
- ...error ? { originalError: error } : {},
4625
- ...notificationTags.length > 0 ? { tags: notificationTags } : {},
4626
- ...severity ? { severity } : {},
4627
- ...resolvedType ? { type: resolvedType } : {}
4628
- };
4629
- return client.notifications.add({
4630
- message,
4631
- options,
4632
- origin
4633
- });
4634
- },
4635
- [client]
4636
- );
4637
- const removeNotification = React.useCallback(
4638
- (id) => {
4639
- client.notifications.remove(id);
4640
- },
4641
- [client]
4642
- );
4643
- const startNotificationTimeout = React.useCallback(
4644
- (id) => {
4645
- client.notifications.startTimeout(id);
4646
- },
4647
- [client]
4648
- );
4649
- return {
4650
- addNotification,
4651
- addSystemNotification,
4652
- removeNotification,
4653
- startNotificationTimeout
4654
- };
4655
- };
4656
- exports.ACTIONS_NOT_WORKING_IN_THREAD = ACTIONS_NOT_WORKING_IN_THREAD;
4657
- exports.AudioPlayer = AudioPlayer;
4658
- exports.Button = Button;
4659
- exports.CHANNEL_CONTAINER_ID = CHANNEL_CONTAINER_ID;
4660
- exports.Channel = Channel;
4661
- exports.ChannelActionContext = ChannelActionContext;
4662
- exports.ChannelActionProvider = ChannelActionProvider;
4663
- exports.ChannelListContext = ChannelListContext;
4664
- exports.ChannelListContextProvider = ChannelListContextProvider;
4665
- exports.ChannelStateContext = ChannelStateContext;
4666
- exports.ChannelStateProvider = ChannelStateProvider;
4667
- exports.ChatContext = ChatContext;
4668
- exports.ChatProvider = ChatProvider;
4669
- exports.ChatView = ChatView;
4670
- exports.ChatViewChannelsSelectorButton = ChatViewChannelsSelectorButton;
4671
- exports.ChatViewContext = ChatViewContext;
4672
- exports.ChatViewSelectorButton = ChatViewSelectorButton;
4673
- exports.ChatViewThreadsSelectorButton = ChatViewThreadsSelectorButton;
4674
- exports.ComponentContext = ComponentContext;
4675
- exports.ComponentProvider = ComponentProvider;
4676
- exports.DEFAULT_JUMP_TO_PAGE_SIZE = DEFAULT_JUMP_TO_PAGE_SIZE;
4677
- exports.DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD;
4678
- exports.DEFAULT_NEXT_CHANNEL_PAGE_SIZE = DEFAULT_NEXT_CHANNEL_PAGE_SIZE;
4679
- exports.EmptyStateIndicator = EmptyStateIndicator;
4680
- exports.IconArchive = IconArchive;
4681
- exports.IconArrowDown = IconArrowDown;
4682
- exports.IconArrowDownCircle = IconArrowDownCircle;
4683
- exports.IconArrowLeft = IconArrowLeft;
4684
- exports.IconArrowUp = IconArrowUp;
4685
- exports.IconArrowUpRight = IconArrowUpRight;
4686
- exports.IconAttachment = IconAttachment;
4687
- exports.IconAudio = IconAudio;
4688
- exports.IconBell = IconBell;
4689
- exports.IconBellOff = IconBellOff;
4690
- exports.IconBolt = IconBolt;
4691
- exports.IconBookmark = IconBookmark;
4692
- exports.IconBookmarkRemove = IconBookmarkRemove;
4693
- exports.IconCamera = IconCamera;
4694
- exports.IconCheckmark = IconCheckmark;
4695
- exports.IconCheckmark1Small = IconCheckmark1Small;
4696
- exports.IconChecks = IconChecks;
4697
- exports.IconChevronDown = IconChevronDown;
4698
- exports.IconChevronLeft = IconChevronLeft;
4699
- exports.IconChevronRight = IconChevronRight;
4700
- exports.IconClock = IconClock;
4701
- exports.IconCommand = IconCommand;
4702
- exports.IconCopy = IconCopy;
4703
- exports.IconDelete = IconDelete;
4704
- exports.IconDownload = IconDownload;
4705
- exports.IconEdit = IconEdit;
4706
- exports.IconEmoji = IconEmoji;
4707
- exports.IconEmojiAdd = IconEmojiAdd;
4708
- exports.IconExclamationCircleFill = IconExclamationCircleFill;
4709
- exports.IconExclamationMark = IconExclamationMark;
4710
- exports.IconExclamationMarkFill = IconExclamationMarkFill;
4711
- exports.IconExclamationTriangleFill = IconExclamationTriangleFill;
4712
- exports.IconEyeFill = IconEyeFill;
4713
- exports.IconFile = IconFile;
4714
- exports.IconFlag = IconFlag;
4715
- exports.IconGiphy = IconGiphy;
4716
- exports.IconImage = IconImage;
4717
- exports.IconLeave = IconLeave;
4718
- exports.IconLink = IconLink;
4719
- exports.IconLoading = IconLoading;
4720
- exports.IconLocation = IconLocation;
4721
- exports.IconMessageBubble = IconMessageBubble;
4722
- exports.IconMessageBubbleFill = IconMessageBubbleFill;
4723
- exports.IconMessageBubbles = IconMessageBubbles;
4724
- exports.IconMicrophoneSolid = IconMicrophoneSolid;
4725
- exports.IconMinus = IconMinus;
4726
- exports.IconMinusCircle = IconMinusCircle;
4727
- exports.IconMore = IconMore;
4728
- exports.IconMute = IconMute;
4729
- exports.IconNoSign = IconNoSign;
4730
- exports.IconNotification = IconNotification;
4731
- exports.IconPauseFill = IconPauseFill;
4732
- exports.IconPin = IconPin;
4733
- exports.IconPlayFill = IconPlayFill;
4734
- exports.IconPlus = IconPlus;
4735
- exports.IconPlusSmall = IconPlusSmall;
4736
- exports.IconPoll = IconPoll;
4737
- exports.IconQuote = IconQuote;
4738
- exports.IconRefresh = IconRefresh;
4739
- exports.IconReorder = IconReorder;
4740
- exports.IconReply = IconReply;
4741
- exports.IconRetry = IconRetry;
4742
- exports.IconSearch = IconSearch;
4743
- exports.IconSend = IconSend;
4744
- exports.IconThread = IconThread;
4745
- exports.IconThreadFill = IconThreadFill;
4746
- exports.IconTranslate = IconTranslate;
4747
- exports.IconTrophy = IconTrophy;
4748
- exports.IconUnpin = IconUnpin;
4749
- exports.IconUnsupportedAttachment = IconUnsupportedAttachment;
4750
- exports.IconUpload = IconUpload;
4751
- exports.IconUser = IconUser;
4752
- exports.IconUserAdd = IconUserAdd;
4753
- exports.IconUserCheck = IconUserCheck;
4754
- exports.IconUserRemove = IconUserRemove;
4755
- exports.IconVideo = IconVideo;
4756
- exports.IconVideoFill = IconVideoFill;
4757
- exports.IconVoice = IconVoice;
4758
- exports.IconXCircle = IconXCircle;
4759
- exports.IconXmark = IconXmark;
4760
- exports.IconXmarkSmall = IconXmarkSmall;
4761
- exports.LegacyThreadContext = LegacyThreadContext;
4762
- exports.LoadingChannel = LoadingChannel;
4763
- exports.LoadingErrorIndicator = LoadingErrorIndicator;
4764
- exports.LocalizedFormat = LocalizedFormat;
4765
- exports.MESSAGE_ACTIONS = MESSAGE_ACTIONS;
4766
- exports.MessageComposerContext = MessageComposerContext;
4767
- exports.MessageComposerContextProvider = MessageComposerContextProvider;
4768
- exports.OPTIONAL_MESSAGE_ACTIONS = OPTIONAL_MESSAGE_ACTIONS;
4769
- exports.SYSTEM_NOTIFICATION_TAG = SYSTEM_NOTIFICATION_TAG;
4770
- exports.ThreadContext = ThreadContext;
4771
- exports.ThreadProvider = ThreadProvider;
4772
- exports.TranslationContext = TranslationContext;
4773
- exports.TranslationProvider = TranslationProvider;
4774
- exports.TypingContext = TypingContext;
4775
- exports.TypingProvider = TypingProvider;
4776
- exports.WithAudioPlayback = WithAudioPlayback;
4777
- exports.addNotificationTargetTag = addNotificationTargetTag;
4778
- exports.areMessagePropsEqual = areMessagePropsEqual;
4779
- exports.areMessageUIPropsEqual = areMessageUIPropsEqual;
4780
- exports.calendar = calendar;
4781
- exports.countEmojis = countEmojis;
4782
- exports.createIcon = createIcon;
4783
- exports.defaultChatViewSelectorItemSet = defaultChatViewSelectorItemSet;
4784
- exports.defaultDateTimeParser = defaultDateTimeParser;
4785
- exports.defaultRegisterAudioPlayerError = defaultRegisterAudioPlayerError;
4786
- exports.defaultTranslatorFunction = defaultTranslatorFunction;
4787
- exports.elementIsPlaying = elementIsPlaying;
4788
- exports.getChannel = getChannel;
4789
- exports.getDateString = getDateString;
4790
- exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
4791
- exports.getGroupStyles = getGroupStyles;
4792
- exports.getImages = getImages;
4793
- exports.getIsFirstUnreadMessage = getIsFirstUnreadMessage;
4794
- exports.getLastReceived = getLastReceived;
4795
- exports.getMessageActions = getMessageActions;
4796
- exports.getNonImageAttachments = getNonImageAttachments;
4797
- exports.getNotificationTargetPanel = getNotificationTargetPanel;
4798
- exports.getNotificationTargetPanels = getNotificationTargetPanels;
4799
- exports.getNotificationTargetTag = getNotificationTargetTag;
4800
- exports.getReadByTooltipText = getReadByTooltipText;
4801
- exports.hasMoreMessagesProbably = hasMoreMessagesProbably;
4802
- exports.hasSystemNotificationTag = hasSystemNotificationTag;
4803
- exports.insertIntro = insertIntro;
4804
- exports.isDate = isDate;
4805
- exports.isDateSeparatorMessage = isDateSeparatorMessage;
4806
- exports.isDayOrMoment = isDayOrMoment;
4807
- exports.isIntroMessage = isIntroMessage;
4808
- exports.isLanguageSupported = isLanguageSupported;
4809
- exports.isLocalMessage = isLocalMessage;
4810
- exports.isMessageBlocked = isMessageBlocked;
4811
- exports.isMessageBounced = isMessageBounced;
4812
- exports.isMessageDeleted = isMessageDeleted;
4813
- exports.isMessageEdited = isMessageEdited;
4814
- exports.isMessageErrorRetryable = isMessageErrorRetryable;
4815
- exports.isNetworkSendFailure = isNetworkSendFailure;
4816
- exports.isNotificationForPanel = isNotificationForPanel;
4817
- exports.isNotificationTargetPanel = isNotificationTargetPanel;
4818
- exports.isNumberOrString = isNumberOrString;
4819
- exports.isUserMuted = isUserMuted;
4820
- exports.makeDateMessageId = makeDateMessageId;
4821
- exports.makeIntroMessage = makeIntroMessage;
4822
- exports.mapToUserNameOrId = mapToUserNameOrId;
4823
- exports.messageHasAttachments = messageHasAttachments;
4824
- exports.messageHasGiphyAttachment = messageHasGiphyAttachment;
4825
- exports.messageHasQuotedMessage = messageHasQuotedMessage;
4826
- exports.messageHasReactions = messageHasReactions;
4827
- exports.messageHasSingleAttachment = messageHasSingleAttachment;
4828
- exports.messageTextHasEmojisOnly = messageTextHasEmojisOnly;
4829
- exports.predefinedFormatters = predefinedFormatters;
4830
- exports.processMessages = processMessages;
4831
- exports.useActiveAudioPlayer = useActiveAudioPlayer;
4832
- exports.useActiveThread = useActiveThread;
4833
- exports.useAudioPlayer = useAudioPlayer;
4834
- exports.useChannelActionContext = useChannelActionContext;
4835
- exports.useChannelListContext = useChannelListContext;
4836
- exports.useChannelStateContext = useChannelStateContext;
4837
- exports.useChatContext = useChatContext;
4838
- exports.useChatViewContext = useChatViewContext;
4839
- exports.useComponentContext = useComponentContext;
4840
- exports.useEditMessageHandler = useEditMessageHandler;
4841
- exports.useIsCooldownActive = useIsCooldownActive;
4842
- exports.useLegacyThreadContext = useLegacyThreadContext;
4843
- exports.useMentionsHandlers = useMentionsHandlers;
4844
- exports.useMessageComposerContext = useMessageComposerContext;
4845
- exports.useMessageComposerController = useMessageComposerController;
4846
- exports.useNotificationApi = useNotificationApi;
4847
- exports.useNotificationTarget = useNotificationTarget;
4848
- exports.usePopoverPosition = usePopoverPosition;
4849
- exports.useStateStore = useStateStore;
4850
- exports.useThreadContext = useThreadContext;
4851
- exports.useThreadsViewContext = useThreadsViewContext;
4852
- exports.useTranslationContext = useTranslationContext;
4853
- exports.useTypingContext = useTypingContext;
4854
- exports.validateAndGetMessage = validateAndGetMessage;
4855
- //# sourceMappingURL=useNotificationApi.f2c7704d.js.map