stream-chat-react 14.4.1 → 14.6.0

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 (218) hide show
  1. package/dist/cjs/{ReactPlayerWrapper.16cd6fed.js → ReactPlayerWrapper.30240f76.js} +2 -2
  2. package/dist/cjs/{ReactPlayerWrapper.16cd6fed.js.map → ReactPlayerWrapper.30240f76.js.map} +1 -1
  3. package/dist/cjs/channel-detail.js +3007 -0
  4. package/dist/cjs/channel-detail.js.map +1 -0
  5. package/dist/cjs/emojis.js +5 -4
  6. package/dist/cjs/emojis.js.map +1 -1
  7. package/dist/cjs/index.js +2273 -4163
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/useChannelHeaderOnlineStatus.6546ac83.js +4143 -0
  10. package/dist/cjs/useChannelHeaderOnlineStatus.6546ac83.js.map +1 -0
  11. package/dist/cjs/useMessageComposerController.c0dad9bc.js +99 -0
  12. package/dist/cjs/useMessageComposerController.c0dad9bc.js.map +1 -0
  13. package/dist/cjs/{useNotificationApi.9ffe5761.js → useNotificationApi.eb753f31.js} +156 -168
  14. package/dist/cjs/useNotificationApi.eb753f31.js.map +1 -0
  15. package/dist/css/channel-detail.css +825 -0
  16. package/dist/css/channel-detail.css.map +1 -0
  17. package/dist/css/index.css +297 -31
  18. package/dist/css/index.css.map +1 -1
  19. package/dist/es/channel-detail.mjs +2950 -0
  20. package/dist/es/channel-detail.mjs.map +1 -0
  21. package/dist/es/emojis.mjs +2 -1
  22. package/dist/es/emojis.mjs.map +1 -1
  23. package/dist/es/index.mjs +1859 -3774
  24. package/dist/es/index.mjs.map +1 -1
  25. package/dist/es/useChannelHeaderOnlineStatus.c5215b13.mjs +3600 -0
  26. package/dist/es/useChannelHeaderOnlineStatus.c5215b13.mjs.map +1 -0
  27. package/dist/es/useMessageComposerController.29f189b4.mjs +69 -0
  28. package/dist/es/useMessageComposerController.29f189b4.mjs.map +1 -0
  29. package/dist/es/{useNotificationApi.88c33caa.mjs → useNotificationApi.fa5cddf9.mjs} +123 -141
  30. package/dist/es/useNotificationApi.fa5cddf9.mjs.map +1 -0
  31. package/dist/types/components/AudioPlayback/components/index.d.ts +1 -0
  32. package/dist/types/components/AudioPlayback/components/index.d.ts.map +1 -1
  33. package/dist/types/components/Avatar/Avatar.d.ts +4 -2
  34. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  35. package/dist/types/components/Avatar/ChannelAvatar.d.ts.map +1 -1
  36. package/dist/types/components/Channel/hooks/useMentionsHandlers.d.ts +8 -3
  37. package/dist/types/components/Channel/hooks/useMentionsHandlers.d.ts.map +1 -1
  38. package/dist/types/components/ChannelHeader/hooks/useChannelHasMembersOnline.d.ts +7 -0
  39. package/dist/types/components/ChannelHeader/hooks/useChannelHasMembersOnline.d.ts.map +1 -0
  40. package/dist/types/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.d.ts +6 -1
  41. package/dist/types/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.d.ts.map +1 -1
  42. package/dist/types/components/ChannelListItem/hooks/index.d.ts +1 -0
  43. package/dist/types/components/ChannelListItem/hooks/index.d.ts.map +1 -1
  44. package/dist/types/components/ChannelListItem/hooks/useChannelPreviewInfo.d.ts.map +1 -1
  45. package/dist/types/components/ChannelListItem/hooks/useIsUserMuted.d.ts +2 -0
  46. package/dist/types/components/ChannelListItem/hooks/useIsUserMuted.d.ts.map +1 -0
  47. package/dist/types/components/Chat/Chat.d.ts.map +1 -1
  48. package/dist/types/components/Dialog/components/Prompt.d.ts +7 -4
  49. package/dist/types/components/Dialog/components/Prompt.d.ts.map +1 -1
  50. package/dist/types/components/Dialog/service/DialogPortal.d.ts +5 -1
  51. package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
  52. package/dist/types/components/FileIcon/iconMap.d.ts.map +1 -1
  53. package/dist/types/components/Form/Checkbox.d.ts +8 -0
  54. package/dist/types/components/Form/Checkbox.d.ts.map +1 -0
  55. package/dist/types/components/Form/SwitchField.d.ts +6 -0
  56. package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
  57. package/dist/types/components/Form/index.d.ts +1 -0
  58. package/dist/types/components/Form/index.d.ts.map +1 -1
  59. package/dist/types/components/Icons/icons.d.ts +24 -0
  60. package/dist/types/components/Icons/icons.d.ts.map +1 -1
  61. package/dist/types/components/InfiniteScrollPaginator/index.d.ts +1 -0
  62. package/dist/types/components/InfiniteScrollPaginator/index.d.ts.map +1 -1
  63. package/dist/types/components/ListItemLayout/ListItemLayout.d.ts +34 -0
  64. package/dist/types/components/ListItemLayout/ListItemLayout.d.ts.map +1 -0
  65. package/dist/types/components/ListItemLayout/index.d.ts +2 -0
  66. package/dist/types/components/ListItemLayout/index.d.ts.map +1 -0
  67. package/dist/types/components/MediaRecorder/classes/MediaRecorderController.d.ts.map +1 -1
  68. package/dist/types/components/Message/MessageText.d.ts.map +1 -1
  69. package/dist/types/components/Message/hooks/useMentionsHandler.d.ts +6 -1
  70. package/dist/types/components/Message/hooks/useMentionsHandler.d.ts.map +1 -1
  71. package/dist/types/components/Message/hooks/useMessageTextStreaming.d.ts +1 -1
  72. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts +1 -1
  73. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts.map +1 -1
  74. package/dist/types/components/Message/renderText/componentRenderers/Mention.d.ts +22 -4
  75. package/dist/types/components/Message/renderText/componentRenderers/Mention.d.ts.map +1 -1
  76. package/dist/types/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +44 -3
  77. package/dist/types/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts.map +1 -1
  78. package/dist/types/components/Message/renderText/renderText.d.ts +25 -3
  79. package/dist/types/components/Message/renderText/renderText.d.ts.map +1 -1
  80. package/dist/types/components/Message/types.d.ts +2 -3
  81. package/dist/types/components/Message/types.d.ts.map +1 -1
  82. package/dist/types/components/MessageComposer/QuotedMessagePreview.d.ts.map +1 -1
  83. package/dist/types/components/MessageComposer/hooks/useMessageComposerController.d.ts.map +1 -1
  84. package/dist/types/components/Modal/GlobalModal.d.ts +3 -1
  85. package/dist/types/components/Modal/GlobalModal.d.ts.map +1 -1
  86. package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -1
  87. package/dist/types/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts.map +1 -1
  88. package/dist/types/components/Poll/PollOptionSelector.d.ts +0 -4
  89. package/dist/types/components/Poll/PollOptionSelector.d.ts.map +1 -1
  90. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.d.ts +5 -0
  91. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.d.ts.map +1 -0
  92. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/MentionItem.d.ts +17 -0
  93. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/MentionItem.d.ts.map +1 -0
  94. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/MentionSuggestionTitle.d.ts +6 -0
  95. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/MentionSuggestionTitle.d.ts.map +1 -0
  96. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.d.ts +5 -0
  97. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.d.ts.map +1 -0
  98. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/SpecialMentionItem.d.ts +10 -0
  99. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/SpecialMentionItem.d.ts.map +1 -0
  100. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.d.ts +5 -0
  101. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.d.ts.map +1 -0
  102. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserItem.d.ts +17 -0
  103. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserItem.d.ts.map +1 -0
  104. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/index.d.ts +8 -0
  105. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/index.d.ts.map +1 -0
  106. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/types.d.ts +6 -0
  107. package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/types.d.ts.map +1 -0
  108. package/dist/types/components/TextareaComposer/SuggestionList/SuggestionList.d.ts.map +1 -1
  109. package/dist/types/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +2 -2
  110. package/dist/types/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts.map +1 -1
  111. package/dist/types/components/TextareaComposer/SuggestionList/TokenizedSuggestionParts.d.ts +9 -0
  112. package/dist/types/components/TextareaComposer/SuggestionList/TokenizedSuggestionParts.d.ts.map +1 -0
  113. package/dist/types/components/TextareaComposer/SuggestionList/index.d.ts +2 -1
  114. package/dist/types/components/TextareaComposer/SuggestionList/index.d.ts.map +1 -1
  115. package/dist/types/components/TextareaComposer/TextareaComposer.d.ts.map +1 -1
  116. package/dist/types/components/index.d.ts +1 -0
  117. package/dist/types/components/index.d.ts.map +1 -1
  118. package/dist/types/context/DialogManagerContext.d.ts +3 -1
  119. package/dist/types/context/DialogManagerContext.d.ts.map +1 -1
  120. package/dist/types/context/MessageContext.d.ts +3 -3
  121. package/dist/types/context/MessageContext.d.ts.map +1 -1
  122. package/dist/types/i18n/Streami18n.d.ts +105 -1
  123. package/dist/types/i18n/Streami18n.d.ts.map +1 -1
  124. package/dist/types/plugins/ChannelDetail/AvatarWithChannelDetail.d.ts +9 -0
  125. package/dist/types/plugins/ChannelDetail/AvatarWithChannelDetail.d.ts.map +1 -0
  126. package/dist/types/plugins/ChannelDetail/ChannelDetail.d.ts +14 -0
  127. package/dist/types/plugins/ChannelDetail/ChannelDetail.d.ts.map +1 -0
  128. package/dist/types/plugins/ChannelDetail/ChannelDetailContext.d.ts +11 -0
  129. package/dist/types/plugins/ChannelDetail/ChannelDetailContext.d.ts.map +1 -0
  130. package/dist/types/plugins/ChannelDetail/ChannelDetailEmptyList.d.ts +3 -0
  131. package/dist/types/plugins/ChannelDetail/ChannelDetailEmptyList.d.ts.map +1 -0
  132. package/dist/types/plugins/ChannelDetail/ChannelDetailListLoadingIndicator.d.ts +6 -0
  133. package/dist/types/plugins/ChannelDetail/ChannelDetailListLoadingIndicator.d.ts.map +1 -0
  134. package/dist/types/plugins/ChannelDetail/ChannelDetailNavButton.d.ts +15 -0
  135. package/dist/types/plugins/ChannelDetail/ChannelDetailNavButton.d.ts.map +1 -0
  136. package/dist/types/plugins/ChannelDetail/ChannelDetailSearchInput.d.ts +8 -0
  137. package/dist/types/plugins/ChannelDetail/ChannelDetailSearchInput.d.ts.map +1 -0
  138. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigator.d.ts +52 -0
  139. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigator.d.ts.map +1 -0
  140. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.d.ts +11 -0
  141. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.d.ts.map +1 -0
  142. package/dist/types/plugins/ChannelDetail/SectionNavigator/index.d.ts +3 -0
  143. package/dist/types/plugins/ChannelDetail/SectionNavigator/index.d.ts.map +1 -0
  144. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.d.ts +2 -0
  145. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.d.ts.map +1 -0
  146. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.d.ts +5 -0
  147. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.d.ts.map +1 -0
  148. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.utils.d.ts +40 -0
  149. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.utils.d.ts.map +1 -0
  150. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/index.d.ts +5 -0
  151. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/index.d.ts.map +1 -0
  152. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/useChannelFilesSearch.d.ts +10 -0
  153. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/useChannelFilesSearch.d.ts.map +1 -0
  154. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.d.ts +16 -0
  155. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.d.ts.map +1 -0
  156. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.d.ts +20 -0
  157. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.d.ts.map +1 -0
  158. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/index.d.ts +3 -0
  159. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/index.d.ts.map +1 -0
  160. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.d.ts +2 -0
  161. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.d.ts.map +1 -0
  162. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts +8 -0
  163. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts.map +1 -0
  164. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.utils.d.ts +22 -0
  165. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.utils.d.ts.map +1 -0
  166. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/index.d.ts +5 -0
  167. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/index.d.ts.map +1 -0
  168. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/useChannelMediaSearch.d.ts +9 -0
  169. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/useChannelMediaSearch.d.ts.map +1 -0
  170. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.d.ts +26 -0
  171. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.d.ts.map +1 -0
  172. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberDetail.d.ts +12 -0
  173. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberDetail.d.ts.map +1 -0
  174. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/index.d.ts +3 -0
  175. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/index.d.ts.map +1 -0
  176. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.d.ts +7 -0
  177. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.d.ts.map +1 -0
  178. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.d.ts +6 -0
  179. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.d.ts.map +1 -0
  180. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.d.ts +45 -0
  181. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.d.ts.map +1 -0
  182. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.d.ts +46 -0
  183. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.d.ts.map +1 -0
  184. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.utils.d.ts +8 -0
  185. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.utils.d.ts.map +1 -0
  186. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/index.d.ts +6 -0
  187. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/index.d.ts.map +1 -0
  188. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberCount.d.ts +4 -0
  189. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberCount.d.ts.map +1 -0
  190. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberIds.d.ts +4 -0
  191. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberIds.d.ts.map +1 -0
  192. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMembersSearch.d.ts +12 -0
  193. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMembersSearch.d.ts.map +1 -0
  194. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.d.ts +2 -0
  195. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.d.ts.map +1 -0
  196. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts +9 -0
  197. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts.map +1 -0
  198. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/index.d.ts +4 -0
  199. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/index.d.ts.map +1 -0
  200. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesCount.d.ts +4 -0
  201. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesCount.d.ts.map +1 -0
  202. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesSearch.d.ts +16 -0
  203. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesSearch.d.ts.map +1 -0
  204. package/dist/types/plugins/ChannelDetail/VirtualizedList/VirtualizedList.d.ts +28 -0
  205. package/dist/types/plugins/ChannelDetail/VirtualizedList/VirtualizedList.d.ts.map +1 -0
  206. package/dist/types/plugins/ChannelDetail/VirtualizedList/index.d.ts +2 -0
  207. package/dist/types/plugins/ChannelDetail/VirtualizedList/index.d.ts.map +1 -0
  208. package/dist/types/plugins/ChannelDetail/index.d.ts +16 -0
  209. package/dist/types/plugins/ChannelDetail/index.d.ts.map +1 -0
  210. package/dist/types/utils/index.d.ts +2 -0
  211. package/dist/types/utils/index.d.ts.map +1 -1
  212. package/dist/types/utils/isDmChannel.d.ts +6 -0
  213. package/dist/types/utils/isDmChannel.d.ts.map +1 -0
  214. package/package.json +13 -4
  215. package/dist/cjs/useNotificationApi.9ffe5761.js.map +0 -1
  216. package/dist/es/useNotificationApi.88c33caa.mjs.map +0 -1
  217. package/dist/types/components/TextareaComposer/SuggestionList/UserItem.d.ts +0 -25
  218. package/dist/types/components/TextareaComposer/SuggestionList/UserItem.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChannelHeaderOnlineStatus.6546ac83.js","names":[],"sources":["../../src/context/MessageContext.tsx","../../src/context/MessageTranslationViewContext.tsx","../../src/context/ModalContext.tsx","../../src/components/Notifications/NotificationConfigurationContext.tsx","../../src/components/Notifications/hooks/useNotifications.ts","../../src/components/Loading/LoadingIndicator.tsx","../../src/components/MessageComposer/hooks/utils.ts","../../src/components/Attachment/components/FileSizeIndicator.tsx","../../src/utils/useStableCallback.ts","../../src/a11y/hooks/useAriaIdentifiers.ts","../../src/components/Dialog/components/Alert.tsx","../../src/components/Dialog/service/DialogAnchor.tsx","../../src/components/Avatar/Avatar.tsx","../../src/components/Badge/Badge.tsx","../../src/components/Avatar/ChannelAvatar.tsx","../../src/components/Avatar/GroupAvatar.tsx","../../src/a11y/a11yUtils.ts","../../src/components/Dialog/components/ContextMenu.tsx","../../src/components/Dialog/components/Prompt.tsx","../../src/a11y/hooks/useResolvedModalAriaProps.ts","../../src/components/Modal/GlobalModal.tsx","../../src/components/Message/renderText/remarkPlugins/htmlToTextPlugin.ts","../../src/components/Message/renderText/remarkPlugins/imageToLink.ts","../../src/components/Message/renderText/remarkPlugins/plusPlusToEmphasis.ts","../../src/components/Message/Timestamp.tsx","../../src/components/Message/MessageTimestamp.tsx","../../src/components/Attachment/components/DownloadButton.tsx","../../src/components/FileIcon/FileIconSet.tsx","../../src/components/FileIcon/mimeTypes.ts","../../src/components/FileIcon/iconMap.ts","../../src/components/FileIcon/FileIcon.tsx","../../src/components/AudioPlayback/components/formatTime.ts","../../src/components/BaseImage/ImagePlaceholder.tsx","../../src/components/BaseImage/BaseImage.tsx","../../src/components/BaseImage/toBaseImageDescriptors.ts","../../src/components/Gallery/GalleryContext.tsx","../../src/components/Gallery/GalleryHeader.tsx","../../src/components/VideoPlayer/VideoPlayer.tsx","../../src/components/VideoPlayer/VideoThumbnail.tsx","../../src/components/Gallery/GalleryUI.tsx","../../src/components/Gallery/Gallery.tsx","../../src/components/Form/SwitchField.tsx","../../src/components/Form/Checkbox.tsx","../../src/components/Form/TextInput.tsx","../../src/components/ListItemLayout/ListItemLayout.tsx","../../src/components/ChannelListItem/utils.tsx","../../src/components/ChannelListItem/hooks/useChannelDisplayName.ts","../../src/components/ChannelListItem/hooks/useChannelPreviewInfo.ts","../../src/utils/isDmChannel.ts","../../src/components/ChannelList/hooks/useSelectedChannelState.ts","../../src/components/ChannelList/hooks/useChannelMembershipState.ts","../../src/components/ChannelListItem/hooks/useIsChannelMuted.ts","../../src/components/ChannelListItem/hooks/useIsUserMuted.ts","../../src/components/Notifications/Notification.tsx","../../src/components/Notifications/NotificationList.tsx","../../src/components/ChannelHeader/hooks/useChannelHasMembersOnline.ts","../../src/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport React, { useContext } from 'react';\n\nimport type {\n DeleteMessageOptions,\n LocalMessage,\n Mute,\n ReactionResponse,\n ReactionSort,\n UserResponse,\n} from 'stream-chat';\n\nimport type { ChannelActionContextValue } from './ChannelActionContext';\n\nimport type { ActionHandlerReturnType } from '../components/Message/hooks/useActionHandler';\nimport type { ReactEventHandler } from '../components/Message/types';\nimport type { MessageActionsArray } from '../components/Message/utils';\nimport type { GroupStyle } from '../components/MessageList/utils';\nimport type { ReactionsComparator, ReactionType } from '../components/Reactions/types';\n\nimport type { RenderTextFunction } from '../components/Message/renderText';\n\nexport type MessageContextValue = {\n /** If actions such as edit, delete, flag, mute are enabled on Message */\n actionsEnabled: boolean;\n /**\n * Returns all allowed actions on message by current user e.g., ['edit', 'delete', 'flag', 'mute', 'pin', 'quote', 'react', 'reply'].\n * Please check [Message](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message.tsx) component for default implementation.\n */\n getMessageActions: () => MessageActionsArray<string>;\n /** Function to send an action in a Channel */\n handleAction: ActionHandlerReturnType;\n /** Function to delete a message in a Channel */\n handleDelete: (options?: DeleteMessageOptions) => Promise<void> | void;\n /** Function to fetch the message reactions */\n handleFetchReactions: (\n reactionType?: ReactionType,\n sort?: ReactionSort,\n ) => Promise<Array<ReactionResponse>>;\n /** Function to flag a message in a Channel */\n handleFlag: ReactEventHandler;\n /** Function to mark message and the messages that follow it as unread in a Channel */\n handleMarkUnread: ReactEventHandler;\n /** Function to mute a user in a Channel */\n handleMute: ReactEventHandler;\n /** Function to open a Thread on a Message */\n handleOpenThread: ReactEventHandler;\n /** Function to pin a Message in a Channel */\n handlePin: ReactEventHandler;\n /** Function to post a reaction on a Message */\n handleReaction: (\n reactionType: string,\n event: React.BaseSyntheticEvent,\n ) => Promise<void>;\n /** Function to retry sending a Message */\n handleRetry: ChannelActionContextValue['retrySendMessage'];\n /** Function that returns whether the Message belongs to the current user */\n isMyMessage: () => boolean;\n /** The message object */\n message: LocalMessage;\n /** Indicates whether a message has not been read yet or has been marked unread */\n messageIsUnread: boolean;\n /** Handler function for a click event on an @mention in Message */\n onMentionsClickMessage: ReactEventHandler;\n /** Handler function for a hover event on an @mention in Message */\n onMentionsHoverMessage: ReactEventHandler;\n /** Handler function for a click event on the user that posted the Message */\n onUserClick: ReactEventHandler;\n /** Handler function for a hover event on the user that posted the Message */\n onUserHover: ReactEventHandler;\n /** Call this function to keep message list scrolled to the bottom when the scroll height increases, e.g. an element appears below the last message (only used in the `VirtualizedMessageList`) */\n autoscrollToBottom?: () => void;\n /** Message component configuration prop. If true, picking a reaction from the `ReactionSelector` component will close the selector */\n closeReactionSelectorOnClick?: boolean;\n /** An array of user IDs that have confirmed the message delivery to their device */\n deliveredTo?: UserResponse[];\n /** If true, the message is the last one in a group sent by a specific user (only used in the `VirtualizedMessageList`) */\n endOfGroup?: boolean;\n /** If true, the message is the first one in a group sent by a specific user (only used in the `VirtualizedMessageList`) */\n firstOfGroup?: boolean;\n /** Override the default formatting of the date. This is a function that has access to the original date object, returns a string */\n formatDate?: (date: Date) => string;\n /** If true, group messages sent by each user (only used in the `VirtualizedMessageList`) */\n groupedByUser?: boolean;\n /** A list of styles to apply to this message, ie. top, bottom, single */\n groupStyles?: GroupStyle[];\n /** Whether to highlight and focus the message on load */\n highlighted?: boolean;\n /** Whether the threaded message is the first in the thread list */\n initialMessage?: boolean;\n /**\n * A factory function that determines whether a message is AI generated or not.\n */\n isMessageAIGenerated?: (message: LocalMessage) => boolean;\n /** Latest own message in currently displayed message set. */\n lastOwnMessage?: LocalMessage;\n /** Latest message id on current channel */\n lastReceivedId?: string | null;\n /** DOMRect object for parent MessageList component */\n messageListRect?: DOMRect;\n /** Array of muted users coming from [ChannelStateContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_state_context/#mutes) */\n mutes?: Mute[];\n /** Sort options to provide to a reactions query */\n reactionDetailsSort?: ReactionSort;\n /** A list of users that have read this Message */\n readBy?: UserResponse[];\n /** When set, shows the sender avatar in a grid layout. Values: true | 'incoming' | 'outgoing'. */\n showAvatar?: boolean | 'incoming' | 'outgoing';\n /** Custom function to render message text content, defaults to the renderText function: [utils](https://github.com/GetStream/stream-chat-react/blob/master/src/utils.tsx) */\n renderText?: RenderTextFunction;\n /** Keep track of read receipts for each message sent by the user. When disabled, only the last own message delivery / read status is rendered. */\n returnAllReadData?: boolean;\n /** Comparator function to sort reactions, defaults to chronological order */\n sortReactions?: ReactionsComparator;\n /** Whether or not the Message is in a Thread */\n threadList?: boolean;\n /** render HTML instead of markdown. Posting HTML is only allowed server-side */\n unsafeHTML?: boolean;\n /**\n * User-specific view for translated messages: which text to show.\n * - `'original'`: show `message.text` (source language).\n * - `'translated'`: show the translation for the **current user language** (from\n * `useTranslationContext().userLanguage`), i.e. `message.i18n[userLanguage + '_text']`\n * or fallback to `message.text` when missing. Resolved via `getTranslatedMessageText`.\n */\n translationView?: 'original' | 'translated';\n /** Set whether this message shows original or translated text (user-specific, does not change message data). */\n setTranslationView?: (view: 'original' | 'translated') => void;\n};\n\nexport const MessageContext = React.createContext<MessageContextValue | undefined>(\n undefined,\n);\n\nexport const MessageProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageContextValue;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _componentName?: string,\n) => {\n const contextValue = useContext(MessageContext);\n\n if (!contextValue) {\n return {} as MessageContextValue;\n }\n\n return contextValue as unknown as MessageContextValue;\n};\n","/**\n * Message translation view context: user-specific state for whether each message\n * shows original text or a translation.\n *\n * ## Spec\n *\n * - **State**: Per message list (channel vs thread), we store a map\n * `messageId → 'original' | 'translated'`. Default for messages with `message.i18n`\n * is `'translated'`; otherwise `'original'`.\n *\n * - **Provider placement**: The provider is tied to the **message list**, not the channel.\n * It is rendered inside `MessageList` and `VirtualizedMessageList`. That way the\n * main channel list and the thread list each have their own translation view state\n * (e.g. Thread.tsx gets correct behavior without sharing channel state).\n *\n * - **Multiple translations**: `message.i18n` can contain multiple languages, e.g.:\n * `{ en_text: \"Good morning\", fr_text: \"Bonjour\", it_text: \"Buongiorno\", language: \"en\" }`.\n * Which translation is shown is determined by the app’s **user language**\n * (`useTranslationContext().userLanguage`). We use `message.i18n[userLanguage + '_text']`;\n * if missing, we fall back to `message.text`. Only one translation is shown at a time.\n *\n * - **Source language**: When present, `message.i18n.language` is the original/source\n * language of `message.text`. It can be used for the indicator label, e.g.\n * \"Translated from English · View original\".\n *\n * - **Invariants**: The original message content, layout, grouping, and order stay\n * unchanged. Removing or toggling translation only changes the annotation and which\n * text is displayed. \"View original\" / \"View translation\" switch the displayed\n * text and update the annotation (e.g. \"Original · View translation\" when showing\n * original).\n *\n * - **Translation indicator visibility**: The translation indicator (e.g. \"Translated ·\n * View original\") is **not** shown when the currently viewed text already corresponds\n * to `userLanguage` — for example when viewing original and the original text is the\n * user-language version (i.e. `getTranslatedMessageText({ language: userLanguage, message })`\n * equals `message.text`). In that case there is no meaningful original/translated choice,\n * so the indicator is hidden.\n */\n\nimport React, { createContext, useCallback, useContext, useState } from 'react';\nimport type { LocalMessage, TranslationLanguages } from 'stream-chat';\n\n/**\n * Returns the translated message text for a given language from `message.i18n`, or\n * undefined if not present. Used to resolve which of the multiple translations to show.\n */\nexport const getTranslatedMessageText = ({\n language,\n message,\n}: {\n language: string;\n message?: LocalMessage;\n}): string | undefined =>\n message?.i18n?.[`${language}_text` as `${TranslationLanguages}_text`];\n\n/**\n * Which message text to show.\n * - `'original'`: `message.text` (source language).\n * - `'translated'`: translation for the **current user language** (TranslationContext’s\n * `userLanguage`), i.e. `getTranslatedMessageText({ language: userLanguage, message })`\n * or fallback to `message.text`.\n */\nexport type TranslationView = 'original' | 'translated';\n\nexport type MessageTranslationViewContextValue = {\n getTranslationView: (messageId: string, hasI18n: boolean) => TranslationView;\n setTranslationView: (messageId: string, view: TranslationView) => void;\n};\n\nconst defaultContextValue: MessageTranslationViewContextValue = {\n getTranslationView: (_messageId, hasI18n) => (hasI18n ? 'translated' : 'original'),\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setTranslationView: () => {},\n};\n\nexport const MessageTranslationViewContext =\n createContext<MessageTranslationViewContextValue>(defaultContextValue);\n\nexport const MessageTranslationViewProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const [viewByMessageId, setViewByMessageId] = useState<Record<string, TranslationView>>(\n {},\n );\n\n const setTranslationView = useCallback((messageId: string, view: TranslationView) => {\n setViewByMessageId((prev) => ({ ...prev, [messageId]: view }));\n }, []);\n\n const getTranslationView = useCallback(\n (messageId: string, hasI18n: boolean): TranslationView =>\n viewByMessageId[messageId] ?? (hasI18n ? 'translated' : 'original'),\n [viewByMessageId],\n );\n\n const stableValue = React.useMemo(\n () => ({ getTranslationView, setTranslationView }),\n [getTranslationView, setTranslationView],\n );\n\n return (\n <MessageTranslationViewContext.Provider value={stableValue}>\n {children}\n </MessageTranslationViewContext.Provider>\n );\n};\n\nexport const useMessageTranslationViewContext =\n (): MessageTranslationViewContextValue => {\n const context = useContext(MessageTranslationViewContext);\n return context ?? defaultContextValue;\n };\n","import type { PropsWithChildren } from 'react';\nimport React, { useContext } from 'react';\n\nexport type ModalContextValue = {\n close: () => void;\n dialogId?: string;\n};\n\nexport const ModalContext = React.createContext<ModalContextValue | undefined>(undefined);\n\nexport const ModalContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: ModalContextValue;\n}>) => <ModalContext.Provider value={value}>{children}</ModalContext.Provider>;\n\nexport const useModalContext = () => {\n const contextValue = useContext(ModalContext);\n\n if (!contextValue) {\n console.warn(\n `The useModalContext hook was called outside of the ModalContext provider. Make sure this hook is called within a child of the GlobalModal.`,\n );\n\n return { close: () => null };\n }\n\n return contextValue;\n};\n","import React, { useContext, useMemo } from 'react';\n\nimport type { Notification } from 'stream-chat';\nimport type { PropsWithChildrenOnly } from '../../types/types';\nimport type { NotificationTargetPanel } from './notificationTarget';\nimport type { NotificationListFilter } from './NotificationList';\n\nexport type NotificationDisplayFilterParams = {\n /** Fallback panel used by the receiving NotificationList when a notification has no explicit target. */\n fallbackPanel?: NotificationTargetPanel;\n /** Local NotificationList filter. Runs only after the display filter accepts the notification. */\n filter?: NotificationListFilter;\n /** Notification being evaluated after panel/fallback routing matched it to this list. */\n notification: Notification;\n /** Panel of the NotificationList currently evaluating the notification. */\n panel?: NotificationTargetPanel;\n};\n\nexport type NotificationDisplayFilter = (\n params: NotificationDisplayFilterParams,\n) => boolean;\n\nexport type NotificationConfigurationContextValue = {\n displayFilter: NotificationDisplayFilter;\n};\n\nconst defaultNotificationDisplayFilter: NotificationDisplayFilter = () => true;\n\nconst defaultNotificationConfigurationContextValue: NotificationConfigurationContextValue =\n {\n displayFilter: defaultNotificationDisplayFilter,\n };\n\nconst NotificationConfigurationContext =\n React.createContext<NotificationConfigurationContextValue>(\n defaultNotificationConfigurationContextValue,\n );\n\nexport type NotificationConfigurationProviderProps = PropsWithChildrenOnly & {\n displayFilter?: NotificationDisplayFilter;\n};\n\nexport const NotificationConfigurationProvider = ({\n children,\n displayFilter,\n}: NotificationConfigurationProviderProps) => {\n const parentConfiguration = useContext(NotificationConfigurationContext);\n const value = useMemo<NotificationConfigurationContextValue>(\n () => ({\n displayFilter: displayFilter ?? parentConfiguration.displayFilter,\n }),\n [displayFilter, parentConfiguration.displayFilter],\n );\n\n return (\n <NotificationConfigurationContext.Provider value={value}>\n {children}\n </NotificationConfigurationContext.Provider>\n );\n};\n\nexport const useNotificationConfigurationContext = () =>\n useContext(NotificationConfigurationContext);\n","import { useCallback } from 'react';\nimport { useChatContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { Notification, NotificationManagerState } from 'stream-chat';\nimport { useNotificationConfigurationContext } from '../NotificationConfigurationContext';\nimport { isNotificationForPanel } from '../notificationTarget';\n\nimport type { NotificationTargetPanel } from '../notificationTarget';\n\nexport type UseNotificationsFilter = (notification: Notification) => boolean;\n\nexport type UseNotificationsOptions = {\n /**\n * When true, the configured Chat-level notificationDisplayFilter is applied after\n * panel routing and before the local filter.\n */\n applyDisplayFilter?: boolean;\n /**\n * When provided, only notifications that pass this filter are returned.\n * Use to have a given NotificationList consume only a subset of client.notifications\n * (e.g. by origin.emitter, origin.context, or metadata).\n */\n filter?: UseNotificationsFilter;\n /**\n * Panel target consumed by a specific notification list.\n */\n panel?: NotificationTargetPanel;\n /**\n * Fallback panel used when origin.context.panel is absent.\n * Defaults to `channel`.\n */\n fallbackPanel?: NotificationTargetPanel;\n};\n\n/**\n * Subscribes to client.notifications.store and returns the list of notifications.\n * Optionally pass a filter so only notifications that match are returned (e.g. for a specific NotificationList).\n */\nexport const useNotifications = (options?: UseNotificationsOptions): Notification[] => {\n const { client } = useChatContext();\n const { displayFilter } = useNotificationConfigurationContext();\n const { applyDisplayFilter, fallbackPanel, filter, panel } = options ?? {};\n const selector = useCallback(\n (state: NotificationManagerState) => {\n const notifications = state.notifications;\n return {\n notifications: notifications.filter((notification) => {\n if (\n panel &&\n !isNotificationForPanel(notification, panel, {\n fallbackPanel,\n })\n ) {\n return false;\n }\n\n if (\n applyDisplayFilter &&\n !displayFilter({\n fallbackPanel,\n filter,\n notification,\n panel,\n })\n ) {\n return false;\n }\n\n return filter ? filter(notification) : true;\n }),\n };\n },\n [applyDisplayFilter, displayFilter, fallbackPanel, filter, panel],\n );\n\n const { notifications } = useStateStore(client.notifications.store, selector);\n\n return notifications;\n};\n","import React, { type ComponentProps } from 'react';\nimport { IconLoading } from '../Icons';\n\nexport type LoadingIndicatorProps = ComponentProps<typeof IconLoading>;\n\nexport const LoadingIndicator = (props: LoadingIndicatorProps) => (\n <IconLoading {...props} className='str-chat__loading-indicator' />\n);\n","export function prettifyFileSize(bytes: number, precision = 3) {\n const units = ['B', 'kB', 'MB', 'GB'];\n const exponent =\n bytes === 0\n ? 0\n : Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);\n const mantissa = bytes / 1024 ** exponent;\n const formattedMantissa =\n precision === 0 ? Math.round(mantissa).toString() : mantissa.toPrecision(precision);\n return `${formattedMantissa} ${units[exponent]}`;\n}\n","import React from 'react';\nimport { prettifyFileSize } from '../../MessageComposer/hooks/utils';\n\nexport type FileSizeIndicatorProps = {\n /** file size in byte */\n fileSize?: number | string;\n /**\n The maximum number of fraction digits to display. If not set, the default behavior is to round to 3 significant digits.\n @default undefined\n */\n maximumFractionDigits?: number;\n};\n\nexport const FileSizeIndicator = ({\n fileSize,\n maximumFractionDigits,\n}: FileSizeIndicatorProps) => {\n const actualFileSize = typeof fileSize === 'string' ? parseFloat(fileSize) : fileSize;\n\n if (typeof actualFileSize === 'undefined' || !Number.isFinite(Number(actualFileSize))) {\n return null;\n }\n\n return (\n <span\n className='str-chat__message-attachment-file--item-size'\n data-testid='file-size-indicator'\n >\n {prettifyFileSize(actualFileSize, maximumFractionDigits)}\n </span>\n );\n};\n","import { useCallback, useRef } from 'react';\n\nexport type StableCallback<A extends unknown[], R> = (...args: A) => R;\n\n/**\n * A utility hook implementing a stable callback. It takes in an unstable method that\n * is supposed to be invoked somewhere deeper in the DOM tree without making it\n * change its reference every time the parent component rerenders. It will also return\n * the value of the callback if it does return one.\n * A common use-case would be having a function whose invocation depends on state\n * somewhere high up in the DOM tree and wanting to use the same function deeper\n * down, for example in a leaf node and simply using useCallback results in\n * cascading dependency hell. If we wrap it in useStableCallback, we would be able\n * to:\n * - Use the same function as a dependency of another hook (since it is stable)\n * - Still invoke it and get the latest state\n *\n * **Caveats:**\n * - Never wrap a function that is supposed to return a React.ReactElement in\n * useStableCallback, since React will not know that the DOM needs to be updated\n * whenever the callback value changes (for example, renderItem from FlatList must\n * never be wrapped in this hook)\n * - Always prefer using a standard useCallback/stable function wherever possible\n * (the purpose of useStableCallback is to bridge the gap between top level contexts\n * and cascading rereders in downstream components - **not** as an escape hatch)\n * @param callback - the callback we want to stabilize\n */\nexport const useStableCallback = <A extends unknown[], R>(\n callback: StableCallback<A, R>,\n): StableCallback<A, R> => {\n const ref = useRef(callback);\n ref.current = callback;\n\n return useCallback<StableCallback<A, R>>((...args) => ref.current(...args), []);\n};\n","import { useMemo } from 'react';\n\ntype AriaIdentifierDescriptor = 'description' | 'title';\n\nconst sanitizeAriaRootId = (rootId?: string) =>\n rootId?.trim().replace(/[^A-Za-z0-9:_-]/g, '-') ?? '';\n\nconst buildAriaIdentifier = (\n sanitizedRootId: string,\n descriptor: AriaIdentifierDescriptor,\n) => (sanitizedRootId ? `${sanitizedRootId}-${descriptor}` : undefined);\n\n/**\n * Derives stable ARIA identifier IDs from a single root ID.\n *\n * Use this to keep dialog/component labeling conventions consistent without\n * manually building `*-title` and `*-description` IDs at each call site.\n *\n * Behavior:\n * - Root ID is trimmed and sanitized to `[A-Za-z0-9:_-]` before use.\n * - Returns `undefined` IDs when root ID is missing/empty after sanitization.\n */\nexport const useAriaIdentifiers = (rootId?: string) => {\n const sanitizedRootId = sanitizeAriaRootId(rootId);\n\n return useMemo(\n () => ({\n descriptionId: buildAriaIdentifier(sanitizedRootId, 'description'),\n titleId: buildAriaIdentifier(sanitizedRootId, 'title'),\n }),\n [sanitizedRootId],\n );\n};\n","import React, { type ComponentProps, type ComponentType, forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { useModalContext } from '../../../context';\nimport { useAriaIdentifiers } from '../../../a11y/hooks/useAriaIdentifiers';\n\nexport const Root = forwardRef<HTMLDivElement, ComponentProps<'div'>>(function AlertRoot(\n { children, className, ...props }: ComponentProps<'div'>,\n ref,\n) {\n return (\n <div {...props} className={clsx('str-chat__alert-root', className)} ref={ref}>\n {children}\n </div>\n );\n});\n\nexport type AlertHeaderProps = ComponentProps<'div'> & {\n description?: string;\n descriptionId?: string;\n Icon?: ComponentType;\n title?: string;\n titleId?: string;\n};\n\nexport const Header = forwardRef<HTMLDivElement, AlertHeaderProps>(function AlertHeader(\n { children, className, description, descriptionId, Icon, title, titleId, ...props },\n ref,\n) {\n const { dialogId } = useModalContext();\n const { descriptionId: derivedDescriptionId, titleId: derivedTitleId } =\n useAriaIdentifiers(dialogId);\n const resolvedTitleId = titleId ?? derivedTitleId;\n const resolvedDescriptionId = descriptionId ?? derivedDescriptionId;\n\n return (\n <div {...props} className={clsx('str-chat__alert-header', className)} ref={ref}>\n {title ? (\n <>\n {Icon && <Icon />}\n <div className='str-chat__alert-header__copy'>\n <h2 className='str-chat__alert-header__title' id={resolvedTitleId}>\n {title}\n </h2>\n {description && (\n <p\n className='str-chat__alert-header__description'\n id={resolvedDescriptionId}\n >\n {description}\n </p>\n )}\n </div>\n </>\n ) : (\n children\n )}\n </div>\n );\n});\n\nconst Actions = forwardRef<HTMLDivElement, ComponentProps<'div'>>(function AlertActions(\n { children, className, ...props },\n ref,\n) {\n return (\n <div {...props} className={clsx('str-chat__alert-actions', className)} ref={ref}>\n {children}\n </div>\n );\n});\n\nexport const Alert = {\n Actions,\n Header,\n Root,\n};\n","import clsx from 'clsx';\nimport type { ComponentProps, PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { FocusScope } from '@react-aria/focus';\nimport { DialogPortalEntry } from './DialogPortal';\nimport { useDialog, useDialogIsOpen } from '../hooks';\nimport { type OffsetOpt, usePopoverPosition } from '../hooks/usePopoverPosition';\nimport type { PopperLikePlacement } from '../hooks';\nimport type { Placement } from '@floating-ui/react';\n\nexport interface DialogAnchorOptions {\n open: boolean;\n placement: PopperLikePlacement;\n referenceElement: HTMLElement | null;\n allowFlip?: boolean;\n updateKey?: unknown;\n updatePositionOnContentResize?: boolean;\n offset?: OffsetOpt;\n}\n\nexport function useDialogAnchor<T extends HTMLElement>({\n allowFlip,\n offset,\n open,\n placement,\n referenceElement,\n updateKey,\n updatePositionOnContentResize = false,\n}: DialogAnchorOptions) {\n const [popperElement, setPopperElement] = useState<T | null>(null);\n // keeps track of the first \"chosen\" placement (after popperElement is set) to avoid popper \"jumping\" to a different placement when it updates and finds a better fit; resets when popperElement is unset (!open)\n const [stabilisedChosenPlacement, setStabilisedChosenPlacement] =\n useState<Placement | null>(null);\n\n const {\n placement: chosenPlacement,\n refs,\n strategy,\n update,\n x,\n y,\n } = usePopoverPosition({\n allowFlip,\n freeze: true,\n offset,\n placement: stabilisedChosenPlacement ?? placement,\n });\n\n if (!stabilisedChosenPlacement && popperElement && placement !== chosenPlacement) {\n setStabilisedChosenPlacement(chosenPlacement);\n } else if (stabilisedChosenPlacement && !popperElement) {\n setStabilisedChosenPlacement(null);\n }\n\n // Freeze reference when dialog opens so submenus (e.g. ContextMenu level 2+) stay aligned to the original anchor\n const frozenReferenceRef = useRef<HTMLElement | null>(null);\n if (open && referenceElement && !frozenReferenceRef.current) {\n frozenReferenceRef.current = referenceElement;\n }\n if (!open) {\n frozenReferenceRef.current = null;\n }\n const effectiveReference = open ? frozenReferenceRef.current : referenceElement;\n\n useEffect(() => {\n refs.setReference(effectiveReference);\n }, [effectiveReference, refs]);\n\n useEffect(() => {\n refs.setFloating(popperElement);\n }, [popperElement, refs]);\n\n useEffect(() => {\n if (open && popperElement && effectiveReference) {\n // Re-run when reference becomes available (e.g. after ref is set) or when updateKey changes (e.g. submenu open)\n // Since the popper's reference element might not be (and usually is not) visible\n // all the time, it's safer to force popper update before showing it.\n // update is non-null only if popperElement is non-null\n update?.();\n }\n }, [open, placement, popperElement, update, updateKey, effectiveReference]);\n\n useEffect(() => {\n if (!popperElement || !updatePositionOnContentResize) return;\n\n const resizeObserver = new ResizeObserver(update);\n\n resizeObserver.observe(popperElement);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [popperElement, update, updatePositionOnContentResize]);\n\n if (popperElement && !open) {\n setPopperElement(null);\n }\n\n return {\n placement: stabilisedChosenPlacement ?? chosenPlacement,\n setPopperElement,\n styles: {\n left: x ?? 0,\n position: strategy,\n top: y ?? 0,\n } as React.CSSProperties,\n };\n}\n\nexport type DialogAnchorProps = PropsWithChildren<Partial<DialogAnchorOptions>> & {\n /**\n * Optional per-dialog override for outside-click dismissal.\n * If undefined, manager-level `DialogManager.closeOnClickOutside` is used.\n */\n closeOnClickOutside?: boolean;\n id: string;\n /**\n * Delay (ms) before unmounting after dialog closes.\n * Use this to keep the dialog in DOM long enough for CSS exit animations.\n * `0` means immediate unmount (no exit-animation window).\n */\n closeTransitionMs?: number;\n dialogManagerId?: string;\n focus?: boolean;\n trapFocus?: boolean;\n} & ComponentProps<'div'>;\n\nexport const DialogAnchor = ({\n allowFlip = true,\n children,\n className,\n closeOnClickOutside,\n closeTransitionMs = 0,\n dialogManagerId,\n focus = true,\n id,\n offset,\n placement = 'auto',\n referenceElement = null,\n tabIndex,\n trapFocus,\n updateKey,\n updatePositionOnContentResize,\n ...restDivProps\n}: DialogAnchorProps) => {\n /**\n * Rendering lifecycle notes:\n * - `open=true` renders dialog contents immediately.\n * - `open=false` can keep contents mounted for `closeTransitionMs` to allow CSS exit\n * animations before unmount.\n *\n * State exposed to CSS:\n * - `data-str-chat-dialog-state=\"open\"` while actively open.\n * - `data-str-chat-dialog-state=\"closing\"` during delayed unmount window.\n *\n * Consumers like `ContextMenu` combine:\n * - `data-str-chat-dialog-state` from this component, and\n * - `data-str-chat-placement` (e.g. `top-start`, `right-end`)\n * to select the correct closing keyframe in CSS (horizontal vs vertical roll direction).\n * In practice, JS only toggles state and timing (`closeTransitionMs`); CSS owns the\n * visual motion details (transform/easing), so animation behavior stays declarative.\n */\n const dialog = useDialog({ closeOnClickOutside, dialogManagerId, id });\n const open = useDialogIsOpen(id, dialogManagerId);\n const [shouldRender, setShouldRender] = useState(open);\n const closeTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const isClosing = !open && shouldRender;\n\n useEffect(() => {\n if (open) {\n setShouldRender(true);\n if (closeTimeoutRef.current) {\n clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = null;\n }\n return;\n }\n\n if (!shouldRender) return;\n if (!closeTransitionMs) {\n setShouldRender(false);\n return;\n }\n\n closeTimeoutRef.current = setTimeout(() => {\n setShouldRender(false);\n closeTimeoutRef.current = null;\n }, closeTransitionMs);\n }, [closeTransitionMs, open, shouldRender]);\n\n useEffect(\n () => () => {\n if (closeTimeoutRef.current) clearTimeout(closeTimeoutRef.current);\n },\n [],\n );\n\n const {\n placement: chosenPlacement,\n setPopperElement,\n styles,\n } = useDialogAnchor<HTMLDivElement>({\n allowFlip,\n offset,\n open: shouldRender,\n placement,\n referenceElement,\n updateKey,\n updatePositionOnContentResize,\n });\n\n useEffect(() => {\n if (!open) return;\n const hideOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n dialog?.close();\n };\n\n document.addEventListener('keyup', hideOnEscape);\n\n return () => {\n document.removeEventListener('keyup', hideOnEscape);\n };\n }, [dialog, open]);\n\n // prevent rendering the dialog contents if the dialog should not be open / shown\n if (!shouldRender) {\n return null;\n }\n\n const {\n ['aria-describedby']: ariaDescribedBy,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledBy,\n ['aria-modal']: ariaModal,\n role,\n ...anchorDivProps\n } = restDivProps;\n const resolvedRole = trapFocus ? (role ?? 'dialog') : role;\n const resolvedAriaModal = trapFocus ? true : ariaModal;\n const resolvedAriaLabel = ariaLabelledBy ? undefined : ariaLabel;\n\n return (\n <DialogPortalEntry dialogId={id} dialogManagerId={dialogManagerId}>\n <FocusScope autoFocus={focus} contain={trapFocus} restoreFocus>\n <div\n {...anchorDivProps}\n aria-describedby={ariaDescribedBy}\n aria-label={resolvedAriaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-modal={resolvedAriaModal}\n className={clsx('str-chat__dialog-contents', className)}\n data-str-chat-dialog-state={isClosing ? 'closing' : 'open'}\n data-str-chat-placement={chosenPlacement}\n data-testid='str-chat__dialog-contents'\n ref={setPopperElement}\n role={resolvedRole}\n style={styles}\n tabIndex={typeof tabIndex !== 'undefined' ? tabIndex : 0}\n >\n {children}\n </div>\n </FocusScope>\n </DialogPortalEntry>\n );\n};\n","import clsx from 'clsx';\nimport React, {\n type ComponentPropsWithoutRef,\n type ComponentType,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { IconUser } from '../Icons';\n\nexport type AvatarProps = {\n /** Custom icon rendered when there is no image and no initials */\n FallbackIcon?: ComponentType<ComponentPropsWithoutRef<'svg'>>;\n /** URL of the avatar image */\n imageUrl?: string;\n /** Name of the user, used for avatar image alt text and title fallback */\n userName?: string;\n /** Online status indicator, not rendered if not of type boolean */\n isOnline?: boolean;\n size: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | (string & {}) | null;\n} & ComponentPropsWithoutRef<'div'>;\n\nconst getInitials = (name?: string) => {\n const regex = /(\\p{L}{1})\\p{L}+/gu;\n\n if (!name || name.trim().length === 0) {\n return '';\n }\n\n const initials = Array.from(name?.matchAll(regex) || []);\n\n if (!initials.length) {\n return '';\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const startInitial = initials.at(0)![1];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const endInitial = initials.length > 1 ? initials.at(-1)![1] : '';\n\n return `${startInitial}${endInitial}`;\n};\n\n/**\n * A round avatar image with fallback to username's first letter\n */\nexport const Avatar = ({\n className,\n FallbackIcon = IconUser,\n imageUrl,\n isOnline,\n size,\n userName,\n ...rest\n}: AvatarProps) => {\n const [error, setError] = useState(false);\n\n useEffect(() => () => setError(false), [imageUrl]);\n\n const nameString = userName?.toString() || '';\n const avatarImageAlt = nameString.trim();\n\n const sizeAwareInitials = useMemo(() => {\n const initials = getInitials(nameString);\n\n if (size === 'sm' || size === 'xs') {\n return initials.charAt(0);\n }\n\n return initials;\n }, [nameString, size]);\n\n const showImage = typeof imageUrl === 'string' && imageUrl && !error;\n\n return (\n <div\n className={clsx(`str-chat__avatar`, className, {\n 'str-chat__avatar--multiple-letters': sizeAwareInitials.length > 1,\n 'str-chat__avatar--no-letters': !sizeAwareInitials.length,\n 'str-chat__avatar--one-letter': sizeAwareInitials.length === 1,\n [`str-chat__avatar--size-${size}`]: typeof size === 'string',\n })}\n data-testid='avatar'\n role='button'\n title={userName}\n {...rest}\n >\n {typeof isOnline === 'boolean' && (\n <div\n className={clsx('str-chat__avatar-status-badge', {\n 'str-chat__avatar-status-badge--offline': !isOnline,\n 'str-chat__avatar-status-badge--online': isOnline,\n })}\n />\n )}\n {showImage ? (\n <img\n alt={avatarImageAlt}\n className='str-chat__avatar-image'\n data-testid='avatar-img'\n onError={() => setError(true)}\n src={imageUrl}\n />\n ) : (\n <>\n {!!sizeAwareInitials.length && (\n <div className='str-chat__avatar-initials' data-testid='avatar-fallback'>\n {sizeAwareInitials}\n </div>\n )}\n {!sizeAwareInitials.length && <FallbackIcon />}\n </>\n )}\n </div>\n );\n};\n","import clsx from 'clsx';\nimport React, { type ComponentProps } from 'react';\nimport { IconExclamationMarkFill } from '../Icons';\n\nexport type BadgeVariant =\n | 'default'\n | 'primary'\n | 'error'\n | 'neutral'\n | 'counter'\n | 'inverse';\n\nexport type BadgeSize = 'xs' | 'sm' | 'md' | 'lg' | null;\n\nexport type BadgeProps = ComponentProps<'div'> & {\n /** Visual variant mapping to design tokens */\n variant?: BadgeVariant;\n /** Size preset (typography and padding) */\n size?: BadgeSize;\n};\n\n/**\n * Compact pill/circle badge for counts and labels.\n * Uses design tokens: --badge-bg-*, --badge-text-*, --badge-border.\n */\nexport const Badge = ({\n children,\n className,\n size = 'md',\n variant = 'default',\n ...spanProps\n}: BadgeProps) => (\n <div\n {...spanProps}\n className={clsx(\n 'str-chat__badge',\n `str-chat__badge--variant-${variant}`,\n { [`str-chat__badge--size-${size}`]: size },\n className,\n )}\n >\n {children}\n </div>\n);\n\nexport const ErrorBadge = ({\n className,\n size = 'sm',\n ...rest\n}: Omit<BadgeProps, 'variant'>) => (\n <Badge {...rest} className={className} size={size} variant='error'>\n <IconExclamationMarkFill />\n </Badge>\n);\n","import React, { useMemo } from 'react';\n\nimport { GroupAvatar } from './';\nimport type { AvatarProps, GroupAvatarProps } from './';\n\nexport type ChannelAvatarProps = Partial<Omit<GroupAvatarProps & AvatarProps, 'size'>> & {\n size: GroupAvatarProps['size'] | AvatarProps['size'];\n};\n\nexport const ChannelAvatar = ({\n displayMembers,\n imageUrl,\n size,\n userName,\n ...sharedProps\n}: ChannelAvatarProps) => {\n const displayInfo = useMemo(() => {\n // Prefer the channel's own image; only derive the avatar from members when\n // there is no channel imageUrl to display.\n if (!imageUrl && displayMembers && displayMembers.length > 0) {\n return displayMembers;\n }\n\n return [\n {\n imageUrl,\n userName,\n },\n ];\n }, [displayMembers, imageUrl, userName]);\n\n return <GroupAvatar displayMembers={displayInfo} size={size} {...sharedProps} />;\n};\n","import clsx from 'clsx';\nimport React, { type ComponentPropsWithoutRef, useMemo } from 'react';\nimport { Avatar, type AvatarProps } from './Avatar';\nimport { Badge, type BadgeSize } from '../Badge';\n\nexport type GroupAvatarMember = {\n imageUrl?: string;\n userName?: string;\n id?: string;\n};\n\nexport type GroupAvatarProps = {\n /** List of members to show as avatars; at most 2 when there's more than 4 members, otherwise 4. Defaults to [] when omitted. */\n displayMembers?: GroupAvatarMember[];\n size: '2xl' | 'xl' | 'lg' | (string & {}) | null;\n badgeSize?: BadgeSize;\n isOnline?: boolean;\n} & ComponentPropsWithoutRef<'div'>;\n\n/**\n * Avatar component to display multiple users' avatars in a group.\n * Renders a single Avatar if fewer than 2 members. Otherwise, renders up to 2 avatars (when overflowCount is set) or 4, plus an optional +N badge.\n */\nexport const GroupAvatar = ({\n badgeSize,\n className,\n displayMembers = [],\n isOnline,\n size,\n ...rest\n}: GroupAvatarProps) => {\n const displayMembersToRender = useMemo(\n () => (displayMembers.length > 4 ? displayMembers.slice(0, 2) : displayMembers),\n [displayMembers],\n );\n const overflowCount = displayMembers.length - displayMembersToRender.length;\n\n if (displayMembers.length < 2) {\n const firstUser = displayMembers[0];\n\n return (\n <Avatar\n imageUrl={firstUser?.imageUrl}\n isOnline={isOnline}\n size={size}\n userName={firstUser?.userName}\n {...rest}\n />\n );\n }\n\n let avatarSize: AvatarProps['size'] = null;\n if (size === '2xl') {\n avatarSize = 'lg';\n } else if (size === 'xl') {\n avatarSize = 'md';\n } else if (size === 'lg') {\n avatarSize = 'sm';\n }\n\n return (\n <div\n className={clsx(\n 'str-chat__avatar-group',\n {\n 'str-chat__avatar-group--offline': typeof isOnline === 'boolean' && !isOnline,\n 'str-chat__avatar-group--online': typeof isOnline === 'boolean' && isOnline,\n [`str-chat__avatar-group--size-${size}`]: typeof size === 'string',\n },\n className,\n )}\n data-testid='group-avatar'\n role='button'\n {...rest}\n >\n {displayMembersToRender.map(({ id, imageUrl, userName }, index) => (\n <Avatar\n imageUrl={imageUrl}\n key={id || `${userName}-${imageUrl}-${index}`}\n size={avatarSize}\n userName={userName}\n />\n ))}\n {typeof overflowCount === 'number' && overflowCount > 0 && (\n <Badge\n className='str-chat__avatar-group__count-badge'\n data-testid='group-avatar-count-badge'\n size={badgeSize}\n variant='counter'\n >\n +{overflowCount}\n </Badge>\n )}\n </div>\n );\n};\n","const MENU_KEYBOARD_NAVIGATION_KEYS = ['ArrowDown', 'ArrowUp', 'End', 'Home'] as const;\n\ntype MenuKeyboardNavigationKey = (typeof MENU_KEYBOARD_NAVIGATION_KEYS)[number];\n\nconst isMenuKeyboardNavigationKey = (key: string): key is MenuKeyboardNavigationKey =>\n (MENU_KEYBOARD_NAVIGATION_KEYS as readonly string[]).includes(key);\n\ntype GetNextRovingFocusIndexArgs = {\n activeIndex: number;\n itemCount: number;\n key: string;\n};\n\nexport const getNextRovingFocusIndex = ({\n activeIndex,\n itemCount,\n key,\n}: GetNextRovingFocusIndexArgs): number | null => {\n if (itemCount <= 0 || !isMenuKeyboardNavigationKey(key)) return null;\n\n const lastIndex = itemCount - 1;\n\n if (key === 'Home') return 0;\n if (key === 'End') return lastIndex;\n if (activeIndex === -1) return key === 'ArrowUp' ? lastIndex : 0;\n if (key === 'ArrowUp') return activeIndex <= 0 ? lastIndex : activeIndex - 1;\n\n return activeIndex >= lastIndex ? 0 : activeIndex + 1;\n};\n\ntype RovingFocusKeyboardEvent = {\n currentTarget: Element;\n key: string;\n preventDefault: () => void;\n};\n\ntype CreateRovingFocusKeyDownHandlerParams<T extends { focus: () => void }> = {\n focusItem?: (item: T, event: RovingFocusKeyboardEvent) => void;\n getActiveIndex?: (items: T[], event: RovingFocusKeyboardEvent) => number;\n getItems: (event: RovingFocusKeyboardEvent) => T[];\n};\n\nconst getDefaultActiveIndex = <T extends { focus: () => void }>(items: T[]) => {\n const activeElement = document.activeElement;\n if (!(activeElement instanceof Element)) return -1;\n\n return items.findIndex((item) => item instanceof Element && item === activeElement);\n};\n\nexport const createRovingFocusKeyDownHandler = <T extends { focus: () => void }>({\n focusItem = (item) => item.focus(),\n getActiveIndex = (items) => getDefaultActiveIndex(items),\n getItems,\n}: CreateRovingFocusKeyDownHandlerParams<T>) => {\n const handleKeyDown = (event: RovingFocusKeyboardEvent) => {\n const items = getItems(event);\n const activeIndex = getActiveIndex(items, event);\n const nextIndex = getNextRovingFocusIndex({\n activeIndex,\n itemCount: items.length,\n key: event.key,\n });\n\n if (nextIndex === null) return;\n\n event.preventDefault();\n const nextItem = items[nextIndex];\n if (!nextItem) return;\n focusItem(nextItem, event);\n };\n\n return handleKeyDown;\n};\n","import clsx from 'clsx';\nimport React, {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n type ComponentType,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Avatar, type AvatarProps } from '../../Avatar';\nimport { IconChevronLeft, IconChevronRight } from '../../Icons';\nimport type { PopperLikePlacement } from '../hooks';\nimport { useDialogIsOpen, useDialogOnNearestManager } from '../hooks';\nimport type { DialogAnchorProps } from '../service/DialogAnchor';\nimport { DialogAnchor, useDialogAnchor } from '../service/DialogAnchor';\nimport { useComponentContext } from '../../../context';\nimport { createRovingFocusKeyDownHandler } from '../../../a11y/a11yUtils';\n\n/**\n * ContextMenu module\n *\n * What this file provides\n * - Primitives for contextual action UIs:\n * `ContextMenu`, `ContextMenuContent`, `ContextMenuButton`, `ContextMenuHeader`,\n * `ContextMenuBody`, `ContextMenuBackButton`, and user/emoji button variants.\n * - A small runtime context (`useContextMenuContext`) used by menu items to:\n * - close the current menu (`closeMenu`)\n * - open a submenu (`openSubmenu`)\n * - return to parent level (`returnToParentMenu`)\n *\n * Rendering modes\n * - Anchored mode (most common): pass `id` and `referenceElement`.\n * The component renders inside `DialogAnchor` and uses dialog manager state.\n * - Inline mode: omit anchor props and render as a plain contextual list.\n * - Outside click dismissal can be overridden per menu via `closeOnClickOutside`;\n * otherwise manager default is used.\n *\n * Submenu model\n * - Submenus are represented as a stack of menu levels.\n * - Each level can define `Header`, `Submenu`, `items`, `ItemsWrapper`,\n * and `menuClassName`.\n * - Opening submenu pushes a level to the stack; going back pops one level.\n * - When anchored menu closes, stack resets to root to avoid stale submenu state\n * on next open.\n *\n * Animation model\n * - Root menu open/close is handled by `DialogAnchor` transition timing.\n * - `ContextMenu` defaults `closeTransitionMs` to `130` so close animations can be visible.\n * - `DialogAnchor` marks rendered content with `data-str-chat-dialog-state`:\n * - `open` while visible\n * - `closing` during delayed unmount window (`closeTransitionMs`)\n * - Context-menu closing keyframes in `ContextMenu.scss` target\n * `[data-str-chat-dialog-state='closing']` + placement selectors.\n * - Level-to-level transitions are directional:\n * - forward: parent -> submenu\n * - backward: submenu -> parent\n * - Direction is tracked in `ContextMenu` and passed to `ContextMenuContent`.\n * - `ContextMenuContent` bumps an internal key for `ContextMenuBody` so React\n * remounts the body and CSS enter animation reliably restarts on each level change.\n * - Initial/root menu render does not apply submenu forward/backward classes;\n * directional animation classes are used only for submenu transitions.\n * - `enableAnimations` can disable content animations through data attributes/CSS.\n * - `submenuTransitionDurationMs` controls how long directional transition state is kept.\n *\n * Submenu popover behavior (`ContextMenuButton` with `Submenu`)\n * - Submenu can be rendered by passing `Submenu` (and optional placement/container props).\n * - Default submenu roll axis is `x` (override with `submenuRollAxis`).\n * - Hover/focus management uses a \"keep open\" ref flag plus lazy close timeout to avoid\n * accidental submenu dismissal when moving pointer/focus between parent and submenu.\n *\n * Customization via `ComponentContext`\n * - `ComponentContext.ContextMenu` replaces the whole menu component at SDK call sites.\n * - `ComponentContext.ContextMenuContent` replaces content-level behavior while preserving\n * default anchoring/dialog integration from `ContextMenu`.\n * - Built-in call sites (message actions, channel list action buttons, attachment selector,\n * suggestion list) resolve `ContextMenu` from `ComponentContext` with fallback to default.\n */\nexport type BaseContextMenuButtonProps = {\n details?: ReactNode;\n hasSubMenu?: boolean;\n label?: ReactNode;\n Icon?: ComponentType<ComponentProps<'svg'>>;\n SubmenuIcon?: ComponentType<ComponentProps<'svg'>>;\n variant?: 'destructive';\n} & ComponentProps<'button'>;\n\nexport const BaseContextMenuButton = ({\n children,\n className,\n details,\n hasSubMenu,\n Icon,\n label,\n role = 'menuitem',\n SubmenuIcon = IconChevronRight,\n variant,\n ...props\n}: BaseContextMenuButtonProps) => (\n <button\n {...props}\n className={clsx(\n 'str-chat__context-menu__button',\n {\n 'str-chat__context-menu__button--with-submenu': hasSubMenu,\n [`str-chat__context-menu__button--${variant}`]: typeof variant === 'string',\n },\n className,\n )}\n role={role}\n type='button'\n >\n {Icon && <Icon className='str-chat__context-menu__button__icon' />}\n {label ? (\n <>\n <div className='str-chat__context-menu__button__label'>{label}</div>\n <div className='str-chat__context-menu__button__details'>{details}</div>\n </>\n ) : (\n <div className='str-chat__context-menu__button__label'>{children}</div>\n )}\n {!!hasSubMenu && (\n <SubmenuIcon className='str-chat__context-menu__button__submenu-icon' />\n )}\n </button>\n);\n\nexport type UserContextMenuButtonProps = Pick<AvatarProps, 'imageUrl' | 'userName'> &\n ComponentProps<'button'>;\n\nexport const UserContextMenuButton = ({\n children,\n className,\n imageUrl,\n role = 'menuitem',\n userName,\n ...props\n}: UserContextMenuButtonProps) => (\n <button\n {...props}\n className={clsx(\n 'str-chat__context-menu__button str-chat__user-context-menu__button',\n className,\n )}\n role={role}\n type='button'\n >\n <Avatar imageUrl={imageUrl} size='sm' userName={userName} />\n <div className='str-chat__context-menu__button__label'>{children ?? userName}</div>\n </button>\n);\n\nexport type EmojiContextMenuButtonProps = { emoji: string } & Pick<\n BaseContextMenuButtonProps,\n 'label'\n> &\n ComponentProps<'button'>;\n\nexport const EmojiContextMenuButton = ({\n children,\n className,\n emoji,\n label,\n role = 'menuitem',\n ...props\n}: EmojiContextMenuButtonProps) => (\n <button\n {...props}\n className={clsx(\n 'str-chat__context-menu__button str-chat__emoji-context-menu__button',\n className,\n )}\n role={role}\n type='button'\n >\n <span className='str-chat__context-menu__button__emoji str-chat__emoji-item--entity'>\n {emoji}\n </span>\n <div className='str-chat__context-menu__button__label'>{children ?? label}</div>\n </button>\n);\n\ntype ButtonWithSubmenuProps = {\n Submenu: ComponentType;\n submenuContainerProps?: ComponentProps<'div'>;\n submenuPlacement?: PopperLikePlacement;\n submenuRollAxis?: 'x' | 'y';\n};\n\nconst ContextMenuButtonWithSubmenu = ({\n children,\n className,\n Submenu,\n submenuContainerProps,\n submenuPlacement = 'right-start',\n submenuRollAxis = 'x',\n ...buttonProps\n}: BaseContextMenuButtonProps & ButtonWithSubmenuProps) => {\n const { className: submenuClassName, ...submenuContainerRestProps } =\n submenuContainerProps ?? {};\n const { registerDialogSubmenu, unregisterDialogSubmenu } = useContextMenuContext();\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const [dialogContainer, setDialogContainer] = useState<HTMLDivElement | null>(null);\n const keepSubmenuOpenFlag = useRef(false);\n const dialogCloseTimeout = useRef<NodeJS.Timeout | null>(null);\n const dialogId = useMemo(() => `submenu-${Math.random().toString(36).slice(2)}`, []);\n const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n useEffect(() => {\n if (!dialogIsOpen) return;\n registerDialogSubmenu();\n return () => unregisterDialogSubmenu();\n }, [dialogIsOpen, registerDialogSubmenu, unregisterDialogSubmenu]);\n const {\n placement: chosenPlacement,\n setPopperElement,\n styles,\n } = useDialogAnchor<HTMLDivElement>({\n offset: 8,\n open: dialogIsOpen,\n placement: submenuPlacement,\n referenceElement: buttonRef.current,\n });\n\n const closeDialogLazily = useCallback(() => {\n if (dialogCloseTimeout.current) clearTimeout(dialogCloseTimeout.current);\n dialogCloseTimeout.current = setTimeout(() => {\n if (keepSubmenuOpenFlag.current) return;\n dialog.close();\n }, 100);\n }, [dialog]);\n\n const keepSubmenuOpen = useCallback(() => {\n keepSubmenuOpenFlag.current = true;\n }, []);\n\n const allowToCloseSubmenu = useCallback(() => {\n keepSubmenuOpenFlag.current = false;\n }, []);\n\n const closeSubmenu = useCallback(() => {\n allowToCloseSubmenu();\n closeDialogLazily();\n }, [allowToCloseSubmenu, closeDialogLazily]);\n\n const handleClose = useCallback(\n (event: Event) => {\n const parentButton = buttonRef.current;\n if (!dialogIsOpen || !parentButton) return;\n event.stopPropagation();\n closeDialogLazily();\n parentButton.focus();\n },\n [closeDialogLazily, dialogIsOpen, buttonRef],\n );\n\n const handleFocusParentButton = () => {\n if (dialogIsOpen) return;\n dialog.open();\n keepSubmenuOpen();\n };\n\n useEffect(() => {\n const parentButton = buttonRef.current;\n if (!dialogIsOpen || !parentButton) return;\n const hideOnEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n handleClose(event);\n closeSubmenu();\n };\n\n document.addEventListener('keyup', hideOnEscape, { capture: true });\n\n return () => {\n document.removeEventListener('keyup', hideOnEscape, { capture: true });\n };\n }, [dialogIsOpen, handleClose, closeSubmenu]);\n\n return (\n <>\n <BaseContextMenuButton\n aria-expanded={dialogIsOpen}\n aria-haspopup='menu'\n className={clsx(className, 'str_chat__button-with-submenu', {\n 'str_chat__button-with-submenu--submenu-open': dialogIsOpen,\n })}\n hasSubMenu\n onBlur={closeSubmenu}\n onClick={(event) => {\n event.stopPropagation();\n dialog.toggle();\n }}\n onFocus={handleFocusParentButton}\n onMouseEnter={handleFocusParentButton}\n onMouseLeave={closeSubmenu}\n {...buttonProps}\n ref={buttonRef}\n >\n {children}\n </BaseContextMenuButton>\n {dialogIsOpen && (\n <div\n className={clsx('str-chat__context-menu__submenu-container', submenuClassName)}\n data-str-chat-placement={chosenPlacement}\n data-str-chat-roll-axis={submenuRollAxis}\n onBlur={(event) => {\n const isBlurredDescendant =\n event.relatedTarget instanceof Node &&\n dialogContainer?.contains(event.relatedTarget);\n if (isBlurredDescendant) return;\n closeSubmenu();\n }}\n onFocus={keepSubmenuOpen}\n onMouseEnter={keepSubmenuOpen}\n onMouseLeave={closeSubmenu}\n ref={(element) => {\n setPopperElement(element);\n setDialogContainer(element);\n }}\n style={styles}\n tabIndex={-1}\n {...submenuContainerRestProps}\n >\n <Submenu />\n </div>\n )}\n </>\n );\n};\n\ntype ContextMenuButtonProps = BaseContextMenuButtonProps &\n Partial<ButtonWithSubmenuProps>;\n\nexport const ContextMenuButton = (props: ContextMenuButtonProps) => {\n const {\n Submenu,\n submenuContainerProps,\n submenuPlacement,\n submenuRollAxis,\n ...buttonProps\n } = props;\n if (Submenu) {\n return (\n <ContextMenuButtonWithSubmenu\n {...buttonProps}\n Submenu={Submenu}\n submenuContainerProps={submenuContainerProps}\n submenuPlacement={submenuPlacement}\n submenuRollAxis={submenuRollAxis}\n />\n );\n }\n\n return <BaseContextMenuButton {...buttonProps} />;\n};\n\nexport const ContextMenuBackButton = ({\n children,\n className,\n role = 'menuitem',\n ...props\n}: ComponentProps<'button'>) => (\n <button\n {...props}\n className={clsx('str-chat__context-menu__back-button', className)}\n role={role}\n type='button'\n >\n {children}\n </button>\n);\n\nexport const ContextMenuHeader = ({\n children,\n className,\n ...props\n}: ComponentProps<'div'>) => (\n <div {...props} className={clsx('str-chat__context-menu__header', className)}>\n {children}\n </div>\n);\n\nexport const ContextMenuBody = ({\n children,\n className,\n ...props\n}: ComponentProps<'div'>) => (\n <div {...props} className={clsx('str-chat__context-menu__body', className)}>\n {children}\n </div>\n);\n\nexport const ContextMenuRoot = React.forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n function ContextMenuRoot({ className, role = 'menu', ...props }, ref) {\n return (\n <div\n {...props}\n className={clsx('str-chat__context-menu', className)}\n ref={ref}\n role={role}\n />\n );\n },\n);\n\nexport type ContextMenuHeaderComponent = ComponentType;\nexport type ContextMenuSubmenu = ComponentType;\n\nexport type ContextMenuOpenSubmenuParams = Omit<\n ContextMenuLevel,\n 'focusRestoreRequest' | 'items'\n> & {\n focusReturnTarget?: HTMLElement | null;\n};\n\nexport type ContextMenuItemProps = ComponentProps<'button'>;\n\nexport type ContextMenuItemComponent = ComponentType<ContextMenuItemProps>;\n\nexport const DEFAULT_CONTEXT_MENU_KEYBOARD_NAVIGATION_ITEM_SELECTOR = [\n '[role=\"menuitem\"]:not(:disabled)',\n '[role=\"menuitemradio\"]:not(:disabled)',\n '[role=\"menuitemcheckbox\"]:not(:disabled)',\n].join(',');\n\nconst isVisibleContextMenuKeyboardNavigationItem = (item: HTMLElement) => {\n // Fast path: offsetParent is null for display:none elements (and their descendants).\n // offsetHeight covers position:fixed elements which have no offsetParent.\n if (item.offsetParent !== null || item.offsetHeight > 0) return true;\n\n // In environments without layout (e.g. jsdom), offsetParent/offsetHeight are always 0/null.\n // Fall back to checking inline style and the `hidden` attribute.\n if (item.hidden) return false;\n const display = item.style.display;\n if (display === 'none') return false;\n\n // If no layout info and no explicit hiding signal, assume visible.\n return true;\n};\n\ntype ContextMenuFocusRestoreRequest = {\n /** Positional fallback used when the target element is no longer in the DOM. */\n index: number;\n target: HTMLElement | null;\n};\n\nconst getVisibleContextMenuKeyboardNavigationItems = (\n contextMenuRoot: Element | null,\n itemSelector: string = DEFAULT_CONTEXT_MENU_KEYBOARD_NAVIGATION_ITEM_SELECTOR,\n) =>\n Array.from(contextMenuRoot?.querySelectorAll<HTMLElement>(itemSelector) ?? []).filter(\n isVisibleContextMenuKeyboardNavigationItem,\n );\n\nconst createContextMenuFocusRestoreRequest = ({\n contextMenuRoot,\n focusReturnTarget,\n}: {\n contextMenuRoot: Element | null;\n focusReturnTarget?: HTMLElement | null;\n}): ContextMenuFocusRestoreRequest => {\n const target =\n focusReturnTarget ??\n (document.activeElement instanceof HTMLElement ? document.activeElement : null);\n\n if (!target) return { index: -1, target: null };\n\n const index = getVisibleContextMenuKeyboardNavigationItems(contextMenuRoot).findIndex(\n (menuItem) => menuItem === target,\n );\n\n return { index, target };\n};\n\nconst resolveContextMenuFocusRestoreTarget = ({\n contextMenuRoot,\n request,\n}: {\n contextMenuRoot: Element | null;\n request: ContextMenuFocusRestoreRequest | null;\n}) => {\n if (!request) return null;\n\n // Prefer the original element if it's still in the DOM.\n if (request.target?.isConnected) return request.target;\n\n // Fall back to positional index when the element has been unmounted.\n if (request.index >= 0) {\n return (\n getVisibleContextMenuKeyboardNavigationItems(contextMenuRoot)[request.index] ?? null\n );\n }\n\n return null;\n};\n\nexport type ContextMenuKeyboardNavigation = {\n /**\n * CSS selector used to collect focusable menu items.\n * Defaults to `[role=\"menuitem\"]:not(:disabled)`.\n */\n itemSelector?: string;\n};\n\ntype ContextMenuContextValue = {\n anchorReferenceElement?: HTMLElement | null;\n closeMenu: () => void;\n openSubmenu: (params: ContextMenuOpenSubmenuParams) => void;\n registerDialogSubmenu: () => void;\n returnToParentMenu: () => void;\n unregisterDialogSubmenu: () => void;\n};\n\nconst ContextMenuContext = React.createContext<ContextMenuContextValue | undefined>(\n undefined,\n);\n\nexport const useContextMenuContext = () =>\n useContext(ContextMenuContext) as ContextMenuContextValue;\n\ntype ContextMenuLevel = {\n focusRestoreRequest?: ContextMenuFocusRestoreRequest;\n items?: ContextMenuItemComponent[];\n Submenu?: ContextMenuSubmenu;\n Header?: ContextMenuHeaderComponent;\n ItemsWrapper?: ComponentType;\n menuClassName?: string;\n};\n\ntype ContextMenuBaseProps = ComponentPropsWithoutRef<'div'> & {\n backLabel?: ReactNode;\n enableAnimations?: boolean;\n Header?: ContextMenuHeaderComponent;\n /**\n * Customizes roving-focus keyboard navigation for menu items.\n * ArrowUp/ArrowDown/Home/End move focus across items matched by\n * `keyboardNavigation.itemSelector` (defaults to `[role=\"menuitem\"]:not(:disabled)`).\n * Navigation is always enabled; use this prop only to override the item selector.\n */\n keyboardNavigation?: ContextMenuKeyboardNavigation;\n onClose?: () => void;\n onMenuLevelChange?: (level: number) => void;\n /** Duration (ms) to keep submenu transition direction active for forward/backward animations. */\n submenuTransitionDurationMs?: number;\n} & ContextMenuLevel;\n\n/** When provided, ContextMenu renders inside DialogAnchor and wires menu level for submenu alignment. */\ntype ContextMenuAnchorProps = Partial<\n Pick<\n DialogAnchorProps,\n | 'id'\n | 'dialogManagerId'\n | 'placement'\n | 'referenceElement'\n | 'tabIndex'\n | 'trapFocus'\n | 'allowFlip'\n | 'closeOnClickOutside'\n | 'focus'\n | 'closeTransitionMs'\n | 'offset'\n >\n>;\n\nexport type ContextMenuProps = ContextMenuBaseProps & ContextMenuAnchorProps;\n\nexport type ContextMenuContentProps = ContextMenuBaseProps & {\n anchorReferenceElement?: HTMLElement | null;\n transitionDirection?: 'forward' | 'backward';\n};\n\n/**\n * Internal/default content renderer for {@link ContextMenu}.\n *\n * Override this through `ComponentContext.ContextMenuContent` when you need to\n * customize submenu/back navigation behavior while keeping the same anchor/focus\n * handling from `ContextMenu`.\n */\nexport function ContextMenuContent({\n anchorReferenceElement,\n backLabel = 'Back',\n children,\n className,\n enableAnimations = true,\n Header,\n items,\n ItemsWrapper,\n keyboardNavigation,\n menuClassName,\n onClose,\n onMenuLevelChange,\n transitionDirection,\n ...props\n}: ContextMenuContentProps) {\n const rootLevel = useMemo<ContextMenuLevel>(\n () => ({\n Header,\n items,\n ItemsWrapper,\n menuClassName,\n }),\n [Header, items, ItemsWrapper, menuClassName],\n );\n const [menuStack, setMenuStack] = useState<ContextMenuLevel[]>(() => [rootLevel]);\n const [menuBodyAnimationKey, setMenuBodyAnimationKey] = useState(0);\n const contextMenuRootRef = useRef<HTMLDivElement | null>(null);\n const focusRestoreRequestRef = useRef<ContextMenuFocusRestoreRequest | null>(null);\n const activeMenu = menuStack[menuStack.length - 1];\n\n const ActiveMenuItemsWrapper = activeMenu.ItemsWrapper ?? React.Fragment;\n\n const closeMenu = useCallback(() => {\n onClose?.();\n }, [onClose]);\n\n const openSubmenu = useCallback(\n ({\n focusReturnTarget,\n Header,\n ItemsWrapper: SubmenuItemsWrapper,\n menuClassName,\n Submenu,\n }: ContextMenuOpenSubmenuParams) => {\n const nextLevel: ContextMenuLevel = {\n focusRestoreRequest: createContextMenuFocusRestoreRequest({\n contextMenuRoot: contextMenuRootRef.current,\n focusReturnTarget,\n }),\n Header,\n ItemsWrapper: SubmenuItemsWrapper ?? ItemsWrapper,\n menuClassName,\n Submenu,\n };\n setMenuStack((current) => [...current, nextLevel]);\n },\n [ItemsWrapper],\n );\n\n const returnToParentMenu = useCallback(() => {\n setMenuStack((current) => {\n if (current.length <= 1) return current;\n focusRestoreRequestRef.current =\n current[current.length - 1]?.focusRestoreRequest ?? null;\n return current.slice(0, -1);\n });\n }, []);\n\n useEffect(() => {\n setMenuStack((current) => {\n if (current.length === 1 && current[0] === rootLevel) return current;\n return [rootLevel];\n });\n }, [rootLevel]);\n\n useEffect(() => {\n onMenuLevelChange?.(menuStack.length);\n }, [menuStack.length, onMenuLevelChange]);\n\n useEffect(() => {\n const focusRestoreRequest = focusRestoreRequestRef.current;\n if (!focusRestoreRequest) return;\n focusRestoreRequestRef.current = null;\n\n requestAnimationFrame(() => {\n resolveContextMenuFocusRestoreTarget({\n contextMenuRoot: contextMenuRootRef.current,\n request: focusRestoreRequest,\n })?.focus();\n });\n }, [menuStack.length]);\n\n useEffect(() => {\n if (!transitionDirection) return;\n setMenuBodyAnimationKey((value) => value + 1);\n }, [transitionDirection, menuStack.length]);\n\n const dialogSubmenuOpenCountRef = useRef(0);\n\n const registerDialogSubmenu = useCallback(() => {\n dialogSubmenuOpenCountRef.current += 1;\n }, []);\n\n const unregisterDialogSubmenu = useCallback(() => {\n dialogSubmenuOpenCountRef.current = Math.max(\n 0,\n dialogSubmenuOpenCountRef.current - 1,\n );\n }, []);\n\n const rovingFocusKeyDownHandler = useMemo(() => {\n const itemSelector =\n keyboardNavigation?.itemSelector ??\n DEFAULT_CONTEXT_MENU_KEYBOARD_NAVIGATION_ITEM_SELECTOR;\n\n return createRovingFocusKeyDownHandler<HTMLElement>({\n getItems: (event) =>\n getVisibleContextMenuKeyboardNavigationItems(event.currentTarget, itemSelector),\n });\n }, [keyboardNavigation]);\n\n const escapeConsumedRef = useRef(false);\n\n const keyboardNavigationHandler = useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Escape') {\n if (dialogSubmenuOpenCountRef.current > 0) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n if (menuStack.length > 1) {\n escapeConsumedRef.current = true;\n returnToParentMenu();\n } else {\n closeMenu();\n }\n return;\n }\n\n rovingFocusKeyDownHandler(event);\n },\n [closeMenu, menuStack.length, returnToParentMenu, rovingFocusKeyDownHandler],\n );\n\n const suppressEscapeKeyUp = useCallback((event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Escape' && escapeConsumedRef.current) {\n escapeConsumedRef.current = false;\n event.stopPropagation();\n }\n }, []);\n\n return (\n <ContextMenuContext.Provider\n value={{\n anchorReferenceElement,\n closeMenu,\n openSubmenu,\n registerDialogSubmenu,\n returnToParentMenu,\n unregisterDialogSubmenu,\n }}\n >\n <ContextMenuRoot\n className={clsx(className, activeMenu.menuClassName)}\n data-str-chat-enable-animations={enableAnimations}\n onKeyDownCapture={keyboardNavigationHandler}\n onKeyUpCapture={suppressEscapeKeyUp}\n ref={contextMenuRootRef}\n {...props}\n >\n {activeMenu.Header ? (\n <activeMenu.Header />\n ) : menuStack.length > 1 ? (\n <ContextMenuHeader>\n <ContextMenuBackButton onClick={returnToParentMenu}>\n <IconChevronLeft />\n <span>{backLabel}</span>\n </ContextMenuBackButton>\n </ContextMenuHeader>\n ) : null}\n <ContextMenuBody\n className={clsx({\n 'str-chat__context-menu__body--submenu-backward':\n transitionDirection === 'backward',\n 'str-chat__context-menu__body--submenu-forward':\n transitionDirection === 'forward',\n })}\n key={`context-menu-body-${menuStack.length}-${menuBodyAnimationKey}`}\n >\n {activeMenu.Submenu ? (\n <activeMenu.Submenu />\n ) : (\n <ActiveMenuItemsWrapper>\n {typeof children !== 'undefined'\n ? children\n : activeMenu.items?.map((Item, index) => (\n <Item key={`context-menu-item-${index}`} />\n ))}\n </ActiveMenuItemsWrapper>\n )}\n </ContextMenuBody>\n </ContextMenuRoot>\n </ContextMenuContext.Provider>\n );\n}\n\n/**\n * Contextual actions menu that can be used in two modes:\n *\n * - Anchored dialog mode: pass `id` + `referenceElement` (submenu-aware positioning).\n * - Inline mode: omit `id` and render a plain contextual list.\n *\n * Customization via `ComponentContext`:\n *\n * - `ContextMenu`: replace the whole menu container/behavior.\n * - `ContextMenuContent`: keep default container behavior but customize menu content\n * rendering (items, submenu transitions, back navigation UI).\n * - To customize outside-click dismissal via `ComponentContext`, provide a custom\n * `ContextMenu` that sets `closeOnClickOutside`:\n *\n * ```tsx\n * const CustomContextMenu = (props: ContextMenuProps) => (\n * <ContextMenu {...props} closeOnClickOutside={false} />\n * );\n *\n * <ComponentProvider value={{ ContextMenu: CustomContextMenu }}>\n * <Chat client={client}>{children}</Chat>\n * </ComponentProvider>\n * ```\n *\n * Example:\n * ```tsx\n * <ComponentProvider\n * value={{\n * ContextMenu: MyContextMenu,\n * ContextMenuContent: MyContextMenuContent,\n * }}\n * >\n * <Chat client={client}>{children}</Chat>\n * </ComponentProvider>\n * ```\n */\nexport const ContextMenu = (props: ContextMenuProps) => {\n const { ContextMenuContent: ContextMenuContentComponent = ContextMenuContent } =\n useComponentContext();\n const {\n allowFlip,\n closeOnClickOutside,\n closeTransitionMs = 130,\n dialogManagerId,\n focus,\n id,\n offset = 8,\n onMenuLevelChange: onMenuLevelChangeProp,\n placement,\n referenceElement,\n submenuTransitionDurationMs,\n tabIndex,\n trapFocus,\n ...menuProps\n } = props;\n const resolvedSubmenuTransitionDurationMs = submenuTransitionDurationMs ?? 460;\n\n const isAnchored = id != null;\n\n const [menuLevel, setMenuLevel] = useState(1);\n const [transitionDirection, setTransitionDirection] = useState<\n 'forward' | 'backward' | undefined\n >(undefined);\n const [contentResetToken, setContentResetToken] = useState(0);\n const transitionTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const previousMenuLevelRef = useRef(1);\n const open = useDialogIsOpen(id ?? '', dialogManagerId);\n const previousOpenRef = useRef(open);\n\n useEffect(() => {\n if (!isAnchored) return;\n\n if (previousOpenRef.current && !open) {\n setMenuLevel(1);\n setTransitionDirection(undefined);\n setContentResetToken((value) => value + 1);\n previousMenuLevelRef.current = 1;\n if (transitionTimeoutRef.current) {\n clearTimeout(transitionTimeoutRef.current);\n transitionTimeoutRef.current = null;\n }\n }\n previousOpenRef.current = open;\n }, [isAnchored, open]);\n\n useEffect(\n () => () => {\n if (transitionTimeoutRef.current) {\n clearTimeout(transitionTimeoutRef.current);\n }\n },\n [],\n );\n\n const handleMenuLevelChange = useCallback(\n (level: number) => {\n if (isAnchored) {\n const previousLevel = previousMenuLevelRef.current;\n if (level !== previousLevel) {\n setTransitionDirection(level > previousLevel ? 'forward' : 'backward');\n if (transitionTimeoutRef.current) clearTimeout(transitionTimeoutRef.current);\n transitionTimeoutRef.current = setTimeout(() => {\n setTransitionDirection(undefined);\n transitionTimeoutRef.current = null;\n }, resolvedSubmenuTransitionDurationMs);\n }\n previousMenuLevelRef.current = level;\n setMenuLevel(level);\n return;\n }\n onMenuLevelChangeProp?.(level);\n },\n [isAnchored, onMenuLevelChangeProp, resolvedSubmenuTransitionDurationMs],\n );\n\n const content = (\n <ContextMenuContentComponent\n anchorReferenceElement={isAnchored ? referenceElement : undefined}\n {...menuProps}\n key={`context-menu-content-${contentResetToken}`}\n onMenuLevelChange={handleMenuLevelChange}\n transitionDirection={transitionDirection}\n />\n );\n\n if (isAnchored) {\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n backLabel: _b,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n enableAnimations: _ea,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Header: _h,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n items: _i,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ItemsWrapper: _w,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n keyboardNavigation: _kn,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n menuClassName: _m,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onClose: _c,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n role: _r,\n ...anchorDivProps\n } = menuProps;\n return (\n <DialogAnchor\n allowFlip={allowFlip}\n closeOnClickOutside={closeOnClickOutside}\n closeTransitionMs={closeTransitionMs}\n dialogManagerId={dialogManagerId}\n focus={focus}\n id={id}\n offset={offset}\n placement={placement}\n referenceElement={referenceElement}\n tabIndex={tabIndex}\n trapFocus={trapFocus}\n updateKey={menuLevel}\n {...anchorDivProps}\n >\n {content}\n </DialogAnchor>\n );\n }\n\n return content;\n};\n","import React, { type ComponentProps, type PropsWithChildren } from 'react';\nimport clsx from 'clsx';\nimport { Button, type ButtonProps } from '../../Button';\nimport { IconArrowLeft, IconXmark } from '../../Icons';\nimport { useModalContext, useTranslationContext } from '../../../context';\nimport { useAriaIdentifiers } from '../../../a11y/hooks/useAriaIdentifiers';\n\nconst PromptRoot = ({ children, className, ...props }: ComponentProps<'div'>) => (\n <div {...props} className={clsx('str-chat__prompt', className)}>\n {children}\n </div>\n);\n\nexport type PromptHeaderProps = {\n title: React.ReactNode;\n className?: string;\n close?: () => void;\n description?: string;\n descriptionId?: string;\n goBack?: () => void;\n LeadingContent?: React.ComponentType;\n titleId?: string;\n TrailingContent?: React.ComponentType;\n};\n\nconst PromptHeader = ({\n className,\n close,\n description,\n descriptionId,\n goBack,\n LeadingContent,\n title,\n titleId,\n TrailingContent,\n}: PromptHeaderProps) => {\n const { t } = useTranslationContext();\n const { dialogId } = useModalContext();\n const { descriptionId: derivedDescriptionId, titleId: derivedTitleId } =\n useAriaIdentifiers(dialogId);\n const resolvedTitleId = titleId ?? derivedTitleId;\n const resolvedDescriptionId = descriptionId ?? derivedDescriptionId;\n const hasDescription = description != null && description !== '';\n\n return (\n <div\n className={clsx('str-chat__prompt__header', className, {\n 'str-chat__prompt__header--withDescription': hasDescription,\n 'str-chat__prompt__header--withGoBack': goBack,\n })}\n >\n {LeadingContent && (\n <div className='str-chat__prompt__header__leading-content'>\n <LeadingContent />\n </div>\n )}\n <div className={clsx('str-chat__prompt__header__title-group')}>\n {goBack && (\n <Button\n appearance='ghost'\n aria-label={t('Go back')}\n circular\n className='str-chat__prompt__header__go-back-button'\n onClick={goBack}\n size='md'\n variant='secondary'\n >\n <IconArrowLeft />\n </Button>\n )}\n <h2 className='str-chat__prompt__header__title' id={resolvedTitleId}>\n {title}\n </h2>\n {hasDescription && (\n <p className='str-chat__prompt__header__description' id={resolvedDescriptionId}>\n {description}\n </p>\n )}\n </div>\n {(close || TrailingContent) && (\n <div className='str-chat__prompt__header__trailing-content'>\n {TrailingContent && <TrailingContent />}\n {close && (\n <Button\n appearance='ghost'\n aria-describedby={hasDescription ? resolvedDescriptionId : undefined}\n aria-label={\n typeof title === 'string'\n ? t('Close prompt: {{ title }}', { title })\n : t('Close')\n }\n circular\n className='str-chat__prompt__header__close-button'\n onClick={close}\n size='md'\n variant='secondary'\n >\n <IconXmark />\n </Button>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport type PromptBodyProps = PropsWithChildren<{\n className?: string;\n}>;\n\nconst PromptBody = ({ children, className }: PromptBodyProps) => (\n <div className={clsx('str-chat__prompt__body', className)}>{children}</div>\n);\n\nexport type PromptFooterProps = PropsWithChildren<{\n className?: string;\n}>;\n\nconst PromptFooter = ({ children, className }: PromptFooterProps) => (\n <div className={clsx('str-chat__prompt__footer', className)}>{children}</div>\n);\n\ntype PromptFooterControlsProps = PropsWithChildren<{\n className?: string;\n}>;\n\nconst PromptFooterControls = ({ children, className }: PromptFooterControlsProps) => (\n <div className={clsx('str-chat__prompt__footer__controls', className)}>{children}</div>\n);\n\nconst PromptFooterControlsButtonSecondary = ({ className, ...props }: ButtonProps) => (\n <Button\n appearance='ghost'\n className={clsx('str-chat__prompt__footer__controls-button', className)}\n size='md'\n variant='secondary'\n {...props}\n />\n);\n\nconst PromptFooterControlsButtonPrimary = ({ className, ...props }: ButtonProps) => (\n <Button\n appearance='solid'\n className={clsx('str-chat__prompt__footer__controls-button', className)}\n size='md'\n variant='primary'\n {...props}\n />\n);\n\nexport const Prompt = {\n Body: PromptBody,\n Footer: PromptFooter,\n FooterControls: PromptFooterControls,\n FooterControlsButtonPrimary: PromptFooterControlsButtonPrimary,\n FooterControlsButtonSecondary: PromptFooterControlsButtonSecondary,\n Header: PromptHeader,\n Root: PromptRoot,\n};\n","import { useMemo } from 'react';\nimport { useAriaIdentifiers } from './useAriaIdentifiers';\n\nexport type ResolvedModalAriaProps = {\n 'aria-describedby'?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\ntype UseResolvedModalAriaPropsParams = {\n ariaDescribedby?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n dialogId?: string;\n};\n\n/**\n * Resolves modal labeling/description attributes from explicit props first,\n * then from the modal dialog id convention (`${dialogId}-title|description`).\n *\n * Rules:\n * - `aria-labelledby` wins over `aria-label`.\n * - `aria-describedby` defaults to inferred id when explicit value is absent.\n */\nexport const useResolvedModalAriaProps = ({\n ariaDescribedby,\n ariaLabel,\n ariaLabelledby,\n dialogId,\n}: UseResolvedModalAriaPropsParams): ResolvedModalAriaProps => {\n const { descriptionId, titleId } = useAriaIdentifiers(dialogId);\n\n return useMemo(() => {\n const resolvedAriaLabelledby = ariaLabel\n ? ariaLabelledby\n : (ariaLabelledby ?? titleId);\n const resolvedAriaDescribedby = ariaDescribedby ?? descriptionId;\n const resolvedAriaLabel = resolvedAriaLabelledby ? undefined : ariaLabel;\n\n return {\n 'aria-describedby': resolvedAriaDescribedby,\n 'aria-label': resolvedAriaLabel,\n 'aria-labelledby': resolvedAriaLabelledby,\n };\n }, [ariaDescribedby, ariaLabel, ariaLabelledby, descriptionId, titleId]);\n};\n","import clsx from 'clsx';\nimport React, {\n type ComponentProps,\n type ComponentType,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { FocusScope } from '@react-aria/focus';\n\nimport { NotificationList as DefaultNotificationList } from '../Notifications';\nimport {\n DialogManagerProvider,\n ModalContextProvider,\n modalDialogManagerId,\n useChatContext,\n useComponentContext,\n} from '../../context';\nimport {\n DialogPortalEntry,\n modalDialogId,\n useModalDialog,\n useModalDialogIsOpen,\n useModalDialogIsTopmost,\n} from '../Dialog';\nimport { useResolvedModalAriaProps } from '../../a11y/hooks/useResolvedModalAriaProps';\nimport { useStableId } from '../UtilityComponents/useStableId';\n\nexport type ModalCloseEvent =\n | KeyboardEvent\n | React.KeyboardEvent\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>;\n\nexport type ModalCloseSource = 'overlay' | 'button' | 'escape';\n\nexport type ModalProps = {\n /** If true, modal is opened or visible. */\n open: boolean;\n /** Custom class to be applied to the modal root div */\n className?: string;\n /** Optional stable id for this modal instance. Generated automatically when omitted. */\n dialogId?: string;\n /** Properties forwarded to the root div within which the dialog content is rendered */\n dialogRootProps?: Omit<\n ComponentProps<'div'>,\n 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'role'\n >;\n /** Accessible label for the modal dialog. Ignored when aria-labelledby is provided. */\n 'aria-label'?: string;\n /** ID of the element that labels the modal dialog. */\n 'aria-labelledby'?: string;\n /** ID of the element that describes the modal dialog. */\n 'aria-describedby'?: string;\n /** ARIA role for the modal dialog surface. */\n role?: 'alertdialog' | 'dialog';\n /** If provided, the close button is rendered on overlay */\n CloseButtonOnOverlay?: ComponentType<ComponentProps<'button'>>;\n /** Callback handler for closing of modal. */\n onClose?: (event: ModalCloseEvent) => void;\n /** Optional handler to intercept closing logic. Return false to prevent onClose. */\n onCloseAttempt?: (source: ModalCloseSource, event: ModalCloseEvent) => boolean;\n};\n\nexport const GlobalModal = ({\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n className,\n CloseButtonOnOverlay,\n dialogId,\n dialogRootProps,\n onClose,\n onCloseAttempt,\n open,\n role = 'dialog',\n}: PropsWithChildren<ModalProps>) => {\n const generatedDialogId = useStableId();\n const resolvedDialogId = dialogId ?? `${modalDialogId}-${generatedDialogId}`;\n const dialog = useModalDialog(resolvedDialogId);\n const isOpen = useModalDialogIsOpen(resolvedDialogId);\n const isTopmost = useModalDialogIsTopmost(resolvedDialogId);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const closeButtonRef = useRef<HTMLButtonElement | null>(null);\n const closingRef = useRef(false);\n const { theme } = useChatContext();\n const { NotificationList = DefaultNotificationList } = useComponentContext();\n const {\n className: dialogRootClassName,\n onKeyDown: dialogRootOnKeyDown,\n ...dialogRootPropsRest\n } = dialogRootProps ?? {};\n const dialogLabelingBaseId = dialog.id;\n const resolvedModalAriaProps = useResolvedModalAriaProps({\n ariaDescribedby,\n ariaLabel,\n ariaLabelledby,\n dialogId: dialogLabelingBaseId,\n });\n\n const maybeClose = useCallback(\n (source: ModalCloseSource, event: ModalCloseEvent) => {\n const allow = onCloseAttempt?.(source, event);\n if (allow !== false) {\n dialog.close();\n closingRef.current = true;\n onClose?.(event);\n }\n },\n [dialog, onClose, onCloseAttempt],\n );\n\n const modalContextValue = useMemo<{ close: () => void; dialogId?: string }>(\n () => ({\n close: () => maybeClose('button', {} as ModalCloseEvent),\n dialogId: dialogLabelingBaseId,\n }),\n [dialogLabelingBaseId, maybeClose],\n );\n\n const handleOverlayClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (!isTopmost) return;\n const target = event.target as HTMLDivElement;\n if (overlayRef.current === target) {\n maybeClose('overlay', event);\n }\n };\n\n const handleCloseButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!isTopmost) return;\n maybeClose('button', event);\n };\n\n const handleDialogKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n dialogRootOnKeyDown?.(event);\n if (event.defaultPrevented || event.key !== 'Escape' || !isTopmost) return;\n maybeClose('escape', event);\n };\n\n // Sync open prop to dialog state.\n // closingRef blocks re-open when we just closed and parent hasn't set open=false yet.\n useEffect(() => {\n if (!open) {\n closingRef.current = false;\n if (isOpen) {\n dialog.close();\n }\n return;\n }\n if (open && !isOpen && !closingRef.current) {\n dialog.open();\n }\n }, [dialog, isOpen, open]);\n\n if (!open || !isOpen) return null;\n\n return (\n <DialogPortalEntry dialogId={resolvedDialogId} dialogManagerId={modalDialogManagerId}>\n <ModalContextProvider value={modalContextValue}>\n <div\n className={clsx(\n 'str-chat',\n theme,\n 'str-chat__modal str-chat-react__modal str-chat__modal--open',\n className,\n )}\n onClick={handleOverlayClick}\n ref={overlayRef}\n >\n <FocusScope autoFocus={isTopmost} contain={isTopmost} restoreFocus>\n <div\n {...dialogRootPropsRest}\n aria-describedby={resolvedModalAriaProps['aria-describedby']}\n aria-label={resolvedModalAriaProps['aria-label']}\n aria-labelledby={resolvedModalAriaProps['aria-labelledby']}\n aria-modal={isTopmost ? 'true' : undefined}\n className={clsx('str-chat__modal__dialog', dialogRootClassName)}\n inert={isTopmost ? undefined : true}\n onKeyDown={handleDialogKeyDown}\n role={role}\n tabIndex={isTopmost ? 0 : -1}\n >\n <DialogManagerProvider\n id={`${resolvedDialogId}-floating-dialog-manager`}\n portalDestinationProps={{\n captureOutsideClicks: true,\n className: 'str-chat__modal__floating-dialog-overlay',\n }}\n >\n {children}\n </DialogManagerProvider>\n </div>\n </FocusScope>\n <NotificationList\n className='str-chat__modal__notification-list'\n panel='modal'\n verticalAlignment='top'\n />\n {CloseButtonOnOverlay && (\n <CloseButtonOnOverlay onClick={handleCloseButtonClick} ref={closeButtonRef} />\n )}\n </div>\n </ModalContextProvider>\n </DialogPortalEntry>\n );\n};\n","import type { Visitor } from 'unist-util-visit';\nimport { visit } from 'unist-util-visit';\n\n// `Nodes` is not part of hast-util-find-and-replace's public surface; derive\n// the visit-compatible tree type from `visit` itself.\ntype Nodes = Parameters<typeof visit>[0];\n\nconst visitor: Visitor = (node) => {\n if (node.type !== 'html') return;\n\n node.type = 'text';\n};\nconst transform = (tree: Nodes) => {\n visit(tree, visitor);\n};\n\nexport const htmlToTextPlugin = () => transform;\n","import { SKIP, visit, type VisitorResult } from 'unist-util-visit';\nimport type { Image, Link, Parent, Text } from 'mdast';\nimport type { Node } from 'unist';\n\ntype ImgVisitor = (\n node: Image,\n index: number | null,\n parent: Parent | null,\n) => VisitorResult;\n\nexport type ImageToLinkPluginOptions = {\n getTextLabelFrom?: 'alt' | 'title' | 'url';\n};\n\nconst text = (value: string): Text => ({ type: 'text', value });\n\n/**\n * Converts image Markdown links (![Minion](https://octodex.github.com/images/minion.png))\n * to HTML <a href={url}>{url | title | alt}</a>\n *\n * By default, the anchor text content is the image url so that image preview can be generated / enriched on the server.\n * @param getTextLabelFrom\n */\nexport function imageToLink({ getTextLabelFrom = 'url' }: ImageToLinkPluginOptions = {}) {\n return (tree: Node) => {\n const visitor: ImgVisitor = (node, index, parent) => {\n if (parent == null || index == null) return;\n\n const label = node[getTextLabelFrom] ?? node.url; // node.alt || node.title || node.url;\n const link: Link = {\n children: [text(label)],\n title: node.title ?? node.alt ?? node.url,\n type: 'link',\n url: node.url,\n };\n\n parent.children.splice(index, 1, link);\n return [SKIP, index + 1] as const;\n };\n\n visit(tree, 'image', visitor);\n };\n}\n","// remark-plusplus-ins.ts\nimport type { Plugin } from 'unified';\nimport { SKIP, visit } from 'unist-util-visit';\nimport type { Visitor } from 'unist-util-visit';\nimport type { Parent, PhrasingContent, Text } from 'mdast';\n\n/**\n * \\S → first char must be non-whitespace\n * (?:...)?→ optional middle+closing when length > 1\n * [\\s\\S]*?→ anything (including newlines), lazy\n * final \\S→ last char non-whitespace (only required when there’s more than 1)\n *\n * Matches:\n * ++a++\n * Does not match:\n * ++++\n * ++ ++\n */\nconst INS_REGEX = /\\+\\+(\\S(?:[\\s\\S]*?\\S)?)\\+\\+/g;\nconst IGNORE_NODE_TYPES = new Set([\n 'code',\n 'inlineCode',\n 'link',\n 'linkReference',\n 'definition',\n 'math',\n 'inlineMath',\n]);\n\n/**\n * Converts MD \"++Some text++\" to inserted text element rendered in HTML as <ins>Some text</ins>\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ins\n */\nexport const plusPlusToEmphasis: Plugin<[]> = () => {\n const visitor: Visitor = (node, index, parent) => {\n // 1) Don’t traverse inside ignored nodes\n if (IGNORE_NODE_TYPES.has(node.type)) return SKIP;\n\n // 2) Only transform text nodes with a valid parent + index\n if (node.type !== 'text' || parent == null || typeof index !== 'number') return;\n\n const value = (node as Text).value;\n\n // Reset lastIndex to 0 per node so each node is scanned from the beginning\n INS_REGEX.lastIndex = 0;\n\n let match: RegExpExecArray | null;\n let last = 0;\n const out: PhrasingContent[] = [];\n\n while ((match = INS_REGEX.exec(value))) {\n const [full, inner] = match;\n const start = match.index;\n\n if (start > last) out.push({ type: 'text', value: value.slice(last, start) });\n\n // Render as <ins>…</ins> (remark-rehype respects data.hName)\n out.push({\n children: [{ type: 'text', value: inner }],\n data: { hName: 'ins' },\n type: 'emphasis',\n });\n\n last = start + full.length;\n }\n\n if (out.length === 0) return; // nothing to change\n if (last < value.length) out.push({ type: 'text', value: value.slice(last) });\n\n (parent as Parent).children.splice(index, 1, ...out);\n\n // Skip re-visiting the replaced range; continue after inserted nodes\n return [SKIP, index + out.length];\n };\n\n return (tree) => visit(tree, visitor);\n};\n","import React, { useMemo } from 'react';\n\nimport { useMessageContext } from '../../context/MessageContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { getDateString, isDate } from '../../i18n/utils';\nimport type { TimestampFormatterOptions } from '../../i18n/types';\n\nexport interface TimestampProps extends TimestampFormatterOptions {\n /* Adds a CSS class name to the component's outer `time` container. */\n customClass?: string;\n /* Timestamp to display */\n timestamp?: Date | string;\n}\n\nexport function Timestamp(props: TimestampProps) {\n const { calendar, calendarFormats, customClass, format, timestamp } = props;\n\n const { formatDate } = useMessageContext('MessageTimestamp');\n const { t, tDateTimeParser } = useTranslationContext('MessageTimestamp');\n\n const normalizedTimestamp =\n timestamp && isDate(timestamp) ? timestamp.toISOString() : timestamp;\n\n const when = useMemo(\n () =>\n getDateString({\n calendar,\n calendarFormats,\n format,\n formatDate,\n messageCreatedAt: normalizedTimestamp,\n t,\n tDateTimeParser,\n timestampTranslationKey: 'timestamp/MessageTimestamp',\n }),\n [\n calendar,\n calendarFormats,\n format,\n formatDate,\n normalizedTimestamp,\n t,\n tDateTimeParser,\n ],\n );\n\n if (!when) {\n return null;\n }\n\n return (\n <time\n className={customClass}\n dateTime={normalizedTimestamp}\n title={normalizedTimestamp}\n >\n {when}\n </time>\n );\n}\n","import React from 'react';\nimport { useMessageContext } from '../../context/MessageContext';\nimport { Timestamp as DefaultTimestamp } from './Timestamp';\nimport { useComponentContext } from '../../context';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { TimestampFormatterOptions } from '../../i18n/types';\n\nexport type MessageTimestampProps = TimestampFormatterOptions & {\n /* Adds a CSS class name to the component's outer `time` container. */\n customClass?: string;\n /* The `StreamChat` message object, which provides necessary data to the underlying UI components (overrides the value from `MessageContext`) */\n message?: LocalMessage;\n};\n\nconst UnMemoizedMessageTimestamp = (props: MessageTimestampProps) => {\n const { message: propMessage, ...timestampProps } = props;\n const { message: contextMessage } = useMessageContext('MessageTimestamp');\n const { Timestamp = DefaultTimestamp } = useComponentContext('MessageTimestamp');\n const message = propMessage || contextMessage;\n return <Timestamp timestamp={message.created_at} {...timestampProps} />;\n};\n\nexport const MessageTimestamp = React.memo(\n UnMemoizedMessageTimestamp,\n) as typeof UnMemoizedMessageTimestamp;\n","import React from 'react';\nimport clsx from 'clsx';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\n\nimport { useTranslationContext } from '../../../context';\nimport { IconDownload } from '../../Icons';\n\nexport type DownloadButtonProps = {\n /** Attachment asset URL (e.g. `asset_url`). */\n assetUrl?: string;\n className?: string;\n /** Suggested filename for the `download` attribute (not the HTML `title` tooltip). */\n suggestedFileName?: string;\n /** Native browser tooltip; defaults to translated “Download Attachment”. */\n tooltipTitle?: string;\n};\n\n/**\n * Icon download control for {@link Audio} and {@link FileAttachment} rows.\n * (BaseImage defines its own small download link when `showDownloadButtonOnError` is used.)\n */\nexport const DownloadButton = ({\n assetUrl,\n className,\n suggestedFileName,\n tooltipTitle,\n}: DownloadButtonProps) => {\n const { t } = useTranslationContext();\n if (!assetUrl) return null;\n const href = sanitizeUrl(assetUrl);\n if (!href) return null;\n\n return (\n <a\n aria-label={t('aria/Download attachment')}\n className={clsx(\n 'str-chat__button',\n 'str-chat__button--secondary',\n 'str-chat__button--outline',\n 'str-chat__button--circular',\n 'str-chat__button--size-sm',\n 'str-chat__audio-attachment-download-button',\n className,\n )}\n download={suggestedFileName ?? ''}\n href={href}\n rel='noopener noreferrer'\n target='_blank'\n title={tooltipTitle ?? t('Download Attachment')}\n >\n <div className='str-chat__button__content'>\n <IconDownload className='str-chat__icon str-chat__audio-attachment-download-button__icon' />\n </div>\n </a>\n );\n};\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport React from 'react';\nimport clsx from 'clsx';\n\nexport const BASE_FILE_ICON_CLASSNAME = 'str-chat__file-icon' as const;\nexport const FILE_ICON_GRAPHIC_CLASSNAME = 'str-chat__file-icon__graphic' as const;\n/** Add this class (e.g. via className) when hiding the label with CSS to center the icon graphic. */\nexport const FILE_ICON_NO_LABEL_CLASSNAME = 'str-chat__file-icon--no-label' as const;\n\nexport type FileIconSize = 'sm' | 'md' | 'lg' | 'xl';\n\nexport type FileIconSizeConfigEntry = {\n width: number;\n height: number;\n labelX: number;\n labelY: number;\n};\n\n/** Rendered dimensions (px) and label position in viewBox coords for consistent spacing. */\nexport const FILE_ICON_SIZE_CONFIG: Record<FileIconSize, FileIconSizeConfigEntry> = {\n lg: { height: 40, labelX: 16, labelY: 36, width: 32 },\n md: { height: 32, labelX: 16, labelY: 35, width: 26 },\n sm: { height: 24, labelX: 16, labelY: 31.5, width: 19 },\n xl: { height: 48, labelX: 16, labelY: 36, width: 40 },\n};\n\n/** Merge partial overrides with default config. Use for Chat-level fileIconSizeConfig. */\nexport const mergeFileIconSizeConfig = (\n overrides?: Partial<Record<FileIconSize, Partial<FileIconSizeConfigEntry>>>,\n): Record<FileIconSize, FileIconSizeConfigEntry> => {\n if (!overrides) return FILE_ICON_SIZE_CONFIG;\n return (['sm', 'md', 'lg', 'xl'] as const).reduce(\n (acc, size) => ({\n ...acc,\n [size]: { ...FILE_ICON_SIZE_CONFIG[size], ...overrides[size] },\n }),\n {} as Record<FileIconSize, FileIconSizeConfigEntry>,\n );\n};\n\nconst FILE_ICON_VIEWBOX = { height: 40, width: 32 } as const;\nconst FILE_ICON_PAPER_PATH =\n 'M0 4C0 1.79086 1.79086 0 4 0H22.4L32 10V36C32 38.2091 30.2091 40 28 40H4C1.79086 40 0 38.2091 0 36V4Z';\nconst FILE_ICON_FOLD_PATH = 'M32 10H25.4C23.7431 10 22.4 8.65685 22.4 7V0L32 10Z';\nconst FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_X = 32 / 26;\nconst FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_Y = 40 / 32;\n\nexport type BaseFileIconProps = {\n label?: string;\n /** Resolved size config (defaults from FILE_ICON_SIZE_CONFIG when omitted). Pass sizeConfig on FileIcon or use AttachmentFileIcon to override. */\n sizeConfig?: Record<FileIconSize, FileIconSizeConfigEntry>;\n size?: FileIconSize;\n} & ComponentPropsWithoutRef<'svg'>;\n\ntype SvgProps = Omit<BaseFileIconProps, 'label'>;\n\nconst Svg = ({ className, size, sizeConfig, ...props }: SvgProps) => {\n const config = sizeConfig ?? FILE_ICON_SIZE_CONFIG;\n const dimensions = size ? config[size] : undefined;\n const dimensionsStyle = dimensions\n ? {\n flexShrink: 0,\n height: `${dimensions.height}px`,\n width: `${dimensions.width}px`,\n }\n : undefined;\n\n return (\n <svg\n height={dimensions?.height}\n viewBox={`0 0 ${FILE_ICON_VIEWBOX.width} ${FILE_ICON_VIEWBOX.height}`}\n width={dimensions?.width}\n xmlns='http://www.w3.org/2000/svg'\n {...props}\n className={clsx(\n BASE_FILE_ICON_CLASSNAME,\n { [`${BASE_FILE_ICON_CLASSNAME}--size-${size}`]: size },\n className,\n )}\n style={{ ...dimensionsStyle, ...props.style }}\n />\n );\n};\n\ntype FileIconLabelProps = {\n label?: string;\n size?: FileIconSize;\n sizeConfig?: Record<FileIconSize, FileIconSizeConfigEntry>;\n};\n\nconst FileIconLabel = ({ label, size, sizeConfig }: FileIconLabelProps) => {\n const configMap = sizeConfig ?? FILE_ICON_SIZE_CONFIG;\n const config = size ? configMap[size] : { labelX: 16, labelY: 33 };\n return (\n <text className='str-chat__file-icon__label' x={config.labelX} y={config.labelY}>\n {label}\n </text>\n );\n};\n\ntype FileIconSymbolMap = {\n withCaption: ReactNode;\n withoutCaption: ReactNode;\n};\n\nconst TEXT_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <>\n <rect fill='white' height='1.6' rx='0.8' width='14.4' x='8' y='12.2' />\n <rect fill='white' height='1.6' rx='0.8' width='14.4' x='8' y='20.2' />\n <rect fill='white' height='1.6' rx='0.8' width='9.6' x='8' y='16.2' />\n </>\n ),\n withoutCaption: (\n <>\n <rect fill='white' height='1.4' rx='0.7' width='12.6' x='6' y='14.8' />\n <rect fill='white' height='1.4' rx='0.7' width='12.6' x='6' y='21.8' />\n <rect fill='white' height='1.4' rx='0.7' width='8.4' x='6' y='18.3' />\n </>\n ),\n};\n\nconst OTHER_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <>\n <rect fill='white' height='1.6' rx='0.8' width='14.4' x='8' y='13.2' />\n <rect fill='white' height='1.6' rx='0.8' width='14.4' x='8' y='21.2' />\n <rect fill='white' height='1.6' rx='0.8' width='9.6' x='8' y='17.2' />\n </>\n ),\n withoutCaption: TEXT_SYMBOLS.withoutCaption,\n};\n\nconst CODE_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n d='M14.5 22.5L17.5 11.5M20.1666 14.1667L21.9732 16.0862C22.4564 16.5996 22.4564 17.4004 21.9732 17.9138L20.1666 19.8333M11.8333 19.8333L10.0267 17.9138C9.54351 17.4004 9.54351 16.5996 10.0267 16.0862L11.8333 14.1667'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.2'\n />\n ),\n withoutCaption: (\n <path\n d='M11.6876 23.8125L14.3126 14.1875M16.646 16.5208L18.2267 18.2004C18.6495 18.6496 18.6495 19.3503 18.2267 19.7996L16.646 21.4792M9.3543 21.4792L7.77352 19.7996C7.35072 19.3503 7.35072 18.6496 7.77352 18.2004L9.3543 16.5208'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.33333'\n />\n ),\n};\n\nconst AUDIO_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n d='M20.5 15.5V18.5M22.5 14.5V19.5M13.5 19.5H10.5C10.3674 19.5 10.2402 19.4473 10.1464 19.3536C10.0527 19.2598 10 19.1326 10 19V15C10 14.8674 10.0527 14.7402 10.1464 14.6464C10.2402 14.5527 10.3674 14.5 10.5 14.5H13.5L18 11V23L13.5 19.5Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.2'\n />\n ),\n withoutCaption: (\n <path\n d='M17.5 17.5V20.5M19.5 16.5V21.5M10.5 21.5H7.5C7.36739 21.5 7.24021 21.4473 7.14645 21.3536C7.05268 21.2598 7 21.1326 7 21V17C7 16.8674 7.05268 16.7402 7.14645 16.6464C7.24021 16.5527 7.36739 16.5 7.5 16.5H10.5L15 13V25L10.5 21.5Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.33333'\n />\n ),\n};\n\nconst PRESENTATION_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n d='M12.5 15.5H19.5M16 17.5V22.5M14 22.5H18M9.49999 17.5C9.41472 17.5001 9.33085 17.4783 9.25635 17.4368C9.18185 17.3953 9.1192 17.3355 9.07436 17.263C9.02952 17.1904 9.00397 17.1076 9.00014 17.0224C8.99631 16.9373 9.01433 16.8525 9.05249 16.7762L11.5525 11.7763C11.5941 11.6932 11.6579 11.6233 11.737 11.5745C11.816 11.5257 11.9071 11.4999 12 11.5H20C20.0929 11.4999 20.184 11.5257 20.263 11.5745C20.342 11.6233 20.4059 11.6932 20.4475 11.7763L22.9475 16.7762C22.9857 16.8525 23.0037 16.9373 22.9998 17.0224C22.996 17.1076 22.9705 17.1904 22.9256 17.263C22.8808 17.3355 22.8181 17.3953 22.7436 17.4368C22.6691 17.4783 22.5853 17.5001 22.5 17.5H9.49999Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.2'\n />\n ),\n withoutCaption: (\n <path\n d='M9.49999 17.5H16.5M13 19.5V24.5M11 24.5H15M6.49999 19.5C6.41472 19.5001 6.33085 19.4783 6.25635 19.4368C6.18185 19.3953 6.11921 19.3355 6.07436 19.263C6.02952 19.1904 6.00397 19.1076 6.00014 19.0224C5.99631 18.9373 6.01433 18.8525 6.05249 18.7763L8.55249 13.7763C8.59406 13.6932 8.65795 13.6233 8.73699 13.5745C8.81603 13.5257 8.9071 13.4999 8.99999 13.5H17C17.0929 13.4999 17.184 13.5257 17.263 13.5745C17.342 13.6233 17.4059 13.6932 17.4475 13.7763L19.9475 18.7763C19.9857 18.8525 20.0037 18.9373 19.9998 19.0224C19.996 19.1076 19.9705 19.1904 19.9256 19.263C19.8808 19.3355 19.8181 19.3953 19.7436 19.4368C19.6691 19.4783 19.5853 19.5001 19.5 19.5H6.49999Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.33333'\n />\n ),\n};\n\nconst SPREADSHEET_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n d='M10 15.5H22M10 18.5H22M13.5 15.5V21.5M10 12.5H22V21C22 21.1326 21.9473 21.2598 21.8536 21.3536C21.7598 21.4473 21.6326 21.5 21.5 21.5H10.5C10.3674 21.5 10.2402 21.4473 10.1464 21.3536C10.0527 21.2598 10 21.1326 10 21V12.5Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.5'\n />\n ),\n withoutCaption: (\n <path\n d='M7 17.5H19M7 20.5H19M10.5 17.5V23.5M7 14.5H19V23C19 23.1326 18.9473 23.2598 18.8536 23.3536C18.7598 23.4473 18.6326 23.5 18.5 23.5H7.5C7.36739 23.5 7.24021 23.4473 7.14645 23.3536C7.05268 23.2598 7 23.1326 7 23V14.5Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.2'\n />\n ),\n};\n\nconst COMPRESSION_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n clipRule='evenodd'\n d='M9.41177 0H7.52942V2H9.41177V4H7.52942V6H9.41177V8H7.52942V10H9.41177V12H7.52942V14H9.41177V12H11.2941V10H9.41177V8H11.2941V6H9.41177V4H11.2941V2H9.41177V0ZM7.52942 17C7.52942 16.4477 7.9508 16 8.4706 16H10.3529C10.8727 16 11.2941 16.4477 11.2941 17V23C11.2941 23.5523 10.8727 24 10.3529 24H8.4706C7.9508 24 7.52942 23.5523 7.52942 23V17ZM8.4706 23V20H10.3529V23H8.4706Z'\n fill='white'\n fillRule='evenodd'\n />\n ),\n withoutCaption: (\n <path\n clipRule='evenodd'\n d='M8.17031 0H6.11768V2.14737H8.17031V4.29474H6.11768V6.4421H8.17031V8.58947H6.11768V10.7368H8.17031V12.8842H6.11768V15.0316H8.17031V12.8842H10.2229V10.7368H8.17031V8.58947H10.2229V6.4421H8.17031V4.29474H10.2229V2.14737H8.17031V0ZM6.11768 18.2526C6.11768 17.6597 6.57717 17.1789 7.14399 17.1789H9.19662C9.76344 17.1789 10.2229 17.6597 10.2229 18.2526V24.6947C10.2229 25.2877 9.76344 25.7684 9.19662 25.7684H7.14399C6.57717 25.7684 6.11768 25.2877 6.11768 24.6947V18.2526ZM7.14399 24.6947V21.4737H9.19662V24.6947H7.14399Z'\n fill='white'\n fillRule='evenodd'\n />\n ),\n};\n\nconst VIDEO_SYMBOLS: FileIconSymbolMap = {\n withCaption: (\n <path\n d='M20.5 16L23.5 14V20L20.5 18M10 13H20C20.2761 13 20.5 13.2239 20.5 13.5V20.5C20.5 20.7761 20.2761 21 20 21H10C9.72386 21 9.5 20.7761 9.5 20.5V13.5C9.5 13.2239 9.72386 13 10 13Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.2'\n />\n ),\n withoutCaption: (\n <path\n d='M17.5001 18L20.5001 16V22L17.5001 20M7.00012 15H17.0001C17.2763 15 17.5001 15.2239 17.5001 15.5V22.5C17.5001 22.7761 17.2763 23 17.0001 23H7.00012C6.72398 23 6.50012 22.7761 6.50012 22.5V15.5C6.50012 15.2239 6.72398 15 7.00012 15Z'\n stroke='white'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='1.33333'\n />\n ),\n};\n\ntype StandardFileTypeIconProps = BaseFileIconProps & {\n color: string;\n fileTypeClassName: string;\n symbols: FileIconSymbolMap;\n};\n\nconst StandardFileTypeIcon = ({\n className,\n color,\n fileTypeClassName,\n label,\n size,\n sizeConfig,\n symbols,\n ...props\n}: StandardFileTypeIconProps) => {\n const renderLabel = !!label;\n const resolvedLabel = renderLabel ? label : undefined;\n const symbolVariant = renderLabel ? 'withCaption' : 'withoutCaption';\n\n return (\n <Svg\n {...props}\n className={clsx(fileTypeClassName, className)}\n size={size}\n sizeConfig={sizeConfig}\n >\n <g className={FILE_ICON_GRAPHIC_CLASSNAME}>\n <path d={FILE_ICON_PAPER_PATH} fill={color} />\n {renderLabel ? (\n symbols[symbolVariant]\n ) : (\n <g\n transform={`scale(${FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_X} ${FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_Y})`}\n >\n {symbols[symbolVariant]}\n </g>\n )}\n <path d={FILE_ICON_FOLD_PATH} fill='white' opacity='0.5' />\n </g>\n {resolvedLabel && (\n <FileIconLabel label={resolvedLabel} size={size} sizeConfig={sizeConfig} />\n )}\n </Svg>\n );\n};\n\nconst PDF_SMALL_SYMBOL = (\n <path\n d='M20.7533 19.5337C20.28 19.037 19.3093 18.7537 17.9373 18.7537C17.204 18.7537 16.3526 18.8244 15.43 18.9897C14.8647 18.4461 14.3499 17.8523 13.892 17.2157C13.5373 16.7424 13.2293 16.2224 12.9453 15.725C13.49 14.069 13.75 12.7204 13.75 11.7504C13.75 10.6624 13.348 9.52637 12.1886 9.52637C11.834 9.52637 11.4786 9.7397 11.2893 10.047C10.7693 10.9697 11.006 12.9804 11.9046 14.9677C11.5664 15.984 11.1876 16.9863 10.7693 17.9724C10.3906 18.8717 9.96465 19.7944 9.49131 20.6457C6.88931 21.687 5.20931 22.8937 5.01998 23.839C4.94931 24.1944 5.06731 24.5257 5.32798 24.7857C5.42265 24.857 5.75398 25.141 6.32131 25.141C8.04798 25.141 9.86998 22.349 10.7926 20.6697C11.5026 20.433 12.2126 20.1964 12.922 20.007C13.6704 19.8038 14.4284 19.638 15.1933 19.5104C17.0146 21.1424 18.6233 21.403 19.428 21.403C20.4213 21.403 20.7766 21.0004 20.8946 20.6697C21.108 20.243 20.966 19.7704 20.7533 19.5337ZM19.8066 20.2204C19.7353 20.575 19.38 20.8117 18.884 20.8117C18.742 20.8117 18.624 20.7877 18.4813 20.7644C17.5826 20.551 16.7306 20.1017 15.8793 19.3917C16.5357 19.2807 17.2003 19.2254 17.866 19.2264C18.3633 19.2264 18.7893 19.2497 19.0726 19.321C19.404 19.3917 19.9246 19.605 19.806 20.2197L19.8066 20.2204ZM14.7906 19.1084C14.1305 19.2321 13.4755 19.382 12.8273 19.5577C12.262 19.7047 11.7017 19.8703 11.1473 20.0544C11.4355 19.4962 11.7039 18.9281 11.952 18.351C12.236 17.6884 12.472 17.0024 12.7093 16.3637C12.9453 16.7657 13.206 17.1684 13.466 17.523C13.8911 18.065 14.3329 18.5937 14.7906 19.1084ZM11.692 10.307C11.7338 10.2232 11.7978 10.1525 11.877 10.1025C11.9563 10.0526 12.0477 10.0253 12.1413 10.0237C12.638 10.0237 12.7326 10.591 12.7326 11.041C12.7326 11.7977 12.496 12.957 12.094 14.2817C11.4073 12.4364 11.3606 10.899 11.692 10.307ZM9.08931 21.3317C7.88265 23.319 6.72331 24.549 6.01398 24.549C5.88599 24.5498 5.76132 24.5083 5.65931 24.431C5.51731 24.289 5.44598 24.1237 5.49331 23.9344C5.63531 23.2244 7.00731 22.231 9.08931 21.3317Z'\n fill='white'\n />\n);\n\nconst PDF_LEGACY_SYMBOL = (\n <>\n <path\n d='M23.7533 19.2C23.28 18.7033 22.3093 18.42 20.9373 18.42C20.204 18.42 19.3526 18.4906 18.43 18.656C17.8647 18.1124 17.3499 17.5186 16.892 16.882C16.5373 16.4086 16.2293 15.8886 15.9453 15.3913C16.49 13.7353 16.75 12.3866 16.75 11.4166C16.75 10.3286 16.348 9.19263 15.1886 9.19263C14.834 9.19263 14.4786 9.40596 14.2893 9.71329C13.7693 10.636 14.006 12.6466 14.9046 14.634C14.5664 15.6502 14.1877 16.6526 13.7693 17.6386C13.3906 18.538 12.9646 19.4606 12.4913 20.312C9.88931 21.3533 8.20931 22.56 8.01998 23.5053C7.94931 23.8606 8.06731 24.192 8.32798 24.452C8.42265 24.5233 8.75398 24.8073 9.32131 24.8073C11.048 24.8073 12.87 22.0153 13.7926 20.336C14.5026 20.0993 15.2126 19.8626 15.922 19.6733C16.6704 19.4701 17.4284 19.3043 18.1933 19.1766C20.0146 20.8086 21.6233 21.0693 22.428 21.0693C23.4213 21.0693 23.7766 20.6666 23.8946 20.336C24.108 19.9093 23.966 19.4366 23.7533 19.2ZM22.8066 19.8866C22.7353 20.2413 22.38 20.478 21.884 20.478C21.742 20.478 21.624 20.454 21.4813 20.4306C20.5826 20.2173 19.7306 19.768 18.8793 19.058C19.5357 18.947 20.2003 18.8917 20.866 18.8926C21.3633 18.8926 21.7893 18.916 22.0726 18.9873C22.404 19.058 22.9246 19.2713 22.806 19.886L22.8066 19.8866ZM17.7906 18.7746C17.1305 18.8983 16.4755 19.0482 15.8273 19.224C15.262 19.3709 14.7017 19.5366 14.1473 19.7206C14.4355 19.1625 14.7039 18.5944 14.952 18.0173C15.236 17.3546 15.472 16.6686 15.7093 16.03C15.9453 16.432 16.206 16.8346 16.466 17.1893C16.8911 17.7313 17.3329 18.26 17.7906 18.7746ZM14.692 9.97329C14.7338 9.88949 14.7978 9.81875 14.877 9.7688C14.9563 9.71884 15.0477 9.69157 15.1413 9.68996C15.638 9.68996 15.7326 10.2573 15.7326 10.7073C15.7326 11.464 15.496 12.6233 15.094 13.948C14.4073 12.1026 14.3606 10.5653 14.692 9.97329ZM12.0893 20.998C10.8826 22.9853 9.72331 24.2153 9.01398 24.2153C8.88599 24.2161 8.76132 24.1746 8.65931 24.0973C8.51731 23.9553 8.44598 23.79 8.49331 23.6006C8.63531 22.8906 10.0073 21.8973 12.0893 20.998Z'\n fill='white'\n />\n <path\n d='M9.74219 34.4258V28.6992H10.8828V29.3633H10.9531C11.0286 29.2096 11.1276 29.0781 11.25 28.9688C11.375 28.8594 11.5208 28.776 11.6875 28.7188C11.8542 28.6589 12.0391 28.6289 12.2422 28.6289C12.6016 28.6289 12.9115 28.7188 13.1719 28.8984C13.4323 29.0781 13.6328 29.3333 13.7734 29.6641C13.9167 29.9922 13.9883 30.3854 13.9883 30.8438V30.8516C13.9883 31.3125 13.918 31.7083 13.7773 32.0391C13.6367 32.3698 13.4362 32.6237 13.1758 32.8008C12.9154 32.9779 12.6042 33.0664 12.2422 33.0664C12.0443 33.0664 11.8607 33.0365 11.6914 32.9766C11.5247 32.9141 11.3776 32.8268 11.25 32.7148C11.125 32.6029 11.026 32.4688 10.9531 32.3125H10.8828V34.4258H9.74219ZM11.8516 32.1211C12.0547 32.1211 12.2279 32.0703 12.3711 31.9688C12.5169 31.8672 12.6289 31.7214 12.707 31.5312C12.7878 31.3411 12.8281 31.1146 12.8281 30.8516V30.8438C12.8281 30.5807 12.7878 30.3542 12.707 30.1641C12.6289 29.974 12.5169 29.8281 12.3711 29.7266C12.2279 29.625 12.0547 29.5742 11.8516 29.5742C11.651 29.5742 11.4766 29.625 11.3281 29.7266C11.1823 29.8281 11.069 29.974 10.9883 30.1641C10.9102 30.3516 10.8711 30.5781 10.8711 30.8438V30.8516C10.8711 31.112 10.9115 31.3385 10.9922 31.5312C11.0729 31.7214 11.1862 31.8672 11.332 31.9688C11.4805 32.0703 11.6536 32.1211 11.8516 32.1211ZM16.457 33.0664C16.1003 33.0664 15.7904 32.9779 15.5273 32.8008C15.2669 32.6211 15.0651 32.3659 14.9219 32.0352C14.7812 31.7044 14.7109 31.3099 14.7109 30.8516V30.8438C14.7109 30.3828 14.7799 29.987 14.918 29.6562C15.0586 29.3255 15.2591 29.0716 15.5195 28.8945C15.7799 28.7174 16.0924 28.6289 16.457 28.6289C16.6523 28.6289 16.8333 28.6602 17 28.7227C17.1693 28.7826 17.3177 28.8685 17.4453 28.9805C17.5729 29.0924 17.6719 29.2279 17.7422 29.3867H17.8125V27.0547H18.9531V33H17.8125V32.332H17.7422C17.6693 32.4857 17.5703 32.6172 17.4453 32.7266C17.3229 32.8359 17.1784 32.9206 17.0117 32.9805C16.8451 33.0378 16.6602 33.0664 16.457 33.0664ZM16.8438 32.1211C17.0469 32.1211 17.2214 32.0703 17.3672 31.9688C17.513 31.8672 17.625 31.7214 17.7031 31.5312C17.7839 31.3411 17.8242 31.1159 17.8242 30.8555V30.8477C17.8242 30.582 17.7839 30.3555 17.7031 30.168C17.625 29.9779 17.5117 29.832 17.3633 29.7305C17.2174 29.6263 17.0443 29.5742 16.8438 29.5742C16.6458 29.5742 16.4727 29.6263 16.3242 29.7305C16.1784 29.832 16.0664 29.9779 15.9883 30.168C15.9102 30.3555 15.8711 30.5807 15.8711 30.8438V30.8516C15.8711 31.1146 15.9102 31.3411 15.9883 31.5312C16.0664 31.7214 16.1784 31.8672 16.3242 31.9688C16.4701 32.0703 16.6432 32.1211 16.8438 32.1211ZM20.4648 33V29.5586H19.7695V28.6992H20.4648V28.2969C20.4648 28.0104 20.5156 27.7721 20.6172 27.582C20.7188 27.3919 20.8776 27.25 21.0938 27.1562C21.3125 27.0599 21.5951 27.0117 21.9414 27.0117C22.0586 27.0117 22.1641 27.0156 22.2578 27.0234C22.3542 27.0312 22.444 27.0417 22.5273 27.0547V27.8164C22.4909 27.8086 22.4427 27.8034 22.3828 27.8008C22.3255 27.7956 22.2604 27.793 22.1875 27.793C21.9661 27.793 21.8099 27.8438 21.7188 27.9453C21.6276 28.0443 21.582 28.1875 21.582 28.375V28.6992H22.4922V29.5586H21.6055V33H20.4648Z'\n fill='white'\n />\n </>\n);\n\nexport const FilePdfIcon = ({\n className,\n label,\n size,\n sizeConfig,\n ...props\n}: BaseFileIconProps) => {\n const useLegacyPdfMarkup = !!label;\n\n return (\n <Svg\n {...props}\n className={clsx(\n 'str-chat__file-icon--pdf',\n useLegacyPdfMarkup && FILE_ICON_NO_LABEL_CLASSNAME,\n className,\n )}\n size={size}\n sizeConfig={sizeConfig}\n >\n <g className={FILE_ICON_GRAPHIC_CLASSNAME}>\n <path d={FILE_ICON_PAPER_PATH} fill='#E71A01' />\n {useLegacyPdfMarkup ? (\n PDF_LEGACY_SYMBOL\n ) : (\n <g\n transform={`scale(${FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_X} ${FILE_ICON_WITHOUT_CAPTION_SYMBOL_SCALE_Y})`}\n >\n {PDF_SMALL_SYMBOL}\n </g>\n )}\n <path d={FILE_ICON_FOLD_PATH} fill='white' opacity='0.5' />\n </g>\n </Svg>\n );\n};\n\nexport const FileWordIcon = ({ className, label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#3375E2'\n fileTypeClassName='str-chat__file-icon--doc'\n label={label}\n symbols={TEXT_SYMBOLS}\n />\n);\n\nexport const FilePowerPointIcon = ({ className, label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#D14423'\n fileTypeClassName='str-chat__file-icon--ppt'\n label={label}\n symbols={PRESENTATION_SYMBOLS}\n />\n);\n\nexport const FileExcelIcon = ({ className = '', label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#0C864B'\n fileTypeClassName='str-chat__file-icon--xls'\n label={label}\n symbols={SPREADSHEET_SYMBOLS}\n />\n);\n\nexport const FileArchiveIcon = ({\n className = '',\n label = '',\n ...props\n}: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#E59E34'\n fileTypeClassName='str-chat__file-icon--compressed'\n label={label}\n symbols={COMPRESSION_SYMBOLS}\n />\n);\n\nexport const FileCodeIcon = ({ className = '', label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#00ACA1'\n fileTypeClassName='str-chat__file-icon--code'\n label={label}\n symbols={CODE_SYMBOLS}\n />\n);\n\nexport const FileAudioIcon = ({ className = '', label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#2727B0'\n fileTypeClassName='str-chat__file-icon--audio'\n label={label}\n symbols={AUDIO_SYMBOLS}\n />\n);\n\nexport const FileVideoIcon = ({ className = '', label, ...props }: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#A847B7'\n fileTypeClassName='str-chat__file-icon--video'\n label={label}\n symbols={VIDEO_SYMBOLS}\n />\n);\n\nexport const FileFallbackIcon = ({\n className = '',\n label = '',\n ...props\n}: BaseFileIconProps) => (\n <StandardFileTypeIcon\n {...props}\n className={className}\n color='#888888'\n fileTypeClassName='str-chat__file-icon--other'\n label={label}\n symbols={OTHER_SYMBOLS}\n />\n);\n","export type GeneralType = 'audio/' | 'video/' | 'image/' | 'text/';\n\nexport type SupportedMimeType =\n | (typeof wordMimeTypes)[number]\n | (typeof excelMimeTypes)[number]\n | (typeof powerpointMimeTypes)[number]\n | (typeof archiveFileTypes)[number]\n | (typeof codeFileTypes)[number];\n\nexport const wordMimeTypes = [\n // Microsoft Word\n // .doc .dot\n 'application/msword',\n // .doc .dot\n 'application/msword-template',\n // .docx\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n // .dotx (no test)\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n // .docm\n 'application/vnd.ms-word.document.macroEnabled.12',\n // .dotm (no test)\n 'application/vnd.ms-word.template.macroEnabled.12',\n\n // LibreOffice/OpenOffice Writer\n // .odt\n 'application/vnd.oasis.opendocument.text',\n // .ott\n 'application/vnd.oasis.opendocument.text-template',\n // .fodt\n 'application/vnd.oasis.opendocument.text-flat-xml',\n // .uot\n // NOTE: firefox doesn't know mimetype so maybe ignore\n];\n\nexport const excelMimeTypes = [\n // .csv\n 'text/csv',\n // TODO: maybe more data files\n\n // Microsoft Excel\n // .xls .xlt .xla (no test for .xla)\n 'application/vnd.ms-excel',\n // .xlsx\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n // .xltx (no test)\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n // .xlsm\n 'application/vnd.ms-excel.sheet.macroEnabled.12',\n // .xltm (no test)\n 'application/vnd.ms-excel.template.macroEnabled.12',\n // .xlam (no test)\n 'application/vnd.ms-excel.addin.macroEnabled.12',\n // .xlsb (no test)\n 'application/vnd.ms-excel.addin.macroEnabled.12',\n\n // LibreOffice/OpenOffice Calc\n // .ods\n 'application/vnd.oasis.opendocument.spreadsheet',\n // .ots\n 'application/vnd.oasis.opendocument.spreadsheet-template',\n // .fods\n 'application/vnd.oasis.opendocument.spreadsheet-flat-xml',\n // .uos\n // NOTE: firefox doesn't know mimetype so maybe ignore\n];\n\nexport const powerpointMimeTypes = [\n // Microsoft Word\n // .ppt .pot .pps .ppa (no test for .ppa)\n 'application/vnd.ms-powerpoint',\n // .pptx\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n // .potx (no test)\n 'application/vnd.openxmlformats-officedocument.presentationml.template',\n // .ppsx\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n // .ppam\n 'application/vnd.ms-powerpoint.addin.macroEnabled.12',\n // .pptm\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\n // .potm\n 'application/vnd.ms-powerpoint.template.macroEnabled.12',\n // .ppsm\n 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',\n\n // LibreOffice/OpenOffice Writer\n // .odp\n 'application/vnd.oasis.opendocument.presentation',\n // .otp\n 'application/vnd.oasis.opendocument.presentation-template',\n // .fodp\n 'application/vnd.oasis.opendocument.presentation-flat-xml',\n // .uop\n // NOTE: firefox doesn't know mimetype so maybe ignore\n];\n\nexport const archiveFileTypes = [\n // .zip\n 'application/zip',\n // .z7\n 'application/x-7z-compressed',\n // .ar\n 'application/x-archive',\n // .tar\n 'application/x-tar',\n // .tar.gz\n 'application/gzip',\n // .tar.Z\n 'application/x-compress',\n // .tar.bz2\n 'application/x-bzip',\n // .tar.lz\n 'application/x-lzip',\n // .tar.lz4\n 'application/x-lz4',\n // .tar.lzma\n 'application/x-lzma',\n // .tar.lzo (no test)\n 'application/x-lzop',\n // .tar.xz\n 'application/x-xz',\n // .war\n 'application/x-webarchive',\n // .rar\n 'application/vnd.rar',\n];\n\nexport const codeFileTypes = [\n // .html .htm\n 'text/html',\n // .css\n 'text/css',\n // .js\n 'application/x-javascript',\n 'text/javascript',\n // .json\n 'application/json',\n // .py\n 'text/x-python',\n // .go\n 'text/x-go',\n // .c\n 'text/x-csrc',\n // .cpp\n 'text/x-c++src',\n // .rb\n 'application/x-ruby',\n // .rust\n 'text/rust',\n // .java\n 'text/x-java',\n // .php\n 'application/x-php',\n // .cs\n 'text/x-csharp',\n // .scala\n 'text/x-scala',\n // .erl\n 'text/x-erlang',\n // .sh\n 'application/x-shellscript',\n];\n\nexport const mimeTypeToExtensionMap: Record<string, string> = {\n // Application types (sorted alphabetically)\n 'application/epub+zip': 'epub',\n 'application/gzip': 'gz',\n 'application/java-archive': 'jar',\n 'application/json': 'json',\n 'application/ld+json': 'jsonld',\n 'application/msword': 'doc',\n 'application/msword-template': 'dot',\n 'application/octet-stream': 'bin',\n 'application/ogg': 'ogx',\n 'application/pdf': 'pdf',\n 'application/postscript': 'ps',\n 'application/rtf': 'rtf',\n 'application/vnd.amazon.ebook': 'azw',\n 'application/vnd.apple.installer+xml': 'mpkg',\n 'application/vnd.mozilla.xul+xml': 'xul',\n 'application/vnd.ms-excel': 'xls',\n 'application/vnd.ms-excel.addin.macroEnabled.12': 'xlam',\n 'application/vnd.ms-excel.sheet.macroEnabled.12': 'xlsm',\n 'application/vnd.ms-excel.template.macroEnabled.12': 'xltm',\n 'application/vnd.ms-fontobject': 'eot',\n 'application/vnd.ms-powerpoint': 'ppt',\n 'application/vnd.ms-powerpoint.addin.macroEnabled.12': 'ppam',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12': 'pptm',\n 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12': 'ppsm',\n 'application/vnd.ms-powerpoint.template.macroEnabled.12': 'potm',\n 'application/vnd.ms-word.document.macroEnabled.12': 'docm',\n 'application/vnd.ms-word.template.macroEnabled.12': 'dotm',\n 'application/vnd.oasis.opendocument.presentation': 'odp',\n 'application/vnd.oasis.opendocument.presentation-flat-xml': 'fodp',\n 'application/vnd.oasis.opendocument.presentation-template': 'otp',\n 'application/vnd.oasis.opendocument.spreadsheet': 'ods',\n 'application/vnd.oasis.opendocument.spreadsheet-flat-xml': 'fods',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'ots',\n 'application/vnd.oasis.opendocument.text': 'odt',\n 'application/vnd.oasis.opendocument.text-flat-xml': 'fodt',\n 'application/vnd.oasis.opendocument.text-template': 'ott',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow': 'ppsx',\n 'application/vnd.openxmlformats-officedocument.presentationml.template': 'potx',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': 'xltx',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'dotx',\n 'application/vnd.rar': 'rar',\n 'application/vnd.visio': 'vsd',\n 'application/wasm': 'wasm',\n 'application/x-7z-compressed': '7z',\n 'application/x-abiword': 'abw',\n 'application/x-archive': 'ar',\n 'application/x-bzip': 'bz',\n 'application/x-bzip2': 'bz2',\n 'application/x-cdf': 'cda',\n 'application/x-compress': 'Z',\n 'application/x-csh': 'csh',\n 'application/x-dosexec': 'exe',\n 'application/x-freearc': 'arc',\n 'application/x-httpd-php': 'php',\n 'application/x-iso9660-image': 'iso',\n 'application/x-javascript': 'js',\n 'application/x-lz4': 'lz4',\n 'application/x-lzip': 'lz',\n 'application/x-lzma': 'lzma',\n 'application/x-lzop': 'lzo',\n 'application/x-mobipocket-ebook': 'mobi',\n 'application/x-msdownload': 'exe',\n 'application/x-perl': 'pl',\n 'application/x-php': 'php',\n 'application/x-rar-compressed': 'rar',\n 'application/x-ruby': 'rb',\n 'application/x-sh': 'sh',\n 'application/x-shellscript': 'sh',\n 'application/x-shockwave-flash': 'swf',\n 'application/x-sql': 'sql',\n 'application/x-stuffit': 'sit',\n 'application/x-tar': 'tar',\n 'application/x-webarchive': 'war',\n 'application/x-xz': 'xz',\n 'application/x-yaml': 'yaml',\n 'application/xhtml+xml': 'xhtml',\n 'application/xml': 'xml',\n 'application/zip': 'zip',\n\n // Audio types\n 'audio/aac': 'aac',\n 'audio/flac': 'flac',\n 'audio/midi': 'midi',\n 'audio/mp4': 'm4a',\n 'audio/mpeg': 'mp3',\n 'audio/ogg': 'oga',\n 'audio/opus': 'opus',\n 'audio/wav': 'wav',\n 'audio/webm': 'weba',\n 'audio/x-aiff': 'aiff',\n 'audio/x-m4a': 'm4a',\n 'audio/x-midi': 'midi',\n 'audio/x-ms-wma': 'wma',\n 'audio/x-wav': 'wav',\n\n // Font types\n 'font/otf': 'otf',\n 'font/ttf': 'ttf',\n 'font/woff': 'woff',\n 'font/woff2': 'woff2',\n\n // Image types\n 'image/apng': 'apng',\n 'image/avif': 'avif',\n 'image/bmp': 'bmp',\n 'image/gif': 'gif',\n 'image/heic': 'heic',\n 'image/heif': 'heif',\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/svg+xml': 'svg',\n 'image/tiff': 'tiff',\n 'image/vnd.microsoft.icon': 'ico',\n 'image/webp': 'webp',\n 'image/x-icon': 'ico',\n\n // Text types\n 'text/calendar': 'ics',\n 'text/css': 'css',\n 'text/csv': 'csv',\n 'text/html': 'html',\n 'text/javascript': 'js',\n 'text/markdown': 'md',\n 'text/plain': 'txt',\n 'text/rtf': 'rtf',\n 'text/rust': 'rs',\n 'text/tab-separated-values': 'tsv',\n 'text/vcard': 'vcf',\n 'text/x-c': 'c',\n 'text/x-c++src': 'cpp',\n 'text/x-csharp': 'cs',\n 'text/x-csrc': 'c',\n 'text/x-diff': 'diff',\n 'text/x-erlang': 'erl',\n 'text/x-go': 'go',\n 'text/x-java': 'java',\n 'text/x-java-source': 'java',\n 'text/x-kotlin': 'kt',\n 'text/x-lua': 'lua',\n 'text/x-markdown': 'md',\n 'text/x-objectivec': 'm',\n 'text/x-pascal': 'pas',\n 'text/x-perl': 'pl',\n 'text/x-python': 'py',\n 'text/x-ruby': 'rb',\n 'text/x-rust': 'rs',\n 'text/x-scala': 'scala',\n 'text/x-sh': 'sh',\n 'text/x-shellscript': 'sh',\n 'text/x-sql': 'sql',\n 'text/x-swift': 'swift',\n 'text/x-typescript': 'ts',\n 'text/x-yaml': 'yaml',\n 'text/xml': 'xml',\n 'text/yaml': 'yaml',\n\n // Video types\n 'video/3gpp': '3gp',\n 'video/3gpp2': '3g2',\n 'video/mp2t': 'ts',\n 'video/mp4': 'mp4',\n 'video/mpeg': 'mpeg',\n 'video/ogg': 'ogv',\n 'video/quicktime': 'mov',\n 'video/webm': 'webm',\n 'video/x-flv': 'flv',\n 'video/x-m4v': 'm4v',\n 'video/x-matroska': 'mkv',\n 'video/x-ms-wmv': 'wmv',\n 'video/x-msvideo': 'avi',\n};\n","import * as fileIconSet from './FileIconSet';\nimport type { GeneralType, SupportedMimeType } from './mimeTypes';\nimport {\n archiveFileTypes,\n codeFileTypes,\n excelMimeTypes,\n powerpointMimeTypes,\n wordMimeTypes,\n} from './mimeTypes';\nimport type { ComponentType } from 'react';\nimport type { BaseFileIconProps } from './FileIconSet';\n\ntype MimeTypeMappedComponent =\n | 'FilePdfIcon'\n | 'FileWordIcon'\n | 'FileExcelIcon'\n | 'FilePowerPointIcon'\n | 'FileArchiveIcon'\n | 'FileCodeIcon';\n\ntype GeneralContentTypeComponent = 'FileAudioIcon' | 'FileVideoIcon' | 'FileAltIcon';\n\ntype IconComponents<Props> = {\n FileAltIcon: ComponentType<Props>;\n FileArchiveIcon: ComponentType<Props>;\n FileAudioIcon: ComponentType<Props>;\n FileCodeIcon: ComponentType<Props>;\n FileExcelIcon: ComponentType<Props>;\n FileFallbackIcon: ComponentType<Props>;\n FilePdfIcon: ComponentType<Props>;\n FilePowerPointIcon: ComponentType<Props>;\n FileVideoIcon: ComponentType<Props>;\n FileWordIcon: ComponentType<Props>;\n};\n\ntype MimeTypeToIconMap<Props> = {\n [key: string]: ComponentType<Props>;\n};\n\nfunction generateMimeTypeToIconMap<Props>({\n FileArchiveIcon,\n FileCodeIcon,\n FileExcelIcon,\n FilePdfIcon,\n FilePowerPointIcon,\n FileWordIcon,\n}: Pick<IconComponents<Props>, MimeTypeMappedComponent>) {\n const mimeTypeToIconMap: MimeTypeToIconMap<Props> = {\n 'application/pdf': FilePdfIcon,\n };\n\n for (const type of wordMimeTypes) {\n mimeTypeToIconMap[type] = FileWordIcon;\n }\n\n for (const type of excelMimeTypes) {\n mimeTypeToIconMap[type] = FileExcelIcon;\n }\n\n for (const type of powerpointMimeTypes) {\n mimeTypeToIconMap[type] = FilePowerPointIcon;\n }\n\n for (const type of archiveFileTypes) {\n mimeTypeToIconMap[type] = FileArchiveIcon;\n }\n\n for (const type of codeFileTypes) {\n mimeTypeToIconMap[type] = FileCodeIcon;\n }\n return mimeTypeToIconMap;\n}\n\nfunction generateGeneralTypeToIconMap<Props>({\n FileAltIcon,\n FileAudioIcon,\n FileFallbackIcon,\n FileVideoIcon,\n}: Pick<IconComponents<Props>, GeneralContentTypeComponent | 'FileFallbackIcon'>) {\n return {\n 'audio/': FileAudioIcon,\n 'image/': FileFallbackIcon,\n 'text/': FileAltIcon,\n 'video/': FileVideoIcon,\n };\n}\n\ntype IconMap = {\n standard: Record<\n SupportedMimeType | GeneralType | 'fallback',\n ComponentType<BaseFileIconProps>\n >;\n};\n\nexport const iconMap: IconMap = {\n standard: {\n ...generateMimeTypeToIconMap<BaseFileIconProps>({\n FileArchiveIcon: fileIconSet.FileArchiveIcon,\n FileCodeIcon: fileIconSet.FileCodeIcon,\n FileExcelIcon: fileIconSet.FileExcelIcon,\n FilePdfIcon: fileIconSet.FilePdfIcon,\n FilePowerPointIcon: fileIconSet.FilePowerPointIcon,\n FileWordIcon: fileIconSet.FileWordIcon,\n }),\n ...generateGeneralTypeToIconMap<BaseFileIconProps>({\n FileAltIcon: fileIconSet.FileFallbackIcon,\n FileAudioIcon: fileIconSet.FileAudioIcon,\n FileFallbackIcon: fileIconSet.FileFallbackIcon,\n FileVideoIcon: fileIconSet.FileVideoIcon,\n }),\n fallback: fileIconSet.FileFallbackIcon,\n },\n};\n","import React, { useMemo } from 'react';\nimport { iconMap } from './iconMap';\nimport { mergeFileIconSizeConfig } from './FileIconSet';\nimport { mimeTypeToExtensionMap } from './mimeTypes';\nimport type { FileIconSize } from './FileIconSet';\n\nexport type FileIconSizeConfigOverride = Partial<\n Record<\n FileIconSize,\n Partial<{ width: number; height: number; labelX: number; labelY: number }>\n >\n>;\n\nexport type FileIconProps = {\n className?: string;\n fileName?: string;\n mimeType?: string;\n /** Override dimensions/label position per size (sm, md, lg, xl). */\n sizeConfig?: FileIconSizeConfigOverride;\n size?: FileIconSize;\n};\n\nexport function mimeTypeToIcon(mimeType?: string) {\n const theMap = iconMap['standard'];\n\n if (!mimeType) return theMap.fallback;\n\n const icon = theMap[mimeType];\n if (icon) return icon;\n\n if (mimeType.startsWith('audio/')) return theMap['audio/'] ?? theMap.fallback;\n if (mimeType.startsWith('video/')) return theMap['video/'] ?? theMap.fallback;\n if (mimeType.startsWith('image/')) return theMap['image/'] ?? theMap.fallback;\n if (mimeType.startsWith('text/')) return theMap['text/'] ?? theMap.fallback;\n\n return theMap.fallback;\n}\n\nconst labelFromMimeType = ({\n fileName,\n mimeType,\n}: Pick<FileIconProps, 'fileName' | 'mimeType'>) => {\n let label;\n\n if (mimeType) {\n label = mimeTypeToExtensionMap[mimeType];\n }\n\n if (!label && fileName) {\n label = fileName.split('.').slice(-1)[0];\n }\n return label;\n};\n\nexport const FileIcon = (props: FileIconProps) => {\n const {\n className,\n fileName,\n mimeType,\n size = 'md',\n sizeConfig: sizeConfigOverride,\n ...rest\n } = props;\n const sizeConfig = useMemo(\n () => mergeFileIconSizeConfig(sizeConfigOverride),\n [sizeConfigOverride],\n );\n const Icon = mimeTypeToIcon(mimeType);\n const label = fileName ? labelFromMimeType({ fileName, mimeType }) : undefined;\n return (\n <Icon\n {...rest}\n className={className}\n label={label}\n size={size}\n sizeConfig={sizeConfig}\n />\n );\n};\n","export const formatTime = (\n totalSeconds?: number,\n rounding: 'ceil' | 'floor' = 'ceil',\n) => {\n if (totalSeconds == null || Number.isNaN(totalSeconds) || totalSeconds < 0) {\n return null;\n }\n\n const roundedSeconds =\n rounding === 'floor' ? Math.floor(totalSeconds) : Math.ceil(totalSeconds);\n const hours = Math.floor(roundedSeconds / 3600);\n const minutes = Math.floor((roundedSeconds % 3600) / 60);\n const seconds = roundedSeconds % 60;\n const minSec = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(\n 2,\n '0',\n )}`;\n\n return hours ? `${String(hours).padStart(2, '0')}:${minSec}` : minSec;\n};\n","import React from 'react';\nimport clsx from 'clsx';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { IconImage } from '../Icons';\n\nexport type ImagePlaceholderProps = {\n className?: string;\n};\n\nexport const ImagePlaceholder = ({ className }: ImagePlaceholderProps) => {\n const { t } = useTranslationContext();\n return (\n <div\n aria-label={t('aria/Image failed to load')}\n className={clsx('str-chat__image-placeholder', className)}\n data-testid='str-chat__base-image-placeholder'\n role='img'\n >\n <IconImage />\n </div>\n );\n};\n","import React, { forwardRef, useEffect, useMemo, useState } from 'react';\nimport clsx from 'clsx';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { DownloadButton } from '../Attachment';\nimport { ImagePlaceholder as DefaultImagePlaceholder } from './ImagePlaceholder';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\n\nexport type BaseImageProps = React.ComponentPropsWithRef<'img'> & {\n showDownloadButtonOnError?: boolean;\n};\n\nexport const BaseImage = forwardRef<HTMLImageElement, BaseImageProps>(function BaseImage(\n { src, ...props },\n ref,\n) {\n const {\n alt: propsAlt,\n className: propsClassName,\n onError: propsOnError,\n showDownloadButtonOnError = false,\n ...imgProps\n } = props;\n // Store the failed URL rather than a boolean so that when src changes (e.g. retry\n // with a cache-busting param), the error state clears synchronously via the derived\n // `error` check below. A boolean would require a useEffect to reset, causing a\n // 1-frame flash of the error placeholder before the loading state kicks in.\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const { ImagePlaceholder: ImagePlaceholderComponent = DefaultImagePlaceholder } =\n useComponentContext();\n\n const sanitizedUrl = useMemo(() => sanitizeUrl(src), [src]);\n const error = failedSrc === sanitizedUrl;\n\n useEffect(\n () => () => {\n setFailedSrc(null);\n },\n [sanitizedUrl],\n );\n\n if (error) {\n return (\n <>\n <ImagePlaceholderComponent\n className={clsx(propsClassName, 'str-chat__base-image--load-failed')}\n />\n {showDownloadButtonOnError && <DownloadButton assetUrl={sanitizedUrl} />}\n </>\n );\n }\n\n return (\n <img\n data-testid='str-chat__base-image'\n {...imgProps}\n alt={propsAlt ?? ''}\n className={clsx(propsClassName, 'str-chat__base-image')}\n onError={(e) => {\n setFailedSrc(sanitizedUrl);\n propsOnError?.(e);\n }}\n ref={ref}\n src={sanitizedUrl}\n />\n );\n});\n","import {\n type Attachment,\n isGiphyAttachment,\n isImageAttachment,\n isLocalImageAttachment,\n isLocalVideoAttachment,\n isScrapedContent,\n isVideoAttachment,\n type LinkPreview,\n type LocalImageAttachment,\n type LocalVideoAttachment,\n} from 'stream-chat';\nimport type { Dimensions } from '../../types/types';\n\ntype AttachmentPreviewableInGallery =\n | LocalImageAttachment\n | LocalVideoAttachment\n | LinkPreview\n | Attachment;\n\n/** Fields shared with gallery items for image/video preview from an attachment. */\nexport type BaseImageDescriptor = {\n alt?: string;\n dimensions?: Dimensions;\n imageUrl?: string;\n title?: string;\n videoThumbnailUrl?: string;\n videoUrl?: string;\n};\n\n/**\n * Maps an attachment (or link preview) to image/video URLs and metadata for {@link BaseImage} or the gallery.\n */\nexport const toBaseImageDescriptors = (\n attachment: AttachmentPreviewableInGallery,\n options: { giphyVersionName?: string } = {},\n): BaseImageDescriptor | undefined => {\n if (isGiphyAttachment(attachment)) {\n const giphyVersion =\n options?.giphyVersionName && attachment.giphy\n ? attachment.giphy[\n options.giphyVersionName as keyof NonNullable<Attachment['giphy']>\n ]\n : undefined;\n\n return {\n alt: giphyVersion?.url || attachment.thumb_url,\n dimensions: giphyVersion\n ? {\n height: giphyVersion.height,\n width: giphyVersion.width,\n }\n : undefined,\n imageUrl: attachment.thumb_url,\n title: attachment.title || attachment.thumb_url,\n };\n }\n\n if (isScrapedContent(attachment)) {\n const imageUrl = attachment.image_url || attachment.thumb_url;\n return {\n alt: attachment.title || imageUrl,\n imageUrl,\n title: attachment.title,\n };\n }\n\n if (isLocalVideoAttachment(attachment)) {\n return {\n title: attachment.title,\n videoThumbnailUrl: attachment.thumb_url ?? attachment.localMetadata.previewUri,\n videoUrl: attachment.asset_url ?? attachment.localMetadata.previewUri,\n };\n }\n\n if (isVideoAttachment(attachment)) {\n return {\n title: attachment.title,\n videoThumbnailUrl: attachment.thumb_url,\n videoUrl: attachment.asset_url,\n };\n }\n\n if (isLocalImageAttachment(attachment)) {\n const imageUrl = attachment.image_url || attachment.localMetadata.previewUri;\n return {\n alt: attachment.title || imageUrl,\n imageUrl,\n title: attachment.title,\n };\n }\n\n if (isImageAttachment(attachment)) {\n const imageUrl = attachment.image_url;\n return {\n alt: attachment.title || imageUrl,\n imageUrl,\n title: attachment.title,\n };\n }\n\n return undefined;\n};\n","import { createContext, useContext } from 'react';\n\nimport { toBaseImageDescriptors } from '../BaseImage';\nimport type { BaseImageProps } from '../BaseImage';\nimport type { Dimensions } from '../../types/types';\n\nexport type GalleryItem = Omit<BaseImageProps, 'src'> & {\n dimensions?: Dimensions;\n imageUrl?: string;\n videoThumbnailUrl?: string;\n videoUrl?: string;\n};\n\n/**\n * Maps an attachment (or link preview) to gallery item fields.\n * Delegates to {@link toBaseImageDescriptors}.\n */\nexport const toGalleryItemDescriptors = (\n ...args: Parameters<typeof toBaseImageDescriptors>\n):\n | Pick<\n GalleryItem,\n 'alt' | 'dimensions' | 'imageUrl' | 'title' | 'videoThumbnailUrl' | 'videoUrl'\n >\n | undefined => toBaseImageDescriptors(...args);\n\nexport type GalleryContextValue = {\n /** Whether clicking the empty gallery background should request close */\n closeOnBackgroundClick: boolean;\n /** Currently displayed item index */\n currentIndex: number;\n /** Currently displayed item */\n currentItem: GalleryItem;\n /** Navigate to a specific index */\n goToIndex: (index: number) => void;\n /** Navigate to the next item */\n goToNext: () => void;\n /** Navigate to the previous item */\n goToPrevious: () => void;\n /** Whether there is a next item */\n hasNext: boolean;\n /** Whether there is a previous item */\n hasPrevious: boolean;\n /** Total number of items */\n itemCount: number;\n /** All items in the gallery */\n items: GalleryItem[];\n /** Request closing the gallery viewer */\n onRequestClose?: () => void;\n};\n\nexport const GalleryContext = createContext<GalleryContextValue | undefined>(undefined);\n\nexport const useGalleryContext = () => {\n const contextValue = useContext(GalleryContext);\n\n if (!contextValue) {\n console.warn(\n `The useGalleryContext hook was called outside of the GalleryContext provider. Make sure this hook is called within a child of the Gallery component.`,\n );\n\n return {} as GalleryContextValue;\n }\n\n return contextValue;\n};\n","import React, { useContext, useMemo } from 'react';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\n\nimport { type GalleryItem } from './GalleryContext';\nimport { Button } from '../Button';\nimport { IconArrowDownCircle, IconXmark } from '../Icons';\nimport { MessageTimestamp as DefaultMessageTimestamp } from '../Message/MessageTimestamp';\nimport {\n ModalContext,\n useComponentContext,\n useMessageContext,\n useTranslationContext,\n} from '../../context';\n\ntype GalleryHeaderProps = {\n currentItem: GalleryItem;\n};\n\nexport const GalleryHeader = ({ currentItem }: GalleryHeaderProps) => {\n const { t } = useTranslationContext();\n const { MessageTimestamp = DefaultMessageTimestamp } = useComponentContext('GalleryUI');\n const { isMyMessage, message } = useMessageContext('GalleryUI');\n const modalContext = useContext(ModalContext);\n\n const headerTitle =\n (isMyMessage?.() && t('You')) ||\n message?.user?.name ||\n message?.user?.id ||\n currentItem.title ||\n t('User uploaded content');\n const downloadUrl = useMemo(() => {\n const rawDownloadUrl = currentItem.videoUrl ?? currentItem.imageUrl;\n\n if (!rawDownloadUrl) return undefined;\n\n const sanitizedUrl = sanitizeUrl(rawDownloadUrl);\n\n return sanitizedUrl === 'about:blank' ? undefined : sanitizedUrl;\n }, [currentItem.imageUrl, currentItem.videoUrl]);\n const downloadLabel = t('aria/Download attachment');\n\n return (\n <div className='str-chat__gallery__header'>\n <div aria-hidden='true' className='str-chat__gallery__header-spacer' />\n <div className='str-chat__gallery__header-meta'>\n <div className='str-chat__gallery__title'>{headerTitle}</div>\n {message?.created_at ? (\n <MessageTimestamp customClass='str-chat__gallery__timestamp' />\n ) : null}\n </div>\n <div className='str-chat__gallery__header-actions'>\n {downloadUrl ? (\n <a\n aria-label={downloadLabel}\n className='str-chat__gallery__action-button str-chat__gallery__action-button--download'\n download\n href={downloadUrl}\n rel='noreferrer'\n target='_blank'\n title={downloadLabel}\n >\n <IconArrowDownCircle />\n </a>\n ) : null}\n {modalContext?.close ? (\n <Button\n aria-label={t('Close')}\n className='str-chat__gallery__action-button str-chat__gallery__action-button--close'\n onClick={modalContext.close}\n title={t('Close')}\n >\n <IconXmark />\n </Button>\n ) : null}\n </div>\n </div>\n );\n};\n","import React from 'react';\n\nimport { useComponentContext } from '../../context';\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../Loading/LoadingIndicator';\n\n// `react-player` (~2 MB) is loaded lazily so it stays out of the SDK's eager\n// import graph; the consumer's bundler emits it as a separate chunk that is\n// fetched only when a default video player renders. Consumers who override\n// `VideoPlayer` via `ComponentContext` never load it at all.\nconst ReactPlayer = React.lazy(() => import('./ReactPlayerWrapper'));\n\nexport type VideoPlayerProps = {\n isPlaying?: boolean;\n videoUrl?: string;\n thumbnailUrl?: string;\n};\n\nexport const VideoPlayer = ({ isPlaying, thumbnailUrl, videoUrl }: VideoPlayerProps) => {\n const { LoadingIndicator = DefaultLoadingIndicator, VideoPlayer: VideoPlayerContext } =\n useComponentContext();\n\n return VideoPlayerContext ? (\n <VideoPlayerContext thumbnailUrl={thumbnailUrl} videoUrl={videoUrl} />\n ) : (\n <React.Suspense\n fallback={\n <div className='str-chat__video-player-loading'>\n <LoadingIndicator />\n </div>\n }\n >\n <ReactPlayer\n isPlaying={isPlaying}\n thumbnailUrl={thumbnailUrl}\n videoUrl={videoUrl}\n />\n </React.Suspense>\n );\n};\n","import { BaseImage, type BaseImageProps } from '../BaseImage';\nimport { Button } from '../Button';\nimport clsx from 'clsx';\nimport { IconPlayFill } from '../Icons';\nimport React from 'react';\nimport { useTranslationContext } from '../../context';\n\nexport type VideoThumbnailProps = BaseImageProps & {\n onPlay?: () => void;\n};\n\nexport const VideoThumbnail = ({\n className,\n onPlay,\n ...imageProps\n}: VideoThumbnailProps) => {\n const { t } = useTranslationContext();\n\n return (\n <div className='str-chat__message-attachment__video-thumbnail'>\n <BaseImage\n className={clsx('str-chat__message-attachment__video-thumbnail-image', className)}\n {...imageProps}\n />\n {onPlay ? (\n <Button\n appearance='solid'\n aria-label={t('Play video')}\n circular\n className={clsx(\n 'str-chat__message-attachment__video-thumbnail__play-indicator',\n )}\n onClick={onPlay}\n size='lg'\n variant='secondary'\n >\n <IconPlayFill />\n </Button>\n ) : (\n <div className='str-chat__message-attachment__video-thumbnail__play-indicator'>\n <IconPlayFill />\n </div>\n )}\n </div>\n );\n};\n","import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\n\nimport { BaseImage } from '../BaseImage';\nimport { GalleryHeader } from './GalleryHeader';\nimport { useGalleryContext } from './GalleryContext';\nimport { Button, type ButtonProps } from '../Button';\nimport { IconChevronLeft, IconChevronRight } from '../Icons';\nimport { ModalContext, useTranslationContext } from '../../context';\nimport { VideoPlayer } from '../VideoPlayer';\nimport { VideoThumbnail } from '../VideoPlayer/VideoThumbnail';\n\nimport clsx from 'clsx';\n\nconst SWIPE_THRESHOLD = 50;\nconst TRANSITION_DURATION = 300;\n\nexport const GalleryUI = () => {\n const { t } = useTranslationContext();\n const {\n closeOnBackgroundClick,\n currentIndex,\n currentItem,\n goToNext,\n goToPrevious,\n hasNext,\n hasPrevious,\n itemCount,\n onRequestClose,\n } = useGalleryContext();\n const modalContext = useContext(ModalContext);\n\n const [showVideo, setShowVideo] = useState(false);\n\n // Slide transition state\n const isTransitioningRef = useRef(false);\n const [slideOffset, setSlideOffset] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const [slideDirection, setSlideDirection] = useState<'forward' | 'backward' | null>(\n null,\n );\n\n // Touch tracking refs\n // Some touch interactions on the slide container are followed by a click; suppress\n // that one-shot click so swipe navigation doesn't immediately trigger background close.\n const ignoreNextClickRef = useRef(false);\n const touchStartRef = useRef<{ x: number; y: number } | null>(null);\n const isVerticalSwipeRef = useRef(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Reset video play state when navigating to a new item\n useEffect(() => {\n setShowVideo(false);\n }, [currentIndex]);\n\n // Slide animation on index change\n const prevIndexRef = useRef(currentIndex);\n useEffect(() => {\n if (prevIndexRef.current === currentIndex) return;\n const direction = currentIndex > prevIndexRef.current ? 'forward' : 'backward';\n setSlideDirection(direction);\n setSlideOffset(0);\n setIsDragging(false);\n isTransitioningRef.current = true;\n\n const timer = setTimeout(() => {\n setSlideDirection(null);\n isTransitioningRef.current = false;\n }, TRANSITION_DURATION);\n\n prevIndexRef.current = currentIndex;\n return () => clearTimeout(timer);\n }, [currentIndex]);\n\n // Wrapped navigation functions that respect transition lock\n const handleGoToNext = useCallback(() => {\n if (isTransitioningRef.current) return;\n goToNext();\n }, [goToNext]);\n\n const handleGoToPrevious = useCallback(() => {\n if (isTransitioningRef.current) return;\n goToPrevious();\n }, [goToPrevious]);\n\n // Keyboard navigation\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n handleGoToPrevious();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n handleGoToNext();\n }\n },\n [handleGoToNext, handleGoToPrevious],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [handleKeyDown]);\n\n // Touch event handlers\n const handleTouchStart = useCallback((event: React.TouchEvent) => {\n if (isTransitioningRef.current) return;\n const touch = event.touches[0];\n ignoreNextClickRef.current = false;\n touchStartRef.current = { x: touch.clientX, y: touch.clientY };\n isVerticalSwipeRef.current = false;\n }, []);\n\n const handleTouchMove = useCallback(\n (event: React.TouchEvent) => {\n if (!touchStartRef.current || isTransitioningRef.current) return;\n\n const touch = event.touches[0];\n const deltaX = touch.clientX - touchStartRef.current.x;\n const deltaY = touch.clientY - touchStartRef.current.y;\n\n // Determine swipe direction on first significant movement\n if (!isDragging && !isVerticalSwipeRef.current) {\n if (Math.abs(deltaY) > Math.abs(deltaX) && Math.abs(deltaY) > 10) {\n ignoreNextClickRef.current = true;\n isVerticalSwipeRef.current = true;\n return;\n }\n if (Math.abs(deltaX) > 10) {\n ignoreNextClickRef.current = true;\n setIsDragging(true);\n }\n }\n\n if (isVerticalSwipeRef.current) return;\n\n // Constrain drag when at boundaries\n if ((!hasNext && deltaX < 0) || (!hasPrevious && deltaX > 0)) {\n setSlideOffset(deltaX * 0.3); // Rubber-band effect\n } else {\n setSlideOffset(deltaX);\n }\n },\n [isDragging, hasNext, hasPrevious],\n );\n\n const handleTouchEnd = useCallback(() => {\n if (!touchStartRef.current || isVerticalSwipeRef.current) {\n if (isVerticalSwipeRef.current) ignoreNextClickRef.current = true;\n touchStartRef.current = null;\n return;\n }\n\n const offset = slideOffset;\n if (isDragging || Math.abs(offset) > 10) {\n ignoreNextClickRef.current = true;\n }\n touchStartRef.current = null;\n\n if (Math.abs(offset) >= SWIPE_THRESHOLD) {\n if (offset < 0 && hasNext) {\n goToNext();\n } else if (offset > 0 && hasPrevious) {\n goToPrevious();\n } else {\n // Snap back — at boundary\n setSlideOffset(0);\n }\n } else {\n // Snap back — below threshold\n setSlideOffset(0);\n }\n\n setIsDragging(false);\n }, [slideOffset, hasNext, hasPrevious, goToNext, goToPrevious, isDragging]);\n\n const requestClose = modalContext?.close ?? onRequestClose;\n const handleBackgroundClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n\n if (ignoreNextClickRef.current) {\n ignoreNextClickRef.current = false;\n return;\n }\n\n if (!closeOnBackgroundClick) return;\n\n requestClose?.();\n },\n [closeOnBackgroundClick, requestClose],\n );\n\n const mediaStyle: React.CSSProperties =\n isDragging || (slideOffset !== 0 && slideDirection === null)\n ? { transform: `translateX(${slideOffset}px)` }\n : {};\n\n return (\n <div className='str-chat__gallery'>\n <div className='str-chat__gallery__main'>\n <GalleryHeader currentItem={currentItem} />\n <NavButton\n aria-label={t('Previous image')}\n className={clsx(\n 'str-chat__gallery__nav-button--prev',\n !hasPrevious && 'str-chat__gallery__nav-button--hidden',\n )}\n disabled={!hasPrevious}\n onClick={handleGoToPrevious}\n >\n <IconChevronLeft />\n </NavButton>\n <div\n className='str-chat__gallery__slide-container'\n onClick={handleBackgroundClick}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onTouchStart={handleTouchStart}\n ref={containerRef}\n >\n <div\n className={clsx('str-chat__gallery__media-container', {\n 'str-chat__gallery__media--dragging': isDragging,\n 'str-chat__gallery__media--slide-backward':\n !isDragging && slideDirection === 'backward',\n 'str-chat__gallery__media--slide-forward':\n !isDragging && slideDirection === 'forward',\n })}\n style={mediaStyle}\n >\n {currentItem.videoUrl && currentItem.videoThumbnailUrl ? (\n <div className='str-chat__gallery__media str-chat__gallery__media--video'>\n {showVideo ? (\n <VideoPlayer isPlaying videoUrl={currentItem.videoUrl} />\n ) : (\n <VideoThumbnail\n alt={currentItem.title ?? ''}\n onPlay={() => setShowVideo(true)}\n src={currentItem.videoThumbnailUrl}\n />\n )}\n </div>\n ) : (\n <div className='str-chat__gallery__media str-chat__gallery__media--image'>\n <BaseImage alt={currentItem.alt} src={currentItem.imageUrl} />\n </div>\n )}\n </div>\n </div>\n <NavButton\n aria-label={t('Next image')}\n className={clsx(\n 'str-chat__gallery__nav-button--next',\n !hasNext && 'str-chat__gallery__nav-button--hidden',\n )}\n disabled={!hasNext}\n onClick={handleGoToNext}\n >\n <IconChevronRight />\n </NavButton>\n </div>\n {itemCount > 1 && (\n <div className='str-chat__gallery__position-indicator'>\n {currentIndex + 1} of {itemCount}\n </div>\n )}\n </div>\n );\n};\n\nconst NavButton = ({ className, ...props }: ButtonProps) => (\n <Button {...props} className={clsx('str-chat__gallery__nav-button', className)} />\n);\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { GalleryContext } from './GalleryContext';\nimport { GalleryUI as DefaultGalleryUI } from './GalleryUI';\nimport { useComponentContext } from '../../context';\n\nimport type { GalleryContextValue, GalleryItem } from './GalleryContext';\n\nexport type GalleryProps = {\n /** Whether clicking the empty gallery background should request close (default: true) */\n closeOnBackgroundClick?: boolean;\n /** Array of media attachments to display */\n items: GalleryItem[];\n /** Custom UI component to replace the default GalleryUI */\n GalleryUI?: React.ComponentType;\n /** Initial index of the item to display (default: 0) */\n initialIndex?: number;\n /** Callback when the active item changes */\n onIndexChange?: (index: number) => void;\n /** Callback invoked when the gallery requests to close */\n onRequestClose?: () => void;\n};\n\nexport const Gallery = ({\n closeOnBackgroundClick = true,\n GalleryUI,\n initialIndex = 0,\n items,\n onIndexChange,\n onRequestClose,\n}: GalleryProps) => {\n const { GalleryUI: ContextGalleryUI } = useComponentContext();\n const ResolvedGalleryUI = GalleryUI ?? ContextGalleryUI ?? DefaultGalleryUI;\n const [currentIndex, setCurrentIndex] = useState(initialIndex);\n\n const itemCount = items.length;\n\n const goToIndex = useCallback(\n (index: number) => {\n if (index >= 0 && index < itemCount) {\n setCurrentIndex(index);\n }\n },\n [itemCount],\n );\n\n const goToNext = useCallback(() => {\n setCurrentIndex((prev) => (prev < itemCount - 1 ? prev + 1 : prev));\n }, [itemCount]);\n\n const goToPrevious = useCallback(() => {\n setCurrentIndex((prev) => (prev > 0 ? prev - 1 : prev));\n }, []);\n\n useEffect(() => {\n onIndexChange?.(currentIndex);\n }, [currentIndex, onIndexChange]);\n\n const hasNext = currentIndex < itemCount - 1;\n const hasPrevious = currentIndex > 0;\n const currentItem = items[currentIndex];\n\n const contextValue = useMemo<GalleryContextValue>(\n () => ({\n closeOnBackgroundClick,\n currentIndex,\n currentItem,\n goToIndex,\n goToNext,\n goToPrevious,\n hasNext,\n hasPrevious,\n itemCount,\n items,\n onRequestClose,\n }),\n [\n closeOnBackgroundClick,\n currentIndex,\n currentItem,\n goToIndex,\n goToNext,\n goToPrevious,\n hasNext,\n hasPrevious,\n itemCount,\n items,\n onRequestClose,\n ],\n );\n\n return (\n <GalleryContext.Provider value={contextValue}>\n <ResolvedGalleryUI />\n </GalleryContext.Provider>\n );\n};\n","import clsx from 'clsx';\nimport type {\n ChangeEventHandler,\n ComponentProps,\n KeyboardEventHandler,\n MouseEventHandler,\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport React, { isValidElement, useRef, useState } from 'react';\nimport { useStableId } from '../UtilityComponents/useStableId';\n\nexport type SwitchFieldProps = Omit<\n PropsWithChildren<ComponentProps<'input'>>,\n 'children'\n> & {\n /** Main label content when title/description are not used */\n children?: ReactNode;\n /** Optional description line below title */\n description?: string;\n /** Class applied to the root div element of the SwitchField component */\n fieldClassName?: string;\n /** Optional title line */\n title?: string;\n};\n\nexport const SwitchField = ({\n children,\n description,\n fieldClassName,\n title,\n ...props\n}: SwitchFieldProps) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n checked,\n defaultChecked,\n disabled,\n id,\n onChange,\n onKeyDown,\n ...rest\n } = props;\n const generatedSwitchId = useStableId();\n const switchId = id ?? `str-chat__switch-field-${generatedSwitchId}`;\n const switchLabelId = `${switchId}-label`;\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const [uncontrolledChecked, setUncontrolledChecked] = useState(Boolean(defaultChecked));\n const isControlled = checked !== undefined;\n const isOn = isControlled ? checked : uncontrolledChecked;\n const isReadOnly = isControlled && onChange === undefined;\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (!isControlled) {\n setUncontrolledChecked(event.target.checked);\n }\n\n onChange?.(event);\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.key !== ' ') return;\n\n event.preventDefault();\n event.currentTarget.click();\n };\n\n const handleSwitchClick: MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled || event.target === inputRef.current) return;\n inputRef.current?.click();\n };\n\n // When no title/aria-label is provided, SwitchField can still be named by a caller-supplied\n // child element id via aria-labelledby.\n const childElement = isValidElement<{ id?: string }>(children) ? children : undefined;\n const childLabelId = childElement?.props.id;\n // Accessible-name precedence:\n // 1) explicit aria-labelledby prop\n // 2) explicit aria-label prop\n // 3) generated title label id (title path)\n // 4) caller-supplied child id (children path)\n const resolvedAriaLabelledBy =\n ariaLabelledBy ?? (!ariaLabel ? (title ? switchLabelId : childLabelId) : undefined);\n\n return (\n <div\n className={clsx(\n 'str-chat__form__switch-field',\n fieldClassName,\n disabled && 'str-chat__form__switch-field--disabled',\n )}\n >\n {title ? (\n <SwitchFieldLabel\n description={description}\n htmlFor={switchId}\n id={switchLabelId}\n title={title}\n />\n ) : (\n children\n )}\n <Switch\n {...rest}\n aria-label={ariaLabel}\n aria-labelledby={resolvedAriaLabelledBy}\n checked={isOn}\n disabled={disabled}\n id={switchId}\n on={isOn}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onSwitchClick={handleSwitchClick}\n readOnly={isReadOnly}\n switchRef={inputRef}\n />\n </div>\n );\n};\nexport type SwitchProps = Omit<ComponentProps<'input'>, 'type'> & {\n on?: boolean;\n onSwitchClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Renders the switch as a visual-only indicator when another element owns interaction.\n * Example: a button row with a trailing switch indicator must not render an input inside the button.\n */\n presentation?: boolean;\n switchRef?: React.RefObject<HTMLInputElement | null>;\n};\n\nexport const Switch = ({\n className,\n on,\n onSwitchClick,\n presentation,\n switchRef,\n ...props\n}: SwitchProps) => (\n <div\n aria-hidden={presentation ? true : undefined}\n className={clsx('str-chat__form__switch-field__switch', {\n 'str-chat__form__switch-field__switch--on': on,\n })}\n onClick={presentation ? undefined : onSwitchClick}\n >\n {!presentation && (\n <input\n {...props}\n className={clsx('str-chat__form__switch-field__input', className)}\n ref={switchRef}\n role='switch'\n type='checkbox'\n />\n )}\n <span className='str-chat__form__switch-field__switch-handle' />\n </div>\n);\n\nexport type SwitchFieldLabelProps = ComponentProps<'label'> & {\n /** Adds className str-chat__form__switch-field__label--as-error to the root */\n asError?: boolean;\n title?: string;\n description?: string;\n};\n\nexport const SwitchFieldLabel = ({\n asError,\n children,\n className,\n description,\n title,\n ...props\n}: SwitchFieldLabelProps) => (\n <label\n className={clsx(\n 'str-chat__form__switch-field__label',\n { 'str-chat__form__switch-field__label--as-error': asError },\n className,\n )}\n {...props}\n >\n <div className='str-chat__form__switch-field__label__content'>\n {title ? (\n <>\n <SwitchFieldTitle>{title}</SwitchFieldTitle>\n {description != null && description !== '' && (\n <SwitchFieldDescription>{description}</SwitchFieldDescription>\n )}\n </>\n ) : (\n children\n )}\n </div>\n </label>\n);\n\nexport type SwitchFieldTitleProps = ComponentProps<'div'> & {\n title?: string;\n};\n\nexport const SwitchFieldTitle = ({\n children,\n className,\n title,\n ...props\n}: SwitchFieldTitleProps) => (\n <div\n className={clsx('str-chat__form__switch-field__label__text', className)}\n {...props}\n >\n {children ?? title}\n </div>\n);\n\nexport type SwitchFieldDescriptionProps = ComponentProps<'div'> & {\n description?: string;\n};\n\nexport const SwitchFieldDescription = ({\n children,\n className,\n description,\n ...props\n}: SwitchFieldDescriptionProps) => (\n <div\n className={clsx('str-chat__form__switch-field__label__description', className)}\n {...props}\n >\n {children ?? description}\n </div>\n);\n","import clsx from 'clsx';\nimport type { HTMLAttributes } from 'react';\n\nexport type CheckboxProps = HTMLAttributes<HTMLElement> & { checked?: boolean };\n\nexport const Checkbox = ({ checked, ...props }: CheckboxProps) => (\n <div\n {...props}\n className={clsx('str-chat__checkmark str-chat__checkbox', {\n 'str-chat__checkbox--checked': checked,\n 'str-chat__checkmark--checked': checked,\n })}\n />\n);\n\n// fixme: remove str-chat__checkmark class with next major release v15\nexport type CheckmarkProps = CheckboxProps;\n// fixme: remove str-chat__checkmark class with next major release v15\nexport const Checkmark = Checkbox;\n","import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { useStableId } from '../UtilityComponents/useStableId';\nimport { IconCheckmark, IconExclamationMark } from '../Icons';\n\nexport type TextInputVariant = 'outline' | 'ghost';\n\n/** Where the active field message (error, success, or neutral) sits relative to the bordered control */\nexport type TextInputFieldMessagePlacement = 'outside' | 'inside';\n\nexport type TextInputProps = Omit<ComponentProps<'input'>, 'className'> & {\n /** Root class name */\n className?: string;\n /**\n * `outside` (default): message below the bordered wrapper.\n * `inside`: message under the value row, inside the border (error, success, or neutral).\n */\n fieldMessagePlacement?: TextInputFieldMessagePlacement;\n /** Optional label above the input */\n label?: string;\n /** Optional leading content (e.g. icon) inside the input area */\n leading?: ReactNode;\n /** Optional trailing content (e.g. clear button) inside the input area */\n trailing?: ReactNode;\n /** Optional suffix text shown after the input value, inside the field */\n trailingText?: string;\n /** Neutral/helper message below the input (no icon) */\n message?: ReactNode;\n /** Error message; shown when `error` is true, with `errorMessageIcon` */\n errorMessage?: ReactNode;\n /** Icon before error text (default: exclamation) */\n errorMessageIcon?: ReactNode;\n /** Success message below the input */\n successMessage?: ReactNode;\n /** Icon before success text (default: checkmark) */\n successMessageIcon?: ReactNode;\n /** When true, error border and error styling */\n error?: boolean;\n /** `outline` = border always; `ghost` = border on focus */\n variant?: TextInputVariant;\n};\n\ntype TextInputIconMessageLineProps = {\n icon: ReactNode;\n text: ReactNode;\n};\n\nconst TextInputIconMessageLine = ({ icon, text }: TextInputIconMessageLineProps) => (\n <>\n <span aria-hidden className='str-chat__form-text-input__message-icon'>\n {icon}\n </span>\n <span className='str-chat__form-text-input__message-text'>{text}</span>\n </>\n);\n\n/** At most one of error / success / neutral is shown under the field */\ntype TextInputFieldMessageProps =\n | {\n kind: 'error';\n id?: string;\n insidePlacement: boolean;\n errorMessageIcon?: ReactNode;\n text: ReactNode;\n }\n | {\n kind: 'success';\n id?: string;\n insidePlacement: boolean;\n successMessageIcon?: ReactNode;\n text: ReactNode;\n }\n | {\n kind: 'neutral';\n id?: string;\n insidePlacement: boolean;\n text: ReactNode;\n };\n\nconst TextInputFieldMessage = (props: TextInputFieldMessageProps) => {\n if (props.kind === 'neutral') {\n return (\n <div\n className={clsx(\n 'str-chat__form-text-input__message',\n props.insidePlacement &&\n 'str-chat__form-text-input__message--field-message-inside',\n )}\n id={props.id}\n >\n {props.text}\n </div>\n );\n } else if (props.kind === 'success') {\n return (\n <div\n className={clsx(\n 'str-chat__form-text-input__message',\n 'str-chat__form-text-input__message--success',\n props.insidePlacement &&\n 'str-chat__form-text-input__message--field-message-inside',\n )}\n id={props.id}\n >\n <TextInputIconMessageLine\n icon={props.successMessageIcon ?? <IconCheckmark />}\n text={props.text}\n />\n </div>\n );\n } else if (props.kind === 'error') {\n return (\n <div\n className={clsx(\n 'str-chat__form-text-input__message',\n 'str-chat__form-field-error',\n props.insidePlacement &&\n 'str-chat__form-text-input__message--field-message-inside',\n )}\n id={props.id}\n role='alert'\n >\n <TextInputIconMessageLine\n icon={props.errorMessageIcon ?? <IconExclamationMark />}\n text={props.text}\n />\n </div>\n );\n }\n\n return null;\n};\n\nexport const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function TextInput(\n {\n className,\n disabled,\n error = false,\n errorMessage,\n errorMessageIcon,\n fieldMessagePlacement = 'outside',\n id: idProp,\n label,\n leading,\n message,\n successMessage,\n successMessageIcon,\n trailing,\n trailingText,\n variant = 'outline',\n ...inputProps\n },\n ref,\n) {\n const autoId = useStableId();\n const id = idProp ?? autoId;\n\n const hasError = error && (errorMessage != null || message != null);\n const showSuccess = !hasError && successMessage != null;\n const showNeutral = !hasError && !showSuccess && message != null;\n const hasFeedback = hasError || showSuccess || showNeutral;\n const messageInside = fieldMessagePlacement === 'inside' && hasFeedback;\n\n const messageId = hasError\n ? `${id}-field-error`\n : showSuccess || showNeutral\n ? `${id}-message`\n : undefined;\n const describedBy = [inputProps['aria-describedby'], messageId]\n .filter((value): value is string => !!value)\n .join(' ');\n\n const fieldMessage = hasError ? (\n <TextInputFieldMessage\n errorMessageIcon={errorMessageIcon}\n id={messageId}\n insidePlacement={messageInside}\n kind='error'\n text={errorMessage ?? message}\n />\n ) : showSuccess ? (\n <TextInputFieldMessage\n id={messageId}\n insidePlacement={messageInside}\n kind='success'\n successMessageIcon={successMessageIcon}\n text={successMessage}\n />\n ) : showNeutral ? (\n <TextInputFieldMessage\n id={messageId}\n insidePlacement={messageInside}\n kind='neutral'\n text={message}\n />\n ) : null;\n\n return (\n <div\n className={clsx(\n 'str-chat__form-text-input',\n error && 'str-chat__form-text-input--error',\n showSuccess && 'str-chat__form-text-input--success',\n disabled && 'str-chat__form-text-input--disabled',\n messageInside && 'str-chat__form-text-input--field-message-inside',\n className,\n )}\n >\n {label ? (\n <label className='str-chat__form-text-input__label' htmlFor={id}>\n {label}\n </label>\n ) : null}\n <div\n className={clsx(\n 'str-chat__form-text-input__wrapper',\n `str-chat__form-text-input__wrapper--${variant}`,\n messageInside && 'str-chat__form-text-input__wrapper--field-message-inside',\n )}\n >\n <div className='str-chat__form-text-input__control-row'>\n {leading ? (\n <span aria-hidden className='str-chat__form-text-input__leading'>\n {leading}\n </span>\n ) : null}\n <input\n aria-describedby={describedBy}\n aria-invalid={error}\n className='str-chat__form-text-input__input'\n disabled={disabled}\n id={id}\n ref={ref}\n {...inputProps}\n />\n {trailingText != null ? (\n <span aria-hidden className='str-chat__form-text-input__suffix'>\n {trailingText}\n </span>\n ) : null}\n {trailing ? (\n <span aria-hidden className='str-chat__form-text-input__trailing'>\n {trailing}\n </span>\n ) : null}\n </div>\n {messageInside ? fieldMessage : null}\n </div>\n {messageInside ? null : fieldMessage}\n </div>\n );\n});\n","import clsx from 'clsx';\nimport type {\n ComponentProps,\n ComponentType,\n ElementType,\n HTMLAttributes,\n ReactNode,\n} from 'react';\nimport React from 'react';\n\nexport type ListItemLayoutRootElement = Extract<\n keyof React.JSX.IntrinsicElements,\n keyof HTMLElementTagNameMap\n>;\n\nexport type ListItemLayoutBaseProps = {\n ContentSlot?: ComponentType<ListItemLayoutContentProps>;\n contentClassName?: string;\n description?: ReactNode;\n descriptionClassName?: string;\n destructive?: boolean;\n LeadingIcon?: ComponentType;\n LeadingSlot?: ComponentType;\n selected?: boolean;\n subtitle?: ReactNode;\n subtitleClassName?: string;\n title: ReactNode;\n titleClassName?: string;\n TrailingIcon?: ComponentType;\n TrailingSlot?: ComponentType;\n};\n\nexport type ListItemLayoutProps<RootElement extends ListItemLayoutRootElement = 'div'> =\n ListItemLayoutBaseProps & {\n RootElement?: RootElement;\n rootProps?: Omit<ComponentProps<RootElement>, 'children'>;\n };\n\nexport const ListItemLayout = <RootElement extends ListItemLayoutRootElement = 'div'>({\n ContentSlot = ListItemLayoutContent,\n contentClassName,\n description,\n descriptionClassName,\n destructive,\n LeadingIcon,\n LeadingSlot,\n RootElement,\n rootProps,\n selected,\n subtitle,\n subtitleClassName,\n title,\n titleClassName,\n TrailingIcon,\n TrailingSlot,\n}: ListItemLayoutProps<RootElement>) => {\n // The inner container is the interactive element (button/anchor). The outer\n // wrapper is a plain spacing buffer so the container's focus ring (2px offset)\n // never overlaps adjacent items or gets clipped by an overflow ancestor.\n const ContainerComponent = (RootElement ?? 'div') as ElementType<\n HTMLAttributes<HTMLElement>\n >;\n const containerProps = {\n ...(ContainerComponent === 'button' ? { type: 'button' } : undefined),\n ...rootProps,\n className: clsx(\n 'str-chat__list-item-layout__container',\n rootProps?.className,\n destructive && 'str-chat__list-item-layout__container--destructive',\n selected && 'str-chat__list-item-layout__container--selected',\n ),\n } as HTMLAttributes<HTMLElement>;\n\n return (\n <div className='str-chat__list-item-layout'>\n <ContainerComponent {...containerProps}>\n {LeadingIcon && (\n <div className='str-chat__list-item-layout__leading-icon'>\n <LeadingIcon />\n </div>\n )}\n {LeadingSlot && <LeadingSlot />}\n <ContentSlot\n className={contentClassName}\n description={description}\n descriptionClassName={descriptionClassName}\n subtitle={subtitle}\n subtitleClassName={subtitleClassName}\n title={title}\n titleClassName={titleClassName}\n />\n {TrailingIcon && (\n <div className='str-chat__list-item-layout__trailing-icon'>\n <TrailingIcon />\n </div>\n )}\n {TrailingSlot && <TrailingSlot />}\n </ContainerComponent>\n </div>\n );\n};\n\nexport type ListItemLayoutContentProps = Omit<ComponentProps<'div'>, 'title'> & {\n description?: ReactNode;\n descriptionClassName?: string;\n subtitle?: ReactNode;\n subtitleClassName?: string;\n title: ReactNode;\n titleClassName?: string;\n};\n\nexport const ListItemLayoutContent = ({\n className,\n description,\n descriptionClassName,\n subtitle,\n subtitleClassName,\n title,\n titleClassName,\n ...props\n}: ListItemLayoutContentProps) => (\n <div\n {...props}\n className={clsx('str-chat__list-item-layout__content', className, {\n 'str-chat__list-item-layout__content--withDescription': description,\n 'str-chat__list-item-layout__content--withSubtitle': subtitle,\n 'str-chat__list-item-layout__content--withTitle': title,\n })}\n >\n {title && (\n <div className={clsx('str-chat__list-item-layout__title', titleClassName)}>\n {title}\n </div>\n )}\n {subtitle && (\n <div className={clsx('str-chat__list-item-layout__subtitle', subtitleClassName)}>\n {subtitle}\n </div>\n )}\n {description && (\n <div\n className={clsx('str-chat__list-item-layout__description', descriptionClassName)}\n >\n {description}\n </div>\n )}\n </div>\n);\n","import type { ReactNode } from 'react';\nimport React from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport type { Channel, PollVote } from 'stream-chat';\n\nimport type { ChatContextValue } from '../../context';\nimport { getTranslatedMessageText } from '../../context/MessageTranslationViewContext';\nimport type { TranslationContextValue } from '../../context/TranslationContext';\nimport type { PluggableList } from 'unified';\nimport { htmlToTextPlugin, imageToLink, plusPlusToEmphasis } from '../Message';\nimport { isMessageDeleted } from '../Message/utils';\nimport remarkGfm from 'remark-gfm';\n\nconst remarkPlugins: PluggableList = [\n htmlToTextPlugin,\n [remarkGfm, { singleTilde: false }],\n plusPlusToEmphasis,\n imageToLink,\n];\n\nexport const renderPreviewText = (text: string) => (\n <ReactMarkdown remarkPlugins={remarkPlugins} skipHtml>\n {text}\n </ReactMarkdown>\n);\n\nconst getLatestPollVote = (latestVotesByOption: Record<string, PollVote[]>) => {\n let latestVote: PollVote | undefined;\n for (const optionVotes of Object.values(latestVotesByOption)) {\n optionVotes.forEach((vote) => {\n if (latestVote && new Date(latestVote.updated_at) >= new Date(vote.created_at))\n return;\n latestVote = vote;\n });\n }\n\n return latestVote;\n};\n\nexport const getLatestMessagePreview = (\n channel: Channel,\n t: TranslationContextValue['t'],\n userLanguage: TranslationContextValue['userLanguage'] = 'en',\n isMessageAIGenerated?: ChatContextValue['isMessageAIGenerated'],\n): ReactNode => {\n const latestMessage =\n channel.state.latestMessages[channel.state.latestMessages.length - 1];\n\n const previewTextToRender =\n getTranslatedMessageText({ language: userLanguage, message: latestMessage }) ||\n latestMessage?.text;\n const poll = latestMessage?.poll;\n\n if (!latestMessage) {\n return t('Nothing yet...');\n }\n\n if (isMessageDeleted(latestMessage)) {\n return t('Message deleted');\n }\n\n if (poll) {\n if (!poll.vote_count) {\n const createdBy =\n poll.created_by?.id === channel.getClient().userID\n ? t('You')\n : (poll.created_by?.name ?? t('Poll'));\n return t('📊 {{createdBy}} created: {{ pollName}}', {\n createdBy,\n pollName: poll.name,\n });\n } else {\n const latestVote = getLatestPollVote(\n poll.latest_votes_by_option as Record<string, PollVote[]>,\n );\n const option =\n latestVote && poll.options.find((opt) => opt.id === latestVote.option_id);\n\n if (option && latestVote) {\n return t('📊 {{votedBy}} voted: {{pollOptionText}}', {\n pollOptionText: option.text,\n votedBy:\n latestVote?.user?.id === channel.getClient().userID\n ? t('You')\n : (latestVote.user?.name ?? t('Poll')),\n });\n }\n }\n }\n\n if (previewTextToRender) {\n return isMessageAIGenerated?.(latestMessage)\n ? previewTextToRender\n : renderPreviewText(previewTextToRender);\n }\n\n if (latestMessage.command) {\n return `/${latestMessage.command}`;\n }\n\n if (latestMessage.attachments?.length) {\n return t('🏙 Attachment...');\n }\n\n if (latestMessage.shared_location) {\n return t('📍Shared location');\n }\n\n return t('Empty message...');\n};\n\nexport type GroupChannelDisplayInfoMember = {\n imageUrl?: string;\n userName?: string;\n};\n\nexport type GroupChannelDisplayInfo = {\n members: GroupChannelDisplayInfoMember[];\n /** When members.length > 4, count for the \"+N\" badge (members.length - 2). */\n overflowCount?: number;\n};\n\n/**\n * Channel display image: channel.data.image, or for DM (2 members) the other member's user.image.\n */\nexport const getChannelDisplayImage = (\n channel: Channel,\n currentUserId?: string,\n): string | undefined => {\n const data = channel.data as { image?: string } | undefined;\n if (data?.image && typeof data.image === 'string') return data.image;\n\n const memberList = Object.values(channel.state.members);\n if (memberList.length === 2) {\n const other = memberList.find((m) => m.user?.id !== currentUserId);\n const image = other?.user?.image;\n if (image && typeof image === 'string') return image;\n }\n return undefined;\n};\n\nexport const getGroupChannelDisplayInfo = (\n channel: Channel,\n): GroupChannelDisplayInfo | undefined => {\n const members = Object.values(channel.state.members);\n if (members.length <= 2) return;\n\n const memberList: GroupChannelDisplayInfoMember[] = [];\n for (const member of members) {\n const { user } = member;\n if (!user?.name && !user?.image) continue;\n memberList.push({ imageUrl: user.image, userName: user.name });\n }\n return {\n members: memberList,\n };\n};\n","import { useEffect, useState } from 'react';\nimport type { Channel } from 'stream-chat';\n\nimport { useChatContext } from '../../../context';\nimport { useTranslationContext } from '../../../context/TranslationContext';\n\n/**\n * 1. channel.data.name\n * 2. DM (exactly 2 members): other member's name, then directMessageLabel\n * 3. Group (3+ members): comma-separated list of 2 other members' names (no ellipsis)\n * 4. undefined otherwise\n */\nfunction computeChannelDisplayName(\n channel: Channel,\n directMessageLabel: string,\n currentUserId: string | undefined,\n): string | undefined {\n const data = channel.data as { name?: string } | undefined;\n if (data?.name && typeof data.name === 'string') return data.name;\n\n const memberList = Object.values(channel.state.members);\n const otherMembers = memberList.filter((m) => m.user?.id !== currentUserId);\n\n if (memberList.length === 2 && otherMembers.length === 1) {\n const name = otherMembers[0].user?.name;\n return name || directMessageLabel;\n }\n if (otherMembers.length >= 2) {\n const names = otherMembers\n .map((m) => m.user?.name)\n .filter(Boolean)\n .slice(0, 2) as string[];\n if (names.length > 0) return names.join(', ');\n }\n return undefined;\n}\n\n/**\n * Channel display name with translation context.\n * 1. channel.data.name\n * 2. DM (exactly 2 members): other member's name, then translated \"Direct message\"\n * 3. Group (3+ members): comma-separated list of 2 other members' names (no ellipsis)\n * 4. undefined otherwise\n */\nexport const useChannelDisplayName = (\n channel: Channel | undefined,\n): string | undefined => {\n const { client } = useChatContext('useChannelDisplayName');\n const { t } = useTranslationContext('useChannelDisplayName');\n const directMessageLabel = t('Direct message');\n\n const [displayName, setDisplayName] = useState<string | undefined>(() =>\n channel\n ? computeChannelDisplayName(channel, directMessageLabel, client.userID ?? undefined)\n : undefined,\n );\n\n useEffect(() => {\n if (!channel) {\n setDisplayName(undefined);\n return;\n }\n const updateDisplayName = () =>\n setDisplayName(\n computeChannelDisplayName(\n channel,\n directMessageLabel,\n client.userID ?? undefined,\n ),\n );\n updateDisplayName();\n client.on('user.updated', updateDisplayName);\n return () => {\n client.off('user.updated', updateDisplayName);\n };\n }, [channel, channel?.data, client, directMessageLabel]);\n\n return displayName;\n};\n","import { useEffect, useMemo, useState } from 'react';\nimport type { Channel } from 'stream-chat';\n\nimport { useChatContext } from '../../../context';\nimport {\n getChannelDisplayImage,\n getGroupChannelDisplayInfo,\n type GroupChannelDisplayInfo,\n} from '../utils';\nimport { useChannelDisplayName } from './useChannelDisplayName';\n\nconst emptyGroupInfo: GroupChannelDisplayInfo = {\n members: [],\n overflowCount: undefined,\n};\n\nexport type ChannelPreviewInfoParams = {\n /** Channel to read display info from; when undefined, returns undefined display title/image */\n channel?: Channel;\n /** Manually set the image to render, defaults to the Channel image */\n overrideImage?: string;\n /** Set title manually */\n overrideTitle?: string;\n};\n\nexport const useChannelPreviewInfo = (props: ChannelPreviewInfoParams) => {\n const { channel, overrideImage, overrideTitle } = props;\n const { client } = useChatContext();\n\n const channelDisplayName = useChannelDisplayName(channel);\n const displayTitle = overrideTitle ?? channelDisplayName;\n\n const [displayImage, setDisplayImage] = useState<string | undefined>(() =>\n channel\n ? (overrideImage ?? getChannelDisplayImage(channel, client.userID ?? undefined))\n : undefined,\n );\n const [groupChannelDisplayInfo, setGroupChannelDisplayInfo] =\n useState<GroupChannelDisplayInfo>(() =>\n channel ? (getGroupChannelDisplayInfo(channel) ?? emptyGroupInfo) : emptyGroupInfo,\n );\n\n useEffect(() => {\n if (!channel) return;\n if (overrideImage) return;\n\n const updateInfo = () => {\n setDisplayImage(getChannelDisplayImage(channel, client.userID ?? undefined));\n setGroupChannelDisplayInfo(getGroupChannelDisplayInfo(channel) ?? emptyGroupInfo);\n };\n\n updateInfo();\n const { unsubscribe: unsubscribeChannelUpdated } = channel.on(\n 'channel.updated',\n updateInfo,\n );\n const { unsubscribe: unsubscribeUserUpdated } = client.on('user.updated', updateInfo);\n return () => {\n unsubscribeChannelUpdated();\n unsubscribeUserUpdated();\n };\n }, [channel, channel?.data, client, overrideImage]);\n\n return useMemo(\n () => ({\n displayImage: overrideImage ?? displayImage,\n displayTitle,\n groupChannelDisplayInfo,\n }),\n [displayImage, displayTitle, groupChannelDisplayInfo, overrideImage],\n );\n};\n","import type { Channel } from 'stream-chat';\n\nexport const isDmChannel = ({\n channel,\n ownUserId,\n}: {\n channel: Channel;\n ownUserId?: string;\n}) => {\n const memberCount = channel.data?.member_count ?? 0;\n return (\n memberCount === 1 ||\n (memberCount === 2 &&\n !!ownUserId &&\n Object.values(channel.state?.members ?? {}).some(\n ({ user }) => user?.id === ownUserId,\n ))\n );\n};\n","import { useCallback } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport type { Channel, EventTypes } from 'stream-chat';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport function useSelectedChannelState<O>(_: {\n channel: Channel;\n selector: (channel: Channel) => O;\n stateChangeEventKeys?: EventTypes[];\n}): O;\nexport function useSelectedChannelState<O>(_: {\n selector: (channel: Channel) => O;\n channel?: Channel | undefined;\n stateChangeEventKeys?: EventTypes[];\n}): O | undefined;\nexport function useSelectedChannelState<O>({\n channel,\n selector,\n stateChangeEventKeys = ['all'],\n}: {\n selector: (channel: Channel) => O;\n channel?: Channel;\n stateChangeEventKeys?: EventTypes[];\n}): O | undefined {\n const subscribe = useCallback(\n (onStoreChange: (value: O) => void) => {\n if (!channel) return noop;\n\n const subscriptions = stateChangeEventKeys.map((et) =>\n channel.on(et, () => {\n onStoreChange(selector(channel));\n }),\n );\n\n return () => subscriptions.forEach((subscription) => subscription.unsubscribe());\n },\n [channel, selector, stateChangeEventKeys],\n );\n\n const getSnapshot = useCallback(() => {\n if (!channel) return undefined;\n\n return selector(channel);\n }, [channel, selector]);\n\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n","import type { Channel, ChannelMemberResponse, EventTypes } from 'stream-chat';\nimport { useSelectedChannelState } from './useSelectedChannelState';\n\nconst selector = (c: Channel) => c.state.membership;\nconst keys: EventTypes[] = ['member.updated'];\n\nexport function useChannelMembershipState(channel: Channel): ChannelMemberResponse;\nexport function useChannelMembershipState(\n channel?: Channel | undefined,\n): ChannelMemberResponse | undefined;\nexport function useChannelMembershipState(channel?: Channel) {\n return useSelectedChannelState({ channel, selector, stateChangeEventKeys: keys });\n}\n","import { useEffect, useState } from 'react';\n\nimport { useChatContext } from '../../../context/ChatContext';\n\nimport type { Channel } from 'stream-chat';\n\nexport const useIsChannelMuted = (channel: Channel) => {\n const { client } = useChatContext('useIsChannelMuted');\n\n const [muted, setMuted] = useState(channel.muteStatus());\n\n useEffect(() => {\n const handleEvent = () => setMuted(channel.muteStatus());\n\n client.on('notification.channel_mutes_updated', handleEvent);\n return () => client.off('notification.channel_mutes_updated', handleEvent);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [muted]);\n\n return muted;\n};\n","import { useMemo } from 'react';\n\nimport { useChatContext } from '../../../context/ChatContext';\n\nexport const useIsUserMuted = (targetUserId?: string) => {\n const { mutes } = useChatContext();\n\n return useMemo(\n () => !!targetUserId && mutes.some((mute) => mute.target.id === targetUserId),\n [mutes, targetUserId],\n );\n};\n","import React, { type ComponentType, forwardRef } from 'react';\nimport clsx from 'clsx';\nimport type { NotificationSeverity } from 'stream-chat';\nimport { type Notification as NotificationType } from 'stream-chat';\n\nimport {\n IconCheckmark,\n IconExclamationMark,\n IconExclamationTriangleFill,\n IconRefresh,\n IconXmark,\n} from '../../components/Icons';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { Button } from '../Button';\nimport { useNotificationApi } from './hooks/useNotificationApi';\n\ntype NotificationEntryDirection = 'bottom' | 'left' | 'right' | 'top';\ntype NotificationTransitionState = 'enter' | 'exit';\n\nexport type NotificationIconProps = {\n notification: NotificationType;\n};\n\nconst IconsBySeverity: Record<NotificationSeverity, ComponentType | null> = {\n error: IconExclamationMark,\n info: null,\n loading: IconRefresh,\n success: IconCheckmark,\n warning: IconExclamationTriangleFill,\n};\n\nconst DefaultNotificationIcon = ({ notification }: NotificationIconProps) => {\n if (!notification.severity) return null;\n\n const Icon = IconsBySeverity[notification.severity] ?? null;\n return (\n Icon && (\n <div className='str-chat__notification-icon'>\n <Icon />\n </div>\n )\n );\n};\n\nexport type NotificationProps = {\n /** Notification from client.notifications state */\n notification: NotificationType;\n /** Optional class name */\n className?: string;\n /** Direction from which the notification enters. */\n entryDirection?: NotificationEntryDirection;\n /** Optional custom icon component. */\n Icon?: React.ComponentType<NotificationIconProps>;\n /** Optional dismiss handler */\n onDismiss?: () => void;\n /** Show close button (for persistent notifications) */\n showClose?: boolean;\n /** Optional transition state applied by NotificationList. */\n transitionState?: NotificationTransitionState;\n};\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n className,\n entryDirection,\n Icon = DefaultNotificationIcon,\n notification,\n onDismiss,\n showClose = false,\n transitionState,\n }: NotificationProps,\n ref,\n ) => {\n const { removeNotification } = useNotificationApi();\n const { t } = useTranslationContext();\n\n const displayMessage = t('translationBuilderTopic/notification', {\n notification,\n value: notification.message,\n });\n\n const handleDismiss = () => {\n if (onDismiss) {\n onDismiss();\n return;\n }\n\n removeNotification(notification.id);\n };\n\n const isPersistent = !notification.duration;\n\n const severity = notification.severity;\n const livePriority = severity === 'error' ? 'assertive' : 'polite';\n\n return (\n <div\n className={clsx(\n 'str-chat__notification',\n entryDirection && `str-chat__notification--enter-from-${entryDirection}`,\n transitionState === 'enter' && 'str-chat__notification--is-entering',\n transitionState === 'exit' && 'str-chat__notification--is-exiting',\n severity && `str-chat__notification--${severity}`,\n severity === 'loading' && 'str-chat__notification--loading',\n className,\n )}\n data-testid='notification'\n ref={ref}\n >\n <div className='str-chat__notification-content'>\n {Icon && <Icon notification={notification} />}\n <div\n aria-atomic='true'\n aria-live={livePriority}\n className='str-chat__notification-message'\n role={livePriority === 'assertive' ? 'alert' : 'status'}\n >\n {displayMessage}\n </div>\n </div>\n {notification.actions && notification.actions.length > 0 && (\n <div className='str-chat__notification-actions'>\n {notification.actions.map((action, index) => (\n <Button\n appearance='outline'\n className='str-chat__notification-action'\n inverseTheme\n key={index}\n onClick={() => {\n action.handler();\n }}\n size='sm'\n variant='secondary'\n >\n {action.label}\n </Button>\n ))}\n </div>\n )}\n {(showClose || isPersistent) && (\n <Button\n appearance='ghost'\n aria-label={t('aria/Dismiss notification')}\n circular\n className='str-chat__notification-close-button'\n inverseTheme\n onClick={handleDismiss}\n size='sm'\n variant='secondary'\n >\n <IconXmark />\n </Button>\n )}\n </div>\n );\n },\n);\n\nNotification.displayName = 'Notification';\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport type { Notification } from 'stream-chat';\n\nimport { hasSystemNotificationTag, useNotificationApi } from './hooks/useNotificationApi';\nimport { useNotifications } from './hooks/useNotifications';\nimport { Notification as DefaultNotification } from './Notification';\nimport { useComponentContext, useTranslationContext } from '../../context';\n\nimport type { NotificationTargetPanel } from './notificationTarget';\n\nexport type NotificationListFilter = (notification: Notification) => boolean;\nexport type NotificationListEnterFrom = 'bottom' | 'left' | 'right' | 'top';\nexport type NotificationListVerticalAlignment = 'bottom' | 'top';\n/**\n * Selects the candidate notification to display. Receives the current store contents and\n * the currently displayed notification (or `null` when nothing is mounted). Returning\n * `displayed` (or any notification with the same id) means \"no swap\"; returning a\n * different notification triggers a swap (immediate or after `minDisplayMs`, see the\n * scheduling effect); returning `null` triggers the empty-slot exit.\n *\n * Default: `createDefaultPickNext(pickOldest)` — applies persistent-wins,\n * same-type-refresh and FIFO queue rules from the design spec. Pass\n * `pickNext={createDefaultPickNext(pickNewest)}` to swap FIFO for LIFO without\n * reimplementing those rules, or your own `pickNext` to opt out entirely.\n */\nexport type PickNextNotification = (\n notifications: Notification[],\n displayed: Notification | null,\n) => Notification | null;\n\n/**\n * Picks the next queued notification when no higher-priority rule applies (persistent\n * wins, same-type refresh). Used by `createDefaultPickNext`.\n */\nexport type PickFromQueue = (\n notifications: Notification[],\n displayed: Notification | null,\n) => Notification | null;\n\nexport type NotificationListProps = {\n /** Optional class name for the list container */\n className?: string;\n /**\n * Direction from which the replacement notification enters the single visible slot.\n * Travel distance is configured in `ENTER_TRANSLATION` below.\n */\n enterFrom?: NotificationListEnterFrom;\n /**\n * When provided, this list only shows notifications that pass the filter.\n * Use to declare which notifications this list consumes (e.g. by origin.emitter, origin.context.channelId, or metadata).\n */\n filter?: NotificationListFilter;\n /**\n * Minimum time in milliseconds the active notification stays visible before a queued one\n * can replace it. Replacements scheduled while the dwell window is open wait until it has\n * elapsed; arrivals after that window replace the active notification immediately.\n * Same-type repeated triggers and external dismissals bypass this dwell.\n * Defaults to 1000ms.\n */\n minDisplayMs?: number;\n /**\n * Override the candidate-selection policy. The function decides which notification\n * should be displayed given the store and the currently displayed one. Defaults to\n * `createDefaultPickNext(pickOldest)`. Pass `createDefaultPickNext(pickNewest)` for LIFO.\n */\n pickNext?: PickNextNotification;\n /** Panel target consumed by this list. */\n panel?: NotificationTargetPanel;\n /** Fallback panel when emitted notifications do not include origin.context.panel. */\n fallbackPanel?: NotificationTargetPanel;\n /** Vertical alignment of the single notification slot within its parent. Defaults to `bottom`. */\n verticalAlignment?: NotificationListVerticalAlignment;\n};\n\n// Entry motion is controlled through CSS variables so the keyframe can stay shared in SCSS.\n// Use full-size percentages on the active axis to make a replacement notification slide in\n// from outside its slot. If future tuning needs more travel, prefer `calc(100% + gap)` here.\nconst ENTER_TRANSLATION: Record<NotificationListEnterFrom, { x: string; y: string }> = {\n bottom: { x: '0%', y: '100%' },\n left: { x: '-100%', y: '0%' },\n right: { x: '100%', y: '0%' },\n top: { x: '0%', y: '-100%' },\n};\n\nconst EXIT_ANIMATION_MS = 340;\nconst DEFAULT_MIN_DISPLAY_MS = 1000;\n\nconst isEnterFrom = (value: unknown): value is NotificationListEnterFrom =>\n value === 'bottom' || value === 'left' || value === 'right' || value === 'top';\n\nconst getNotificationEnterFrom = (\n notification: Notification | null,\n fallbackEnterFrom: NotificationListEnterFrom,\n) => {\n if (!notification) return fallbackEnterFrom;\n\n const metadataEnterFrom = notification.metadata?.entryDirection;\n if (isEnterFrom(metadataEnterFrom)) return metadataEnterFrom;\n\n const originEnterFrom = notification.origin.context?.entryDirection;\n if (isEnterFrom(originEnterFrom)) return originEnterFrom;\n\n return fallbackEnterFrom;\n};\n\nconst isPersistent = (notification: Notification) => !notification.duration;\n\nconst haveSameType = (a: Notification | null, b: Notification | null) =>\n !!a?.type && !!b?.type && a.type === b.type;\n\n/** FIFO queue selector — oldest `createdAt` other than `displayed` wins. */\nexport const pickOldest: PickFromQueue = (notifications, displayed) => {\n const excludeId = displayed?.id ?? null;\n let oldest: Notification | null = null;\n for (const notification of notifications) {\n if (notification.id === excludeId) continue;\n if (!oldest || notification.createdAt < oldest.createdAt) {\n oldest = notification;\n }\n }\n return oldest;\n};\n\n/** LIFO queue selector — newest `createdAt` other than `displayed` wins. */\nexport const pickNewest: PickFromQueue = (notifications, displayed) => {\n const excludeId = displayed?.id ?? null;\n let newest: Notification | null = null;\n for (const notification of notifications) {\n if (notification.id === excludeId) continue;\n if (!newest || notification.createdAt > newest.createdAt) {\n newest = notification;\n }\n }\n return newest;\n};\n\nconst pickNewestPersistent = (\n notifications: Notification[],\n excludeId: string | null,\n): Notification | null => {\n let newest: Notification | null = null;\n for (const notification of notifications) {\n if (notification.id === excludeId) continue;\n if (!isPersistent(notification)) continue;\n if (!newest || notification.createdAt > newest.createdAt) {\n newest = notification;\n }\n }\n return newest;\n};\n\nconst pickNewestOfType = (\n notifications: Notification[],\n type: string | undefined | null,\n excludeId: string | null,\n): Notification | null => {\n if (!type) return null;\n let newest: Notification | null = null;\n for (const notification of notifications) {\n if (notification.id === excludeId) continue;\n if (notification.type !== type) continue;\n if (!newest || notification.createdAt > newest.createdAt) {\n newest = notification;\n }\n }\n return newest;\n};\n\n/**\n * Builds the default `PickNextNotification` selector with a configurable queue fallback.\n * Encodes the snackbar concurrency rules from the design spec — the scheduling effect\n * only decides *when* to swap, the returned function decides *what* to swap to.\n *\n * Rules, in order of precedence:\n * 1. **Persistent wins.** Persistent variants (no `duration`) jump ahead of any\n * queued transient because they carry an action the user must acknowledge.\n * 2. **Persistent ↛ replaced by transient.** While a persistent is displayed it stays\n * put until dismissed externally or a *newer* persistent arrives.\n * 3. **Same-type refresh.** While a transient is displayed, a repeated trigger of the\n * same `type` collapses to its latest occurrence. (The scheduling effect detects\n * this via `haveSameType` and bypasses the dwell window so the refresh feels\n * instant; this function just makes sure the latest same-type is returned.)\n * 4. **Queue fallback.** Otherwise, `pickFromQueue` selects the next notification\n * (default: `pickOldest` / FIFO).\n *\n * Exported so callers that want to layer behavior on top of the design rules can wrap\n * the result instead of rewriting it.\n */\nexport const createDefaultPickNext =\n (pickFromQueue: PickFromQueue = pickOldest): PickNextNotification =>\n (notifications, displayed) => {\n if (notifications.length === 0) return null;\n\n const newestPersistent = pickNewestPersistent(notifications, null);\n\n if (!displayed) {\n return newestPersistent ?? pickFromQueue(notifications, null);\n }\n\n const displayedInStore = notifications.some(({ id }) => id === displayed.id);\n if (!displayedInStore) {\n return newestPersistent ?? pickFromQueue(notifications, null);\n }\n\n if (isPersistent(displayed)) {\n // Currently showing a persistent: only a newer persistent can replace it. Reuse the\n // earlier lookup when it already points at a different persistent.\n const newerPersistent =\n newestPersistent && newestPersistent.id !== displayed.id\n ? newestPersistent\n : pickNewestPersistent(notifications, displayed.id);\n if (newerPersistent && newerPersistent.createdAt > displayed.createdAt) {\n return newerPersistent;\n }\n return displayed;\n }\n\n // Currently showing a transient.\n // 1. Same-type \"refresh of current\" wins immediately — a repeated trigger of the\n // displayed snackbar collapses to the latest occurrence of that type.\n const sameTypeNewest = pickNewestOfType(notifications, displayed.type, displayed.id);\n if (sameTypeNewest) return sameTypeNewest;\n\n // 2. Any queued persistent jumps ahead of the queue.\n if (newestPersistent) return newestPersistent;\n\n // 3. Queue fallback.\n return pickFromQueue(notifications, displayed) ?? displayed;\n };\n\n/** Default selector — design-spec rules with FIFO queue fallback (`pickOldest`). */\nconst defaultPickNext = createDefaultPickNext(pickOldest);\n\nexport const NotificationList = ({\n className,\n enterFrom = 'bottom',\n fallbackPanel,\n filter,\n minDisplayMs = DEFAULT_MIN_DISPLAY_MS,\n panel,\n pickNext = defaultPickNext,\n verticalAlignment = 'bottom',\n}: NotificationListProps) => {\n const { Notification: NotificationComponent = DefaultNotification } =\n useComponentContext();\n const { t } = useTranslationContext();\n const { removeNotification, startNotificationTimeout } = useNotificationApi();\n // Holds the timer that runs the exit animation. Set when we flip `transitionState` to\n // `'exit'`; when it fires, the previously displayed notification is removed and either the\n // next candidate is mounted (entering) or the list collapses to empty. Only one exit\n // animation can be in flight at a time.\n const exitTimeoutRef = useRef<number | null>(null);\n // Holds the dwell timer that defers a swap until `minDisplayMs` has elapsed since the\n // active notification became visible. It only exists while we're waiting out the dwell\n // window; same-type triggers, external dismissals and arrivals after the dwell window\n // bypass it and trigger the exit animation directly.\n const replacementTimeoutRef = useRef<number | null>(null);\n const candidateRef = useRef<Notification | null>(null);\n const displayedAtRef = useRef<number | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const observedElementRef = useRef<HTMLDivElement | null>(null);\n const startedTimeoutIdsRef = useRef<Set<string> | null>(null);\n\n if (!startedTimeoutIdsRef.current) {\n startedTimeoutIdsRef.current = new Set<string>();\n }\n\n const [displayedNotification, setDisplayedNotification] = useState<Notification | null>(\n null,\n );\n const [transitionState, setTransitionState] = useState<'enter' | 'exit'>('enter');\n const combinedFilter = useCallback(\n (notification: Notification) => {\n if (hasSystemNotificationTag(notification)) return false;\n return filter ? filter(notification) : true;\n },\n [filter],\n );\n const notifications = useNotifications({\n applyDisplayFilter: true,\n fallbackPanel,\n filter: combinedFilter,\n panel,\n });\n\n const dismiss = useCallback(\n (id: string) => {\n startedTimeoutIdsRef.current?.delete(id);\n removeNotification(id);\n },\n [removeNotification],\n );\n\n // Drop any stale entries from the started-timeouts set whenever the store changes.\n useEffect(() => {\n const notificationIds = new Set(notifications.map(({ id }) => id));\n\n startedTimeoutIdsRef.current?.forEach((id) => {\n if (!notificationIds.has(id)) {\n startedTimeoutIdsRef.current?.delete(id);\n }\n });\n }, [notifications]);\n\n const clearReplacementTimeout = useCallback(() => {\n if (replacementTimeoutRef.current !== null) {\n window.clearTimeout(replacementTimeoutRef.current);\n replacementTimeoutRef.current = null;\n }\n }, []);\n\n // Cleanup pending timers on unmount.\n useEffect(\n () => () => {\n clearReplacementTimeout();\n if (exitTimeoutRef.current !== null) {\n window.clearTimeout(exitTimeoutRef.current);\n exitTimeoutRef.current = null;\n }\n },\n [clearReplacementTimeout],\n );\n\n // Keep the freshest candidate around so swap completion can read the latest value, even\n // when a new notification arrives mid-exit-animation.\n useEffect(() => {\n candidateRef.current = pickNext(notifications, displayedNotification);\n }, [displayedNotification, notifications, pickNext]);\n\n // Main scheduling effect — owns *when* swaps happen. The *what* is delegated entirely\n // to `pickNext` (default: `createDefaultPickNext(pickOldest)`).\n //\n // Runs on every change to `displayedNotification`, `notifications`, `pickNext`, or\n // `transitionState`, and decides one of four outcomes:\n // 1. Do nothing (the right notification is already on screen, or an exit animation\n // is mid-flight and will re-trigger this effect when it finishes).\n // 2. Mount the first notification (no `displayedNotification` yet).\n // 3. Unmount the current one (`pickNext` returned `null`, the store became empty).\n // 4. Swap the displayed one for the new candidate — either immediately or after the\n // `minDisplayMs` dwell window has elapsed.\n //\n // Timing rules applied here (independent of selection policy):\n // - **Dwell window.** When `pickNext` returns a different candidate, hold the active\n // notification on screen until at least `minDisplayMs` has passed since it became\n // visible. Replacements that arrive after that window swap immediately.\n // - **Same-type bypass.** If the candidate has the same `type` as the displayed\n // notification, swap immediately (no dwell) — this is the \"repeated trigger\n // refreshes the snackbar and resets the auto-dismiss timer\" behavior. The timer\n // reset is achieved by removing the previously displayed notification on swap\n // (which clears its `NotificationManager` timer) so the new one starts its own\n // when it next intersects the slot.\n // - **External-dismiss bypass.** If the displayed notification is no longer in the\n // store (user clicked the close button, `NotificationManager` auto-removed it,\n // etc.), swap immediately — we should not stall an empty slot for the dwell.\n useEffect(() => {\n // An exit animation is already in flight. Once its timer fires it sets new state\n // (either the next notification or `null`), which will re-run this effect from a\n // clean baseline.\n if (transitionState === 'exit') return;\n\n // No notification is mounted yet — pick whatever the candidate logic prefers and\n // mount it directly with an enter animation. No swap required.\n if (!displayedNotification) {\n const candidate = pickNext(notifications, null);\n if (candidate) {\n displayedAtRef.current = Date.now();\n setDisplayedNotification(candidate);\n setTransitionState('enter');\n }\n return;\n }\n\n const candidate = pickNext(notifications, displayedNotification);\n\n // The store has been drained while a notification was visible. Play the exit\n // animation, then unmount.\n if (!candidate) {\n clearReplacementTimeout();\n setTransitionState('exit');\n exitTimeoutRef.current = window.setTimeout(() => {\n exitTimeoutRef.current = null;\n displayedAtRef.current = null;\n setDisplayedNotification(null);\n setTransitionState('enter');\n }, EXIT_ANIMATION_MS);\n return;\n }\n\n // The candidate is the displayed notification itself — nothing to do. Cancel any\n // dwell timer that may have been queued by an earlier run that has since become\n // moot (e.g. the incoming notification was removed before its dwell expired).\n if (candidate.id === displayedNotification.id) {\n clearReplacementTimeout();\n return;\n }\n\n const displayedInStore = notifications.some(\n ({ id }) => id === displayedNotification.id,\n );\n\n // Swap routine shared by the immediate and dwell-deferred branches below. Captures\n // `previousId` / `wasInStore` from the effect's closure so the exit timer can run\n // the right cleanup even if state has moved on by the time it fires.\n const startSwap = () => {\n replacementTimeoutRef.current = null;\n setTransitionState('exit');\n const previousId = displayedNotification.id;\n const wasInStore = displayedInStore;\n exitTimeoutRef.current = window.setTimeout(() => {\n exitTimeoutRef.current = null;\n if (wasInStore) {\n // Remove the previously displayed notification from the store so it does not\n // re-appear, and so its NotificationManager auto-dismiss timer is cleared.\n startedTimeoutIdsRef.current?.delete(previousId);\n removeNotification(previousId);\n }\n // Read the latest candidate at the moment the exit animation actually completes —\n // it may differ from the one decided when `startSwap` was queued because new\n // notifications could have arrived during the 340ms exit window.\n const next = candidateRef.current;\n if (next && next.id !== previousId) {\n displayedAtRef.current = Date.now();\n setDisplayedNotification(next);\n setTransitionState('enter');\n } else {\n displayedAtRef.current = null;\n setDisplayedNotification(null);\n setTransitionState('enter');\n }\n }, EXIT_ANIMATION_MS);\n };\n\n // External dismissal or auto-dismiss removed the displayed notification: swap right\n // away (no dwell wait — the slot would otherwise stall empty for `minDisplayMs`).\n if (!displayedInStore) {\n clearReplacementTimeout();\n startSwap();\n return;\n }\n\n // Repeated triggers of the same snackbar replace the active one and reset the\n // auto-dismiss timer immediately — feedback for the same condition should feel like\n // a single, persistent thing being refreshed.\n if (haveSameType(displayedNotification, candidate)) {\n clearReplacementTimeout();\n startSwap();\n return;\n }\n\n // Default branch: enforce the dwell window. `displayedAtRef` is stamped synchronously\n // every time we set `displayedNotification` (initial mount and swap completion), so it\n // is in sync with what is on screen by the time this effect runs.\n const elapsed = displayedAtRef.current ? Date.now() - displayedAtRef.current : 0;\n const remaining = Math.max(0, minDisplayMs - elapsed);\n\n if (remaining === 0) {\n // Dwell already elapsed; swap right now.\n clearReplacementTimeout();\n startSwap();\n } else if (replacementTimeoutRef.current === null) {\n // A swap is pending but the dwell hasn't elapsed yet. Schedule the swap once —\n // subsequent re-runs of this effect (e.g. as even newer notifications arrive)\n // intentionally do NOT reschedule. `candidateRef` keeps tracking the freshest\n // candidate, so when the timer fires `startSwap` → exit completes → the latest\n // candidate is picked up automatically.\n replacementTimeoutRef.current = window.setTimeout(startSwap, remaining);\n }\n }, [\n clearReplacementTimeout,\n displayedNotification,\n minDisplayMs,\n notifications,\n pickNext,\n removeNotification,\n transitionState,\n ]);\n\n const notification = displayedNotification;\n const notificationEnterFrom = getNotificationEnterFrom(notification, enterFrom);\n\n useEffect(() => {\n const element = observedElementRef.current;\n if (!element || !notification || transitionState === 'exit') return;\n\n const startTimeout = () => {\n if (\n !startedTimeoutIdsRef.current ||\n startedTimeoutIdsRef.current.has(notification.id)\n )\n return;\n\n startedTimeoutIdsRef.current.add(notification.id);\n startNotificationTimeout(notification.id);\n };\n\n if (typeof IntersectionObserver === 'undefined') {\n startTimeout();\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const [entry] = entries;\n if (!entry?.isIntersecting) return;\n\n startTimeout();\n observer.disconnect();\n },\n {\n root: listRef.current,\n threshold: 0.5,\n },\n );\n\n observer.observe(element);\n\n return () => {\n observer.disconnect();\n };\n }, [notification, startNotificationTimeout, transitionState]);\n\n if (!notification) return null;\n\n return (\n <div\n aria-label={t('aria/Notifications')}\n className={clsx(\n 'str-chat__notification-list',\n `str-chat__notification-list--enter-from-${notificationEnterFrom}`,\n `str-chat__notification-list--position-${verticalAlignment}`,\n panel && `str-chat__notification-list--${panel}`,\n className,\n )}\n data-testid='notification-list'\n ref={listRef}\n role='region'\n style={\n {\n '--str-chat__notification-list-enter-x':\n ENTER_TRANSLATION[notificationEnterFrom].x,\n '--str-chat__notification-list-enter-y':\n ENTER_TRANSLATION[notificationEnterFrom].y,\n } as React.CSSProperties\n }\n >\n <div\n aria-hidden\n className='str-chat__notification-list__edge str-chat__notification-list__edge--top'\n />\n <NotificationComponent\n entryDirection={notificationEnterFrom}\n key={notification.id}\n notification={notification}\n onDismiss={() => dismiss(notification.id)}\n ref={(element) => {\n observedElementRef.current = element;\n }}\n showClose={!notification.duration}\n transitionState={transitionState}\n />\n <div\n aria-hidden\n className='str-chat__notification-list__edge str-chat__notification-list__edge--bottom'\n />\n </div>\n );\n};\n","import { useEffect, useState } from 'react';\nimport type { Channel, ChannelState } from 'stream-chat';\n\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\n\nexport type UseChannelHasMembersOnlineParams = {\n channel?: Channel;\n enabled?: boolean;\n};\n\n// Watchers include the current user, but \"are other members online\" must reflect\n// only other users — otherwise (e.g. in a DM) the other participant looks online\n// as soon as the local user starts watching.\nconst getOtherWatchers = (\n watchers: ChannelState['watchers'] | undefined,\n ownUserId?: string,\n) => {\n const next = Object.assign({}, watchers ?? {});\n if (ownUserId) delete next[ownUserId];\n return next;\n};\n\nexport const useChannelHasMembersOnline = ({\n channel: channelOverride,\n enabled = true,\n}: UseChannelHasMembersOnlineParams = {}) => {\n const { channel: contextChannel } = useChannelStateContext();\n const { client } = useChatContext();\n const channel = channelOverride ?? contextChannel;\n const ownUserId = client.user?.id;\n const [watchers, setWatchers] = useState<ChannelState['watchers']>(() =>\n getOtherWatchers(channel?.state?.watchers, ownUserId),\n );\n\n useEffect(() => {\n setWatchers(getOtherWatchers(channel?.state?.watchers, ownUserId));\n }, [channel, ownUserId]);\n\n useEffect(() => {\n if (!enabled || !channel) return;\n\n const startSubscription = channel.on('user.watching.start', (event) => {\n setWatchers((prev) => {\n if (!event.user?.id || event.user.id === ownUserId) return prev;\n if (prev[event.user.id]) return prev;\n return Object.assign({ [event.user.id]: event.user }, prev);\n });\n });\n const stopSubscription = channel.on('user.watching.stop', (event) => {\n setWatchers((prev) => {\n if (!event.user?.id || !prev[event.user.id]) return prev;\n\n const next = Object.assign({}, prev);\n delete next[event.user.id];\n return next;\n });\n });\n\n return () => {\n startSubscription.unsubscribe();\n stopSubscription.unsubscribe();\n };\n }, [channel, enabled, ownUserId]);\n\n if (!enabled) return false;\n\n return Object.keys(watchers).length > 0;\n};\n","import { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { isDmChannel } from '../../../utils';\nimport { useChannelHasMembersOnline } from './useChannelHasMembersOnline';\nimport type { Channel } from 'stream-chat';\n\nexport type UseChannelHeaderOnlineStatusParams = {\n channel?: Channel;\n watcherCount?: number;\n};\n\n/**\n * Returns the channel header online status text (e.g. \"Online\", \"Offline\", or \"X members, Y online\").\n * Returns null when the channel has no members (nothing to show).\n */\nexport function useChannelHeaderOnlineStatus({\n channel: channelOverride,\n watcherCount: watcherCountOverride,\n}: UseChannelHeaderOnlineStatusParams = {}): string | null {\n const { t } = useTranslationContext();\n const { client } = useChatContext();\n const { channel: contextChannel, watcherCount: contextWatcherCount = 0 } =\n useChannelStateContext();\n const channel = channelOverride ?? contextChannel;\n const watcherCount = watcherCountOverride ?? contextWatcherCount;\n const { member_count: memberCount = 0 } = channel?.data || {};\n const isDirectMessagingChannel = isDmChannel({\n channel,\n ownUserId: client.user?.id,\n });\n const hasMembersOnline = useChannelHasMembersOnline({\n channel,\n enabled: isDirectMessagingChannel,\n });\n\n if (!memberCount) return null;\n\n if (isDirectMessagingChannel) {\n return hasMembersOnline ? t('Online') : t('Offline');\n }\n\n return `${t('{{ memberCount }} members', { memberCount })} · ${t('{{ watcherCount }} online', { watcherCount })}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkIA,IAAa,iBAAiB,MAAA,QAAM,cAClC,KAAA,CACF;AAEA,IAAa,mBAAmB,EAC9B,UACA,YAIA,iBAAA,GAAA,kBAAA,KAAC,eAAe,UAAhB;CAAgC;CAC7B;AACsB,CAAA;AAG3B,IAAa,qBAEX,mBACG;CACH,MAAM,gBAAA,GAAA,MAAA,YAA0B,cAAc;CAE9C,IAAI,CAAC,cACH,OAAO,CAAC;CAGV,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9GA,IAAa,4BAA4B,EACvC,UACA,cAKA,SAAS,OAAO,GAAG,SAAS;AAgB9B,IAAM,sBAA0D;CAC9D,qBAAqB,YAAY,YAAa,UAAU,eAAe;CAEvE,0BAA0B,CAAC;AAC7B;AAEA,IAA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