{"version":3,"file":"index.mjs","sources":["../../src/components/AIStateIndicator/hooks/useAIState.ts","../../src/context/AttachmentSelectorContext.tsx","../../src/components/Dialog/service/DialogManager.ts","../../src/components/Dialog/hooks/useDialog.ts","../../src/components/Portal/Portal.ts","../../src/components/Dialog/service/DialogPortal.tsx","../../src/context/DialogManagerContext.tsx","../../src/context/MessageContext.tsx","../../src/components/MessageComposer/preEditSnapshot.ts","../../src/context/MessageBounceContext.tsx","../../src/context/MessageListContext.tsx","../../src/context/MessageTranslationViewContext.tsx","../../src/context/ModalContext.tsx","../../src/context/PollContext.tsx","../../src/context/WithComponents.tsx","../../src/components/AIStateIndicator/AIStateIndicator.tsx","../../src/components/VisuallyHidden/VisuallyHidden.tsx","../../src/components/Accessibility/useAriaLiveAnnouncer.ts","../../src/components/Accessibility/AriaLiveRegion.tsx","../../src/components/Notifications/hooks/useNotifications.ts","../../src/components/Button/PlayButton.tsx","../../node_modules/dayjs/plugin/updateLocale.js","../../node_modules/dayjs/plugin/localeData.js","../../node_modules/dayjs/plugin/relativeTime.js","../../node_modules/dayjs/plugin/duration.js","../../node_modules/dayjs/plugin/utc.js","../../node_modules/dayjs/plugin/timezone.js","../../src/i18n/TranslationBuilder/TranslationBuilder.ts","../../src/i18n/TranslationBuilder/notifications/translators.ts","../../src/i18n/TranslationBuilder/notifications/translatorsByNotificationType.ts","../../src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts","../../node_modules/dayjs/locale/de.js","../../node_modules/dayjs/locale/es.js","../../node_modules/dayjs/locale/fr.js","../../node_modules/dayjs/locale/hi.js","../../node_modules/dayjs/locale/it.js","../../node_modules/dayjs/locale/ja.js","../../node_modules/dayjs/locale/ko.js","../../node_modules/dayjs/locale/nl.js","../../node_modules/dayjs/locale/pt.js","../../node_modules/dayjs/locale/ru.js","../../node_modules/dayjs/locale/tr.js","../../node_modules/dayjs/locale/en.js","../../src/i18n/Streami18n.ts","../../src/components/Loading/LoadingChannels.tsx","../../src/components/Loading/LoadingIndicator.tsx","../../src/components/Loading/progress-indicators.tsx","../../src/components/Loading/UploadProgressIndicator.tsx","../../src/components/MessageComposer/hooks/utils.ts","../../src/components/Attachment/components/FileSizeIndicator.tsx","../../src/components/Loading/UploadedSizeIndicator.tsx","../../src/utils/useStableCallback.ts","../../src/components/Message/hooks/useActionHandler.ts","../../src/components/Message/hooks/useDeleteHandler.ts","../../src/components/Message/hooks/useFlagHandler.ts","../../src/components/Message/hooks/useMentionsHandler.ts","../../src/components/Message/hooks/useMarkUnreadHandler.ts","../../src/components/Message/hooks/useMuteHandler.ts","../../src/components/Message/hooks/useOpenThreadHandler.ts","../../src/components/Message/hooks/usePinHandler.ts","../../src/components/Message/hooks/useReactionHandler.ts","../../src/components/Message/hooks/useRetryHandler.ts","../../src/components/Message/hooks/useUserHandler.ts","../../src/components/Message/hooks/useUserRole.ts","../../src/components/Message/hooks/useReactionsFetcher.ts","../../src/components/Message/hooks/useMessageTextStreaming.ts","../../src/components/Message/hooks/useMessageReminder.ts","../../src/a11y/hooks/useAriaIdentifiers.ts","../../src/components/Dialog/components/Alert.tsx","../../src/components/Dialog/service/DialogAnchor.tsx","../../src/components/Dialog/components/Callout.tsx","../../src/components/Avatar/Avatar.tsx","../../src/components/Badge/Badge.tsx","../../src/components/Avatar/AvatarStack.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/components/Dialog/components/Viewer.tsx","../../src/a11y/hooks/useResolvedModalAriaProps.ts","../../src/components/Modal/GlobalModal.tsx","../../src/components/MessageBounce/MessageBounceModal.tsx","../../src/components/MessageBounce/MessageBouncePrompt.tsx","../../src/components/Message/MessageBubble.tsx","../../src/components/Message/MessageDeletedBubble.tsx","../../src/components/Message/MessageBlocked.tsx","../../src/components/MessageActions/hooks/useBaseMessageActionSetFilter.ts","../../src/components/Message/MessageAlsoSentInChannelIndicator.tsx","../../src/components/Message/MessageRepliesCountButton.tsx","../../src/components/Message/PinIndicator.tsx","../../src/components/Tooltip/Tooltip.tsx","../../src/components/Tooltip/hooks/useEnterLeaveHandlers.ts","../../src/components/Message/MessageStatus.tsx","../../src/components/Message/renderText/regex.ts","../../src/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.ts","../../src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts","../../src/components/Message/renderText/remarkPlugins/htmlToTextPlugin.ts","../../src/components/Message/renderText/remarkPlugins/imageToLink.ts","../../src/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.ts","../../src/components/Message/renderText/remarkPlugins/plusPlusToEmphasis.ts","../../src/components/Message/renderText/remarkPlugins/remarkIgnoreMarkdown.ts","../../src/components/Message/renderText/componentRenderers/Anchor.tsx","../../src/components/Message/renderText/componentRenderers/Emoji.tsx","../../src/components/Message/renderText/componentRenderers/Mention.tsx","../../src/components/UtilityComponents/NullComponent.tsx","../../src/components/UtilityComponents/ErrorBoundary.tsx","../../src/components/Message/renderText/renderText.tsx","../../src/components/Message/MessageText.tsx","../../src/components/Message/Timestamp.tsx","../../src/components/Message/MessageTimestamp.tsx","../../src/components/Message/MessageEditedIndicator.tsx","../../src/components/Message/MessageTranslationIndicator.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/AudioPlayback/components/DurationDisplay.tsx","../../src/components/AudioPlayback/components/PlaybackRateButton.tsx","../../src/components/AudioPlayback/components/keyboardSeek.ts","../../src/components/AudioPlayback/components/progressBarA11y.ts","../../src/components/AudioPlayback/components/useInteractiveProgressBar.ts","../../src/components/AudioPlayback/components/ProgressBar.tsx","../../src/components/Attachment/utils.tsx","../../src/components/Attachment/audioSampling.ts","../../src/components/AudioPlayback/components/WaveProgressBar.tsx","../../src/components/Attachment/Audio.tsx","../../src/components/Attachment/AttachmentActions.tsx","../../src/components/Attachment/VoiceRecording.tsx","../../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/Attachment/ModalGallery.tsx","../../src/components/Attachment/Image.tsx","../../src/components/SafeAnchor/SafeAnchor.tsx","../../src/components/Attachment/LinkPreview/UnableToRenderCard.tsx","../../src/components/Attachment/LinkPreview/Card.tsx","../../src/components/Attachment/FileAttachment.tsx","../../src/components/Attachment/Giphy.tsx","../../src/components/Attachment/icons.tsx","../../src/components/Attachment/Geolocation.tsx","../../src/components/Attachment/UnsupportedAttachment.tsx","../../src/components/Attachment/VisibilityDisclaimer.tsx","../../src/components/Attachment/VideoAttachment.tsx","../../src/components/Attachment/AttachmentContainer.tsx","../../src/components/Attachment/Attachment.tsx","../../src/components/Location/hooks/useLiveLocationSharingManager.ts","../../src/components/MessageComposer/hooks/useAttachmentManagerState.ts","../../src/components/MessageComposer/hooks/useAttachmentsForPreview.ts","../../src/components/MessageComposer/hooks/useCanCreatePoll.ts","../../src/components/MessageComposer/hooks/useCooldownRemaining.tsx","../../src/components/MessageComposer/hooks/useTextareaRef.ts","../../src/components/MessageComposer/hooks/useSubmitHandler.ts","../../src/components/ReactFileUtilities/UploadButton.tsx","../../src/components/MessageComposer/hooks/usePasteHandler.ts","../../src/components/MediaRecorder/observable/Subscription.ts","../../src/components/MediaRecorder/observable/Observer.ts","../../src/components/MediaRecorder/observable/Observable.ts","../../src/components/MediaRecorder/observable/Subject.ts","../../src/components/MediaRecorder/observable/BehaviorSubject.ts","../../src/components/MediaRecorder/classes/BrowserPermission.ts","../../src/utils/mergeDeep.ts","../../src/components/MediaRecorder/classes/AmplitudeRecorder.ts","../../src/components/MediaRecorder/transcode/wav.ts","../../src/components/MediaRecorder/transcode/index.ts","../../src/components/MediaRecorder/classes/MediaRecorderController.ts","../../src/components/MediaRecorder/hooks/useMediaRecorder.ts","../../src/components/MessageComposer/hooks/useMessageComposerBindings.ts","../../src/components/MessageComposer/hooks/useMessageComposerCommands.ts","../../src/components/MessageComposer/hooks/useMessageComposerHasSendableData.ts","../../src/components/MessageComposer/hooks/useMessageContentIsEmpty.ts","../../src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx","../../src/components/MessageComposer/QuotedMessageIndicator.tsx","../../src/components/MessageComposer/QuotedMessagePreview.tsx","../../src/components/Message/QuotedMessage.tsx","../../src/components/Message/ReminderNotification.tsx","../../src/components/Message/StreamedMessageText.tsx","../../src/components/Form/Dropdown.tsx","../../src/components/Form/SwitchField.tsx","../../src/components/Location/ShareLocationDialog.tsx","../../src/components/Poll/PollHeader.tsx","../../src/components/Form/FieldError.tsx","../../src/components/UtilityComponents/useStableId.ts","../../src/components/Form/NumericInput.tsx","../../src/components/Form/TextInput.tsx","../../src/components/DragAndDrop/DragAndDropContainer.tsx","../../src/components/Form/TextInputFieldSet.tsx","../../src/components/Form/hooks/useFormState.ts","../../src/components/Poll/PollActions/AddCommentPrompt.tsx","../../src/components/Poll/PollActions/EndPollAlert.tsx","../../src/components/Poll/PollActions/PollAction.tsx","../../src/components/Poll/PollActions/SuggestPollOptionPrompt.tsx","../../src/components/Poll/PollVote.tsx","../../src/components/Poll/hooks/useManagePollVotesRealtime.ts","../../src/components/InfiniteScrollPaginator/hooks/useCursorPaginator.ts","../../src/components/Poll/hooks/usePollAnswerPagination.ts","../../src/components/Poll/hooks/usePollOptionVotesPagination.ts","../../src/components/InfiniteScrollPaginator/InfiniteScrollPaginator.tsx","../../src/components/Poll/PollActions/PollAnswerList.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotes.tsx","../../src/components/Poll/constants.ts","../../src/components/Poll/PollActions/PollQuestion.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotesList.tsx","../../src/components/Poll/PollActions/PollResults/PollResults.tsx","../../src/components/Poll/PollActions/PollActions.tsx","../../src/components/Poll/PollOptionSelector.tsx","../../src/components/Poll/PollOptionList.tsx","../../src/components/Poll/PollActions/PollOptionsFullList.tsx","../../src/components/Poll/PollContent.tsx","../../src/components/Poll/Poll.tsx","../../src/components/Poll/PollCreationDialog/MultipleAnswersField.tsx","../../src/components/Poll/PollCreationDialog/NameField.tsx","../../src/components/Poll/PollCreationDialog/OptionFieldSet.tsx","../../src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx","../../src/components/Poll/PollCreationDialog/PollCreationDialog.tsx","../../src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx","../../src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx","../../src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.tsx","../../src/components/MessageComposer/AttachmentPreviewList/utils/AttachmentPreviewRoot.tsx","../../src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx","../../src/components/Badge/MediaBadge.tsx","../../src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AttachmentPreviewList.tsx","../../src/components/MessageComposer/AttachmentPreviewList/VoiceRecordingPreviewSlot.tsx","../../src/components/MessageComposer/CommandChip.tsx","../../src/components/MessageComposer/CooldownTimer.tsx","../../src/components/MessageComposer/icons.tsx","../../src/components/MessageComposer/LinkPreviewList.tsx","../../src/components/MediaRecorder/RecordingPermissionDeniedNotification.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx","../../src/components/MediaRecorder/AudioRecorder/hooks/useTimeElapsed.ts","../../src/components/MediaRecorder/AudioRecorder/RecordingTimer.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx","../../src/components/MediaRecorder/AudioRecorder/recordingStateIdentity.ts","../../src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecorder.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx","../../src/components/MessageComposer/EditedMessagePreview.tsx","../../src/components/MessageComposer/SendToChannelCheckbox.tsx","../../src/components/TextareaComposer/SuggestionList/CommandItem.tsx","../../src/components/TextareaComposer/SuggestionList/EmoticonItem.tsx","../../src/components/TextareaComposer/SuggestionList/SuggestionListItem.tsx","../../src/components/TextareaComposer/SuggestionList/UserItem.tsx","../../src/utils/getTextareaCaretRect.ts","../../src/components/TextareaComposer/SuggestionList/SuggestionList.tsx","../../src/components/TextareaComposer/hooks/useTextareaPlaceholder.ts","../../src/components/TextareaComposer/TextareaComposer.tsx","../../src/components/MessageComposer/WithDragAndDropUpload.tsx","../../src/components/MessageComposer/StopAIGenerationButton.tsx","../../src/components/MessageComposer/SendButton.tsx","../../src/components/MessageComposer/MessageComposerActions.tsx","../../src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx","../../src/components/MessageComposer/MessageComposerUI.tsx","../../src/components/MessageComposer/hooks/useCreateMessageComposerContext.ts","../../src/components/MessageComposer/MessageComposer.tsx","../../src/components/ChannelListItem/utils.tsx","../../src/components/ChannelListItem/hooks/useChannelDisplayName.ts","../../src/components/ChannelListItem/hooks/useChannelPreviewInfo.ts","../../src/components/TypingIndicator/TypingIndicatorDots.tsx","../../src/components/TypingIndicator/hooks/useDebouncedTypingActive.ts","../../src/components/TypingIndicator/utils/getTypingStatusMessage.ts","../../src/components/TypingIndicator/TypingIndicatorHeader.tsx","../../src/components/Thread/ThreadHeader.tsx","../../src/components/Thread/ThreadStart.tsx","../../src/components/DateSeparator/DateSeparator.tsx","../../src/components/Thread/ThreadHead.tsx","../../src/components/Thread/Thread.tsx","../../src/components/Reactions/reactionOptions.tsx","../../src/components/Reactions/ReactionSelector.tsx","../../src/components/Reactions/hooks/useFetchReactions.ts","../../src/components/Reactions/MessageReactionsDetail.tsx","../../src/components/Reactions/hooks/useProcessReactions.tsx","../../src/components/Reactions/MessageReactions.tsx","../../src/components/Reactions/utils/utils.ts","../../src/components/Reactions/SpriteImage.tsx","../../src/components/Reactions/ReactionSelectorWithButton.tsx","../../src/components/MessageActions/RemindMeSubmenu.tsx","../../src/components/MessageActions/QuickMessageActionButton.tsx","../../src/components/MessageActions/DeleteMessageAlert.tsx","../../src/components/MessageActions/downloadUtils.ts","../../src/components/MessageActions/MessageActions.defaults.tsx","../../src/components/Chat/hooks/useSplitActionSet.ts","../../src/components/MessageActions/MessageActions.tsx","../../src/components/Message/MessageUI.tsx","../../src/components/Message/Message.tsx","../../src/components/MessageList/GiphyPreviewMessage.tsx","../../src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts","../../src/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.ts","../../src/components/MessageList/hooks/useLastReadData.ts","../../src/components/MessageList/hooks/useLastDeliveredData.ts","../../src/components/MessageList/hooks/MessageList/useMessageListElements.tsx","../../src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts","../../src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx","../../src/components/MessageList/MessageListMainPanel.tsx","../../src/components/MessageList/UnreadMessagesSeparator.tsx","../../src/components/MessageList/hooks/MessageList/useUnreadMessagesNotification.ts","../../src/components/MessageList/hooks/useMarkRead.ts","../../src/components/MessageList/NewMessageNotification.tsx","../../src/components/MessageList/UnreadMessagesNotification.tsx","../../src/components/InfiniteScrollPaginator/InfiniteScroll.tsx","../../src/components/TypingIndicator/TypingIndicator.tsx","../../src/components/MessageList/hooks/VirtualizedMessageList/useFloatingDateSeparator.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts","../../src/components/MessageList/FloatingDateSeparator.tsx","../../src/components/EventComponent/EventComponent.tsx","../../src/components/MessageList/renderMessages.tsx","../../src/utils/findReverse.ts","../../src/components/MessageList/hooks/useLastOwnMessage.ts","../../src/components/MessageList/hooks/useReducedMotionPreference.ts","../../src/components/MessageList/ScrollToLatestMessageButton.tsx","../../src/components/MessageList/MessageList.tsx","../../src/components/MessageList/VirtualizedMessageListComponents.tsx","../../src/context/VirtualizedMessageListContext.tsx","../../src/components/MessageList/VirtualizedMessageList.tsx","../../src/utils/getWholeChar.ts","../../src/components/Search/hooks/useSearchQueriesInProgress.ts","../../src/components/ChannelList/hooks/useConnectionRecoveredListener.ts","../../src/components/ChannelList/hooks/usePaginatedChannels.ts","../../src/components/ChannelList/utils.ts","../../src/components/ChannelList/hooks/useChannelListShape.ts","../../src/components/ChannelList/ChannelListUI.tsx","../../src/components/Search/SearchContext.tsx","../../src/components/Search/SearchBar/SearchBar.tsx","../../src/components/Search/SearchResults/SearchResultItem.tsx","../../src/components/Search/SearchSourceResultsContext.tsx","../../src/components/Search/SearchResults/SearchSourceResultsLoadingIndicator.tsx","../../src/components/Search/SearchResults/SearchSourceResultListFooter.tsx","../../src/components/Search/SearchResults/SearchSourceResultList.tsx","../../src/components/Search/SearchResults/SearchSourceResultsEmpty.tsx","../../src/components/Search/SearchResults/SearchSourceResultsHeader.tsx","../../src/components/Search/SearchResults/SearchSourceResults.tsx","../../src/components/Search/SearchResults/SearchResultsHeader.tsx","../../src/components/Search/SearchResults/SearchResultsPresearch.tsx","../../src/components/Search/SearchResults/SearchResults.tsx","../../src/components/Search/Search.tsx","../../src/components/LoadMore/LoadMoreButton.tsx","../../src/components/LoadMore/LoadMorePaginator.tsx","../../src/components/ChannelList/ChannelListHeader.tsx","../../src/components/ChannelList/ChannelList.tsx","../../src/components/ChannelList/hooks/useSelectedChannelState.ts","../../src/components/ChannelList/hooks/useChannelMembershipState.ts","../../src/components/ChannelList/hooks/useChannelMembersState.ts","../../src/components/ChannelListItem/hooks/useIsChannelMuted.ts","../../src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx","../../src/components/ChannelListItem/ChannelListItemActionButtons.tsx","../../src/components/ChannelListItem/ChannelListItemTimestamp.tsx","../../src/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.ts","../../src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx","../../src/components/ChannelListItem/ChannelListItemUI.tsx","../../src/components/ChannelListItem/hooks/useMessageDeliveryStatus.ts","../../src/components/ChannelListItem/ChannelListItem.tsx","../../src/components/Threads/ThreadList/ThreadListItemUI.tsx","../../src/components/Threads/ThreadList/ThreadListItem.tsx","../../src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx","../../src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx","../../src/components/Threads/ThreadList/ThreadListLoadingIndicator.tsx","../../src/components/Threads/ThreadList/ThreadListHeader.tsx","../../src/components/Threads/ThreadList/ThreadList.tsx","../../src/components/Notifications/hooks/useSystemNotifications.ts","../../src/components/Notifications/Notification.tsx","../../src/components/Notifications/NotificationList.tsx","../../src/components/Accessibility/NotificationAnnouncer.tsx","../../src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts","../../src/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.ts","../../src/components/ChannelHeader/ChannelHeader.tsx","../../src/components/SkipNavigation/SkipNavigation.tsx","../../src/components/Chat/hooks/useChat.ts","../../src/components/Chat/hooks/useReportLostConnectionSystemNotification.ts","../../src/components/Chat/hooks/useCreateChatContext.ts","../../src/components/Chat/hooks/useChannelsQueryState.ts","../../src/components/Chat/Chat.tsx","../../src/components/Chat/hooks/useCreateChatClient.ts","../../src/components/Window/Window.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { AIState, Channel, Event } from 'stream-chat';\n\nexport const AIStates = {\n  Error: 'AI_STATE_ERROR',\n  ExternalSources: 'AI_STATE_EXTERNAL_SOURCES',\n  Generating: 'AI_STATE_GENERATING',\n  Idle: 'AI_STATE_IDLE',\n  Stop: 'AI_STATE_STOP',\n  Thinking: 'AI_STATE_THINKING',\n};\n\n/**\n * A hook that returns the current state of the AI.\n * @param {Channel} channel - The channel for which we want to know the AI state.\n * @returns {{ aiState: AIState }} The current AI state for the given channel.\n */\nexport const useAIState = (channel?: Channel): { aiState: AIState } => {\n  const [aiState, setAiState] = useState<AIState>(AIStates.Idle);\n\n  useEffect(() => {\n    if (!channel) {\n      return;\n    }\n\n    const indicatorChangedListener = channel.on('ai_indicator.update', (event: Event) => {\n      const { cid } = event;\n      const state = event.ai_state as AIState;\n      if (channel.cid === cid) {\n        setAiState(state);\n      }\n    });\n\n    const indicatorClearedListener = channel.on('ai_indicator.clear', (event) => {\n      const { cid } = event;\n      if (channel.cid === cid) {\n        setAiState(AIStates.Idle);\n      }\n    });\n\n    const indicatorStoppedListener = channel.on('ai_indicator.stop', (event) => {\n      const { cid } = event;\n      if (channel.cid === cid) {\n        setAiState(AIStates.Stop);\n      }\n    });\n\n    return () => {\n      indicatorChangedListener.unsubscribe();\n      indicatorClearedListener.unsubscribe();\n      indicatorStoppedListener.unsubscribe();\n    };\n  }, [channel]);\n\n  return { aiState };\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { createContext, useContext } from 'react';\n\nexport type AttachmentSelectorContextValue = {\n  fileInput: HTMLInputElement | null;\n};\n\nconst AttachmentSelectorContext = createContext<AttachmentSelectorContextValue>({\n  fileInput: null,\n});\n\nexport const AttachmentSelectorContextProvider = ({\n  children,\n  value,\n}: PropsWithChildren<{ value: AttachmentSelectorContextValue }>) => (\n  <AttachmentSelectorContext.Provider value={value}>\n    {children}\n  </AttachmentSelectorContext.Provider>\n);\n\nexport const useAttachmentSelectorContext = () => useContext(AttachmentSelectorContext);\n","import { nanoid } from 'nanoid';\nimport { StateStore } from 'stream-chat';\n\nexport type GetDialogParams = {\n  id: DialogId;\n};\nexport type GetOrCreateDialogParams = GetDialogParams & {\n  /**\n   * Optional per-dialog override.\n   * If undefined, manager-level `closeOnClickOutside` is used.\n   */\n  closeOnClickOutside?: boolean;\n};\n\ntype DialogId = string;\n\nexport type Dialog = {\n  close: () => void;\n  closeOnClickOutside?: boolean;\n  id: DialogId;\n  isOpen: boolean | undefined;\n  open: (zIndex?: number) => void;\n  removalTimeout: NodeJS.Timeout | undefined;\n  remove: () => void;\n  toggle: (closeAll?: boolean) => void;\n};\n\nexport type DialogManagerOptions = {\n  /** Enables closing all dialogs in this manager when clicking overlay/outside area. */\n  closeOnClickOutside?: boolean;\n  id?: string;\n};\n\ntype Dialogs = Record<DialogId, Dialog>;\n\nexport type DialogManagerState = {\n  dialogsById: Dialogs;\n};\n\n/**\n * Keeps a map of Dialog objects.\n * Dialog can be controlled via `Dialog` object retrieved using `useDialog()` hook.\n * The hook returns an object with the following API:\n *\n * - `dialog.open()` - opens the dialog\n * - `dialog.close()` - closes the dialog\n * - `dialog.toggle()` - toggles the dialog open state. Accepts boolean argument closeAll. If enabled closes any other dialog that would be open.\n * - `dialog.remove()` - removes the dialog object reference from the state (primarily for cleanup purposes)\n */\nexport class DialogManager {\n  /** Manager-level outside click policy used by DialogPortal dismiss handlers. */\n  closeOnClickOutside: boolean;\n  id: string;\n  state = new StateStore<DialogManagerState>({\n    dialogsById: {},\n  });\n\n  constructor({ closeOnClickOutside = true, id }: DialogManagerOptions = {}) {\n    this.closeOnClickOutside = closeOnClickOutside;\n    this.id = id ?? nanoid();\n  }\n\n  get openDialogCount() {\n    return Object.values(this.state.getLatestValue().dialogsById).reduce(\n      (count, dialog) => {\n        if (dialog.isOpen) return count + 1;\n        return count;\n      },\n      0,\n    );\n  }\n\n  get(id: DialogId): Dialog | undefined {\n    return this.state.getLatestValue().dialogsById[id];\n  }\n\n  getOrCreate({ closeOnClickOutside, id }: GetOrCreateDialogParams) {\n    let dialog = this.get(id);\n    if (!dialog) {\n      dialog = {\n        close: () => {\n          this.close(id);\n        },\n        closeOnClickOutside,\n        id,\n        isOpen: false,\n        open: () => {\n          this.open({ id });\n        },\n        removalTimeout: undefined,\n        remove: () => {\n          this.remove(id);\n        },\n        toggle: (closeAll = false) => {\n          this.toggle({ id }, closeAll);\n        },\n      };\n      this.state.next((current) => ({\n        ...current,\n        dialogsById: { ...current.dialogsById, [id]: dialog as Dialog },\n      }));\n    }\n\n    const shouldUpdateDialogSettings =\n      dialog.closeOnClickOutside !== closeOnClickOutside || !!dialog.removalTimeout;\n\n    if (shouldUpdateDialogSettings) {\n      if (dialog.removalTimeout) clearTimeout(dialog.removalTimeout);\n      this.state.next((current) => ({\n        ...current,\n        dialogsById: {\n          ...current.dialogsById,\n          [id]: {\n            ...current.dialogsById[id],\n            closeOnClickOutside,\n            removalTimeout: undefined,\n          },\n        },\n      }));\n    }\n\n    return dialog;\n  }\n\n  open(params: GetOrCreateDialogParams, closeRest?: boolean) {\n    const dialog = this.getOrCreate(params);\n    if (dialog.isOpen) return;\n    if (closeRest) {\n      this.closeAll();\n    }\n    this.state.next((current) => ({\n      ...current,\n      dialogsById: { ...current.dialogsById, [dialog.id]: { ...dialog, isOpen: true } },\n    }));\n  }\n\n  close(id: DialogId) {\n    const dialog = this.state.getLatestValue().dialogsById[id];\n    if (!dialog?.isOpen) return;\n    this.state.next((current) => ({\n      ...current,\n      dialogsById: { ...current.dialogsById, [dialog.id]: { ...dialog, isOpen: false } },\n    }));\n  }\n\n  closeAll() {\n    Object.values(this.state.getLatestValue().dialogsById).forEach((dialog) =>\n      dialog.close(),\n    );\n  }\n\n  toggle(params: GetOrCreateDialogParams, closeAll = false) {\n    if (this.state.getLatestValue().dialogsById[params.id]?.isOpen) {\n      this.close(params.id);\n    } else {\n      this.open(params, closeAll);\n    }\n  }\n\n  remove = (id: DialogId) => {\n    const dialog = this.get(id);\n    if (!dialog) return;\n\n    if (dialog.removalTimeout) {\n      clearTimeout(dialog.removalTimeout);\n    }\n\n    this.state.next((current) => {\n      const newDialogs = { ...current.dialogsById };\n      delete newDialogs[id];\n      return {\n        ...current,\n        dialogsById: newDialogs,\n      };\n    });\n  };\n\n  /**\n   * Marks the dialog state as unused. If the dialog id is referenced again quickly,\n   * the state will not be removed. Otherwise, the state will be removed after\n   * a short timeout.\n   */\n  markForRemoval(id: DialogId) {\n    const dialog = this.get(id);\n\n    if (!dialog) {\n      return;\n    }\n\n    this.state.next((current) => ({\n      ...current,\n      dialogsById: {\n        ...current.dialogsById,\n        [id]: {\n          ...dialog,\n          removalTimeout: setTimeout(() => {\n            this.remove(id);\n          }, 16),\n        },\n      },\n    }));\n  }\n\n  cancelPendingRemoval(id: DialogId) {\n    const dialog = this.get(id);\n\n    if (!dialog?.removalTimeout) {\n      return;\n    }\n\n    clearTimeout(dialog.removalTimeout);\n\n    this.state.next((current) => ({\n      ...current,\n      dialogsById: {\n        ...current.dialogsById,\n        [id]: {\n          ...current.dialogsById[id],\n          removalTimeout: undefined,\n        },\n      },\n    }));\n  }\n}\n","import { useCallback, useEffect } from 'react';\nimport {\n  modalDialogManagerId,\n  useDialogManager,\n  useNearestDialogManagerContext,\n} from '../../../context';\nimport { useStateStore } from '../../../store';\n\nimport type {\n  DialogManagerState,\n  GetOrCreateDialogParams,\n} from '../service/DialogManager';\n\nexport type UseDialogParams = GetOrCreateDialogParams & {\n  dialogManagerId?: string;\n};\n\nexport const useDialog = ({\n  closeOnClickOutside,\n  dialogManagerId,\n  id,\n}: UseDialogParams) => {\n  const { dialogManager } = useDialogManager({ dialogManagerId });\n\n  useEffect(() => {\n    dialogManager.cancelPendingRemoval(id);\n\n    return () => {\n      // Since this cleanup can run even if the component is still mounted\n      // and dialog id is unchanged (e.g. in <StrictMode />), it's safer to\n      // mark state as unused and only remove it after a timeout, rather than\n      // to remove it immediately.\n      dialogManager.markForRemoval(id);\n    };\n  }, [dialogManager, id]);\n\n  return dialogManager.getOrCreate({ closeOnClickOutside, id });\n};\n\nexport const useDialogOnNearestManager = ({ id }: Pick<UseDialogParams, 'id'>) => {\n  const { dialogManager } = useNearestDialogManagerContext() ?? {};\n  const dialog = useDialog({ dialogManagerId: dialogManager?.id, id });\n\n  return {\n    dialog,\n    dialogManager,\n  };\n};\n\nexport const modalDialogId = 'modal-dialog' as const;\n\nexport const useModalDialog = () =>\n  useDialog({ dialogManagerId: modalDialogManagerId, id: modalDialogId });\n\nexport const useDialogIsOpen = (id: string, dialogManagerId?: string) => {\n  const { dialogManager } = useDialogManager({ dialogManagerId });\n  const dialogIsOpenSelector = useCallback(\n    ({ dialogsById }: DialogManagerState) => ({ isOpen: !!dialogsById[id]?.isOpen }),\n    [id],\n  );\n  return useStateStore(dialogManager.state, dialogIsOpenSelector).isOpen;\n};\n\nexport const useModalDialogIsOpen = () =>\n  useDialogIsOpen(modalDialogId, modalDialogManagerId);\n\nconst openedDialogCountSelector = (nextValue: DialogManagerState) => ({\n  openedDialogCount: Object.values(nextValue.dialogsById).reduce((count, dialog) => {\n    if (dialog.isOpen) return count + 1;\n    return count;\n  }, 0),\n});\n\nexport const useOpenedDialogCount = ({\n  dialogManagerId,\n}: { dialogManagerId?: string } = {}) => {\n  const { dialogManager } = useDialogManager({ dialogManagerId });\n  return useStateStore(dialogManager.state, openedDialogCountSelector).openedDialogCount;\n};\n","import type { PropsWithChildren, ReactPortal } from 'react';\nimport { useLayoutEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport type PortalProps = {\n  getPortalDestination: () => Element | null;\n  isOpen?: boolean;\n};\n\nexport const Portal = ({\n  children,\n  getPortalDestination,\n  isOpen,\n}: PropsWithChildren<PortalProps>): ReactPortal | null => {\n  const [portalDestination, setPortalDestination] = useState<Element | null>(null);\n\n  useLayoutEffect(() => {\n    const destination = getPortalDestination();\n    if (!destination || !isOpen) return;\n    setPortalDestination(destination);\n  }, [getPortalDestination, isOpen]);\n\n  if (!portalDestination) return null;\n\n  return createPortal(children, portalDestination);\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { useDialogIsOpen, useOpenedDialogCount } from '../hooks';\nimport { Portal } from '../../Portal/Portal';\nimport { useDialogManager, useNearestDialogManagerContext } from '../../../context';\n\nconst shouldCloseOnOutsideClick = ({\n  dialog,\n  managerCloseOnClickOutside,\n}: {\n  dialog: { closeOnClickOutside?: boolean };\n  managerCloseOnClickOutside: boolean;\n}) => dialog.closeOnClickOutside ?? managerCloseOnClickOutside;\n\nexport const DialogPortalDestination = () => {\n  const { dialogManager } = useNearestDialogManagerContext() ?? {};\n  const openedDialogCount = useOpenedDialogCount({ dialogManagerId: dialogManager?.id });\n  const [destinationRoot, setDestinationRoot] = useState<HTMLDivElement | null>(null);\n\n  // Handle clicks outside dialog contents.\n  // Clicks on the overlay itself or outside it close open dialogs;\n  // only clicks on dialog contents (descendants) are ignored.\n  useEffect(() => {\n    if (!destinationRoot || !dialogManager) return;\n\n    const handleDocumentClick = (event: MouseEvent) => {\n      const target = event.target as Node;\n      const clickedOverlay = (target as HTMLElement).closest?.(\n        '[data-str-chat__portal-id]',\n      );\n      if (clickedOverlay && clickedOverlay !== destinationRoot) return;\n      if (target !== destinationRoot && destinationRoot.contains(target)) return;\n      // Defer so target onClick handlers (e.g. context-menu toggle buttons) can run first.\n      setTimeout(() => {\n        Object.values(dialogManager.state.getLatestValue().dialogsById).forEach(\n          (dialog) => {\n            if (!dialog.isOpen) return;\n            if (\n              !shouldCloseOnOutsideClick({\n                dialog,\n                managerCloseOnClickOutside: dialogManager.closeOnClickOutside,\n              })\n            )\n              return;\n            dialogManager.close(dialog.id);\n          },\n        );\n      }, 0);\n    };\n\n    document.addEventListener('click', handleDocumentClick, { capture: true });\n\n    return () => {\n      document.removeEventListener('click', handleDocumentClick, { capture: true });\n    };\n  }, [destinationRoot, dialogManager]);\n\n  if (!openedDialogCount) return null;\n\n  return (\n    <div\n      className='str-chat__dialog-overlay'\n      data-str-chat__portal-id={dialogManager?.id}\n      data-testid='str-chat__dialog-overlay'\n      ref={setDestinationRoot}\n      style={\n        {\n          '--str-chat__dialog-overlay-height': openedDialogCount > 0 ? '100%' : '0',\n        } as React.CSSProperties\n      }\n    />\n  );\n};\n\ntype DialogPortalEntryProps = {\n  dialogId: string;\n  dialogManagerId?: string;\n};\n\nexport const DialogPortalEntry = ({\n  children,\n  dialogId,\n  dialogManagerId,\n}: PropsWithChildren<DialogPortalEntryProps>) => {\n  const { dialogManager } = useDialogManager({ dialogId, dialogManagerId });\n  const dialogIsOpen = useDialogIsOpen(dialogId, dialogManagerId);\n\n  const getPortalDestination = useCallback(\n    () => document.querySelector(`div[data-str-chat__portal-id=\"${dialogManager.id}\"]`),\n    [dialogManager.id],\n  );\n\n  return (\n    <Portal getPortalDestination={getPortalDestination} isOpen={dialogIsOpen}>\n      {children}\n    </Portal>\n  );\n};\n","import React, {\n  type PropsWithChildren,\n  useContext,\n  useEffect,\n  useMemo,\n  useState,\n} from 'react';\nimport { StateStore } from 'stream-chat';\n\nimport { DialogManager } from '../components/Dialog/service/DialogManager';\nimport { DialogPortalDestination } from '../components/Dialog/service/DialogPortal';\nimport type { PropsWithChildrenOnly } from '../types/types';\n\ntype DialogManagerId = string;\n\ntype DialogManagersState = Record<DialogManagerId, DialogManager | undefined>;\nconst dialogManagersRegistry: StateStore<DialogManagersState> = new StateStore({});\n\nconst getDialogManager = (id: string): DialogManager | undefined =>\n  dialogManagersRegistry.getLatestValue()[id];\n\nconst getOrCreateDialogManager = ({\n  closeOnClickOutside,\n  id,\n}: {\n  closeOnClickOutside?: boolean;\n  id: string;\n}) => {\n  let manager = getDialogManager(id);\n  if (!manager) {\n    manager = new DialogManager({ closeOnClickOutside, id });\n    dialogManagersRegistry.partialNext({ [id]: manager });\n  } else if (typeof closeOnClickOutside === 'boolean') {\n    manager.closeOnClickOutside = closeOnClickOutside;\n  }\n  return manager;\n};\n\nconst removeDialogManager = (id: string) => {\n  if (!getDialogManager(id)) return;\n  dialogManagersRegistry.partialNext({ [id]: undefined });\n};\n\ntype DialogManagerProviderContextValue = {\n  dialogManager: DialogManager;\n};\n\nconst DialogManagerProviderContext = React.createContext<\n  DialogManagerProviderContextValue | undefined\n>(undefined);\n\ntype DialogManagerProviderProps = PropsWithChildren<{\n  /**\n   * Manager-level outside click policy.\n   * When `true`, clicking overlay or outside overlay-covered area closes all dialogs\n   * in this manager. When `false`, outside clicks do not dismiss dialogs.\n   */\n  closeOnClickOutside?: boolean;\n  id?: string;\n}>;\n\n/**\n * Creates/provides a dialog manager and its portal destination.\n */\nexport const DialogManagerProvider = ({\n  children,\n  closeOnClickOutside,\n  id,\n}: DialogManagerProviderProps) => {\n  const [dialogManager, setDialogManager] = useState<DialogManager | null>(() => {\n    if (id) return getDialogManager(id) ?? null;\n    return new DialogManager({ closeOnClickOutside }); // will not be included in the registry\n  });\n\n  useEffect(() => {\n    if (!id) return;\n    setDialogManager(getOrCreateDialogManager({ closeOnClickOutside, id }));\n    return () => {\n      removeDialogManager(id);\n      setDialogManager(null);\n    };\n  }, [closeOnClickOutside, id]);\n\n  // temporarily do not render until a new dialog manager is created\n  if (!dialogManager) return null;\n\n  return (\n    <DialogManagerProviderContext.Provider value={{ dialogManager }}>\n      {children}\n      <DialogPortalDestination />\n    </DialogManagerProviderContext.Provider>\n  );\n};\n\nexport type UseDialogManagerParams = {\n  dialogId?: string;\n  dialogManagerId?: string;\n};\n\nconst getManagerFromStore = ({\n  dialogId,\n  dialogManagerId,\n  newState,\n  previousState,\n}: UseDialogManagerParams & {\n  newState: DialogManagersState;\n  previousState: DialogManagersState | undefined;\n}) => {\n  let managerInNewState: DialogManager | undefined;\n  let managerInPrevState: DialogManager | undefined;\n  if (dialogManagerId) {\n    if (!dialogId) {\n      managerInNewState = newState[dialogManagerId];\n      managerInPrevState = previousState?.[dialogManagerId];\n    } else {\n      if (newState[dialogManagerId]?.get(dialogId)) {\n        managerInNewState = newState[dialogManagerId];\n      }\n      if (previousState?.[dialogManagerId]?.get(dialogId)) {\n        managerInPrevState = previousState[dialogManagerId];\n      }\n    }\n  } else if (dialogId) {\n    managerInNewState = Object.values(newState).find(\n      (dialogMng) => dialogId && dialogMng?.get(dialogId),\n    );\n    managerInPrevState =\n      previousState &&\n      Object.values(previousState).find(\n        (dialogMng) => dialogId && dialogMng?.get(dialogId),\n      );\n  }\n\n  return { managerInNewState, managerInPrevState };\n};\n\n/**\n * Retrieves the nearest dialog manager or searches for the dialog manager by dialog manager id or dialog id.\n * Dialog id will take precedence over dialog manager id if both are provided and dialog manager is found by dialog id.\n */\nexport const useDialogManager = ({\n  dialogId,\n  dialogManagerId,\n}: UseDialogManagerParams = {}) => {\n  const nearestDialogManagerContext = useContext(DialogManagerProviderContext);\n\n  const [dialogManagerContext, setDialogManagerContext] = useState<\n    DialogManagerProviderContextValue | undefined\n  >(() => {\n    const { managerInNewState } = getManagerFromStore({\n      dialogId,\n      dialogManagerId,\n      newState: dialogManagersRegistry.getLatestValue(),\n      previousState: undefined,\n    });\n    return managerInNewState\n      ? { dialogManager: managerInNewState }\n      : nearestDialogManagerContext;\n  });\n\n  useEffect(() => {\n    if (!dialogId && !dialogManagerId) return;\n    const unsubscribe = dialogManagersRegistry.subscribeWithSelector(\n      (state) => state,\n      (newState, previousState) => {\n        const { managerInNewState, managerInPrevState } = getManagerFromStore({\n          dialogId,\n          dialogManagerId,\n          newState,\n          previousState,\n        });\n\n        if (!managerInPrevState || managerInNewState?.id !== managerInPrevState.id) {\n          setDialogManagerContext((prevState) => {\n            if (prevState?.dialogManager.id === managerInNewState?.id) return prevState;\n            // fixme: need to handle the possibility that the dialogManager is undefined\n            return {\n              dialogManager:\n                managerInNewState || nearestDialogManagerContext?.dialogManager,\n            } as DialogManagerProviderContextValue;\n          });\n        }\n      },\n    );\n    return () => {\n      unsubscribe();\n    };\n  }, [dialogId, dialogManagerId, nearestDialogManagerContext?.dialogManager]);\n\n  if (!dialogManagerContext?.dialogManager) {\n    console.warn(\n      `Dialog manager (manager id: ${dialogManagerId}, dialog id: ${dialogId}) is not available`,\n    );\n  }\n\n  return dialogManagerContext as DialogManagerProviderContextValue;\n};\n\nexport const modalDialogManagerId = 'modal-dialog-manager' as const;\n\nexport const ModalDialogManagerProvider = ({ children }: PropsWithChildrenOnly) => (\n  <DialogManagerProvider id={modalDialogManagerId}>{children}</DialogManagerProvider>\n);\n\nexport const useModalDialogManager = () =>\n  useMemo(() => getDialogManager(modalDialogManagerId), []);\n\nexport const useNearestDialogManagerContext = () =>\n  useContext(DialogManagerProviderContext);\n","import type { BaseSyntheticEvent, PropsWithChildren, ReactNode } 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 { RenderTextOptions } 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?: (\n    text?: string,\n    mentioned_users?: UserResponse[],\n    options?: RenderTextOptions,\n  ) => ReactNode;\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","import type { MessageComposer } from 'stream-chat';\n\ntype RestoreFunction = () => void;\n\nconst snapshots = new WeakMap<MessageComposer, RestoreFunction>();\n\n/**\n * Captures a full state snapshot of the composer before entering edit mode.\n * Does nothing if a snapshot already exists (e.g. switching between edits).\n */\nexport const savePreEditSnapshot = (messageComposer: MessageComposer) => {\n  if (snapshots.has(messageComposer)) return;\n\n  const composerState = messageComposer.state.getLatestValue();\n  const textState = messageComposer.textComposer.state.getLatestValue();\n  const attachmentState = messageComposer.attachmentManager.state.getLatestValue();\n  const linkPreviewState = messageComposer.linkPreviewsManager.state.getLatestValue();\n  const locationState = messageComposer.locationComposer.state.getLatestValue();\n  const pollState = messageComposer.pollComposer.state.getLatestValue();\n  const customDataState = messageComposer.customDataManager.state.getLatestValue();\n\n  snapshots.set(messageComposer, () => {\n    messageComposer.state.next(composerState);\n    messageComposer.textComposer.state.next(textState);\n    messageComposer.attachmentManager.state.next(attachmentState);\n    messageComposer.linkPreviewsManager.state.next(linkPreviewState);\n    messageComposer.locationComposer.state.next(locationState);\n    messageComposer.pollComposer.state.next(pollState);\n    messageComposer.customDataManager.state.next(customDataState);\n  });\n};\n\n/**\n * Restores the composer to the state captured before editing began.\n * Falls back to `clear()` if no snapshot exists.\n */\nexport const restorePreEditSnapshot = (messageComposer: MessageComposer) => {\n  const restore = snapshots.get(messageComposer);\n  snapshots.delete(messageComposer);\n  if (restore) {\n    restore();\n  } else {\n    messageComposer.clear();\n  }\n};\n\n/**\n * Discards the snapshot without restoring (e.g. after a successful edit save).\n */\nexport const discardPreEditSnapshot = (messageComposer: MessageComposer) => {\n  snapshots.delete(messageComposer);\n};\n","import type { ReactEventHandler } from 'react';\nimport React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { useMessageContext } from './MessageContext';\nimport { useChannelActionContext } from './ChannelActionContext';\nimport { isMessageBounced, useMessageComposerController } from '../components';\nimport { savePreEditSnapshot } from '../components/MessageComposer/preEditSnapshot';\nimport type { LocalMessage } from 'stream-chat';\nimport type { PropsWithChildrenOnly } from '../types/types';\n\nexport interface MessageBounceContextValue {\n  handleDelete: ReactEventHandler;\n  handleEdit: ReactEventHandler;\n  handleRetry: ReactEventHandler;\n  message: LocalMessage;\n}\n\nconst MessageBounceContext = createContext<MessageBounceContextValue | undefined>(\n  undefined,\n);\n\nexport function useMessageBounceContext(componentName?: string) {\n  const contextValue = useContext(MessageBounceContext);\n\n  if (!contextValue) {\n    console.warn(\n      `The useMessageBounceContext hook was called outside of the MessageBounceContext provider. The errored call is located in the ${componentName} component.`,\n    );\n\n    return {} as MessageBounceContextValue;\n  }\n\n  return contextValue;\n}\n\nexport function MessageBounceProvider({ children }: PropsWithChildrenOnly) {\n  const messageComposer = useMessageComposerController();\n  const { handleRetry: doHandleRetry, message } = useMessageContext(\n    'MessageBounceProvider',\n  );\n\n  if (!isMessageBounced(message)) {\n    console.warn(\n      `The MessageBounceProvider was rendered for a message that is not bounced. Have you missed the \"isMessageBounced\" check?`,\n    );\n  }\n\n  const { removeMessage } = useChannelActionContext('MessageBounceProvider');\n\n  const handleDelete: ReactEventHandler = useCallback(() => {\n    removeMessage(message);\n  }, [message, removeMessage]);\n\n  const handleEdit: ReactEventHandler = useCallback(\n    (e) => {\n      e.preventDefault();\n      savePreEditSnapshot(messageComposer);\n      messageComposer.initState({ composition: message });\n    },\n    [message, messageComposer],\n  );\n\n  const handleRetry = useCallback(() => {\n    doHandleRetry(message);\n  }, [doHandleRetry, message]);\n\n  const value = useMemo(\n    () => ({\n      handleDelete,\n      handleEdit,\n      handleRetry,\n      message,\n    }),\n    [handleDelete, handleEdit, handleRetry, message],\n  );\n\n  return (\n    <MessageBounceContext.Provider value={value}>\n      {children}\n    </MessageBounceContext.Provider>\n  );\n}\n","import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { RenderedMessage } from '../components';\n\nexport type MessageListContextValue = {\n  /** Enriched message list, including date separators and intro message (if enabled) */\n  processedMessages: RenderedMessage[];\n  /** The scroll container within which the messages and typing indicator are rendered */\n  listElement: HTMLDivElement | null;\n  /** Function that scrolls the `listElement` to the bottom. */\n  scrollToBottom: () => void;\n};\n\nexport const MessageListContext = createContext<MessageListContextValue | undefined>(\n  undefined,\n);\n\n/**\n * Context provider for components rendered within the `MessageList`\n */\nexport const MessageListContextProvider = ({\n  children,\n  value,\n}: PropsWithChildren<{\n  value: MessageListContextValue;\n}>) => (\n  <MessageListContext.Provider value={value as MessageListContextValue}>\n    {children}\n  </MessageListContext.Provider>\n);\n\nexport const useMessageListContext = (componentName?: string) => {\n  const contextValue = useContext(MessageListContext);\n\n  if (!contextValue) {\n    console.warn(\n      `The useMessageListContext hook was called outside of the MessageListContext provider. Make sure this hook is called within the MessageList component. The errored call is located in the ${componentName} component.`,\n    );\n\n    return {} as MessageListContextValue;\n  }\n\n  return contextValue as MessageListContextValue;\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 } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { Poll } from 'stream-chat';\n\nexport type PollContextValue = {\n  poll: Poll;\n};\n\nexport const PollContext = React.createContext<PollContextValue | undefined>(undefined);\n\nexport const PollProvider = ({\n  children,\n  poll,\n}: PropsWithChildren<{\n  poll: Poll;\n}>) =>\n  poll ? (\n    <PollContext.Provider value={{ poll } as unknown as PollContextValue}>\n      {children}\n    </PollContext.Provider>\n  ) : null;\n\nexport const usePollContext = () => {\n  const contextValue = useContext(PollContext);\n  return contextValue as unknown as PollContextValue;\n};\n","import React, { useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { ComponentContext } from './ComponentContext';\nimport type { ComponentContextValue } from './ComponentContext';\n\nexport function WithComponents({\n  children,\n  overrides,\n}: PropsWithChildren<{ overrides: Partial<ComponentContextValue> }>) {\n  const parentOverrides = useContext(ComponentContext);\n  const actualOverrides: ComponentContextValue = { ...parentOverrides, ...overrides };\n  return (\n    <ComponentContext.Provider value={actualOverrides}>\n      {children}\n    </ComponentContext.Provider>\n  );\n}\n","import React from 'react';\nimport type { Channel } from 'stream-chat';\n\nimport { AIStates, useAIState } from './hooks/useAIState';\n\nimport { useChannelStateContext, useTranslationContext } from '../../context';\n\nexport type AIStateIndicatorProps = {\n  channel?: Channel;\n};\n\nexport const AIStateIndicator = ({\n  channel: channelFromProps,\n}: AIStateIndicatorProps) => {\n  const { t } = useTranslationContext();\n  const { channel: channelFromContext } = useChannelStateContext('AIStateIndicator');\n  const channel = channelFromProps || channelFromContext;\n  const { aiState } = useAIState(channel);\n  const allowedStates = {\n    [AIStates.Thinking]: t('Thinking...'),\n    [AIStates.Generating]: t('Generating...'),\n  };\n\n  return aiState in allowedStates ? (\n    <div className='str-chat__ai-state-indicator-container'>\n      <p className='str-chat__ai-state-indicator-text'>{allowedStates[aiState]}</p>\n    </div>\n  ) : null;\n};\n","import React, { type ComponentPropsWithoutRef, type CSSProperties } from 'react';\n\nexport type VisuallyHiddenProps = ComponentPropsWithoutRef<'span'>;\n\nconst visuallyHiddenStyle: CSSProperties = {\n  border: 0,\n  clip: 'rect(0, 0, 0, 0)',\n  height: '1px',\n  margin: '-1px',\n  overflow: 'hidden',\n  padding: 0,\n  position: 'absolute',\n  whiteSpace: 'nowrap',\n  width: '1px',\n};\n\n/**\n * Hides content visually while preserving it for assistive technologies.\n */\nexport const VisuallyHidden = ({ children, style, ...rest }: VisuallyHiddenProps) => (\n  <span {...rest} style={{ ...visuallyHiddenStyle, ...style }}>\n    {children}\n  </span>\n);\n","import { createContext, useContext } from 'react';\n\nexport type AriaLivePriority = 'assertive' | 'polite';\nexport type AriaLiveAnnounce = (message: string, priority?: AriaLivePriority) => void;\n\nexport type AriaLiveAnnouncerContextValue = {\n  announce: AriaLiveAnnounce;\n};\n\nconst noopAnnounce: AriaLiveAnnounce = () => undefined;\n\nexport const AriaLiveAnnouncerContext = createContext<\n  AriaLiveAnnouncerContextValue | undefined\n>(undefined);\n\nexport const useAriaLiveAnnouncer = () => {\n  const contextValue = useContext(AriaLiveAnnouncerContext);\n\n  if (!contextValue) {\n    console.warn(\n      'The useAriaLiveAnnouncer hook was called outside of the AriaLiveRegion provider.',\n    );\n\n    return noopAnnounce;\n  }\n\n  return contextValue.announce;\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Portal } from '../Portal/Portal';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n  type AriaLiveAnnounce,\n  AriaLiveAnnouncerContext,\n  type AriaLivePriority,\n} from './useAriaLiveAnnouncer';\n\ntype SequenceByPriority = {\n  [key in AriaLivePriority]: number;\n};\n\ntype TimeoutByPriority = {\n  [key in AriaLivePriority]: ReturnType<typeof setTimeout> | undefined;\n};\n\nexport const AriaLiveRegion = ({ children }: PropsWithChildren) => {\n  const [assertiveMessage, setAssertiveMessage] = useState('');\n  const [politeMessage, setPoliteMessage] = useState('');\n  const sequenceByPriorityRef = useRef<SequenceByPriority>({\n    assertive: 0,\n    polite: 0,\n  });\n  const timeoutByPriorityRef = useRef<TimeoutByPriority>({\n    assertive: undefined,\n    polite: undefined,\n  });\n  const unmountedRef = useRef(false);\n\n  const clearPendingTimeout = useCallback((priority: AriaLivePriority) => {\n    if (!timeoutByPriorityRef.current[priority]) return;\n    clearTimeout(timeoutByPriorityRef.current[priority]);\n    timeoutByPriorityRef.current[priority] = undefined;\n  }, []);\n\n  const clearPendingTimeouts = useCallback(() => {\n    clearPendingTimeout('assertive');\n    clearPendingTimeout('polite');\n  }, [clearPendingTimeout]);\n\n  const announce = useCallback<AriaLiveAnnounce>(\n    (message, priority = 'polite') => {\n      const setAnnouncement =\n        priority === 'assertive' ? setAssertiveMessage : setPoliteMessage;\n      const sequence = sequenceByPriorityRef.current[priority] + 1;\n\n      sequenceByPriorityRef.current[priority] = sequence;\n      clearPendingTimeout(priority);\n      setAnnouncement('');\n      timeoutByPriorityRef.current[priority] = setTimeout(() => {\n        if (unmountedRef.current) return;\n        if (sequenceByPriorityRef.current[priority] !== sequence) return;\n        setAnnouncement(message);\n        timeoutByPriorityRef.current[priority] = undefined;\n      }, 50);\n    },\n    [clearPendingTimeout],\n  );\n\n  useEffect(() => {\n    unmountedRef.current = false;\n\n    return () => {\n      unmountedRef.current = true;\n      clearPendingTimeouts();\n    };\n  }, [clearPendingTimeouts]);\n\n  const contextValue = useMemo(() => ({ announce }), [announce]);\n\n  const getPortalDestination = useCallback(() => document.body, []);\n\n  return (\n    <AriaLiveAnnouncerContext.Provider value={contextValue}>\n      {children}\n      <Portal getPortalDestination={getPortalDestination} isOpen>\n        <VisuallyHidden>\n          <div\n            aria-atomic='true'\n            aria-live='polite'\n            aria-relevant='additions text'\n            data-testid='str-chat__aria-live-region--polite'\n            role='status'\n          >\n            {politeMessage}\n          </div>\n          <div\n            aria-atomic='true'\n            aria-live='assertive'\n            aria-relevant='additions text'\n            data-testid='str-chat__aria-live-region--assertive'\n            role='alert'\n          >\n            {assertiveMessage}\n          </div>\n        </VisuallyHidden>\n      </Portal>\n    </AriaLiveAnnouncerContext.Provider>\n  );\n};\n","import { useCallback } from 'react';\nimport { useChatContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { Notification, NotificationManagerState } from 'stream-chat';\nimport { isNotificationForPanel } from '../notificationTarget';\n\nimport type { NotificationTargetPanel } from '../notificationTarget';\n\nexport type UseNotificationsFilter = (notification: Notification) => boolean;\n\nexport type UseNotificationsOptions = {\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 selector = useCallback(\n    (state: NotificationManagerState) => {\n      const notifications = state.notifications;\n      const panel = options?.panel;\n      const byPanel = panel\n        ? notifications.filter((notification) =>\n            isNotificationForPanel(notification, panel, {\n              fallbackPanel: options?.fallbackPanel,\n            }),\n          )\n        : notifications;\n\n      return {\n        notifications: options?.filter ? byPanel.filter(options.filter) : byPanel,\n      };\n    },\n    [options?.fallbackPanel, options?.filter, options?.panel],\n  );\n\n  const { notifications } = useStateStore(client.notifications.store, selector);\n\n  return notifications;\n};\n","import React from 'react';\nimport { Button } from './Button';\nimport type { ComponentProps } from 'react';\nimport clsx from 'clsx';\nimport { IconPauseFill, IconPlayFill } from '../Icons';\nimport { useTranslationContext } from '../../context';\n\nexport type PlayButtonProps = ComponentProps<'button'> & {\n  isPlaying: boolean;\n};\n\nexport const PlayButton = ({ className, isPlaying, ...props }: PlayButtonProps) => {\n  const { t } = useTranslationContext();\n  return (\n    <Button\n      appearance='outline'\n      aria-label={isPlaying ? t('aria/Pause') : t('aria/Play')}\n      circular\n      className={clsx('str-chat__button-play', className)}\n      data-testid={isPlaying ? 'pause-audio' : 'play-audio'}\n      size='sm'\n      variant='secondary'\n      {...props}\n    >\n      {isPlaying ? <IconPauseFill /> : <IconPlayFill />}\n    </Button>\n  );\n};\n","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dayjs_plugin_updateLocale=n()}(this,function(){\"use strict\";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach(function(e){o[e]=n[e]}),o}}});\n","!function(n,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):n.dayjs_plugin_localeData=t()}(this,function(){\"use strict\";return function(n,t,e){var r=function(n){return n&&(n.indexOf?n:n.s)},o=function(n,t,e,o,u){var a=n.name?n:n.$locale(),i=r(a[t]),s=r(a[e]),d=i||s.map(function(n){return n.substr(0,o)});if(!u)return d;var f=a.weekStart;return d.map(function(n,t){return d[(t+(f||0))%7]})},u=function(){return e.Ls[e.locale()]},a=function(n,t){return n.formats[t]||function(n){return n.replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,function(n,t,e){return t||e.slice(1)})}(n.formats[t.toUpperCase()])};t.prototype.localeData=function(){return function(){var n=this;return{months:function(t){return t?t.format(\"MMMM\"):o(n,\"months\")},monthsShort:function(t){return t?t.format(\"MMM\"):o(n,\"monthsShort\",\"months\",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(t){return t?t.format(\"dddd\"):o(n,\"weekdays\")},weekdaysMin:function(t){return t?t.format(\"dd\"):o(n,\"weekdaysMin\",\"weekdays\",2)},weekdaysShort:function(t){return t?t.format(\"ddd\"):o(n,\"weekdaysShort\",\"weekdays\",3)},longDateFormat:function(t){return a(n.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}}.bind(this)()},e.localeData=function(){var n=u();return{firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return e.weekdays()},weekdaysShort:function(){return e.weekdaysShort()},weekdaysMin:function(){return e.weekdaysMin()},months:function(){return e.months()},monthsShort:function(){return e.monthsShort()},longDateFormat:function(t){return a(n,t)},meridiem:n.meridiem,ordinal:n.ordinal}},e.months=function(){return o(u(),\"months\")},e.monthsShort=function(){return o(u(),\"monthsShort\",\"months\",3)},e.weekdays=function(n){return o(u(),\"weekdays\",null,null,n)},e.weekdaysShort=function(n){return o(u(),\"weekdaysShort\",\"weekdays\",3,n)},e.weekdaysMin=function(n){return o(u(),\"weekdaysMin\",\"weekdays\",2,n)}}});\n","!function(r,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):r.dayjs_plugin_relativeTime=t()}(this,function(){\"use strict\";return function(r,t,e){r=r||{};var n=t.prototype,o={future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"};function i(r,t,e,o){return n.fromToBase(r,t,e,o)}e.en.relativeTime=o,n.fromToBase=function(t,n,i,d,u){for(var a,f,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:\"s\",r:44,d:\"second\"},{l:\"m\",r:89},{l:\"mm\",r:44,d:\"minute\"},{l:\"h\",r:89},{l:\"hh\",r:21,d:\"hour\"},{l:\"d\",r:35},{l:\"dd\",r:25,d:\"day\"},{l:\"M\",r:45},{l:\"MM\",r:10,d:\"month\"},{l:\"y\",r:17},{l:\"yy\",d:\"year\"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(a=d?e(t).diff(i,y.d,!0):i.diff(t,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(a));if(s=a>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(\"\"+p)),f=\"string\"==typeof v?v.replace(\"%d\",p):v(p,n,y.l,s);break}}if(n)return f;var M=s?l.future:l.past;return\"function\"==typeof M?M(f):M.replace(\"%s\",f)},n.to=function(r,t){return i(r,t,this,!0)},n.from=function(r,t){return i(r,t,this)};var d=function(r){return r.$u?e.utc():e()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}});\n","!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):t.dayjs_plugin_duration=s()}(this,function(){\"use strict\";var t,s,n=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,i=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,e={years:31536e6,months:2592e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},r=function(t){return t instanceof c},o=function(t,s,n){return new c(t,n,s.$l)},u=function(t){return s.p(t)+\"s\"},h=function(t){return t<0},a=function(t){return h(t)?Math.ceil(t):Math.floor(t)},d=function(t,s){return t?h(t)?{negative:!0,format:\"\"+function(t){return Math.abs(t)}(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},c=function(){function h(t,s,n){var r=this;if(this.$d={},this.$l=n,s)return o(t*e[u(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach(function(s){r.$d[u(s)]=t[s]}),this.calMilliseconds(),this;if(\"string\"==typeof t){var h=t.match(i);if(h)return this.$d.years=h[2],this.$d.months=h[3],this.$d.weeks=h[4],this.$d.days=h[5],this.$d.hours=h[6],this.$d.minutes=h[7],this.$d.seconds=h[8],this.calMilliseconds(),this}return this}var c=h.prototype;return c.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce(function(s,n){return s+(t.$d[n]||0)*e[n]},0)},c.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=a(t/31536e6),t%=31536e6,this.$d.months=a(t/2592e6),t%=2592e6,this.$d.days=a(t/864e5),t%=864e5,this.$d.hours=a(t/36e5),t%=36e5,this.$d.minutes=a(t/6e4),t%=6e4,this.$d.seconds=a(t/1e3),t%=1e3,this.$d.milliseconds=t},c.toISOString=function(){var t=d(this.$d.years,\"Y\"),s=d(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=d(n,\"D\"),e=d(this.$d.hours,\"H\"),r=d(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=d(o,\"S\"),h=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",c=(h?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===c||\"-P\"===c?\"P0D\":c},c.toJSON=function(){return this.toISOString()},c.format=function(t){var i=t||\"YYYY-MM-DDTHH:mm:ss\",e={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return i.replace(n,function(t,s){return s||String(e[t])})},c.as=function(t){return this.$ms/e[u(t)]},c.get=function(t){var s=this.$ms,n=u(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?a(s/e[n]):this.$d[n],0===s?0:s},c.add=function(t,s,n){var i;return i=s?t*e[u(s)]:r(t)?t.$ms:o(t,this).$ms,o(this.$ms+i*(n?-1:1),this)},c.subtract=function(t,s){return this.add(t,s,!0)},c.locale=function(t){var s=this.clone();return s.$l=t,s},c.clone=function(){return o(this.$ms,this)},c.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},c.milliseconds=function(){return this.get(\"milliseconds\")},c.asMilliseconds=function(){return this.as(\"milliseconds\")},c.seconds=function(){return this.get(\"seconds\")},c.asSeconds=function(){return this.as(\"seconds\")},c.minutes=function(){return this.get(\"minutes\")},c.asMinutes=function(){return this.as(\"minutes\")},c.hours=function(){return this.get(\"hours\")},c.asHours=function(){return this.as(\"hours\")},c.days=function(){return this.get(\"days\")},c.asDays=function(){return this.as(\"days\")},c.weeks=function(){return this.get(\"weeks\")},c.asWeeks=function(){return this.as(\"weeks\")},c.months=function(){return this.get(\"months\")},c.asMonths=function(){return this.as(\"months\")},c.years=function(){return this.get(\"years\")},c.asYears=function(){return this.as(\"years\")},h}();return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return o(t,{$l:n},s)},e.isDuration=r;var u=i.prototype.add,h=i.prototype.subtract;i.prototype.add=function(t,s){return r(t)&&(t=t.asMilliseconds()),u.bind(this)(t,s)},i.prototype.subtract=function(t,s){return r(t)&&(t=t.asMilliseconds()),h.bind(this)(t,s)}}});\n","!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):t.dayjs_plugin_utc=i()}(this,function(){\"use strict\";return function(t,i,e){var s=i.prototype;e.utc=function(t){return new i({date:t,utc:!0,args:arguments})},s.utc=function(t){var i=e(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),\"minute\"):i},s.local=function(){return e(this.toDate(),{locale:this.$L,utc:!1})};var f=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),f.call(this,t)};var n=s.init;s.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else n.call(this)};var u=s.utcOffset;s.utcOffset=function(t,i){var e=this.$utils().u;if(e(t))return this.$u?0:e(this.$offset)?u.call(this):this.$offset;var s=Math.abs(t)<=16?60*t:t,f=this;if(i)return f.$offset=s,f.$u=0===t,f;if(0!==t){var n=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(f=this.local().add(s+n,\"minute\")).$offset=s,f.$x.$localOffset=n}else f=this.utc();return f};var o=s.format;s.format=function(t){var i=t||(this.$u?\"YYYY-MM-DDTHH:mm:ss[Z]\":\"\");return o.call(this,i)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var r=s.toDate;s.toDate=function(t){return\"s\"===t&&this.$offset?e(this.format(\"YYYY-MM-DD HH:mm:ss:SSS\")).toDate():r.call(this)};var a=s.diff;s.diff=function(t,i,s){if(t&&this.$u===t.$u)return a.call(this,t,i,s);var f=this.local(),n=e(t).local();return a.call(f,n,i,s)}}});\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.dayjs_plugin_timezone=e()}(this,function(){\"use strict\";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,r){var o,u=r().utcOffset(),a=function(t,n,i){void 0===i&&(i={});var r=new Date(t);return function(t,n){void 0===n&&(n={});var i=n.timeZoneName||\"short\",r=t+\"|\"+i,o=e[r];return o||(o=new Intl.DateTimeFormat(\"en-US\",{hour12:!1,timeZone:t,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",timeZoneName:i}),e[r]=o),o}(n,i).formatToParts(r)},f=function(e,n){for(var i=a(e,n),o=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(o[c]=parseInt(m,10))}var d=o[3],v=24===d?0:d,h=o[0]+\"-\"+o[1]+\"-\"+o[2]+\" \"+v+\":\"+o[4]+\":\"+o[5]+\":000\",l=+e;return(r.utc(h).valueOf()-(l-=l%1e3))/6e4},s=i.prototype;s.tz=function(t,e){void 0===t&&(t=o);var n=this.utcOffset(),i=this.toDate().toLocaleString(\"en-US\",{timeZone:t}),a=Math.round((this.toDate()-new Date(i))/1e3/60),f=r(i).$set(\"millisecond\",this.$ms).utcOffset(u-a,!0);if(e){var s=f.utcOffset();f=f.add(n-s,\"minute\")}return f.$x.$timezone=t,f},s.offsetName=function(t){var e=this.$x.$timezone||r.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return\"timezonename\"===t.type.toLowerCase()});return n&&n.value};var m=s.startOf;s.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return m.call(this,t,e);var n=r(this.format(\"YYYY-MM-DD HH:mm:ss:SSS\"));return m.call(n,t,e).tz(this.$x.$timezone,!0)},r.tz=function(t,e,n){var i=n&&e,u=n||e||o,a=f(+r(),u);if(\"string\"!=typeof t)return r(t).tz(u);var s=function(t,e,n){var i=t-60*e*1e3,r=f(i,n);if(e===r)return[i,e];var o=f(i-=60*(r-e)*1e3,n);return r===o?[i,r]:[t-60*Math.min(r,o)*1e3,Math.max(r,o)]}(r.utc(t,i).valueOf(),a,u),m=s[0],c=s[1],d=r(m).utcOffset(c);return d.$x.$timezone=u,d},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(t){o=t}}});\n","import type { i18n, TFunction } from 'i18next';\n\ntype TopicName = string;\ntype TranslatorName = string;\n\nexport type Translator<O extends Record<string, unknown> = Record<string, unknown>> =\n  (params: { key: string; value: string; t: TFunction; options: O }) => string | null;\n\nexport type TranslationTopicOptions<\n  O extends Record<string, unknown> = Record<string, unknown>,\n> = {\n  i18next: i18n;\n  translators?: Record<string, Translator<O>>;\n};\n\nexport abstract class TranslationTopic<\n  O extends Record<string, unknown> = Record<string, unknown>,\n> {\n  protected translators: Map<string, Translator<O>> = new Map();\n  protected i18next: i18n;\n\n  constructor(protected options: TranslationTopicOptions<O>) {\n    this.i18next = options.i18next;\n    if (options.translators) {\n      Object.entries(options.translators).forEach(([name, translator]) => {\n        this.setTranslator(name, translator);\n      });\n    }\n  }\n\n  abstract translate(value: string, key: string, options: O): string;\n\n  setTranslator = (name: string, translator: Translator<O>) => {\n    this.translators.set(name, translator);\n  };\n\n  removeTranslator = (name: string) => {\n    this.translators.delete(name);\n  };\n}\n\nconst forwardTranslation: Translator = ({ value }) => value;\n\nexport type TranslationTopicConstructor = new (\n  options: TranslationTopicOptions,\n) => TranslationTopic;\n\nexport class TranslationBuilder {\n  private topics = new Map<string, TranslationTopic>();\n  // need to keep a registration buffer so that translators can be registered once a topic is registered\n  // what does not happen when Streami18n is instantiated but rather once Streami18n.init() is invoked\n  private translatorRegistrationsBuffer: Record<\n    TopicName,\n    Record<TranslatorName, Translator>\n  > = {};\n\n  constructor(private i18next: i18n) {}\n\n  registerTopic = (name: TopicName, Topic: TranslationTopicConstructor) => {\n    let topic = this.topics.get(name);\n\n    if (!topic) {\n      topic = new Topic({ i18next: this.i18next });\n      this.topics.set(name, topic);\n      this.i18next.use({\n        name,\n        process: (value: string, key: string, options: Record<string, unknown>) => {\n          const topic = this.topics.get(name);\n          if (!topic) return value;\n          return topic.translate(value, key, options);\n        },\n        type: 'postProcessor' as const,\n      });\n    }\n\n    const additionalTranslatorsToRegister = this.translatorRegistrationsBuffer[name];\n    if (additionalTranslatorsToRegister) {\n      Object.entries(additionalTranslatorsToRegister).forEach(\n        ([translatorName, translator]) => {\n          topic.setTranslator(translatorName, translator);\n        },\n      );\n      delete this.translatorRegistrationsBuffer[name];\n    }\n    return topic;\n  };\n\n  disableTopic = (topicName: TopicName) => {\n    const topic = this.topics.get(topicName);\n    if (!topic) return;\n    this.i18next.use({\n      name: topicName,\n      process: forwardTranslation,\n      type: 'postProcessor',\n    });\n    this.topics.delete(topicName);\n  };\n\n  getTopic = (topicName: TopicName) => this.topics.get(topicName);\n\n  registerTranslators(\n    topicName: TopicName,\n    translators: Record<TranslatorName, Translator>,\n  ) {\n    const topic = this.getTopic(topicName);\n    if (!topic) {\n      if (!this.translatorRegistrationsBuffer[topicName])\n        this.translatorRegistrationsBuffer[topicName] = {};\n\n      Object.entries(translators).forEach(([translatorName, translator]) => {\n        this.translatorRegistrationsBuffer[topicName][translatorName] = translator;\n      });\n      return;\n    }\n    Object.entries(translators).forEach(([name, translator]) => {\n      topic.setTranslator(name, translator);\n    });\n  }\n\n  removeTranslators(topicName: TopicName, translators: TranslatorName[]) {\n    const topic = this.getTopic(topicName);\n    if (this.translatorRegistrationsBuffer[topicName]) {\n      translators.forEach((translatorName) => {\n        delete this.translatorRegistrationsBuffer[topicName][translatorName];\n      });\n    }\n    if (!topic) return;\n    translators.forEach((name) => {\n      topic.removeTranslator(name);\n    });\n  }\n}\n","import type { Notification } from 'stream-chat';\n\nimport type { NotificationTranslatorOptions } from './types';\nimport type { TranslationTopicOptions, Translator } from '../../index';\n\nconst normalizeReason = (notification?: Notification) => {\n  const reason = notification?.metadata?.reason;\n  if (typeof reason !== 'string' || !reason.length) return undefined;\n  return reason.toLowerCase();\n};\n\nconst withReasonFallback = ({\n  fallbackTranslationKey,\n  notification,\n  reasonTranslationKey,\n  t,\n}: {\n  fallbackTranslationKey: string;\n  notification?: Notification;\n  reasonTranslationKey: string;\n  t: TranslationTopicOptions['i18next']['t'];\n}) => {\n  const reason = normalizeReason(notification);\n  if (!reason) return t(fallbackTranslationKey);\n  return t(reasonTranslationKey, { reason });\n};\n\nexport const translateAttachmentUploadBlocked: Translator<\n  NotificationTranslatorOptions\n> = ({ options: { notification }, t }) => {\n  const rawReason = notification?.metadata?.reason;\n  let reason = t('unsupported file type');\n  if (typeof rawReason !== 'string') reason = t('unknown error');\n  if (rawReason === 'size_limit') reason = t('size limit');\n  return t('Attachment upload blocked due to {{reason}}', { reason });\n};\n\nexport const translateAttachmentUploadFailed: Translator<\n  NotificationTranslatorOptions\n> = ({ options: { notification }, t }) =>\n  withReasonFallback({\n    fallbackTranslationKey: 'Error uploading attachment',\n    notification,\n    reasonTranslationKey: 'Attachment upload failed due to {{reason}}',\n    t,\n  });\n\nexport const translatePollCreateFailed: Translator<NotificationTranslatorOptions> = ({\n  options: { notification },\n  t,\n}) =>\n  withReasonFallback({\n    fallbackTranslationKey: 'Failed to create the poll',\n    notification,\n    reasonTranslationKey: 'Failed to create the poll due to {{reason}}',\n    t,\n  });\n\nexport const translatePollEndFailed: Translator<NotificationTranslatorOptions> = ({\n  options: { notification },\n  t,\n}) =>\n  withReasonFallback({\n    fallbackTranslationKey: 'Failed to end the poll',\n    notification,\n    reasonTranslationKey: 'Failed to end the poll due to {{reason}}',\n    t,\n  });\n\nexport const translateBrowserAudioPlaybackError: Translator<\n  NotificationTranslatorOptions\n> = ({ options: { notification }, t }) =>\n  notification?.message ? t(notification.message) : t('Error reproducing the recording');\n\nexport const translateCommandDisabled: Translator<NotificationTranslatorOptions> = ({\n  options: { notification },\n  t,\n}) => {\n  const reason = normalizeReason(notification);\n\n  if (reason === 'editing') {\n    return t('Command not available while editing');\n  }\n\n  if (reason === 'quoted_message') {\n    return t('Command not available while replying');\n  }\n\n  return t(notification?.message || 'Command not available');\n};\n","import type { NotificationTranslatorOptions } from './types';\nimport {\n  translateAttachmentUploadBlocked,\n  translateAttachmentUploadFailed,\n  translateBrowserAudioPlaybackError,\n  translateCommandDisabled,\n  translatePollCreateFailed,\n  translatePollEndFailed,\n} from './translators';\nimport type { Translator } from '../../index';\n\nexport const translatorsByNotificationType: Record<\n  string,\n  Translator<NotificationTranslatorOptions>\n> = {\n  'api:attachment:upload:failed': translateAttachmentUploadFailed,\n  'api:location:create:failed': ({ t }) => t('Failed to share location'),\n  'api:location:share:failed': ({ t }) => t('Failed to share location'),\n  'api:poll:create:failed': translatePollCreateFailed,\n  'api:poll:end:failed': translatePollEndFailed,\n  'api:poll:end:success': ({ t }) => t('Poll ended'),\n  'api:reply:search:failed': ({ t }) => t('Thread has not been found'),\n  'browser:audio:playback:error': translateBrowserAudioPlaybackError,\n  'browser:location:get:failed': ({ t }) => t('Failed to retrieve location'),\n  'channel:jumpToFirstUnread:failed': ({ t }) =>\n    t('Failed to jump to the first unread message'),\n  'validation:attachment:file:missing': ({ t }) =>\n    t('File is required for upload attachment'),\n  'validation:attachment:id:missing': ({ t }) =>\n    t('Local upload attachment missing local id'),\n  'validation:attachment:upload:blocked': translateAttachmentUploadBlocked,\n  'validation:attachment:upload:in-progress': ({ t }) =>\n    t('Wait until all attachments have uploaded'),\n  'validation:command:disabled': translateCommandDisabled,\n  'validation:poll:castVote:limit': ({ t }) =>\n    t('Reached the vote limit. Remove an existing vote first.'),\n};\n","import { TranslationTopic } from '../../TranslationBuilder';\nimport type { Notification } from 'stream-chat';\nimport type { NotificationTranslatorOptions } from './types';\nimport { translatorsByNotificationType } from './translatorsByNotificationType';\nimport type { TranslationTopicOptions, Translator } from '../../index';\n\nconst translateByNotificationType: Translator<NotificationTranslatorOptions> = ({\n  options: { notification },\n  ...params\n}) => {\n  if (!notification?.type) return null;\n  const translator = translatorsByNotificationType[notification.type];\n  if (!translator) return null;\n  return translator({ ...params, options: { notification } });\n};\n\nexport const defaultNotificationTranslators: Record<\n  string,\n  Translator<NotificationTranslatorOptions>\n> = {\n  '*': translateByNotificationType,\n};\n\nexport class NotificationTranslationTopic extends TranslationTopic<NotificationTranslatorOptions> {\n  constructor({ i18next, translators }: TranslationTopicOptions) {\n    super({ i18next, translators: defaultNotificationTranslators });\n    if (translators) {\n      Object.entries(translators).forEach(([name, translator]) => {\n        this.setTranslator(name, translator);\n      });\n    }\n  }\n\n  translate = (value: string, key: string, options: { notification?: Notification }) => {\n    const { notification } = options;\n    if (!notification) return value;\n    const byType = notification.type\n      ? this.translators.get(notification.type)\n      : undefined;\n    if (byType) return byType({ key, options, t: this.i18next.t, value }) || value;\n\n    const byFallback = this.translators.get('*');\n    const translated = byFallback?.({ key, options, t: this.i18next.t, value }) ?? null;\n    if (translated) return translated;\n    if (!notification.message) return value;\n\n    // Final fallback: attempt to translate message as natural key.\n    return this.i18next.t(notification.message, {\n      ...(notification.metadata ?? {}),\n      value: notification.message,\n    });\n  };\n}\n","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],n):e.dayjs_locale_de=n(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var n={s:\"ein paar Sekunden\",m:[\"eine Minute\",\"einer Minute\"],mm:\"%d Minuten\",h:[\"eine Stunde\",\"einer Stunde\"],hh:\"%d Stunden\",d:[\"ein Tag\",\"einem Tag\"],dd:[\"%d Tage\",\"%d Tagen\"],M:[\"ein Monat\",\"einem Monat\"],MM:[\"%d Monate\",\"%d Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[\"%d Jahre\",\"%d Jahren\"]};function t(e,t,a){var r=n[a];return Array.isArray(r)&&(r=r[t?0:1]),r.replace(\"%d\",e)}var a={name:\"de\",weekdays:\"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag\".split(\"_\"),weekdaysShort:\"So._Mo._Di._Mi._Do._Fr._Sa.\".split(\"_\"),weekdaysMin:\"So_Mo_Di_Mi_Do_Fr_Sa\".split(\"_\"),months:\"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember\".split(\"_\"),monthsShort:\"Jan_Feb_März_Apr_Mai_Juni_Juli_Aug_Sept_Okt_Nov_Dez\".split(\"_\"),ordinal:function(e){return e+\".\"},weekStart:1,yearStart:4,formats:{LTS:\"HH:mm:ss\",LT:\"HH:mm\",L:\"DD.MM.YYYY\",LL:\"D. MMMM YYYY\",LLL:\"D. MMMM YYYY HH:mm\",LLLL:\"dddd, D. MMMM YYYY HH:mm\"},relativeTime:{future:\"in %s\",past:\"vor %s\",s:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t}};return e.locale(a,null,!0),a});\n","!function(e,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],s):e.dayjs_locale_es=s(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var s={name:\"es\",monthsShort:\"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic\".split(\"_\"),weekdays:\"domingo_lunes_martes_miércoles_jueves_viernes_sábado\".split(\"_\"),weekdaysShort:\"dom._lun._mar._mié._jue._vie._sáb.\".split(\"_\"),weekdaysMin:\"do_lu_ma_mi_ju_vi_sá\".split(\"_\"),months:\"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre\".split(\"_\"),weekStart:1,formats:{LT:\"H:mm\",LTS:\"H:mm:ss\",L:\"DD/MM/YYYY\",LL:\"D [de] MMMM [de] YYYY\",LLL:\"D [de] MMMM [de] YYYY H:mm\",LLLL:\"dddd, D [de] MMMM [de] YYYY H:mm\"},relativeTime:{future:\"en %s\",past:\"hace %s\",s:\"unos segundos\",m:\"un minuto\",mm:\"%d minutos\",h:\"una hora\",hh:\"%d horas\",d:\"un día\",dd:\"%d días\",M:\"un mes\",MM:\"%d meses\",y:\"un año\",yy:\"%d años\"},ordinal:function(e){return e+\"º\"}};return e.locale(s,null,!0),s});\n","!function(e,_){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=_(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],_):e.dayjs_locale_fr=_(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var _={name:\"fr\",weekdays:\"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi\".split(\"_\"),weekdaysShort:\"dim._lun._mar._mer._jeu._ven._sam.\".split(\"_\"),weekdaysMin:\"di_lu_ma_me_je_ve_sa\".split(\"_\"),months:\"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre\".split(\"_\"),monthsShort:\"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.\".split(\"_\"),weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"DD/MM/YYYY\",LL:\"D MMMM YYYY\",LLL:\"D MMMM YYYY HH:mm\",LLLL:\"dddd D MMMM YYYY HH:mm\"},relativeTime:{future:\"dans %s\",past:\"il y a %s\",s:\"quelques secondes\",m:\"une minute\",mm:\"%d minutes\",h:\"une heure\",hh:\"%d heures\",d:\"un jour\",dd:\"%d jours\",M:\"un mois\",MM:\"%d mois\",y:\"un an\",yy:\"%d ans\"},ordinal:function(e){return\"\"+e+(1===e?\"er\":\"\")}};return e.locale(_,null,!0),_});\n","!function(_,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],e):_.dayjs_locale_hi=e(_.dayjs)}(this,function(_){\"use strict\";_=_&&_.hasOwnProperty(\"default\")?_.default:_;var e={name:\"hi\",weekdays:\"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार\".split(\"_\"),months:\"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर\".split(\"_\"),weekdaysShort:\"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि\".split(\"_\"),monthsShort:\"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.\".split(\"_\"),weekdaysMin:\"र_सो_मं_बु_गु_शु_श\".split(\"_\"),ordinal:function(_){return _},formats:{LT:\"A h:mm बजे\",LTS:\"A h:mm:ss बजे\",L:\"DD/MM/YYYY\",LL:\"D MMMM YYYY\",LLL:\"D MMMM YYYY, A h:mm बजे\",LLLL:\"dddd, D MMMM YYYY, A h:mm बजे\"},relativeTime:{future:\"%s में\",past:\"%s पहले\",s:\"कुछ ही क्षण\",m:\"एक मिनट\",mm:\"%d मिनट\",h:\"एक घंटा\",hh:\"%d घंटे\",d:\"एक दिन\",dd:\"%d दिन\",M:\"एक महीने\",MM:\"%d महीने\",y:\"एक वर्ष\",yy:\"%d वर्ष\"}};return _.locale(e,null,!0),e});\n","!function(e,o){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=o(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],o):e.dayjs_locale_it=o(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var o={name:\"it\",weekdays:\"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato\".split(\"_\"),weekdaysShort:\"dom_lun_mar_mer_gio_ven_sab\".split(\"_\"),weekdaysMin:\"do_lu_ma_me_gi_ve_sa\".split(\"_\"),months:\"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre\".split(\"_\"),weekStart:1,monthsShort:\"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic\".split(\"_\"),formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"DD/MM/YYYY\",LL:\"D MMMM YYYY\",LLL:\"D MMMM YYYY HH:mm\",LLLL:\"dddd D MMMM YYYY HH:mm\"},relativeTime:{future:\"tra %s\",past:\"%s fa\",s:\"qualche secondo\",m:\"un minuto\",mm:\"%d minuti\",h:\"un' ora\",hh:\"%d ore\",d:\"un giorno\",dd:\"%d giorni\",M:\"un mese\",MM:\"%d mesi\",y:\"un anno\",yy:\"%d anni\"},ordinal:function(e){return e+\"º\"}};return e.locale(o,null,!0),o});\n","!function(_,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],e):_.dayjs_locale_ja=e(_.dayjs)}(this,function(_){\"use strict\";_=_&&_.hasOwnProperty(\"default\")?_.default:_;var e={name:\"ja\",weekdays:\"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日\".split(\"_\"),weekdaysShort:\"日_月_火_水_木_金_土\".split(\"_\"),weekdaysMin:\"日_月_火_水_木_金_土\".split(\"_\"),months:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_){return _+\"日\"},formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日 HH:mm\",LLLL:\"YYYY年M月D日 dddd HH:mm\",l:\"YYYY/MM/DD\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日(ddd) HH:mm\"},meridiem:function(_){return _<12?\"午前\":\"午後\"},relativeTime:{future:\"%s後\",past:\"%s前\",s:\"数秒\",m:\"1分\",mm:\"%d分\",h:\"1時間\",hh:\"%d時間\",d:\"1日\",dd:\"%d日\",M:\"1ヶ月\",MM:\"%dヶ月\",y:\"1年\",yy:\"%d年\"}};return _.locale(e,null,!0),e});\n","!function(_,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],e):_.dayjs_locale_ko=e(_.dayjs)}(this,function(_){\"use strict\";_=_&&_.hasOwnProperty(\"default\")?_.default:_;var e={name:\"ko\",weekdays:\"일요일_월요일_화요일_수요일_목요일_금요일_토요일\".split(\"_\"),weekdaysShort:\"일_월_화_수_목_금_토\".split(\"_\"),weekdaysMin:\"일_월_화_수_목_금_토\".split(\"_\"),months:\"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월\".split(\"_\"),monthsShort:\"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월\".split(\"_\"),ordinal:function(_){return _},formats:{LT:\"A h:mm\",LTS:\"A h:mm:ss\",L:\"YYYY.MM.DD.\",LL:\"YYYY년 MMMM D일\",LLL:\"YYYY년 MMMM D일 A h:mm\",LLLL:\"YYYY년 MMMM D일 dddd A h:mm\",l:\"YYYY.MM.DD.\",ll:\"YYYY년 MMMM D일\",lll:\"YYYY년 MMMM D일 A h:mm\",llll:\"YYYY년 MMMM D일 dddd A h:mm\"},meridiem:function(_){return _<12?\"오전\":\"오후\"},relativeTime:{future:\"%s 후\",past:\"%s 전\",s:\"몇 초\",m:\"1분\",mm:\"%d분\",h:\"한 시간\",hh:\"%d시간\",d:\"하루\",dd:\"%d일\",M:\"한 달\",MM:\"%d달\",y:\"일 년\",yy:\"%d년\"}};return _.locale(e,null,!0),e});\n","!function(e,a){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=a(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],a):e.dayjs_locale_nl=a(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var a={name:\"nl\",weekdays:\"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag\".split(\"_\"),weekdaysShort:\"zo._ma._di._wo._do._vr._za.\".split(\"_\"),weekdaysMin:\"zo_ma_di_wo_do_vr_za\".split(\"_\"),months:\"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december\".split(\"_\"),monthsShort:\"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec\".split(\"_\"),ordinal:function(e){return e+\".\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"DD-MM-YYYY\",LL:\"D MMMM YYYY\",LLL:\"D MMMM YYYY HH:mm\",LLLL:\"dddd D MMMM YYYY HH:mm\"},relativeTime:{future:\"over %s\",past:\"%s geleden\",s:\"een paar seconden\",m:\"een minuut\",mm:\"%d minuten\",h:\"een uur\",hh:\"%d uur\",d:\"een dag\",dd:\"%d dagen\",M:\"een maand\",MM:\"%d maanden\",y:\"een jaar\",yy:\"%d jaar\"}};return e.locale(a,null,!0),a});\n","!function(e,a){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=a(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],a):e.dayjs_locale_pt=a(e.dayjs)}(this,function(e){\"use strict\";e=e&&e.hasOwnProperty(\"default\")?e.default:e;var a={name:\"pt\",weekdays:\"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado\".split(\"_\"),weekdaysShort:\"Dom_Seg_Ter_Qua_Qui_Sex_Sab\".split(\"_\"),weekdaysMin:\"Do_2ª_3ª_4ª_5ª_6ª_Sa\".split(\"_\"),months:\"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro\".split(\"_\"),monthsShort:\"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez\".split(\"_\"),ordinal:function(e){return e+\"º\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"DD/MM/YYYY\",LL:\"D [de] MMMM [de] YYYY\",LLL:\"D [de] MMMM [de] YYYY [às] HH:mm\",LLLL:\"dddd, D [de] MMMM [de] YYYY [às] HH:mm\"},relativeTime:{future:\"em %s\",past:\"há %s\",s:\"alguns segundos\",m:\"um minuto\",mm:\"%d minutos\",h:\"uma hora\",hh:\"%d horas\",d:\"um dia\",dd:\"%d dias\",M:\"um mês\",MM:\"%d meses\",y:\"um ano\",yy:\"%d anos\"}};return e.locale(a,null,!0),a});\n","!function(_,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],t):_.dayjs_locale_ru=t(_.dayjs)}(this,function(_){\"use strict\";_=_&&_.hasOwnProperty(\"default\")?_.default:_;var t=\"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря\".split(\"_\"),e=\"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь\".split(\"_\"),n=\"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.\".split(\"_\"),s=\"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.\".split(\"_\"),r=/D[oD]?(\\[[^[\\]]*\\]|\\s)+MMMM?/;function o(_,t,e){var n,s;return\"m\"===e?t?\"минута\":\"минуту\":_+\" \"+(n=+_,s={mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[e].split(\"_\"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var d=function(_,n){return r.test(n)?t[_.month()]:e[_.month()]};d.s=e,d.f=t;var i=function(_,t){return r.test(t)?n[_.month()]:s[_.month()]};i.s=s,i.f=n;var m={name:\"ru\",weekdays:\"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота\".split(\"_\"),weekdaysShort:\"вск_пнд_втр_срд_чтв_птн_сбт\".split(\"_\"),weekdaysMin:\"вс_пн_вт_ср_чт_пт_сб\".split(\"_\"),months:d,monthsShort:i,weekStart:1,formats:{LT:\"H:mm\",LTS:\"H:mm:ss\",L:\"DD.MM.YYYY\",LL:\"D MMMM YYYY г.\",LLL:\"D MMMM YYYY г., H:mm\",LLLL:\"dddd, D MMMM YYYY г., H:mm\"},relativeTime:{future:\"через %s\",past:\"%s назад\",s:\"несколько секунд\",m:o,mm:o,h:\"час\",hh:o,d:\"день\",dd:o,M:\"месяц\",MM:o,y:\"год\",yy:o},ordinal:function(_){return _}};return _.locale(m,null,!0),m});\n","!function(a,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e(require(\"dayjs\")):\"function\"==typeof define&&define.amd?define([\"dayjs\"],e):a.dayjs_locale_tr=e(a.dayjs)}(this,function(a){\"use strict\";a=a&&a.hasOwnProperty(\"default\")?a.default:a;var e={name:\"tr\",weekdays:\"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi\".split(\"_\"),weekdaysShort:\"Paz_Pts_Sal_Çar_Per_Cum_Cts\".split(\"_\"),weekdaysMin:\"Pz_Pt_Sa_Ça_Pe_Cu_Ct\".split(\"_\"),months:\"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık\".split(\"_\"),monthsShort:\"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara\".split(\"_\"),weekStart:1,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"DD.MM.YYYY\",LL:\"D MMMM YYYY\",LLL:\"D MMMM YYYY HH:mm\",LLLL:\"dddd, D MMMM YYYY HH:mm\"},relativeTime:{future:\"%s sonra\",past:\"%s önce\",s:\"birkaç saniye\",m:\"bir dakika\",mm:\"%d dakika\",h:\"bir saat\",hh:\"%d saat\",d:\"bir gün\",dd:\"%d gün\",M:\"bir ay\",MM:\"%d ay\",y:\"bir yıl\",yy:\"%d yıl\"},ordinal:function(a){return a+\".\"}};return a.locale(e,null,!0),e});\n","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dayjs_locale_en=n()}(this,function(){\"use strict\";return{name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")}});\n","import i18n from 'i18next';\nimport Dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\nimport updateLocale from 'dayjs/plugin/updateLocale';\nimport LocalizedFormat from 'dayjs/plugin/localizedFormat';\nimport localeData from 'dayjs/plugin/localeData';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport duration from 'dayjs/plugin/duration';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\nimport { NotificationTranslationTopic, TranslationBuilder } from './TranslationBuilder';\nimport { defaultTranslatorFunction, predefinedFormatters } from './utils';\n\nimport type { TFunction } from 'i18next';\nimport type momentTimezone from 'moment-timezone';\nimport type { TranslationLanguages } from 'stream-chat';\n\nimport type { TranslationTopicConstructor } from './TranslationBuilder';\nimport type { UnknownType } from '../types/types';\nimport type { CustomFormatters, PredefinedFormatters, TDateTimeParser } from './types';\n\nimport {\n  deTranslations,\n  enTranslations,\n  esTranslations,\n  frTranslations,\n  hiTranslations,\n  itTranslations,\n  jaTranslations,\n  koTranslations,\n  nlTranslations,\n  ptTranslations,\n  ruTranslations,\n  trTranslations,\n} from './translations';\n\nimport 'dayjs/locale/de';\nimport 'dayjs/locale/es';\nimport 'dayjs/locale/fr';\nimport 'dayjs/locale/hi';\nimport 'dayjs/locale/it';\nimport 'dayjs/locale/ja';\nimport 'dayjs/locale/ko';\nimport 'dayjs/locale/nl';\nimport 'dayjs/locale/pt';\nimport 'dayjs/locale/ru';\nimport 'dayjs/locale/tr';\n// These locale imports also set these locale globally.\n// So As a last step I am going to import english locale\n// to make sure I don't mess up language at other places in app.\nimport 'dayjs/locale/en';\n\nconst defaultNS = 'translation';\nconst defaultLng = 'en';\n\ntype CalendarLocaleConfig = {\n  lastDay: string;\n  lastWeek: string;\n  nextDay: string;\n  nextWeek: string;\n  sameDay: string;\n  sameElse: string;\n};\n\nDayjs.extend(updateLocale);\nDayjs.extend(utc);\nDayjs.extend(timezone);\n\nDayjs.updateLocale('de', {\n  calendar: {\n    lastDay: '[gestern um] LT',\n    lastWeek: '[letzten] dddd [um] LT',\n    nextDay: '[morgen um] LT',\n    nextWeek: 'dddd [um] LT',\n    sameDay: '[heute um] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('es', {\n  calendar: {\n    lastDay: '[ayer a las] LT',\n    lastWeek: '[pasado] dddd [a] LT',\n    nextDay: '[mañana a] LT',\n    nextWeek: 'dddd [a] LT',\n    sameDay: '[hoy a las] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('fr', {\n  calendar: {\n    lastDay: '[Hier à] LT',\n    lastWeek: 'dddd [dernier à] LT',\n    nextDay: '[Demain à] LT',\n    nextWeek: 'dddd [à] LT',\n    sameDay: \"[Aujourd'hui à] LT\",\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('hi', {\n  calendar: {\n    lastDay: '[कल] LT',\n    lastWeek: '[पिछले] dddd, LT',\n    nextDay: '[कल] LT',\n    nextWeek: 'dddd, LT',\n    sameDay: '[आज] LT',\n    sameElse: 'L',\n  },\n  // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n  // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n  meridiem(hour: number) {\n    if (hour < 4) {\n      return 'रात';\n    } else if (hour < 10) {\n      return 'सुबह';\n    } else if (hour < 17) {\n      return 'दोपहर';\n    } else if (hour < 20) {\n      return 'शाम';\n    } else {\n      return 'रात';\n    }\n  },\n  meridiemHour(hour: number, meridiem: string) {\n    if (hour === 12) {\n      hour = 0;\n    }\n    if (meridiem === 'रात') {\n      return hour < 4 ? hour : hour + 12;\n    } else if (meridiem === 'सुबह') {\n      return hour;\n    } else if (meridiem === 'दोपहर') {\n      return hour >= 10 ? hour : hour + 12;\n    } else if (meridiem === 'शाम') {\n      return hour + 12;\n    }\n    return hour;\n  },\n  meridiemParse: /रात|सुबह|दोपहर|शाम/,\n});\n\nDayjs.updateLocale('it', {\n  calendar: {\n    lastDay: '[Ieri alle] LT',\n    lastWeek: '[lo scorso] dddd [alle] LT',\n    nextDay: '[Domani alle] LT',\n    nextWeek: 'dddd [alle] LT',\n    sameDay: '[Oggi alle] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('ja', {\n  calendar: {\n    lastDay: '[昨日] LT',\n    lastWeek: 'dddd LT',\n    nextDay: '[明日] LT',\n    nextWeek: '[次の] dddd LT',\n    sameDay: '[今日] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('ko', {\n  calendar: {\n    lastDay: '[어제] LT',\n    lastWeek: '[지난] dddd LT',\n    nextDay: '[내일] LT',\n    nextWeek: 'dddd LT',\n    sameDay: '[오늘] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('nl', {\n  calendar: {\n    lastDay: '[gisteren om] LT',\n    lastWeek: '[afgelopen] dddd [om] LT',\n    nextDay: '[morgen om] LT',\n    nextWeek: 'dddd [om] LT',\n    sameDay: '[vandaag om] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('pt', {\n  calendar: {\n    lastDay: '[ontem às] LT',\n    lastWeek: 'dddd [passada às] LT',\n    nextDay: '[amanhã às] LT',\n    nextWeek: 'dddd [às] LT',\n    sameDay: '[hoje às] LT',\n    sameElse: 'L',\n  },\n});\n\nDayjs.updateLocale('ru', {\n  calendar: {\n    lastDay: '[Вчера, в] LT',\n    nextDay: '[Завтра, в] LT',\n    sameDay: '[Сегодня, в] LT',\n  },\n});\n\nDayjs.updateLocale('tr', {\n  calendar: {\n    lastDay: '[dün] LT',\n    lastWeek: '[geçen] dddd [saat] LT',\n    nextDay: '[yarın saat] LT',\n    nextWeek: '[gelecek] dddd [saat] LT',\n    sameDay: '[bugün saat] LT',\n    sameElse: 'L',\n  },\n});\n\nconst en_locale = {\n  formats: {},\n  months: [\n    'January',\n    'February',\n    'March',\n    'April',\n    'May',\n    'June',\n    'July',\n    'August',\n    'September',\n    'October',\n    'November',\n    'December',\n  ],\n  relativeTime: {},\n  weekdays: [\n    'Sunday',\n    'Monday',\n    'Tuesday',\n    'Wednesday',\n    'Thursday',\n    'Friday',\n    'Saturday',\n  ],\n};\n\ntype DateTimeParserModule = typeof Dayjs | typeof momentTimezone;\n// Type guards to check DayJs\nconst isDayJs = (dateTimeParser: DateTimeParserModule): dateTimeParser is typeof Dayjs =>\n  (dateTimeParser as typeof Dayjs).extend !== undefined;\n\ntype TimezoneParser = {\n  tz: momentTimezone.MomentTimezone | Dayjs.Dayjs;\n};\nconst supportsTz = (dateTimeParser: unknown): dateTimeParser is TimezoneParser =>\n  (dateTimeParser as TimezoneParser).tz !== undefined;\n\nexport type Streami18nOptions = {\n  DateTimeParser?: DateTimeParserModule;\n  dayjsLocaleConfigForLanguage?: Partial<ILocale> & { calendar?: CalendarLocaleConfig };\n  debug?: boolean;\n  disableDateTimeTranslations?: boolean;\n  formatters?: Partial<PredefinedFormatters> & CustomFormatters;\n  language?: TranslationLanguages;\n  logger?: (message?: string) => void;\n  translationBuilderTopics?: Record<string, TranslationTopicConstructor>;\n  parseMissingKeyHandler?: (key: string, defaultValue?: string) => string;\n  timezone?: string;\n  translationsForLanguage?: Partial<typeof enTranslations>;\n};\n\n/**\n * Wrapper around [i18next](https://www.i18next.com/) class for Stream related i18n.\n * Instance of this class should be provided to Chat component to handle i18n.\n * Stream provides following list of in-built i18n:\n * 1. English (en)\n * 2. Dutch (nl)\n * 3. Russian (ru)\n * 4. Turkish (tr)\n * 5. French (fr)\n * 6. Italian (it)\n * 7. Hindi (hi)\n * 8. Spanish (es)\n * 9. Portuguese (pt)\n * 10. German (de)\n * 11. Japanese (ja)\n * 12. Korean (ko)\n *\n * Simplest way to start using chat components in one of the in-built languages would be following:\n *\n * ```\n * const i18n = new Streami18n({ language 'nl' });\n * <Chat client={chatClient} i18nInstance={i18n}>\n *  ...\n * </Chat>\n * ```\n *\n * If you would like to override certain keys in in-built translation.\n * UI will be automatically updated in this case.\n *\n * ```\n * const i18n = new Streami18n({\n *  language: 'nl',\n *  translationsForLanguage: {\n *    'Nothing yet...': 'Nog Niet ...',\n *    '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n *  }\n * });\n *\n * If you would like to register additional languages, use registerTranslation. You can add as many languages as you want:\n *\n * i18n.registerTranslation('zh', {\n *  'Nothing yet...': 'Nog Niet ...',\n *  '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n * });\n *\n * <Chat client={chatClient} i18nInstance={i18n}>\n *  ...\n * </Chat>\n * ```\n *\n * You can use the same function to add whole new language as well.\n *\n * ```\n * const i18n = new Streami18n();\n *\n * i18n.registerTranslation('mr', {\n *  'Nothing yet...': 'काहीही नाही  ...',\n *  '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',\n * });\n *\n * // Make sure to call setLanguage to reflect new language in UI.\n * i18n.setLanguage('it');\n * <Chat client={chatClient} i18nInstance={i18n}>\n *  ...\n * </Chat>\n * ```\n *\n * ## Datetime i18n\n *\n * Stream react chat components uses [dayjs](https://day.js.org/en/) internally by default to format datetime stamp.\n * e.g., in ChannelPreview, MessageContent components.\n * Dayjs has locale support as well - https://day.js.org/docs/en/i18n/i18n\n * Dayjs is a lightweight alternative to Momentjs with the same modern API.\n *\n * Dayjs provides locale config for plenty of languages, you can check the whole list of locale configs at following url\n * https://github.com/iamkun/dayjs/tree/dev/src/locale\n *\n * You can either provide the dayjs locale config while registering\n * language with Streami18n (either via constructor or registerTranslation()) or you can provide your own Dayjs or Moment instance\n * to Streami18n constructor, which will be then used internally (using the language locale) in components.\n *\n * 1. Via language registration\n *\n * e.g.,\n * ```\n * const i18n = new Streami18n({\n *  language: 'nl',\n *  dayjsLocaleConfigForLanguage: {\n *    months: [...],\n *    monthsShort: [...],\n *    calendar: {\n *      sameDay: ...'\n *    }\n *  }\n * });\n * ```\n *\n * Similarly, you can add locale config for moment while registering translation via `registerTranslation` function.\n *\n * e.g.,\n * ```\n * const i18n = new Streami18n();\n *\n * i18n.registerTranslation(\n *  'mr',\n *  {\n *    'Nothing yet...': 'काहीही नाही  ...',\n *    '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',\n *  },\n *  {\n *    months: [...],\n *    monthsShort: [...],\n *    calendar: {\n *      sameDay: ...'\n *    }\n *  }\n * );\n *```\n * 2. Provide your own Moment object\n *\n * ```js\n * import 'moment/locale/nl';\n * import 'moment/locale/it';\n * // or if you want to include all locales\n * import 'moment/min/locales';\n *\n * import Moment from moment\n *\n * const i18n = new Streami18n({\n *  language: 'nl',\n *  DateTimeParser: Moment\n * })\n * ```\n *\n * 3. Provide your own Dayjs object\n *\n * ```js\n * import Dayjs from 'dayjs'\n *\n * import 'dayjs/locale/nl';\n * import 'dayjs/locale/it';\n * // or if you want to include all locales\n * import 'dayjs/min/locales';\n *\n * const i18n = new Streami18n({\n *  language: 'nl',\n *  DateTimeParser: Dayjs\n * })\n * ```\n * If you would like to stick with english language for datetimes in Stream components, you can set `disableDateTimeTranslations` to true.\n *\n */\nconst defaultStreami18nOptions = {\n  DateTimeParser: Dayjs,\n  dayjsLocaleConfigForLanguage: null,\n  debug: false,\n  disableDateTimeTranslations: false,\n  language: 'en' as TranslationLanguages,\n  logger: (message?: string) => console.warn(message),\n  /**\n   * Key in the translationBuilderTopics has to match postProcessorName in the translation value.\n   *\n   * {\n   *   \"key\": \"{{value, postProcessorName}}\"\n   * }\n   *\n   * At least the default topics will be supported.\n   */\n  translationBuilderTopics: {\n    notification: NotificationTranslationTopic,\n  },\n};\n\nexport class Streami18n {\n  i18nInstance = i18n.createInstance();\n  translationBuilder: TranslationBuilder;\n  private translationBuilderTopics: Record<string, TranslationTopicConstructor> = {};\n  Dayjs = null;\n  setLanguageCallback: (t: TFunction) => void = () => null;\n  initialized = false;\n\n  t: TFunction = defaultTranslatorFunction;\n  tDateTimeParser: TDateTimeParser;\n\n  translations: {\n    [key: string]: {\n      [key: string]: typeof enTranslations | UnknownType;\n    };\n  } = {\n    de: { [defaultNS]: deTranslations },\n    en: { [defaultNS]: enTranslations },\n    es: { [defaultNS]: esTranslations },\n    fr: { [defaultNS]: frTranslations },\n    hi: { [defaultNS]: hiTranslations },\n    it: { [defaultNS]: itTranslations },\n    ja: { [defaultNS]: jaTranslations },\n    ko: { [defaultNS]: koTranslations },\n    nl: { [defaultNS]: nlTranslations },\n    pt: { [defaultNS]: ptTranslations },\n    ru: { [defaultNS]: ruTranslations },\n    tr: { [defaultNS]: trTranslations },\n  };\n\n  /**\n   * dayjs.defineLanguage('nl') also changes the global locale. We don't want to do that\n   * when user calls registerTranslation() function. So instead we will store the locale configs\n   * given to registerTranslation() function in `dayjsLocales` object, and register the required locale\n   * with moment, when setLanguage is called.\n   * */\n  dayjsLocales: { [key: string]: Partial<ILocale> } = {};\n  // dayjsLocales = {};\n\n  /**\n   * Initialize properties used in constructor\n   */\n  logger: (msg?: string) => void;\n  currentLanguage: TranslationLanguages;\n  DateTimeParser: DateTimeParserModule;\n  formatters: PredefinedFormatters & CustomFormatters = predefinedFormatters;\n  isCustomDateTimeParser: boolean;\n  i18nextConfig: {\n    debug: boolean;\n    fallbackLng: false;\n    interpolation: { escapeValue: boolean; formatSeparator: string };\n    keySeparator: false;\n    lng: string;\n    nsSeparator: false;\n    parseMissingKeyHandler?: (key: string, defaultValue?: string) => string;\n    postProcess?: string[];\n  };\n  /**\n   * A valid TZ identifier string (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\n   */\n  timezone?: string;\n  /**\n   * Constructor accepts following options:\n   *  - language (String) default: 'en'\n   *    Language code e.g., en, tr\n   *\n   *  - translationsForLanguage (object)\n   *    Translations object. Please check src/i18n/en.json for example.\n   *\n   *  - disableDateTimeTranslations (boolean) default: false\n   *    Disable translations for date-times\n   *\n   *  - debug (boolean) default: false\n   *    Enable debug mode in internal i18n class\n   *\n   *  - logger (function) default: () => {}\n   *    Logger function to log warnings/errors from this class\n   *\n   *  - dayjsLocaleConfigForLanguage (object) default: 'enConfig'\n   *    [Config object](https://momentjs.com/docs/#/i18n/changing-locale/) for internal moment object,\n   *    corresponding to language (param)\n   *\n   *  - DateTimeParser (function) Moment or Dayjs instance/function.\n   *    Make sure to load all the required locales in this Moment or Dayjs instance that you will be provide to Streami18n\n   *\n   * @param {*} options\n   */\n  constructor(options: Streami18nOptions = {}) {\n    const finalOptions = {\n      ...defaultStreami18nOptions,\n      ...options,\n    };\n    // Prepare the i18next configuration.\n    this.logger = finalOptions.logger;\n    this.currentLanguage = finalOptions.language;\n    this.DateTimeParser = finalOptions.DateTimeParser;\n    this.timezone = finalOptions.timezone;\n    this.formatters = { ...predefinedFormatters, ...options?.formatters };\n    this.translationBuilder = new TranslationBuilder(this.i18nInstance);\n    this.translationBuilderTopics = {\n      ...defaultStreami18nOptions.translationBuilderTopics,\n      ...options.translationBuilderTopics,\n    };\n\n    try {\n      if (this.DateTimeParser && isDayJs(this.DateTimeParser)) {\n        this.DateTimeParser.extend(LocalizedFormat);\n        this.DateTimeParser.extend(calendar);\n        this.DateTimeParser.extend(localeData);\n        this.DateTimeParser.extend(relativeTime);\n        this.DateTimeParser.extend(duration);\n      }\n    } catch (error) {\n      throw Error(\n        `Streami18n: Looks like you wanted to provide Dayjs instance, but something went wrong while adding plugins ${error}`,\n      );\n    }\n\n    this.isCustomDateTimeParser = !!options.DateTimeParser;\n    const translationsForLanguage = finalOptions.translationsForLanguage;\n\n    if (translationsForLanguage) {\n      this.translations[this.currentLanguage] = {\n        [defaultNS]:\n          this.translations[this.currentLanguage] &&\n          this.translations[this.currentLanguage][defaultNS]\n            ? {\n                ...this.translations[this.currentLanguage][defaultNS],\n                ...translationsForLanguage,\n              }\n            : translationsForLanguage,\n      };\n    }\n\n    // If translations don't exist for given language, then set it as empty object.\n    if (!this.translations[this.currentLanguage]) {\n      this.translations[this.currentLanguage] = {\n        [defaultNS]: {},\n      };\n    }\n\n    this.i18nextConfig = {\n      debug: finalOptions.debug,\n      fallbackLng: false,\n      interpolation: { escapeValue: false, formatSeparator: '|' },\n      keySeparator: false,\n      lng: this.currentLanguage,\n      nsSeparator: false,\n    };\n\n    const postProcess = Object.keys(this.translationBuilderTopics);\n\n    if (postProcess.length > 0) {\n      this.i18nextConfig.postProcess = postProcess;\n    }\n\n    if (finalOptions.parseMissingKeyHandler) {\n      this.i18nextConfig.parseMissingKeyHandler = finalOptions.parseMissingKeyHandler;\n    }\n\n    this.validateCurrentLanguage();\n\n    const dayjsLocaleConfigForLanguage = finalOptions.dayjsLocaleConfigForLanguage;\n\n    if (dayjsLocaleConfigForLanguage) {\n      this.addOrUpdateLocale(this.currentLanguage, {\n        ...dayjsLocaleConfigForLanguage,\n      });\n    } else if (!this.localeExists(this.currentLanguage)) {\n      this.logger(\n        `Streami18n: Streami18n(...) - Locale config for ${this.currentLanguage} does not exist in momentjs.` +\n          `Please import the locale file using \"import 'moment/locale/${this.currentLanguage}';\" in your app or ` +\n          `register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)`,\n      );\n    }\n\n    this.tDateTimeParser = (timestamp) => {\n      const language =\n        finalOptions.disableDateTimeTranslations ||\n        !this.localeExists(this.currentLanguage)\n          ? defaultLng\n          : this.currentLanguage;\n\n      if (isDayJs(this.DateTimeParser)) {\n        return supportsTz(this.DateTimeParser)\n          ? this.DateTimeParser(timestamp).tz(this.timezone).locale(language)\n          : this.DateTimeParser(timestamp).locale(language);\n      }\n\n      if (supportsTz(this.DateTimeParser) && this.timezone) {\n        return this.DateTimeParser(timestamp).tz(this.timezone).locale(language);\n      }\n      return this.DateTimeParser(timestamp).locale(language);\n    };\n  }\n\n  /**\n   * Initializes the i18next instance with configuration (which enables natural language as default keys)\n   */\n  async init() {\n    this.validateCurrentLanguage();\n\n    try {\n      this.t = await this.i18nInstance.init({\n        ...this.i18nextConfig,\n        lng: this.currentLanguage,\n        resources: this.translations,\n      });\n      this.initialized = true;\n      if (this.formatters) {\n        Object.entries(this.formatters).forEach(([name, formatterFactory]) => {\n          if (!formatterFactory) return;\n          this.i18nInstance.services.formatter?.add(name, formatterFactory(this));\n        });\n      }\n      // Register post-processors after initialization\n      Object.entries(this.translationBuilderTopics).forEach(\n        ([topic, TranslationTopic]) => {\n          this.translationBuilder.registerTopic(topic, TranslationTopic);\n        },\n      );\n    } catch (error) {\n      this.logger(`Something went wrong with init: ${JSON.stringify(error)}`);\n    }\n\n    return {\n      t: this.t,\n      tDateTimeParser: this.tDateTimeParser,\n    };\n  }\n\n  localeExists = (language: TranslationLanguages) => {\n    if (this.isCustomDateTimeParser) return true;\n\n    return Object.keys(Dayjs.Ls).indexOf(language) > -1;\n  };\n\n  validateCurrentLanguage = () => {\n    const availableLanguages = Object.keys(this.translations);\n    if (availableLanguages.indexOf(this.currentLanguage) === -1) {\n      this.logger(\n        `Streami18n: '${this.currentLanguage}' language is not registered.` +\n          ` Please make sure to call streami18n.registerTranslation('${this.currentLanguage}', {...}) or ` +\n          `use one the built-in supported languages - ${this.getAvailableLanguages()}`,\n      );\n\n      this.currentLanguage = defaultLng;\n    }\n  };\n\n  /** Returns an instance of i18next used within this class instance */\n  geti18Instance = () => this.i18nInstance;\n\n  /** Returns list of available languages. */\n  getAvailableLanguages = () => Object.keys(this.translations);\n\n  /** Returns all the translation dictionary for all inbuilt-languages */\n  getTranslations = () => this.translations;\n\n  /**\n   * Returns current version translator function.\n   */\n  async getTranslators() {\n    if (!this.initialized) {\n      if (this.dayjsLocales[this.currentLanguage]) {\n        this.addOrUpdateLocale(\n          this.currentLanguage,\n          this.dayjsLocales[this.currentLanguage],\n        );\n      }\n\n      return await this.init();\n    } else {\n      return {\n        t: this.t,\n        tDateTimeParser: this.tDateTimeParser,\n      };\n    }\n  }\n\n  registerTranslation(\n    language: TranslationLanguages,\n    translation: typeof enTranslations,\n    customDayjsLocale?: Partial<ILocale>,\n  ) {\n    if (!translation) {\n      this.logger(\n        `Streami18n: registerTranslation(language, translation, customDayjsLocale) called without translation`,\n      );\n      return;\n    }\n\n    if (!this.translations[language]) {\n      this.translations[language] = { [defaultNS]: translation };\n    } else {\n      this.translations[language][defaultNS] = translation;\n    }\n\n    if (customDayjsLocale) {\n      this.dayjsLocales[language] = { ...customDayjsLocale };\n    } else if (!this.localeExists(language)) {\n      this.logger(\n        `Streami18n: registerTranslation(language, translation, customDayjsLocale) - ` +\n          `Locale config for ${language} does not exist in Dayjs.` +\n          `Please import the locale file using \"import 'dayjs/locale/${language}';\" in your app or ` +\n          `register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)`,\n      );\n    }\n\n    if (this.initialized) {\n      this.i18nInstance.addResources(language, defaultNS, translation);\n    }\n  }\n\n  addOrUpdateLocale(key: TranslationLanguages, config: Partial<ILocale>) {\n    if (this.localeExists(key)) {\n      Dayjs.updateLocale(key, { ...config });\n    } else {\n      // Merging the custom locale config with en config, so missing keys can default to english.\n      Dayjs.locale({ name: key, ...en_locale, ...config }, undefined, true);\n    }\n  }\n\n  async setLanguage(language: TranslationLanguages) {\n    this.currentLanguage = language;\n\n    if (!this.initialized) return;\n\n    try {\n      const t = await this.i18nInstance.changeLanguage(language);\n      if (this.dayjsLocales[language]) {\n        this.addOrUpdateLocale(\n          this.currentLanguage,\n          this.dayjsLocales[this.currentLanguage],\n        );\n      }\n\n      this.setLanguageCallback(t);\n      return t;\n    } catch (error) {\n      this.logger(`Failed to set language: ${JSON.stringify(error)}`);\n      return this.t;\n    }\n  }\n\n  registerSetLanguageCallback(callback: (t: TFunction) => void) {\n    this.setLanguageCallback = callback;\n  }\n}\n","import React from 'react';\n\nconst LoadingItems = () => (\n  <div className='str-chat__channel-list-item-container'>\n    <div\n      aria-hidden='true'\n      className='str-chat__channel-list-item str-chat__channel-list-item--loading'\n    >\n      <div className='str-chat__loading-channels-avatar' />\n      <div className='str-chat__channel-list-item-data str-chat__channel-list-item-data--loading'>\n        <div className='str-chat__loading-channels-username' />\n        <div className='str-chat__loading-channels-status' />\n      </div>\n    </div>\n  </div>\n);\n\nexport const LoadingChannels = () => (\n  <div className='str-chat__loading-channels'>\n    <LoadingItems />\n    <LoadingItems />\n    <LoadingItems />\n    <LoadingItems />\n    <LoadingItems />\n  </div>\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","import React from 'react';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\n\nexport type ProgressIndicatorProps = {\n  /** Clamped 0–100 completion. */\n  percent: number;\n};\n\nconst RING_RADIUS = 12;\nconst RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;\n\n/** Circular progress indicator with input from 0 to 100. */\nexport const CircularProgressIndicator = ({ percent }: ProgressIndicatorProps) => {\n  const { t } = useTranslationContext('CircularProgressIndicator');\n  const dashOffset = RING_CIRCUMFERENCE * (1 - percent / 100);\n\n  return (\n    <div className='str-chat__circular-progress-indicator str-chat__progress-indicator'>\n      <svg\n        aria-label={t('aria/Percent complete', { percent })}\n        aria-valuemax={100}\n        aria-valuemin={0}\n        aria-valuenow={percent}\n        data-testid='circular-progress-ring'\n        height='100%'\n        role='progressbar'\n        viewBox='0 0 32 32'\n        width='100%'\n        xmlns='http://www.w3.org/2000/svg'\n      >\n        <circle\n          cx='16'\n          cy='16'\n          fill='none'\n          r={RING_RADIUS}\n          stroke='currentColor'\n          strokeOpacity={0.35}\n          strokeWidth='2.5'\n        />\n        <circle\n          cx='16'\n          cy='16'\n          fill='none'\n          r={RING_RADIUS}\n          stroke='currentColor'\n          strokeDasharray={RING_CIRCUMFERENCE}\n          strokeDashoffset={dashOffset}\n          strokeLinecap='round'\n          strokeWidth='2.5'\n          transform='rotate(-90 16 16)'\n        />\n      </svg>\n    </div>\n  );\n};\n","import React from 'react';\n\nimport { useComponentContext } from '../../context';\nimport { CircularProgressIndicator as DefaultProgressIndicator } from './progress-indicators';\nimport { LoadingIndicator as DefaultLoadingIndicator } from './LoadingIndicator';\n\nexport type UploadProgressIndicatorProps = {\n  uploadProgress?: number;\n};\n\nexport const UploadProgressIndicator = ({\n  uploadProgress,\n}: UploadProgressIndicatorProps) => {\n  const {\n    LoadingIndicator = DefaultLoadingIndicator,\n    ProgressIndicator = DefaultProgressIndicator,\n  } = useComponentContext();\n\n  if (uploadProgress === undefined) {\n    return <LoadingIndicator data-testid='loading-indicator' />;\n  }\n\n  return <ProgressIndicator percent={uploadProgress} />;\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 React from 'react';\n\nimport { useComponentContext } from '../../context';\nimport { FileSizeIndicator as DefaultFileSizeIndicator } from '../Attachment/components/FileSizeIndicator';\n\nexport type UploadedSizeIndicatorProps = {\n  fullBytes: number;\n  uploadedBytes: number;\n};\n\nexport const UploadedSizeIndicator = ({\n  fullBytes,\n  uploadedBytes,\n}: UploadedSizeIndicatorProps) => {\n  const { FileSizeIndicator = DefaultFileSizeIndicator } = useComponentContext();\n  return (\n    <div\n      className='str-chat__attachment-preview-file__upload-size-fraction'\n      data-testid='upload-size-fraction'\n    >\n      <FileSizeIndicator fileSize={uploadedBytes} /> {` / `}\n      <FileSizeIndicator fileSize={fullBytes} />\n    </div>\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 { useChannelActionContext } from '../../../context/ChannelActionContext';\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\n\nimport type React from 'react';\nimport type { LocalMessage } from 'stream-chat';\nimport { useStableCallback } from '../../../utils/useStableCallback';\n\nexport type FormData = Record<string, string>;\n\nexport type ActionHandlerReturnType = (\n  dataOrName?: string | FormData,\n  value?: string,\n  event?: React.BaseSyntheticEvent,\n) => Promise<void> | void;\n\nexport const handleActionWarning = `Action handler was called, but it is missing one of its required arguments. \nMake sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`;\n\nexport function useActionHandler(message?: LocalMessage): ActionHandlerReturnType {\n  const { removeMessage, updateMessage } = useChannelActionContext('useActionHandler');\n  const { channel } = useChannelStateContext('useActionHandler');\n\n  return useStableCallback(async (dataOrName, value, event) => {\n    if (event) event.preventDefault();\n\n    if (!message || !updateMessage || !removeMessage || !channel) {\n      console.warn(handleActionWarning);\n      return;\n    }\n\n    const messageId = message.id;\n    let formData: FormData = {};\n\n    // deprecated: value&name should be removed in favor of data obj\n    if (typeof dataOrName === 'string') {\n      formData[dataOrName] = value as string;\n    } else {\n      formData = { ...dataOrName };\n    }\n\n    if (messageId) {\n      const data = await channel.sendAction(messageId, formData);\n\n      if (data?.message) {\n        updateMessage(data.message);\n      } else {\n        removeMessage(message);\n      }\n    }\n  });\n}\n","import { isNetworkSendFailure } from '../utils';\n\nimport { useChannelActionContext } from '../../../context/ChannelActionContext';\nimport { useChatContext } from '../../../context/ChatContext';\n\nimport type { DeleteMessageOptions, LocalMessage } from 'stream-chat';\nimport type { MessageContextValue } from '../../../context';\n\nexport const useDeleteHandler = (\n  message?: LocalMessage,\n): MessageContextValue['handleDelete'] => {\n  const { deleteMessage, removeMessage, updateMessage } =\n    useChannelActionContext('useDeleteHandler');\n  const { client } = useChatContext('useDeleteHandler');\n\n  return async (options?: DeleteMessageOptions) => {\n    if (!message) {\n      return;\n    }\n\n    if (message.type === 'error' || isNetworkSendFailure(message)) {\n      removeMessage?.(message);\n      return;\n    }\n\n    if (!message.id || !client || !updateMessage) {\n      return;\n    }\n\n    const deletedMessage = await deleteMessage(message, options);\n    updateMessage(deletedMessage);\n  };\n};\n","import { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ReactEventHandler } from '../types';\n\nexport const missingUseFlagHandlerParameterWarning =\n  'useFlagHandler was called but it is missing one or more necessary parameters.';\n\nexport const useFlagHandler = (message?: LocalMessage): ReactEventHandler => {\n  const { client } = useChatContext('useFlagHandler');\n  const { t } = useTranslationContext('useFlagHandler');\n\n  return async (event) => {\n    event.preventDefault();\n\n    if (!client || !t || !message?.id) {\n      console.warn(missingUseFlagHandlerParameterWarning);\n      return;\n    }\n\n    await client.flagMessage(message.id);\n  };\n};\n","import { useChannelActionContext } from '../../../context/ChannelActionContext';\n\nimport type React from 'react';\nimport type { LocalMessage, UserResponse } from 'stream-chat';\n\nimport type { ReactEventHandler } from '../types';\n\nexport type CustomMentionHandler = (\n  event: React.BaseSyntheticEvent,\n  mentioned_users: UserResponse[],\n) => void;\n\nexport type MentionedUserEventHandler = (\n  event: React.BaseSyntheticEvent,\n  mentionedUsers: UserResponse[],\n) => void;\n\nfunction createEventHandler(\n  fn?: CustomMentionHandler,\n  message?: LocalMessage,\n): ReactEventHandler {\n  return (event) => {\n    if (typeof fn !== 'function' || !message?.mentioned_users?.length) {\n      return;\n    }\n    fn(event, message.mentioned_users);\n  };\n}\n\nexport const useMentionsHandler = (\n  message?: LocalMessage,\n  customMentionHandler?: {\n    onMentionsClick?: CustomMentionHandler;\n    onMentionsHover?: CustomMentionHandler;\n  },\n) => {\n  const {\n    onMentionsClick: contextOnMentionsClick,\n    onMentionsHover: contextOnMentionsHover,\n  } = useChannelActionContext('useMentionsHandler');\n\n  const onMentionsClick =\n    customMentionHandler?.onMentionsClick || contextOnMentionsClick || (() => null);\n\n  const onMentionsHover =\n    customMentionHandler?.onMentionsHover || contextOnMentionsHover || (() => null);\n\n  return {\n    onMentionsClick: createEventHandler(onMentionsClick, message),\n    onMentionsHover: createEventHandler(onMentionsHover, message),\n  };\n};\n","import { useChannelStateContext } from '../../../context';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ReactEventHandler } from '../types';\n\nexport const useMarkUnreadHandler = (message?: LocalMessage): ReactEventHandler => {\n  const { channel } = useChannelStateContext('useMarkUnreadHandler');\n\n  return async (event) => {\n    event.preventDefault();\n    if (!message?.id) {\n      console.warn('Mark unread handler does not have access to message id');\n      return;\n    }\n\n    await channel.markUnread({ message_id: message.id });\n  };\n};\n","import { isUserMuted } from '../utils';\n\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\n\nimport type { LocalMessage } from 'stream-chat';\n\nimport type { ReactEventHandler } from '../types';\n\nexport const missingUseMuteHandlerParamsWarning =\n  'useMuteHandler was called but it is missing one or more necessary parameter.';\n\nexport const useMuteHandler = (message?: LocalMessage): ReactEventHandler => {\n  const { mutes } = useChannelStateContext('useMuteHandler');\n  const { client } = useChatContext('useMuteHandler');\n  const { t } = useTranslationContext('useMuteHandler');\n\n  return async (event) => {\n    event.preventDefault();\n\n    if (!t || !message?.user || !client) {\n      console.warn(missingUseMuteHandlerParamsWarning);\n      return;\n    }\n\n    if (!isUserMuted(message, mutes)) {\n      await client.muteUser(message.user.id);\n    } else {\n      await client.unmuteUser(message.user.id);\n    }\n  };\n};\n","import { useChannelActionContext } from '../../../context/ChannelActionContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ReactEventHandler } from '../types';\n\nexport const useOpenThreadHandler = (\n  message?: LocalMessage,\n  customOpenThread?: (message: LocalMessage, event: React.BaseSyntheticEvent) => void,\n): ReactEventHandler => {\n  const { openThread: channelOpenThread } =\n    useChannelActionContext('useOpenThreadHandler');\n\n  const openThread = customOpenThread || channelOpenThread;\n\n  return (event) => {\n    if (!openThread || !message) {\n      console.warn(\n        'Open thread handler was called but it is missing one of its parameters',\n      );\n      return;\n    }\n\n    openThread(message, event);\n  };\n};\n","import { useChannelActionContext } from '../../../context/ChannelActionContext';\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ReactEventHandler } from '../types';\n\nexport const usePinHandler = (message: LocalMessage) => {\n  const { updateMessage } = useChannelActionContext('usePinHandler');\n  const { channelCapabilities = {} } = useChannelStateContext('usePinHandler');\n  const { client } = useChatContext('usePinHandler');\n\n  const canPin = !!channelCapabilities['pin-message'];\n\n  const handlePin: ReactEventHandler = async (event) => {\n    event.preventDefault();\n\n    if (!message) return;\n\n    if (!message.pinned) {\n      try {\n        const optimisticMessage: LocalMessage = {\n          ...message,\n          pinned: true,\n          pinned_at: new Date(),\n          pinned_by: client.user,\n        };\n\n        updateMessage(optimisticMessage);\n\n        await client.pinMessage(message);\n      } catch (e) {\n        updateMessage(message);\n      }\n    } else {\n      try {\n        const optimisticMessage = {\n          ...message,\n          pin_expires: null,\n          pinned: false,\n          pinned_at: null,\n          pinned_by: null,\n        };\n\n        updateMessage(optimisticMessage);\n\n        await client.unpinMessage(message);\n      } catch (e) {\n        updateMessage(message);\n      }\n    }\n  };\n\n  return { canPin, handlePin };\n};\n","import type React from 'react';\nimport { useCallback } from 'react';\nimport throttle from 'lodash.throttle';\n\nimport { useThreadContext } from '../../Threads';\nimport { useChannelActionContext } from '../../../context/ChannelActionContext';\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\n\nimport type { LocalMessage, Reaction, ReactionResponse } from 'stream-chat';\n\nexport const reactionHandlerWarning = `Reaction handler was called, but it is missing one of its required arguments.\nMake sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`;\n\nexport const useReactionHandler = (message?: LocalMessage) => {\n  const thread = useThreadContext();\n  const { updateMessage } = useChannelActionContext('useReactionHandler');\n  const { channel, channelCapabilities } = useChannelStateContext('useReactionHandler');\n  const { client } = useChatContext('useReactionHandler');\n\n  const createMessagePreview = useCallback(\n    (add: boolean, reaction: ReactionResponse, message: LocalMessage): LocalMessage => {\n      const newReactionGroups = message?.reaction_groups || {};\n      const reactionType = reaction.type;\n      const hasReaction = !!newReactionGroups[reactionType];\n\n      if (add) {\n        const timestamp = new Date().toISOString();\n        newReactionGroups[reactionType] = hasReaction\n          ? {\n              ...newReactionGroups[reactionType],\n              count: newReactionGroups[reactionType].count + 1,\n            }\n          : {\n              count: 1,\n              first_reaction_at: timestamp,\n              last_reaction_at: timestamp,\n              sum_scores: 1,\n            };\n      } else {\n        if (hasReaction && newReactionGroups[reactionType].count > 1) {\n          newReactionGroups[reactionType] = {\n            ...newReactionGroups[reactionType],\n            count: newReactionGroups[reactionType].count - 1,\n          };\n        } else {\n          delete newReactionGroups[reactionType];\n        }\n      }\n\n      const newReactions: ReactionResponse[] | undefined = add\n        ? [reaction, ...(message?.latest_reactions || [])]\n        : message.latest_reactions?.filter(\n            (item) => !(item.type === reaction.type && item.user_id === reaction.user_id),\n          );\n\n      const newOwnReactions = add\n        ? [reaction, ...(message?.own_reactions || [])]\n        : message?.own_reactions?.filter((item) => item.type !== reaction.type);\n\n      return {\n        ...message,\n        latest_reactions: newReactions || message.latest_reactions,\n        own_reactions: newOwnReactions,\n        reaction_groups: newReactionGroups,\n      };\n    },\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [client.user, client.userID],\n  );\n\n  const createReactionPreview = (type: string) => ({\n    message_id: message?.id,\n    score: 1,\n    type,\n    user: client.user,\n    user_id: client.user?.id,\n  });\n\n  const toggleReaction = throttle(async (id: string, type: string, add: boolean) => {\n    if (!message || !channelCapabilities['send-reaction']) return;\n\n    const newReaction = createReactionPreview(type) as ReactionResponse;\n    const tempMessage = createMessagePreview(add, newReaction, message);\n\n    try {\n      updateMessage(tempMessage);\n      thread?.upsertReplyLocally({ message: tempMessage });\n\n      const messageResponse = add\n        ? await channel.sendReaction(id, { type } as Reaction)\n        : await channel.deleteReaction(id, type);\n\n      // seems useless as we're expecting WS event to come in and replace this anyway\n      updateMessage(messageResponse.message);\n    } catch (error) {\n      // revert to the original message if the API call fails\n      updateMessage(message);\n      thread?.upsertReplyLocally({ message });\n    }\n  }, 1000);\n\n  return async (reactionType: string, event?: React.BaseSyntheticEvent) => {\n    if (event?.preventDefault) {\n      event.preventDefault();\n    }\n\n    if (!message) {\n      return console.warn(reactionHandlerWarning);\n    }\n\n    let userExistingReaction = null as unknown as ReactionResponse;\n\n    if (message.own_reactions) {\n      message.own_reactions.forEach((reaction) => {\n        // own user should only ever contain the current user id\n        // just in case we check to prevent bugs with message updates from breaking reactions\n        if (\n          reaction.user &&\n          client.userID === reaction.user.id &&\n          reaction.type === reactionType\n        ) {\n          userExistingReaction = reaction;\n        } else if (reaction.user && client.userID !== reaction.user.id) {\n          console.warn(\n            `message.own_reactions contained reactions from a different user, this indicates a bug`,\n          );\n        }\n      });\n    }\n\n    try {\n      if (userExistingReaction) {\n        await toggleReaction(message.id, userExistingReaction.type, false);\n      } else {\n        await toggleReaction(message.id, reactionType, true);\n      }\n    } catch (error) {\n      console.log({ error });\n    }\n  };\n};\n","import type { RetrySendMessage } from '../../../context/ChannelActionContext';\nimport { useChannelActionContext } from '../../../context/ChannelActionContext';\n\nexport const useRetryHandler = (\n  customRetrySendMessage?: RetrySendMessage,\n): RetrySendMessage => {\n  const { retrySendMessage: contextRetrySendMessage } =\n    useChannelActionContext('useRetryHandler');\n\n  const retrySendMessage = customRetrySendMessage || contextRetrySendMessage;\n\n  return async (message) => {\n    if (message) {\n      await retrySendMessage(message);\n    }\n  };\n};\n","import type { User } from 'stream-chat';\n\nimport type { ReactEventHandler } from '../types';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type UserEventHandler = (event: React.BaseSyntheticEvent, user: User) => void;\n\nexport const useUserHandler = (\n  message?: LocalMessage,\n  eventHandlers?: {\n    onUserClickHandler?: UserEventHandler;\n    onUserHoverHandler?: UserEventHandler;\n  },\n): {\n  onUserClick: ReactEventHandler;\n  onUserHover: ReactEventHandler;\n} => ({\n  onUserClick: (event) => {\n    if (typeof eventHandlers?.onUserClickHandler !== 'function' || !message?.user) {\n      return;\n    }\n    eventHandlers.onUserClickHandler(event, message.user);\n  },\n  onUserHover: (event) => {\n    if (typeof eventHandlers?.onUserHoverHandler !== 'function' || !message?.user) {\n      return;\n    }\n\n    eventHandlers.onUserHoverHandler(event, message.user);\n  },\n});\n","import { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\nimport type { LocalMessage } from 'stream-chat';\n\nexport const useUserRole = (message: LocalMessage, disableQuotedMessages?: boolean) => {\n  const { channel, channelCapabilities = {} } = useChannelStateContext('useUserRole');\n  const { client } = useChatContext('useUserRole');\n\n  /**\n   * @deprecated as it relies on `membership.role` check which is already deprecated and shouldn't be used anymore.\n   * `isAdmin` will be removed in future release. See `channelCapabilities`.\n   */\n  const isAdmin =\n    client.user?.role === 'admin' || channel.state.membership.role === 'admin';\n\n  /**\n   * @deprecated as it relies on `membership.role` check which is already deprecated and shouldn't be used anymore.\n   * `isOwner` will be removed in future release. See `channelCapabilities`.\n   */\n  const isOwner = channel.state.membership.role === 'owner';\n\n  /**\n   * @deprecated as it relies on `membership.role` check which is already deprecated and shouldn't be used anymore.\n   * `isModerator` will be removed in future release. See `channelCapabilities`.\n   */\n  const isModerator =\n    client.user?.role === 'channel_moderator' ||\n    channel.state.membership.role === 'channel_moderator' ||\n    channel.state.membership.role === 'moderator' ||\n    channel.state.membership.is_moderator === true ||\n    channel.state.membership.channel_role === 'channel_moderator';\n\n  const isMyMessage = client.userID === message.user?.id;\n\n  const canEdit =\n    !message.poll &&\n    message.command !== 'giphy' &&\n    (channelCapabilities['update-any-message'] ||\n      (isMyMessage && channelCapabilities['update-own-message']));\n\n  const canDelete =\n    channelCapabilities['delete-any-message'] ||\n    (isMyMessage && channelCapabilities['delete-own-message']);\n\n  const canFlag = !isMyMessage && channelCapabilities['flag-message'];\n  const canMute = !isMyMessage && channelCapabilities['mute-channel'];\n  const canBlockUser = !isMyMessage;\n  const canMarkUnread = !isMyMessage && channelCapabilities['read-events'];\n  const canQuote = !disableQuotedMessages && channelCapabilities['quote-message'];\n  const canReact = channelCapabilities['send-reaction'];\n  const canReply = channelCapabilities['send-reply'];\n  const canSendMessage = channelCapabilities['send-message'];\n\n  return {\n    canBlockUser,\n    canDelete,\n    canEdit,\n    canFlag,\n    canMarkUnread,\n    canMute,\n    canQuote,\n    canReact,\n    canReply,\n    canSendMessage,\n    isAdmin,\n    isModerator,\n    isMyMessage,\n    isOwner,\n  };\n};\n","import { useChatContext } from '../../../context';\nimport { useStableCallback } from '../../../utils/useStableCallback';\nimport type {\n  LocalMessage,\n  ReactionResponse,\n  ReactionSort,\n  StreamChat,\n} from 'stream-chat';\nimport type { ReactionType } from '../../Reactions/types';\n\nexport const MAX_MESSAGE_REACTIONS_TO_FETCH = 1000;\n\nexport function useReactionsFetcher(message: LocalMessage) {\n  const { client } = useChatContext('useRectionsFetcher');\n\n  return useStableCallback((reactionType?: ReactionType, sort?: ReactionSort) =>\n    fetchMessageReactions(client, message.id, reactionType, sort),\n  );\n}\n\nasync function fetchMessageReactions(\n  client: StreamChat,\n  messageId: string,\n  reactionType?: ReactionType,\n  sort?: ReactionSort,\n) {\n  const reactions: ReactionResponse[] = [];\n  const limit = 25;\n  let next: string | undefined;\n  let hasNext = true;\n\n  while (hasNext && reactions.length < MAX_MESSAGE_REACTIONS_TO_FETCH) {\n    const response = await client.queryReactions(\n      messageId,\n      reactionType ? { type: reactionType } : {},\n      sort,\n      { limit, next },\n    );\n\n    reactions.push(...response.reactions);\n    next = response.next;\n    hasNext = Boolean(next);\n  }\n\n  return reactions;\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '../../../utils/useStableCallback';\nimport type { StreamedMessageTextProps } from '../StreamedMessageText';\n\nexport type UseMessageTextStreamingProps = Pick<\n  StreamedMessageTextProps,\n  'streamingLetterIntervalMs' | 'renderingLetterCount'\n> & { text: string };\n\nconst DEFAULT_LETTER_INTERVAL = 30;\nconst DEFAULT_RENDERING_LETTER_COUNT = 2;\n\n/**\n * A hook that returns text in a streamed, typewriter fashion. The speed of streaming is\n * configurable.\n * @param {number} [streamingLetterIntervalMs=30] - The timeout between each typing animation in milliseconds.\n * @param {number} [renderingLetterCount=2] - The number of letters to be rendered each time we update.\n * @param {string} text - The text that we want to render in a typewriter fashion.\n * @returns {{ streamedMessageText: string }} - A substring of the text property, up until we've finished rendering the typewriter animation.\n */\nexport const useMessageTextStreaming = ({\n  renderingLetterCount = DEFAULT_RENDERING_LETTER_COUNT,\n  streamingLetterIntervalMs = DEFAULT_LETTER_INTERVAL,\n  text,\n}: UseMessageTextStreamingProps) => {\n  const [streamedMessageText, setStreamedMessageText] = useState<string>(text);\n  const textCursor = useRef<number>(text.length);\n\n  useEffect(() => {\n    const textLength = text.length;\n\n    const interval = setInterval(() => {\n      if (!text || textCursor.current >= textLength) {\n        clearInterval(interval);\n        return;\n      }\n      const newCursorValue = textCursor.current + renderingLetterCount;\n      const newText = text.substring(0, newCursorValue);\n      textCursor.current += newText.length - textCursor.current;\n      setStreamedMessageText(newText);\n    }, streamingLetterIntervalMs);\n\n    return () => {\n      clearInterval(interval);\n    };\n  }, [streamingLetterIntervalMs, renderingLetterCount, text]);\n\n  const skipAnimation = useStableCallback(() => {\n    textCursor.current = text.length;\n    setStreamedMessageText(text);\n  });\n\n  return { skipAnimation, streamedMessageText } as const;\n};\n","import { useCallback } from 'react';\nimport { useChatContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { ReminderManagerState } from 'stream-chat';\n\nexport const useMessageReminder = (messageId: string) => {\n  const { client } = useChatContext();\n  const reminderSelector = useCallback(\n    (state: ReminderManagerState) => ({\n      reminder: state.reminders.get(messageId),\n    }),\n    [messageId],\n  );\n  const { reminder } = useStateStore(client.reminders.state, reminderSelector);\n  return reminder;\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 React, { type PropsWithChildren } from 'react';\nimport { DialogAnchor, type DialogAnchorProps } from '../service';\nimport { useDialogIsOpen } from '../hooks';\nimport { Button } from '../../Button';\nimport clsx from 'clsx';\nimport { IconXmark } from '../../Icons';\nimport { useComponentContext, useTranslationContext } from '../../../context';\n\nexport type CalloutProps = PropsWithChildren<\n  DialogAnchorProps & {\n    onClose: () => void;\n    className?: string;\n  }\n>;\n\n/**\n * Callout is a general purpose component that displays content in dialog that has been previously opened by clicking on a reference element\n * and has to be dismissed to disappear.\n * Tooltip on the other side is a dialog that appears upon pointer device cursor hovering above a reference element.\n * @param children\n * @param className\n * @param dialogManagerId\n * @param dialogId\n * @param onClose\n * @param anchorProps\n * @constructor\n */\n\nexport const Callout = ({\n  children,\n  className,\n  dialogManagerId,\n  id: dialogId,\n  onClose,\n  ...anchorProps\n}: CalloutProps) => {\n  const { CalloutDialog = DefaultCalloutDialog } = useComponentContext();\n\n  const dialogIsOpen = useDialogIsOpen(dialogId, dialogManagerId);\n  return (\n    <DialogAnchor {...anchorProps} dialogManagerId={dialogManagerId} id={dialogId}>\n      {dialogIsOpen && (\n        <CalloutDialog className={className} onClose={onClose}>\n          {children}\n        </CalloutDialog>\n      )}\n    </DialogAnchor>\n  );\n};\n\nexport type CalloutDialogProps = Pick<CalloutProps, 'children' | 'className' | 'onClose'>;\n\nconst DefaultCalloutDialog = ({ children, className, onClose }: CalloutDialogProps) => {\n  const { t } = useTranslationContext();\n\n  return (\n    <div className='str-chat__callout'>\n      {children}\n      <Button\n        appearance='ghost'\n        aria-label={t('aria/Close callout dialog')}\n        circular\n        className={clsx(className, 'str-chat__callout__close-button')}\n        onClick={onClose}\n        size='sm'\n        variant='secondary'\n      >\n        <IconXmark />\n      </Button>\n    </div>\n  );\n};\n","import clsx from 'clsx';\nimport React, {\n  type ComponentPropsWithoutRef,\n  useEffect,\n  useMemo,\n  useState,\n} from 'react';\nimport { IconUser } from '../Icons';\n\nexport type AvatarProps = {\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  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 && <IconUser />}\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, { type ComponentProps, type ElementType, useMemo } from 'react';\nimport { useComponentContext } from '../../context';\nimport { type AvatarProps, Avatar as DefaultAvatar } from './Avatar';\nimport clsx from 'clsx';\nimport { Badge, type BadgeSize } from '../Badge';\n\nexport function AvatarStack({\n  badgeSize,\n  capLimit = 3,\n  component: Component = 'div',\n  displayInfo = [],\n  size,\n}: {\n  component?: ElementType;\n  displayInfo?: (Pick<AvatarProps, 'imageUrl' | 'userName'> & { id?: string })[];\n  size: 'md' | 'sm' | 'xs' | null;\n  badgeSize?: BadgeSize;\n  capLimit?: number;\n}) {\n  const { Avatar = DefaultAvatar } = useComponentContext(AvatarStack.name);\n\n  const displayInfoToRender = useMemo(\n    () => (displayInfo.length > capLimit ? displayInfo.slice(0, capLimit) : displayInfo),\n    [displayInfo, capLimit],\n  );\n  const overflowCount = displayInfo.length - displayInfoToRender.length;\n\n  if (!displayInfo.length) {\n    return null;\n  }\n\n  return (\n    <Component\n      className={clsx('str-chat__avatar-stack', {\n        [`str-chat__avatar-stack--size-${size}`]: typeof size === 'string',\n      })}\n      data-testid='avatar-stack'\n    >\n      {displayInfoToRender.map((info, index) => (\n        <Avatar\n          imageUrl={info.imageUrl}\n          key={info.id ?? `${info.userName}-${info.imageUrl}-${index}`}\n          size={size}\n          userName={info.userName}\n        />\n      ))}\n      {typeof overflowCount === 'number' && overflowCount > 0 && (\n        <Badge\n          className='str-chat__avatar-stack__count-badge'\n          data-testid='avatar-stack-count-badge'\n          size={badgeSize ?? size}\n          variant='counter'\n        >\n          +{overflowCount}\n        </Badge>\n      )}\n    </Component>\n  );\n}\n\nexport type AvatarStackProps = ComponentProps<typeof AvatarStack>;\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    if (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 { 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: string;\n  description?: string;\n  className?: string;\n  close?: () => void;\n  descriptionId?: string;\n  titleId?: string;\n};\n\nconst PromptHeader = ({\n  className,\n  close,\n  description,\n  descriptionId,\n  title,\n  titleId,\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\n  return (\n    <div className={clsx('str-chat__prompt__header', className)}>\n      <div className='str-chat__prompt__header__title-group'>\n        <h2 className='str-chat__prompt__header__title' id={resolvedTitleId}>\n          {title}\n        </h2>\n        {description != null && description !== '' && (\n          <p className='str-chat__prompt__header__description' id={resolvedDescriptionId}>\n            {description}\n          </p>\n        )}\n      </div>\n      {close && (\n        <Button\n          appearance='ghost'\n          aria-describedby={\n            description != null && description !== '' ? resolvedDescriptionId : undefined\n          }\n          aria-label={t('Close prompt: {{ title }}', { title })}\n          circular\n          className='str-chat__prompt__header__close-button'\n          onClick={close}\n          size='sm'\n          variant='secondary'\n        >\n          <IconXmark />\n        </Button>\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 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 ViewerRoot = ({ children, className, ...props }: ComponentProps<'div'>) => (\n  <div {...props} className={clsx('str-chat__viewer', className)}>\n    {children}\n  </div>\n);\n\nexport type ViewerHeaderProps = {\n  title: string;\n  description?: string;\n  className?: string;\n  close?: () => void;\n  goBack?: () => void;\n  descriptionId?: string;\n  titleId?: string;\n};\n\nconst ViewerHeader = ({\n  className,\n  close,\n  description,\n  descriptionId,\n  goBack,\n  title,\n  titleId,\n}: ViewerHeaderProps) => {\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\n  return (\n    <div className={clsx('str-chat__viewer__header', className)}>\n      {goBack && (\n        <Button\n          appearance='ghost'\n          aria-describedby={\n            description != null && description !== '' ? resolvedDescriptionId : undefined\n          }\n          aria-label={t('Back')}\n          circular\n          className='str-chat__viewer__header__go-back-button'\n          onClick={goBack}\n          size='sm'\n          variant='secondary'\n        >\n          <IconArrowLeft />\n        </Button>\n      )}\n      <div className='str-chat__viewer__header__title-group'>\n        <h2 className='str-chat__viewer__header__title' id={resolvedTitleId}>\n          {title}\n        </h2>\n        {description != null && description !== '' && (\n          <p className='str-chat__viewer__header__description' id={resolvedDescriptionId}>\n            {description}\n          </p>\n        )}\n      </div>\n      {close && (\n        <Button\n          appearance='ghost'\n          aria-describedby={\n            description != null && description !== '' ? resolvedDescriptionId : undefined\n          }\n          aria-label={t('Close dialog')}\n          circular\n          className='str-chat__viewer__header__close-button'\n          onClick={close}\n          size='sm'\n          variant='secondary'\n        >\n          <IconXmark />\n        </Button>\n      )}\n    </div>\n  );\n};\n\nexport type ViewerBodyProps = PropsWithChildren<{\n  className?: string;\n}>;\n\nconst ViewerBody = ({ children, className }: ViewerBodyProps) => (\n  <div className={clsx('str-chat__viewer__body', className)}>{children}</div>\n);\n\nexport type ViewerFooterProps = PropsWithChildren<{\n  className?: string;\n}>;\n\nconst ViewerFooter = ({ children, className }: ViewerFooterProps) => (\n  <div className={clsx('str-chat__viewer__footer', className)}>{children}</div>\n);\n\ntype ViewerFooterControlsProps = PropsWithChildren<{\n  className?: string;\n}>;\n\nconst ViewerFooterControls = ({ children, className }: ViewerFooterControlsProps) => (\n  <div className={clsx('str-chat__viewer__footer__controls', className)}>{children}</div>\n);\n\nconst ViewerFooterControlsButtonSecondary = ({ className, ...props }: ButtonProps) => (\n  <Button\n    appearance='ghost'\n    className={clsx('str-chat__viewer__footer__controls-button', className)}\n    size='md'\n    variant='secondary'\n    {...props}\n  />\n);\n\nconst ViewerFooterControlsButtonPrimary = ({ className, ...props }: ButtonProps) => (\n  <Button\n    appearance='solid'\n    className={clsx('str-chat__viewer__footer__controls-button', className)}\n    size='md'\n    variant='primary'\n    {...props}\n  />\n);\n\nexport const Viewer = {\n  Body: ViewerBody,\n  Footer: ViewerFooter,\n  FooterControls: ViewerFooterControls,\n  FooterControlsButtonPrimary: ViewerFooterControlsButtonPrimary,\n  FooterControlsButtonSecondary: ViewerFooterControlsButtonSecondary,\n  Header: ViewerHeader,\n  Root: ViewerRoot,\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 {\n  ModalContextProvider,\n  modalDialogManagerId,\n  useChatContext,\n} from '../../context';\nimport {\n  DialogPortalEntry,\n  modalDialogId,\n  useModalDialog,\n  useModalDialogIsOpen,\n} from '../Dialog';\nimport { useResolvedModalAriaProps } from '../../a11y/hooks/useResolvedModalAriaProps';\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  /** 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  onClose,\n  onCloseAttempt,\n  open,\n  role = 'dialog',\n}: PropsWithChildren<ModalProps>) => {\n  const dialog = useModalDialog();\n  const isOpen = useModalDialogIsOpen();\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 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    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    maybeClose('button', event);\n  };\n\n  const handleDialogKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    if (event.defaultPrevented || event.key !== 'Escape') return;\n    maybeClose('escape', event);\n  };\n\n  // Sync open prop → dialog open. Don't close here (dialog ref changes after close → effect loop).\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    }\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={modalDialogId} 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 contain restoreFocus>\n            <div\n              aria-describedby={resolvedModalAriaProps['aria-describedby']}\n              aria-label={resolvedModalAriaProps['aria-label']}\n              aria-labelledby={resolvedModalAriaProps['aria-labelledby']}\n              aria-modal='true'\n              className='str-chat__modal__dialog'\n              onKeyDown={handleDialogKeyDown}\n              role={role}\n              tabIndex={-1}\n            >\n              {children}\n            </div>\n          </FocusScope>\n          {CloseButtonOnOverlay && (\n            <CloseButtonOnOverlay onClick={handleCloseButtonClick} ref={closeButtonRef} />\n          )}\n        </div>\n      </ModalContextProvider>\n    </DialogPortalEntry>\n  );\n};\n","import type { ComponentType, PropsWithChildren } from 'react';\nimport React from 'react';\nimport { GlobalModal, type ModalProps } from '../Modal';\nimport { MessageBounceProvider, useComponentContext } from '../../context';\nimport type { MessageBouncePromptProps } from './MessageBouncePrompt';\n\nexport type MessageBounceModalProps = PropsWithChildren<\n  ModalProps & {\n    MessageBouncePrompt: ComponentType<MessageBouncePromptProps>;\n  }\n>;\n\nexport function MessageBounceModal({\n  MessageBouncePrompt,\n  ...modalProps\n}: MessageBounceModalProps) {\n  const { Modal = GlobalModal } = useComponentContext();\n  return (\n    <Modal className='str-chat__message-bounce-modal' {...modalProps}>\n      <MessageBounceProvider>\n        <MessageBouncePrompt />\n      </MessageBounceProvider>\n    </Modal>\n  );\n}\n","import type { MouseEventHandler } from 'react';\nimport React from 'react';\nimport {\n  useMessageBounceContext,\n  useModalContext,\n  useTranslationContext,\n} from '../../context';\nimport { Button } from '../Button';\nimport { IconExclamationMark } from '../Icons';\nimport { Alert } from '../Dialog';\nimport type { PropsWithChildrenOnly } from '../../types/types';\n\nexport type MessageBouncePromptProps = PropsWithChildrenOnly;\n\n// todo: shall we rename this to MessageBounceAlert?\nexport function MessageBouncePrompt({ children }: MessageBouncePromptProps) {\n  const { handleDelete, handleEdit, handleRetry } = useMessageBounceContext();\n  const { t } = useTranslationContext();\n  const { close } = useModalContext();\n\n  function createHandler(\n    handle: MouseEventHandler<HTMLButtonElement>,\n  ): MouseEventHandler<HTMLButtonElement> {\n    return (e) => {\n      handle(e);\n      close();\n    };\n  }\n\n  return (\n    <Alert.Root\n      className='str-chat__message-bounce-alert'\n      data-testid='message-bounce-prompt'\n    >\n      <Alert.Header\n        className='str-chat__message-bounce-alert-header'\n        description={\n          !children\n            ? t(\n                'Review this message and choose whether to delete it, edit it, or send it anyway',\n              )\n            : undefined\n        }\n        Icon={IconExclamationMark}\n        title={\n          !children ? t('This message did not meet our content guidelines') : undefined\n        }\n      >\n        {children}\n      </Alert.Header>\n      <Alert.Actions className={'str-chat__message-bounce-actions'}>\n        <Button\n          appearance='outline'\n          className='str-chat__message-bounce-delete'\n          data-testid='message-bounce-delete'\n          onClick={createHandler(handleDelete)}\n          size='md'\n          variant='danger'\n        >\n          {t('Delete')}\n        </Button>\n        <Button\n          appearance='outline'\n          className='str-chat__message-bounce-edit'\n          data-testid='message-bounce-edit'\n          onClick={createHandler(handleEdit)}\n          size='md'\n          variant='secondary'\n        >\n          {t('Edit Message')}\n        </Button>\n        <Button\n          appearance='outline'\n          className='str-chat__message-bounce-send'\n          data-testid='message-bounce-send'\n          onClick={createHandler(handleRetry)}\n          size='md'\n          variant='secondary'\n        >\n          {t('Send Anyway')}\n        </Button>\n      </Alert.Actions>\n    </Alert.Root>\n  );\n}\n","import React, { type ComponentProps } from 'react';\nimport clsx from 'clsx';\n\nexport const MessageBubble = ({ className, ...props }: ComponentProps<'div'>) => (\n  <div {...props} className={clsx('str-chat__message-bubble', className)} />\n);\n","import React from 'react';\n\nimport { IconNoSign } from '../Icons';\nimport { useTranslationContext } from '../../context/TranslationContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport { MessageBubble } from './MessageBubble';\n\nexport type MessageDeletedProps = {\n  message: LocalMessage;\n};\n\nexport const MessageDeletedBubble = () => {\n  const { t } = useTranslationContext();\n\n  return (\n    <MessageBubble data-testid={'message-deleted-bubble'}>\n      <div className='str-chat__message-text'>\n        <IconNoSign />\n        <span>{t('Message deleted')}</span>\n      </div>\n    </MessageBubble>\n  );\n};\n","import React from 'react';\nimport clsx from 'clsx';\n\nimport { useUserRole } from './hooks/useUserRole';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useMessageContext } from '../../context';\n\nexport const MessageBlocked = () => {\n  const { message } = useMessageContext();\n  const { t } = useTranslationContext('MessageBlocked');\n\n  const { isMyMessage } = useUserRole(message);\n\n  const messageClasses = clsx(\n    'str-chat__message str-chat__message--blocked',\n    message.type,\n    {\n      'str-chat__message--me': isMyMessage,\n      'str-chat__message--other': !isMyMessage,\n    },\n  );\n\n  return (\n    <div\n      className={messageClasses}\n      data-testid='message-blocked-component'\n      key={message.id}\n    >\n      <div className='str-chat__message--blocked-inner'>\n        {t('Message was blocked by moderation policies')}\n      </div>\n    </div>\n  );\n};\n","import { useMemo } from 'react';\n\nimport { useChannelStateContext, useMessageContext } from '../../../context';\nimport { useUserRole } from '../../Message/hooks';\nimport {\n  ACTIONS_NOT_WORKING_IN_THREAD,\n  isMessageBounced,\n  isMessageDeleted,\n  isMessageErrorRetryable,\n  isNetworkSendFailure,\n} from '../../Message/utils';\n\nimport type { MessageActionSetItem } from '../MessageActions';\nimport {\n  isAudioAttachment,\n  isFileAttachment,\n  isImageAttachment,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n} from 'stream-chat';\n\n/**\n * Base filter hook which covers actions of type `delete`, `edit`,\n * `flag`, `markUnread`, `mute`, `quote`, `react` and `reply`, whether\n * the rendered message is a reply (replies are limited to certain actions) and\n * whether the message has appropriate type and status (including soft-deleted).\n */\nexport const useBaseMessageActionSetFilter = (\n  messageActionSet: MessageActionSetItem[],\n  disable = false,\n) => {\n  const { initialMessage: isInitialMessage, message } = useMessageContext();\n  const { channelConfig } = useChannelStateContext();\n  const messageIsDeleted = isMessageDeleted(message);\n  const {\n    canBlockUser,\n    canDelete,\n    canEdit,\n    canFlag,\n    canMarkUnread,\n    canMute,\n    canQuote,\n    canReact,\n    canReply,\n    canSendMessage,\n  } = useUserRole(message);\n  const isMessageThreadReply = typeof message.parent_id === 'string';\n  const isBounced = isMessageBounced(message);\n  const allowRetry = isMessageErrorRetryable(message);\n  const hasNetworkSendFailure = isNetworkSendFailure(message);\n\n  return useMemo(() => {\n    if (disable) return messageActionSet;\n\n    // filter out all actions if any of these are true\n    if (\n      isBounced ||\n      isInitialMessage || // not sure whether this thing even works anymore\n      !message.type ||\n      message.type === 'system' ||\n      message.type === 'ephemeral' ||\n      message.status === 'sending'\n    )\n      return [];\n\n    return messageActionSet.filter((action) => {\n      if (action.placement === 'quick-dropdown-toggle') return true;\n\n      const type = action.type;\n\n      // filter out actions with types that do not work in thread\n      if (ACTIONS_NOT_WORKING_IN_THREAD.includes(type) && isMessageThreadReply)\n        return false;\n\n      // failed message menu has special treatment\n      if (message.error) {\n        return (\n          (type === 'resendMessage' && canSendMessage && (allowRetry || isBounced)) ||\n          (type === 'edit' && ((isBounced && canEdit) || hasNetworkSendFailure)) ||\n          (type === 'delete' &&\n            !messageIsDeleted &&\n            ((isBounced && canDelete) || hasNetworkSendFailure))\n        );\n      }\n\n      if (\n        type === 'resendMessage' ||\n        (type === 'blockUser' && !canBlockUser) ||\n        (type === 'copyMessageText' && !message.text) ||\n        (type === 'download' &&\n          !message.attachments?.some(\n            (attachment) =>\n              isFileAttachment(attachment) ||\n              isImageAttachment(attachment) ||\n              isVideoAttachment(attachment) ||\n              isAudioAttachment(attachment) ||\n              isVoiceRecordingAttachment(attachment),\n          )) ||\n        (type === 'delete' && (!canDelete || messageIsDeleted)) ||\n        (type === 'edit' && !canEdit) ||\n        (type === 'flag' && !canFlag) ||\n        (type === 'markUnread' && !canMarkUnread) ||\n        (type === 'mute' && !canMute) ||\n        (type === 'quote' && !canQuote) ||\n        (type === 'react' && !canReact) ||\n        (type === 'reply' && !canReply) ||\n        (type === 'remindMe' && !channelConfig?.['user_message_reminders']) ||\n        (type === 'saveForLater' && !channelConfig?.['user_message_reminders'])\n      )\n        return false;\n\n      return true;\n    });\n  }, [\n    allowRetry,\n    canBlockUser,\n    canDelete,\n    canEdit,\n    canFlag,\n    canMarkUnread,\n    canMute,\n    canQuote,\n    canReact,\n    canReply,\n    canSendMessage,\n    channelConfig,\n    isBounced,\n    isInitialMessage,\n    messageIsDeleted,\n    isMessageThreadReply,\n    message.error,\n    message.attachments,\n    message.status,\n    message.text,\n    message.type,\n    disable,\n    hasNetworkSendFailure,\n    messageActionSet,\n  ]);\n};\n","import React, { useEffect, useRef } from 'react';\n\nimport { IconArrowUpRight } from '../Icons';\nimport { useNotificationApi } from '../Notifications';\nimport {\n  useChannelActionContext,\n  useChannelStateContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport { formatMessage, type LocalMessage } from 'stream-chat';\n\n/**\n * Indicator shown when the message was also sent to the main channel (show_in_channel === true).\n */\nexport const MessageAlsoSentInChannelIndicator = () => {\n  const { addNotification } = useNotificationApi();\n  const { t } = useTranslationContext();\n  const { channel } = useChannelStateContext();\n  const { jumpToMessage, openThread } = useChannelActionContext();\n  const { message, threadList } = useMessageContext('MessageAlsoSentInChannelIndicator');\n  const targetMessageRef = useRef<LocalMessage | null | undefined>(undefined);\n\n  const queryParent = () =>\n    channel\n      .getClient()\n      .search({ cid: channel.cid }, { id: message.parent_id })\n      .then(({ results }) => {\n        if (!results.length) {\n          throw new Error('Thread has not been found');\n        }\n        targetMessageRef.current = formatMessage(results[0].message);\n      })\n      .catch((error: Error) => {\n        addNotification({\n          context: { threadReply: message },\n          emitter: 'MessageIsThreadReplyInChannelButtonIndicator',\n          error,\n          message: t('Thread has not been found'),\n          severity: 'error',\n          type: 'api:reply:search:failed',\n        });\n      });\n\n  // todo: it is not possible to jump to a message in thread\n  const jumpToReplyInChannelMessages = async (id: string) => {\n    await jumpToMessage(id);\n    // todo: we do not have API to control, whether thread of channel message list is show - on mobile devices important\n  };\n\n  useEffect(() => {\n    if (\n      targetMessageRef.current ||\n      targetMessageRef.current === null ||\n      !message.parent_id\n    )\n      return;\n    const localMessage = channel.state.findMessage(message.parent_id);\n    if (localMessage) {\n      targetMessageRef.current = localMessage;\n      return;\n    }\n  }, [channel, message]);\n\n  const handleClickViewReference = async () => {\n    if (!targetMessageRef.current) {\n      // search query is performed here in order to prevent multiple search queries in useEffect\n      // due to the message list 3x remounting its items\n      if (threadList) {\n        await jumpToReplyInChannelMessages(message.id); // we are in thread, and we want to jump to this reply in the main message list\n        return;\n      } else await queryParent(); // we are in the main list and need to query the thread\n    }\n    const target = targetMessageRef.current;\n    if (!target) {\n      // prevent further search queries if the message is not found in the DB\n      targetMessageRef.current = null;\n      return;\n    }\n\n    if (threadList) await jumpToReplyInChannelMessages(message.id);\n    else openThread(target);\n  };\n\n  if (!message?.show_in_channel) return null;\n\n  return (\n    <div className='str-chat__message-also-sent-in-channel' role='status'>\n      <IconArrowUpRight />\n      <span>{threadList ? t('Also sent in channel') : t('Replied to a thread')}</span>\n      <span> · </span>\n      <button\n        className='str-chat__message-also-sent-in-channel__link-button'\n        onClick={handleClickViewReference}\n        type='button'\n      >\n        {t('View')}\n      </button>\n    </div>\n  );\n};\n","import type { MouseEventHandler } from 'react';\nimport type { UserResponse } from 'stream-chat';\nimport React, { useMemo } from 'react';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useChannelStateContext, useComponentContext } from '../../context';\nimport { AvatarStack as DefaultAvatarStack } from '../Avatar';\n\nexport type MessageRepliesCountButtonProps = {\n  /* If supplied, adds custom text to the end of a multiple replies message */\n  labelPlural?: string;\n  /* If supplied, adds custom text to the end of a single reply message */\n  labelSingle?: string;\n  /* Function to navigate into an existing thread on a message */\n  onClick?: MouseEventHandler;\n  /* The amount of replies (i.e., threaded messages) on a message */\n  reply_count?: number;\n  thread_participants?: UserResponse[];\n};\n\nfunction UnMemoizedMessageRepliesCountButton(props: MessageRepliesCountButtonProps) {\n  const { AvatarStack = DefaultAvatarStack } = useComponentContext(\n    MessageRepliesCountButton.name,\n  );\n  const {\n    labelPlural,\n    labelSingle,\n    onClick,\n    reply_count: replyCount = 0,\n    thread_participants: threadParticipants = [],\n  } = props;\n  const { channelCapabilities } = useChannelStateContext();\n\n  const { t } = useTranslationContext('MessageRepliesCountButton');\n\n  const avatarStackDisplayInfo = useMemo(\n    () =>\n      threadParticipants.slice(0, 3).map((participant) => ({\n        imageUrl: participant.image,\n        userName: participant.name || participant.id,\n      })),\n    [threadParticipants],\n  );\n\n  if (!replyCount) return null;\n\n  let replyCountText = t('replyCount', { count: replyCount });\n\n  if (labelPlural && replyCount > 1) {\n    replyCountText = `${replyCount} ${labelPlural}`;\n  } else if (labelSingle) {\n    replyCountText = `1 ${labelSingle}`;\n  }\n\n  return (\n    <div className='str-chat__message-replies-count-button-wrapper'>\n      <button\n        className='str-chat__message-replies-count-button'\n        data-testid='replies-count-button'\n        disabled={!channelCapabilities['send-reply']}\n        onClick={onClick}\n      >\n        {replyCountText}\n\n        <AvatarStack displayInfo={avatarStackDisplayInfo} size='xs' />\n      </button>\n    </div>\n  );\n}\n\nexport const MessageRepliesCountButton = React.memo(\n  UnMemoizedMessageRepliesCountButton,\n) as typeof UnMemoizedMessageRepliesCountButton;\n","import React from 'react';\n\nimport { IconPin } from '../Icons';\nimport { useChatContext, useTranslationContext } from '../../context';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type PinIndicatorProps = {\n  message?: LocalMessage;\n};\n\n/**\n * Default pinned message indicator. Renders \"Pinned by [name]\" with pin icon above the message bubble.\n * Name is taken from message.pinned_by (who pinned).\n */\nexport const PinIndicator = ({ message }: PinIndicatorProps) => {\n  const { t } = useTranslationContext();\n  const { client } = useChatContext();\n\n  if (!message) return null;\n\n  const isOwnPin = !!message.pinned_by?.id && message.pinned_by.id === client.user?.id;\n  const name = message.pinned_by?.name ?? message.pinned_by?.id ?? '';\n\n  const label = isOwnPin\n    ? t('Pinned by You')\n    : name\n      ? t('Pinned by {{ name }}', { name })\n      : t('Message pinned');\n\n  return (\n    <div className='str-chat__message-pin-indicator'>\n      <div className='str-chat__message-pin-indicator__content'>\n        <span aria-hidden className='str-chat__message-pin-indicator__icon'>\n          <IconPin />\n        </span>\n        <span>{label}</span>\n      </div>\n    </div>\n  );\n};\n","import type { ComponentProps } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport type { PopperLikePlacement } from '../Dialog';\nimport { usePopoverPosition } from '../Dialog/hooks/usePopoverPosition';\nimport clsx from 'clsx';\n\nexport const Tooltip = ({ children, className, ...rest }: ComponentProps<'div'>) => (\n  <div className={clsx('str-chat__tooltip', className)} {...rest}>\n    {children}\n  </div>\n);\n\nexport type PopperTooltipProps<T extends HTMLElement> = React.PropsWithChildren<{\n  /** Reference element to which the tooltip should attach to */\n  referenceElement: T | null;\n  /** Custom class to be merged along the defaults */\n  className?: string;\n  /** Popper's modifier (offset) property - [xAxis offset, yAxis offset], default [0, 10] */\n  offset?: [number, number];\n  /** Popper's placement property defining default position of the tooltip, default 'top' */\n  placement?: PopperLikePlacement;\n  /** Tells component whether to render its contents */\n  visible?: boolean;\n}>;\n\nexport const PopperTooltip = <T extends HTMLElement>({\n  children,\n  className,\n  offset = [0, 10],\n  placement = 'top',\n  referenceElement,\n  visible = false,\n}: PopperTooltipProps<T>) => {\n  const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n  const {\n    placement: resolvedPlacement,\n    refs,\n    strategy,\n    x,\n    y,\n  } = usePopoverPosition({\n    offset,\n    placement,\n  });\n\n  useEffect(() => {\n    refs.setReference(referenceElement);\n  }, [referenceElement, refs]);\n\n  useEffect(() => {\n    refs.setFloating(popperElement);\n  }, [popperElement, refs]);\n\n  if (!visible) return null;\n\n  return (\n    <div\n      className={clsx('str-chat__tooltip', className)}\n      data-placement={resolvedPlacement}\n      ref={setPopperElement}\n      style={{ left: x ?? 0, position: strategy, top: y ?? 0 }}\n    >\n      {children}\n    </div>\n  );\n};\n","import type React from 'react';\nimport { useCallback, useState } from 'react';\n\nexport const useEnterLeaveHandlers = <T extends HTMLElement>({\n  onMouseEnter,\n  onMouseLeave,\n}: Partial<Record<'onMouseEnter' | 'onMouseLeave', React.MouseEventHandler<T>>> = {}) => {\n  const [tooltipVisible, setTooltipVisible] = useState(false);\n\n  const handleEnter: React.MouseEventHandler<T> = useCallback(\n    (e) => {\n      setTooltipVisible(true);\n      onMouseEnter?.(e);\n    },\n    [onMouseEnter],\n  );\n\n  const handleLeave: React.MouseEventHandler<T> = useCallback(\n    (e) => {\n      setTooltipVisible(false);\n      onMouseLeave?.(e);\n    },\n    [onMouseLeave],\n  );\n\n  return { handleEnter, handleLeave, tooltipVisible };\n};\n","import React, { useState } from 'react';\nimport clsx from 'clsx';\nimport type { TooltipUsernameMapper } from './utils';\nimport { getReadByTooltipText, mapToUserNameOrId } from './utils';\nimport { PopperTooltip } from '../Tooltip';\nimport { useEnterLeaveHandlers } from '../Tooltip/hooks';\n\nimport { useChatContext } from '../../context/ChatContext';\nimport { useMessageContext } from '../../context/MessageContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { IconCheckmark1Small, IconChecks, IconClock } from '../Icons';\n\nexport type MessageStatusProps = {\n  /* Custom component to render when message is considered delivered, not read. The default UI renders MessageDeliveredIcon and a tooltip with string 'Delivered'. */\n  MessageDeliveredStatus?: React.ComponentType;\n  /* Custom component to render when message is considered delivered and read. The default UI renders the last reader's Avatar and a tooltip with string readers' names. */\n  MessageReadStatus?: React.ComponentType;\n  /* Custom component to render when message is considered as being the in the process of delivery. The default UI renders a clock icon and a tooltip with string 'Sending...'. */\n  MessageSendingStatus?: React.ComponentType;\n  /* Custom component to render when message is considered created on the server, but not delivered. The default UI renders MessageSentIcon and a tooltip with string 'Sent'. */\n  MessageSentStatus?: React.ComponentType;\n  /* Message type string to be added to CSS class names. */\n  messageType?: string;\n  /* Allows to customize the username(s) that appear on the message status tooltip */\n  tooltipUserNameMapper?: TooltipUsernameMapper;\n};\n\nconst UnMemoizedMessageStatus = (props: MessageStatusProps) => {\n  const {\n    MessageDeliveredStatus,\n    MessageReadStatus,\n    MessageSendingStatus,\n    MessageSentStatus,\n    messageType = 'simple',\n    tooltipUserNameMapper = mapToUserNameOrId,\n  } = props;\n\n  const { handleEnter, handleLeave, tooltipVisible } =\n    useEnterLeaveHandlers<HTMLSpanElement>();\n\n  const { client } = useChatContext('MessageStatus');\n  const {\n    deliveredTo,\n    isMyMessage,\n    lastOwnMessage,\n    message,\n    readBy,\n    returnAllReadData,\n    threadList,\n  } = useMessageContext('MessageStatus');\n  const { t } = useTranslationContext('MessageStatus');\n  const [referenceElement, setReferenceElement] = useState<HTMLSpanElement | null>(null);\n\n  if (!isMyMessage() || message.type === 'error') return null;\n\n  const justReadByMe = readBy?.length === 1 && readBy[0].id === client.user?.id;\n  const deliveredOnlyToMe =\n    deliveredTo?.length === 1 && deliveredTo[0].id === client.user?.id;\n  const sending = message.status === 'sending';\n  const read = !!(readBy?.length && !justReadByMe && !threadList);\n  const delivered = !!(deliveredTo?.length && !deliveredOnlyToMe && !read && !threadList);\n  const sent =\n    (returnAllReadData || lastOwnMessage?.id === message.id) &&\n    message.status === 'received' &&\n    !delivered &&\n    !read &&\n    !threadList;\n\n  const readersWithoutOwnUser = read\n    ? readBy.filter((item) => item.id !== client.user?.id)\n    : [];\n\n  return (\n    <span\n      className={clsx(\n        `str-chat__message-${messageType}-status str-chat__message-status`,\n        {\n          'str-chat__message-status-delivered': delivered,\n          'str-chat__message-status-read-by': read,\n          'str-chat__message-status-sending': sending,\n          'str-chat__message-status-sent': sent,\n        },\n      )}\n      data-testid={clsx({\n        'message-status-delivered': delivered,\n        'message-status-read-by': read,\n        'message-status-sending': sending,\n        'message-status-sent': sent,\n      })}\n      onMouseEnter={handleEnter}\n      onMouseLeave={handleLeave}\n      ref={setReferenceElement}\n    >\n      {sending &&\n        (MessageSendingStatus ? (\n          <MessageSendingStatus />\n        ) : (\n          <>\n            <PopperTooltip\n              offset={[0, 5]}\n              referenceElement={referenceElement}\n              visible={tooltipVisible}\n            >\n              {t('Sending...')}\n            </PopperTooltip>\n            <IconClock className='str-chat__message-status-sending' />\n          </>\n        ))}\n\n      {sent &&\n        (MessageSentStatus ? (\n          <MessageSentStatus />\n        ) : (\n          <>\n            <PopperTooltip\n              offset={[0, 5]}\n              referenceElement={referenceElement}\n              visible={tooltipVisible}\n            >\n              {t('Sent')}\n            </PopperTooltip>\n            <IconCheckmark1Small className='str-chat__message-status-sent' />\n          </>\n        ))}\n\n      {delivered &&\n        (MessageDeliveredStatus ? (\n          <MessageDeliveredStatus />\n        ) : (\n          <>\n            <PopperTooltip\n              offset={[0, 5]}\n              referenceElement={referenceElement}\n              visible={tooltipVisible}\n            >\n              {t('Delivered')}\n            </PopperTooltip>\n            <IconChecks className='str-chat__message-status-delivered' />\n          </>\n        ))}\n\n      {read &&\n        (MessageReadStatus ? (\n          <MessageReadStatus />\n        ) : (\n          <>\n            <PopperTooltip\n              offset={[0, 5]}\n              referenceElement={referenceElement}\n              visible={tooltipVisible}\n            >\n              {getReadByTooltipText(readBy, t, client, tooltipUserNameMapper)}\n            </PopperTooltip>\n\n            <IconChecks className='str-chat__message-status-read' />\n\n            {readersWithoutOwnUser.length > 1 && (\n              <span\n                className={`str-chat__message-${messageType}-status-number`}\n                data-testid='message-status-read-by-many'\n              >\n                {readersWithoutOwnUser.length}\n              </span>\n            )}\n          </>\n        ))}\n    </span>\n  );\n};\n\nexport const MessageStatus = React.memo(\n  UnMemoizedMessageStatus,\n) as typeof UnMemoizedMessageStatus;\n","export function escapeRegExp(text: string) {\n  return text.replace(/[-[\\]{}()*+?.,/\\\\^$|#]/g, '\\\\$&');\n}\n\nexport const detectHttp = /(http(s?):\\/\\/)?(www\\.)?/;\n\nexport const messageCodeBlocks = (message: string) => {\n  const codeRegex = /```[a-z]*\\n[\\s\\S]*?\\n```|`[a-z]*[\\s\\S]*?`/gm;\n  const matches = message.match(codeRegex);\n  return matches || [];\n};\n\nexport const matchMarkdownLinks = (message: string) => {\n  const regexMdLinks = /\\[([^[]+)\\](\\(.*\\))/gm;\n  const matches = message.match(regexMdLinks);\n  const singleMatch = /\\[([^[]+)\\]\\((.*)\\)/;\n\n  const links = matches\n    ? matches.map((match) => {\n        const i = singleMatch.exec(match);\n        return i && [i[1], i[2]];\n      })\n    : [];\n\n  return links.flat();\n};\n","import type { ReplaceFunction } from 'hast-util-find-and-replace';\nimport { findAndReplace } from 'hast-util-find-and-replace';\nimport { u } from 'unist-builder';\nimport emojiRegex from 'emoji-regex';\n\nimport type { Nodes } from 'hast-util-find-and-replace/lib';\n\nexport const emojiMarkdownPlugin = () => {\n  const replace: ReplaceFunction = (match) =>\n    u('element', { properties: {}, tagName: 'emoji' }, [u('text', match)]);\n\n  const transform = (node: Nodes) => findAndReplace(node, [emojiRegex(), replace]);\n\n  return transform;\n};\n","import { escapeRegExp } from '../regex';\nimport type { ReplaceFunction } from 'hast-util-find-and-replace';\nimport { findAndReplace } from 'hast-util-find-and-replace';\nimport { u } from 'unist-builder';\nimport { visit } from 'unist-util-visit';\n\nimport type { Nodes } from 'hast-util-find-and-replace/lib';\nimport type { Element } from 'hast';\nimport type { UserResponse } from 'stream-chat';\n\nexport const mentionsMarkdownPlugin = (mentioned_users: UserResponse[]) => () => {\n  const mentioned_usernames = mentioned_users\n    .map((user) => user.name || user.id)\n    .filter(Boolean)\n    .map(escapeRegExp);\n\n  const mentionedUsersRegex = new RegExp(\n    mentioned_usernames.map((username) => `@${username}`).join('|'),\n    'g',\n  );\n\n  const replace: ReplaceFunction = (match) => {\n    const usernameOrId = match.replace('@', '');\n    const user = mentioned_users.find(\n      ({ id, name }) => name === usernameOrId || id === usernameOrId,\n    );\n    return u('element', { mentionedUser: user, properties: {}, tagName: 'mention' }, [\n      u('text', match),\n    ]);\n  };\n\n  const transform = (tree: Nodes) => {\n    if (!mentioned_usernames.length) return;\n\n    // handles special cases of mentions where user.name is an e-mail\n    // Remark GFM translates all e-mail-like text nodes to links creating\n    // two separate child nodes \"@\" and \"your.name@as.email\" instead of\n    // keeping it as one text node with value \"@your.name@as.email\"\n    // this piece finds these two separated nodes and merges them together\n    // before \"replace\" function takes over\n    visit(tree, (node, index, parent) => {\n      if (typeof index === 'undefined') return;\n      if (!parent) return;\n\n      const nextChild = parent.children.at(index + 1) as Element;\n      const nextChildHref = nextChild?.properties?.href as string | undefined;\n\n      if (\n        node.type === 'text' &&\n        // text value has to have @ sign at the end of the string\n        // and no other characters except whitespace can precede it\n        // valid cases:   \"text @\", \"@\", \" @\"\n        // invalid cases: \"text@\", \"@text\",\n        /.?\\s?@$|^@$/.test(node.value) &&\n        nextChildHref?.startsWith('mailto:')\n      ) {\n        const newTextValue = node.value.replace(/@$/, '');\n        const username = nextChildHref.replace('mailto:', '');\n        parent.children[index] = u('text', newTextValue);\n        parent.children[index + 1] = u('text', `@${username}`);\n      }\n    });\n\n    findAndReplace(tree, [mentionedUsersRegex, replace]);\n  };\n\n  return transform;\n};\n","import type { Visitor } from 'unist-util-visit';\nimport { visit } from 'unist-util-visit';\n\nimport type { Nodes } from 'hast-util-find-and-replace/lib';\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","import type { Plugin } from 'unified';\nimport { visit } from 'unist-util-visit';\nimport type { Node, Parent as UnistParent } from 'unist';\nimport type { Root, RootContent, ThematicBreak } from 'mdast';\n\n/** Type guard: does the node have mdast children? */\nfunction isParentWithChildren(\n  node: Node,\n): node is UnistParent & { children: RootContent[] } {\n  const maybe = node as unknown as { children?: unknown };\n  return Array.isArray(maybe.children);\n}\n\n/** Build a single <br> by mapping a standard mdast node via data.hName */\nfunction brNode(): ThematicBreak {\n  return { data: { hName: 'br' }, type: 'thematicBreak' };\n}\n\n/**\n * Inserts runs of <br> between sibling block nodes to preserve the exact\n * number of *blank source lines* between them. No paragraph wrappers are added.\n *\n * Works because `mdast-util-to-hast` respects `data.hName`, turning our\n * `thematicBreak` into `<br>`. Multiple blank lines -> multiple `<br>` siblings.\n */\nexport const keepLineBreaksPlugin: Plugin<[], Root> = () => (tree) => {\n  visit(\n    tree as unknown as UnistParent, // visit needs a Unist parent-like root\n    isParentWithChildren, // limit to parents with children\n    (parent) => {\n      const children = parent.children as RootContent[];\n      if (children.length < 2) return;\n\n      const out: RootContent[] = [];\n\n      for (let i = 0; i < children.length; i++) {\n        const curr = children[i];\n        out.push(curr);\n\n        if (i === children.length - 1) break;\n\n        const next = children[i + 1];\n\n        const currEndLine =\n          curr.position && curr.position.end ? curr.position.end.line : undefined;\n        const nextStartLine =\n          next.position && next.position.start ? next.position.start.line : undefined;\n\n        if (typeof currEndLine !== 'number' || typeof nextStartLine !== 'number') {\n          continue;\n        }\n\n        // Markdown already separates blocks by at least one visual gap.\n        // We add back only the *extra* blank lines from the source.\n        const extraBlankLines = Math.max(0, nextStartLine - currEndLine - 1);\n        if (extraBlankLines > 0) {\n          for (let k = 0; k < extraBlankLines; k++) {\n            out.push(brNode());\n          }\n        }\n      }\n\n      parent.children = out;\n    },\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 type { Plugin } from 'unified';\nimport type { Paragraph, Root, Text } from 'mdast';\n\n/**\n * Replace the parsed Markdown tree with a single paragraph containing the\n * original source as a plain text node. No Markdown formatting is interpreted.\n * React will escape it.\n */\nexport const remarkIgnoreMarkdown: Plugin<[], Root> = () => (tree, file) => {\n  const source = String(file.value ?? '');\n\n  const text: Text = { type: 'text', value: source };\n  const paragraph: Paragraph = { children: [text], type: 'paragraph' };\n\n  tree.children = [paragraph];\n};\n","import clsx from 'clsx';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\n\nexport const Anchor = ({ children, href }: ComponentProps<'a'>) => {\n  const isEmail = href?.startsWith('mailto:');\n  const isUrl = href?.startsWith('http');\n\n  if (!href || (!isEmail && !isUrl)) return <>{children}</>;\n\n  return (\n    <a\n      className={clsx({ 'str-chat__message-url-link': isUrl })}\n      href={href}\n      rel='nofollow noreferrer noopener'\n      target='_blank'\n    >\n      {children}\n    </a>\n  );\n};\n","import React from 'react';\nimport type { PropsWithChildrenOnly } from '../../../../types/types';\n\nexport const Emoji = ({ children }: PropsWithChildrenOnly) => (\n  <span className='inline-text-emoji' data-testid='inline-text-emoji'>\n    {children}\n  </span>\n);\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport type { UserResponse } from 'stream-chat';\n\nexport type MentionProps = PropsWithChildren<{\n  node: {\n    mentionedUser: UserResponse;\n  };\n}>;\n\nexport const Mention = ({ children, node: { mentionedUser } }: MentionProps) => (\n  <span className='str-chat__message-mention' data-user-id={mentionedUser.id}>\n    {children}\n  </span>\n);\n","export const NullComponent = () => null;\n","import { Component } from 'react';\nimport type { PropsWithChildren, ReactNode } from 'react';\n\ntype ErrorBoundaryProps = PropsWithChildren<{ fallback?: ReactNode }>;\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, { hasError: boolean }> {\n  constructor(props: ErrorBoundaryProps) {\n    super(props);\n    this.state = { hasError: false };\n  }\n\n  static getDerivedStateFromError() {\n    return { hasError: true };\n  }\n\n  componentDidCatch(error: unknown, information: unknown) {\n    console.error(error, information);\n  }\n\n  render() {\n    if (this.state.hasError) {\n      return this.props.fallback;\n    }\n\n    return this.props.children;\n  }\n}\n","import React from 'react';\nimport ReactMarkdown, { defaultUrlTransform } from 'react-markdown';\nimport { find } from 'linkifyjs';\nimport remarkGfm from 'remark-gfm';\nimport type { ComponentType, JSX } from 'react';\nimport type { Options } from 'react-markdown/lib';\nimport type { UserResponse } from 'stream-chat';\nimport type { PluggableList } from 'unified'; // A sub-dependency of react-markdown. The type is not declared or re-exported from anywhere else\n\nimport { Anchor, Emoji, Mention } from './componentRenderers';\nimport { detectHttp, matchMarkdownLinks, messageCodeBlocks } from './regex';\nimport { emojiMarkdownPlugin, mentionsMarkdownPlugin } from './rehypePlugins';\nimport {\n  htmlToTextPlugin,\n  imageToLink,\n  keepLineBreaksPlugin,\n  plusPlusToEmphasis,\n} from './remarkPlugins';\nimport { ErrorBoundary } from '../../UtilityComponents';\nimport type { MentionProps } from './componentRenderers';\n\nexport type RenderTextPluginConfigurator = (\n  defaultPlugins: PluggableList,\n) => PluggableList;\n\ntype IntrinsicElementTagName = keyof JSX.IntrinsicElements & string;\n\nexport const defaultAllowedTagNames: Array<\n  IntrinsicElementTagName | 'emoji' | 'mention'\n> = [\n  'html',\n  'text',\n  'br',\n  'p',\n  'em',\n  'strong',\n  'a',\n  'ol',\n  'ul',\n  'li',\n  'code',\n  'pre',\n  'blockquote',\n  'del',\n  'table',\n  'thead',\n  'tbody',\n  'th',\n  'tr',\n  'td',\n  'tfoot',\n  // custom types (tagNames)\n  'emoji',\n  'mention',\n  'h1',\n  'h2',\n  'h3',\n  'h4',\n  'h5',\n  'h6',\n  'ins',\n];\n\nfunction formatUrlForDisplay(url: string) {\n  try {\n    return decodeURIComponent(url).replace(detectHttp, '');\n  } catch (e) {\n    return url;\n  }\n}\n\nfunction encodeDecode(url: string) {\n  try {\n    return encodeURI(decodeURIComponent(url));\n  } catch (error) {\n    return url;\n  }\n}\n\nconst urlTransform = (uri: string) =>\n  uri.startsWith('app://') ? uri : defaultUrlTransform(uri);\n\nconst getPluginsForward: RenderTextPluginConfigurator = (plugins: PluggableList) =>\n  plugins;\n\nexport const markDownRenderers: RenderTextOptions['customMarkDownRenderers'] = {\n  a: Anchor,\n  emoji: Emoji,\n  mention: Mention,\n};\n\nexport type RenderTextOptions = {\n  allowedTagNames?: Array<IntrinsicElementTagName | 'emoji' | 'mention' | (string & {})>;\n  customMarkDownRenderers?: Options['components'] &\n    Partial<{\n      emoji: ComponentType;\n      mention: ComponentType<MentionProps>;\n    }>;\n  getRehypePlugins?: RenderTextPluginConfigurator;\n  getRemarkPlugins?: RenderTextPluginConfigurator;\n};\n\nexport const renderText = (\n  text?: string,\n  mentionedUsers?: UserResponse[],\n  {\n    allowedTagNames = defaultAllowedTagNames,\n    customMarkDownRenderers,\n    getRehypePlugins = getPluginsForward,\n    getRemarkPlugins = getPluginsForward,\n  }: RenderTextOptions = {},\n) => {\n  // take the @ mentions and turn them into markdown?\n  // translate links\n  if (!text) return null;\n  if (text.trim().length === 1) return <>{text}</>;\n\n  let newText = text;\n  const markdownLinks = matchMarkdownLinks(newText);\n  const codeBlocks = messageCodeBlocks(newText);\n\n  // Extract all valid links/emails within text and replace it with proper markup\n  // Revert the link order to avoid getting out of sync of the original start and end positions of links\n  // - due to the addition of new characters when creating Markdown links\n  const links = [...find(newText, 'email'), ...find(newText, 'url')];\n  for (let i = links.length - 1; i >= 0; i--) {\n    const { end, href, start, type, value } = links[i];\n    const linkIsInBlock = codeBlocks.some((block) => block?.includes(value));\n\n    // check if message is already  markdown\n    const noParsingNeeded =\n      markdownLinks &&\n      markdownLinks.filter((text) => {\n        const strippedHref = href?.replace(detectHttp, '');\n        const strippedText = text?.replace(detectHttp, '');\n\n        if (!strippedHref || !strippedText) return false;\n\n        return strippedHref.includes(strippedText) || strippedText.includes(strippedHref);\n      });\n\n    if (noParsingNeeded.length > 0 || linkIsInBlock) continue;\n\n    try {\n      // special case for mentions:\n      // it could happen that a user's name matches with an e-mail format pattern.\n      // in that case, we check whether the found e-mail is actually a mention\n      // by naively checking for an existence of @ sign in front of it.\n      if (type === 'email' && mentionedUsers) {\n        const emailMatchesWithName = mentionedUsers.find((u) => u.name === value);\n        if (emailMatchesWithName) {\n          // FIXME: breaks if the mention symbol is not '@'\n          const isMention = newText.charAt(start - 1) === '@';\n          // in case of mention, we leave the match in its original form,\n          // and we let `mentionsMarkdownPlugin` to do its job\n          newText =\n            newText.slice(0, start) +\n            (isMention ? value : `[${value}](${encodeDecode(href)})`) +\n            newText.slice(end);\n        }\n      } else {\n        const displayLink = type === 'email' ? value : formatUrlForDisplay(href);\n\n        newText =\n          newText.slice(0, start) +\n          `[${displayLink}](${encodeDecode(href)})` +\n          newText.slice(end);\n      }\n    } catch (e) {\n      void e;\n    }\n  }\n\n  const remarkPlugins: PluggableList = [\n    htmlToTextPlugin,\n    keepLineBreaksPlugin,\n    [remarkGfm, { singleTilde: false }],\n    plusPlusToEmphasis,\n    imageToLink,\n  ];\n  const rehypePlugins: PluggableList = [emojiMarkdownPlugin];\n\n  if (mentionedUsers?.length) {\n    rehypePlugins.push(mentionsMarkdownPlugin(mentionedUsers));\n  }\n\n  return (\n    <ErrorBoundary fallback={<>{text}</>}>\n      <ReactMarkdown\n        allowedElements={allowedTagNames}\n        components={{\n          ...markDownRenderers,\n          ...customMarkDownRenderers,\n        }}\n        rehypePlugins={getRehypePlugins(rehypePlugins)}\n        remarkPlugins={getRemarkPlugins(remarkPlugins)}\n        skipHtml\n        unwrapDisallowed\n        urlTransform={urlTransform}\n      >\n        {newText}\n      </ReactMarkdown>\n    </ErrorBoundary>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useId, useMemo } from 'react';\nimport { messageHasAttachments, messageTextHasEmojisOnly } from './utils';\n\nimport type { MessageContextValue } from '../../context';\nimport { useMessageContext, useTranslationContext } from '../../context';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { renderText as defaultRenderText } from './renderText';\n\nimport type { LocalMessage } from 'stream-chat';\nimport { getTranslatedMessageText } from '../../context/MessageTranslationViewContext';\n\nexport type MessageTextProps = {\n  /* Replaces the CSS class name placed on the component's inner `div` container */\n  customInnerClass?: string;\n  /* Adds a CSS class name to the component's outer `div` container */\n  customWrapperClass?: string;\n  /* The `StreamChat` message object, which provides necessary data to the underlying UI components (overrides the value stored in `MessageContext`) */\n  message?: LocalMessage;\n} & Pick<MessageContextValue, 'renderText'>;\n\nconst UnMemoizedMessageTextComponent = (props: MessageTextProps) => {\n  const {\n    customInnerClass,\n    customWrapperClass = '',\n    message: propMessage,\n    renderText: propsRenderText,\n  } = props;\n\n  const {\n    message: contextMessage,\n    onMentionsClickMessage,\n    onMentionsHoverMessage,\n    renderText: contextRenderText,\n    translationView = 'translated',\n    unsafeHTML,\n  } = useMessageContext('MessageText');\n\n  const renderText = propsRenderText ?? contextRenderText ?? defaultRenderText;\n\n  const { t, userLanguage } = useTranslationContext('MessageText');\n  const message = propMessage || contextMessage;\n  const hasAttachment = messageHasAttachments(message);\n  const messageContextId = useId();\n  const messageTextId = useId();\n\n  const messageTextToRender =\n    translationView === 'original'\n      ? message.text\n      : getTranslatedMessageText({ language: userLanguage, message }) || message.text;\n\n  const messageText = useMemo(\n    () => renderText(messageTextToRender, message.mentioned_users),\n    [message.mentioned_users, messageTextToRender, renderText],\n  );\n\n  const wrapperClass = customWrapperClass || 'str-chat__message-text';\n  const innerClass = customInnerClass;\n  const hasMentionedUsers = Boolean(message.mentioned_users?.length);\n  const isMentionsInteractionEnabled =\n    hasMentionedUsers && typeof onMentionsClickMessage === 'function';\n  const senderName = message.user?.name;\n  const messageContext = senderName\n    ? t('aria/Message from {{ user }},', { user: senderName })\n    : t('aria/Message,');\n  // `aria-labelledby` accepts a space-separated list of element ids. We point to the\n  // hidden message context and the rendered message text so screen readers announce both.\n  const messageLabelledBy = `${messageContextId} ${messageTextId}`;\n\n  const handleMentionsKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    if (!isMentionsInteractionEnabled || (event.key !== 'Enter' && event.key !== ' ')) {\n      return;\n    }\n\n    event.preventDefault();\n    onMentionsClickMessage(event);\n  };\n\n  if (!messageTextToRender) return null;\n\n  /**\n   * The component has two mutually exclusive focus models. The reason is this bit of behavior:\n   *\n   * if mentions are not interactive:\n   *  - the whole message text block is just a readable focus stop\n   *  - outer wrapper gets tabIndex={0}\n   *  - inner wrapper is not focusable\n   * if mentions are interactive:\n   *  - keyboard interaction needs to land on the inner element, because that’s where onClick, onKeyDown, and mention hover/click behavior live\n   *  - inner wrapper gets tabIndex={0}\n   *  - outer wrapper must stop being focusable, otherwise you create an extra dead focus stop before the actual interactive target\n   */\n  return (\n    <div\n      aria-labelledby={isMentionsInteractionEnabled ? undefined : messageLabelledBy}\n      className={wrapperClass}\n      tabIndex={isMentionsInteractionEnabled ? undefined : 0}\n    >\n      <VisuallyHidden id={messageContextId}>{messageContext}</VisuallyHidden>\n      <div\n        aria-labelledby={isMentionsInteractionEnabled ? messageLabelledBy : undefined}\n        className={clsx(innerClass, {\n          [` str-chat__message-text-inner--is-emoji`]:\n            messageTextHasEmojisOnly(message) && !message.quoted_message,\n          [`str-chat__message-text-inner--has-attachment`]: hasAttachment,\n        })}\n        data-testid='message-text-inner-wrapper'\n        onClick={onMentionsClickMessage}\n        onKeyDown={isMentionsInteractionEnabled ? handleMentionsKeyDown : undefined}\n        onMouseOver={onMentionsHoverMessage}\n        tabIndex={isMentionsInteractionEnabled ? 0 : undefined}\n      >\n        {unsafeHTML && message.html ? (\n          <div dangerouslySetInnerHTML={{ __html: message.html }} id={messageTextId} />\n        ) : (\n          <div id={messageTextId}>{messageText}</div>\n        )}\n      </div>\n    </div>\n  );\n};\n\nexport const MessageText = React.memo(\n  UnMemoizedMessageTextComponent,\n) as typeof UnMemoizedMessageTextComponent;\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, { useState } from 'react';\nimport type { LocalMessage } from 'stream-chat';\nimport type { TimestampFormatterOptions } from '../../i18n/types';\nimport { PopperTooltip } from '../Tooltip';\nimport { useEnterLeaveHandlers } from '../Tooltip/hooks';\nimport { Timestamp as DefaultTimestamp } from './Timestamp';\nimport {\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\n\nexport type MessageEditedIndicatorProps = TimestampFormatterOptions & {\n  /* Adds a CSS class name to the component's outer 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 UnMemoizedMessageEditedIndicator = (props: MessageEditedIndicatorProps) => {\n  const { customClass, message: propMessage, ...timestampProps } = props;\n  const { message: contextMessage } = useMessageContext('MessageEditedIndicator');\n  const { t } = useTranslationContext('MessageEditedIndicator');\n  const { Timestamp = DefaultTimestamp } = useComponentContext('MessageEditedIndicator');\n  const message = propMessage ?? contextMessage;\n\n  const [referenceElement, setReferenceElement] = useState<HTMLSpanElement | null>(null);\n  const { handleEnter, handleLeave, tooltipVisible } =\n    useEnterLeaveHandlers<HTMLSpanElement>();\n\n  if (!message?.message_text_updated_at) {\n    return null;\n  }\n\n  return (\n    <span\n      className={customClass ?? 'str-chat__message-edited-indicator'}\n      data-testid='message-edited-indicator'\n      onMouseEnter={handleEnter}\n      onMouseLeave={handleLeave}\n      ref={setReferenceElement}\n    >\n      {t('Edited')}\n      <PopperTooltip\n        offset={[0, 5]}\n        placement='top'\n        referenceElement={referenceElement}\n        visible={tooltipVisible}\n      >\n        <Timestamp timestamp={message.message_text_updated_at} {...timestampProps} />\n      </PopperTooltip>\n    </span>\n  );\n};\n\nexport const MessageEditedIndicator = React.memo(\n  UnMemoizedMessageEditedIndicator,\n) as typeof UnMemoizedMessageEditedIndicator;\n","import type { LocalMessage } from 'stream-chat';\nimport React, { useCallback, useMemo } from 'react';\nimport { IconTranslate } from '../Icons';\nimport {\n  getTranslatedMessageText,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport { Button } from '../Button';\n\nexport type TranslationIndicatorProps = {\n  message?: LocalMessage;\n};\n\nexport const MessageTranslationIndicator = ({\n  message: propMessage,\n}: TranslationIndicatorProps) => {\n  const { t, userLanguage } = useTranslationContext();\n  const {\n    message: contextMessage,\n    setTranslationView,\n    translationView,\n  } = useMessageContext('MessageTranslationIndicator');\n  const message = propMessage ?? contextMessage;\n\n  const translatedTextForUser = useMemo(\n    () => getTranslatedMessageText({ language: userLanguage, message }),\n    [userLanguage, message],\n  );\n\n  const hasTranslationForUserLanguage = useMemo(\n    () =>\n      translatedTextForUser != null &&\n      message?.text !== undefined &&\n      translatedTextForUser !== message.text,\n    [translatedTextForUser, message?.text],\n  );\n\n  const viewingOriginal = useMemo(\n    () =>\n      translationView === 'original' ||\n      (translationView === undefined && !hasTranslationForUserLanguage),\n    [translationView, hasTranslationForUserLanguage],\n  );\n\n  const handleToggle = useCallback(() => {\n    setTranslationView?.(viewingOriginal ? 'translated' : 'original');\n  }, [setTranslationView, viewingOriginal]);\n\n  const sourceLanguageName = useMemo(() => {\n    const sourceLanguageCode = message?.i18n?.language;\n    if (!sourceLanguageCode) return '';\n    const languageKey = 'language/' + sourceLanguageCode;\n    const translatedName = t(languageKey);\n    return translatedName && translatedName !== languageKey\n      ? translatedName\n      : sourceLanguageCode;\n  }, [message?.i18n?.language, t]);\n\n  if (!message?.i18n || !setTranslationView) return null;\n  if (!hasTranslationForUserLanguage) return null;\n\n  return (\n    <div className='str-chat__message-translation-indicator'>\n      <IconTranslate />\n      <span className='str-chat__message-translation-indicator__sign'>\n        {viewingOriginal\n          ? t('Original')\n          : sourceLanguageName\n            ? t('Translated from {{ language }}', { language: sourceLanguageName })\n            : t('Translated')}\n      </span>\n      <span> · </span>\n      <Button\n        className='str-chat__message-translation-indicator__translation-toggle'\n        onClick={handleToggle}\n        type='button'\n      >\n        {viewingOriginal ? t('View translation') : t('View original')}\n      </Button>\n    </div>\n  );\n};\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  FileVideoIcon,\n}: Pick<IconComponents<Props>, GeneralContentTypeComponent>) {\n  return {\n    'audio/': FileAudioIcon,\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      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/'];\n  if (mimeType.startsWith('video/')) return theMap['video/'];\n  if (mimeType.startsWith('image/')) return theMap['image/'];\n  if (mimeType.startsWith('text/')) return theMap['text/'];\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 { formatTime } from './formatTime';\n\ntype DurationDisplayProps = {\n  /** Whether audio is currently playing */\n  isPlaying: boolean;\n  /** Optional className for styling */\n  className?: string;\n  /** Total duration in seconds */\n  duration?: number;\n  /** Elapsed time in seconds */\n  secondsElapsed?: number;\n  /** Show remaining time instead of elapsed when possible */\n  showRemaining?: boolean;\n};\n\nexport function DurationDisplay({\n  className,\n  duration,\n  isPlaying,\n  secondsElapsed,\n  showRemaining = false,\n}: DurationDisplayProps) {\n  const remainingSeconds =\n    duration != null && secondsElapsed != null\n      ? Math.max(0, duration - secondsElapsed)\n      : undefined;\n  const formattedDuration = formatTime(duration);\n  const formattedSecondsElapsed = formatTime(secondsElapsed);\n  const formattedRemaining = formatTime(remainingSeconds);\n\n  const shouldShowElapsed =\n    !!secondsElapsed && secondsElapsed > 0 && secondsElapsed < (duration || 0);\n  const canShowRemaining = showRemaining && duration != null && secondsElapsed != null;\n  const primaryValue = showRemaining ? formattedRemaining : formattedSecondsElapsed;\n  const showPrimary = (canShowRemaining || shouldShowElapsed) && !!primaryValue;\n  const showDuration = !showPrimary && !!formattedDuration;\n\n  return (\n    <div\n      className={clsx(\n        'str-chat__duration-display',\n        {\n          'str-chat__duration-display--hasProgress': !!secondsElapsed,\n          'str-chat__duration-display--isPlaying': isPlaying,\n        },\n        className,\n      )}\n    >\n      {showPrimary && (\n        <span className='str-chat__duration-display__time-elapsed'>{primaryValue}</span>\n      )}\n      {showDuration && (\n        <span className='str-chat__duration-display__duration'>{formattedDuration}</span>\n      )}\n    </div>\n  );\n}\n","import React from 'react';\nimport { Button } from '../../Button';\nimport clsx from 'clsx';\n\nexport type PlaybackRateButtonProps = React.ComponentProps<'button'>;\n\nexport const PlaybackRateButton = ({\n  children,\n  className,\n  ...rest\n}: PlaybackRateButtonProps) => (\n  <Button\n    data-testid='playback-rate-button'\n    {...rest}\n    className={clsx('str-chat__playback-rate-button', className)}\n  >\n    {children}\n  </Button>\n);\n","import type { KeyboardEvent } from 'react';\nimport type { SeekFn as AudioPlayerSeekFn } from '../AudioPlayer';\n\ntype SeekParams = Parameters<AudioPlayerSeekFn>[0];\n\nconst DEFAULT_KEYBOARD_PROGRESS_STEP = 5;\nconst DEFAULT_KEYBOARD_PROGRESS_LARGE_STEP = 10;\n\nconst getNextProgressByKey = ({\n  key,\n  largeStep,\n  progress,\n  step,\n}: {\n  key: string;\n  largeStep: number;\n  progress: number;\n  step: number;\n}) => {\n  switch (key) {\n    case 'ArrowRight':\n    case 'ArrowUp':\n      return Math.min(100, progress + step);\n    case 'ArrowLeft':\n    case 'ArrowDown':\n      return Math.max(0, progress - step);\n    case 'PageUp':\n      return Math.min(100, progress + largeStep);\n    case 'PageDown':\n      return Math.max(0, progress - largeStep);\n    case 'Home':\n      return 0;\n    case 'End':\n      return 100;\n    default:\n      return null;\n  }\n};\n\nexport const handleProgressBarKeyboardSeek = ({\n  event,\n  largeStep = DEFAULT_KEYBOARD_PROGRESS_LARGE_STEP,\n  progress,\n  seek,\n  step = DEFAULT_KEYBOARD_PROGRESS_STEP,\n}: {\n  event: KeyboardEvent<HTMLDivElement>;\n  largeStep?: number;\n  progress: number;\n  seek: (params: SeekParams) => void;\n  step?: number;\n}) => {\n  const nextProgress = getNextProgressByKey({\n    key: event.key,\n    largeStep,\n    progress,\n    step,\n  });\n\n  if (nextProgress === null) return;\n\n  event.preventDefault();\n  const currentTarget = event.currentTarget;\n  const { width, x } = currentTarget.getBoundingClientRect();\n\n  seek({\n    clientX: x + (width * nextProgress) / 100,\n    currentTarget,\n  });\n};\n","import type { TFunction } from 'i18next';\nimport { formatTime } from './formatTime';\n\ntype GetAudioTrackSliderAriaValueTextParams = {\n  durationSeconds?: number;\n  progress: number;\n  secondsElapsed?: number;\n  t: TFunction;\n};\n\nexport const getAudioTrackSliderAriaValueText = ({\n  durationSeconds,\n  progress,\n  secondsElapsed,\n  t,\n}: GetAudioTrackSliderAriaValueTextParams) => {\n  const normalizedProgress = Math.max(0, Math.min(100, progress));\n\n  if (typeof durationSeconds === 'number' && Number.isFinite(durationSeconds)) {\n    const normalizedDuration = Math.max(0, durationSeconds);\n    const elapsed =\n      typeof secondsElapsed === 'number' && Number.isFinite(secondsElapsed)\n        ? Math.max(0, Math.min(secondsElapsed, normalizedDuration))\n        : (normalizedDuration * normalizedProgress) / 100;\n    const formattedElapsed = formatTime(elapsed, 'floor');\n    const formattedDuration = formatTime(normalizedDuration, 'floor');\n\n    if (formattedElapsed && formattedDuration) {\n      return t('aria/Audio position {{ elapsed }} of {{ duration }}', {\n        duration: formattedDuration,\n        elapsed: formattedElapsed,\n      });\n    }\n  }\n\n  return t('aria/Audio position {{ progress }} percent', {\n    progress: Math.round(normalizedProgress),\n  });\n};\n","import type { PointerEventHandler } from 'react';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { SeekFn as AudioPlayerSeekFn } from '../AudioPlayer';\n\ntype SeekParams = Parameters<AudioPlayerSeekFn>[0];\n\ntype UseInteractiveProgressBarParams = {\n  progress?: number;\n  seek: (params: SeekParams) => void;\n};\n\nconst getAvailableTrackWidth = (trackRoot: HTMLDivElement | null) => {\n  if (!trackRoot) return 0;\n\n  const parent = trackRoot.parentElement;\n  if (!parent) return trackRoot.getBoundingClientRect().width;\n\n  const parentWidth = parent.getBoundingClientRect().width;\n  const computedStyle = window.getComputedStyle(parent);\n  const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;\n  const paddingRight = parseFloat(computedStyle.paddingRight) || 0;\n  const rawColumnGap = computedStyle.columnGap || computedStyle.gap;\n  const parsedColumnGap = parseFloat(rawColumnGap);\n  const columnGap = Number.isNaN(parsedColumnGap) ? 0 : parsedColumnGap;\n  const gapCount = Math.max(0, parent.children.length - 1);\n  const totalGapsWidth = columnGap * gapCount;\n  const siblingsWidth = Array.from(parent.children).reduce((total, child) => {\n    if (child === trackRoot) return total;\n    return total + child.getBoundingClientRect().width;\n  }, 0);\n\n  return Math.max(\n    0,\n    parentWidth - paddingLeft - paddingRight - totalGapsWidth - siblingsWidth,\n  );\n};\n\nexport const useInteractiveProgressBar = ({\n  progress = 0,\n  seek,\n}: UseInteractiveProgressBarParams) => {\n  const isDragging = useRef(false);\n  const [availableTrackWidth, setAvailableTrackWidth] = useState(0);\n  const [root, setRoot] = useState<HTMLDivElement | null>(null);\n  const [progressIndicator, setProgressIndicator] = useState<HTMLDivElement | null>(null);\n  const lastIndicatorWidth = useRef(0);\n\n  const handleDragStart: PointerEventHandler<HTMLDivElement> = (e) => {\n    e.preventDefault();\n    if (!progressIndicator) return;\n\n    isDragging.current = true;\n    progressIndicator.style.cursor = 'grabbing';\n    root?.classList.add('str-chat__wave-progress-bar__track--dragging');\n  };\n\n  const handleDrag: PointerEventHandler<HTMLDivElement> = (e) => {\n    if (!isDragging.current) return;\n    // Snapshot the event because seek is throttled.\n    seek({ ...e });\n  };\n\n  const handleDragStop = useCallback(() => {\n    if (!progressIndicator) return;\n\n    isDragging.current = false;\n    progressIndicator.style.removeProperty('cursor');\n    root?.classList.remove('str-chat__wave-progress-bar__track--dragging');\n  }, [progressIndicator, root]);\n\n  useEffect(() => {\n    document.addEventListener('pointerup', handleDragStop);\n\n    return () => {\n      document.removeEventListener('pointerup', handleDragStop);\n    };\n  }, [handleDragStop]);\n\n  useEffect(() => {\n    if (!root || typeof ResizeObserver === 'undefined') return;\n\n    const observer = new ResizeObserver(([entry]) => {\n      const nextAvailableWidth = getAvailableTrackWidth(entry.target as HTMLDivElement);\n      setAvailableTrackWidth(nextAvailableWidth || entry.contentRect.width);\n    });\n\n    observer.observe(root);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [root]);\n\n  useLayoutEffect(() => {\n    if (root) {\n      setAvailableTrackWidth(getAvailableTrackWidth(root));\n    }\n\n    if (progressIndicator) {\n      lastIndicatorWidth.current = progressIndicator.getBoundingClientRect().width;\n    }\n  }, [progressIndicator, root]);\n\n  const indicatorLeft =\n    progress === 0 || !progressIndicator\n      ? 0\n      : Math.max(0, availableTrackWidth - lastIndicatorWidth.current) * (progress / 100) +\n        1;\n\n  return {\n    availableTrackWidth,\n    handleDrag,\n    handleDragStart,\n    handleDragStop,\n    indicatorLeft,\n    root,\n    setProgressIndicator,\n    setRoot,\n  };\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport { handleProgressBarKeyboardSeek } from './keyboardSeek';\nimport { getAudioTrackSliderAriaValueText } from './progressBarA11y';\nimport { useInteractiveProgressBar } from './useInteractiveProgressBar';\nimport type { SeekFn as AudioPlayerSeekFn } from '../AudioPlayer';\nimport { useTranslationContext } from '../../../context';\n\ntype SeekParams = Parameters<AudioPlayerSeekFn>[0];\n\nexport type ProgressBarProps = {\n  /** Progress expressed in fractional number value btw 0 and 100. */\n  progress: number;\n  /** Total track duration in seconds. */\n  durationSeconds?: number;\n  /** Current elapsed position in seconds. */\n  secondsElapsed?: number;\n  seek: (params: SeekParams) => void;\n} & Pick<React.ComponentProps<'div'>, 'className'>;\n\nexport const ProgressBar = ({\n  className,\n  durationSeconds,\n  progress,\n  secondsElapsed,\n  seek,\n}: ProgressBarProps) => {\n  const { t } = useTranslationContext('ProgressBar');\n  const {\n    handleDrag,\n    handleDragStart,\n    handleDragStop,\n    indicatorLeft,\n    setProgressIndicator,\n    setRoot,\n  } = useInteractiveProgressBar({ progress, seek });\n  const normalizedProgress = Math.max(0, Math.min(100, progress));\n  const ariaValueText = getAudioTrackSliderAriaValueText({\n    durationSeconds,\n    progress: normalizedProgress,\n    secondsElapsed,\n    t,\n  });\n\n  return (\n    <div\n      aria-label={t('aria/Seek audio position')}\n      aria-orientation='horizontal'\n      aria-valuemax={100}\n      aria-valuemin={0}\n      aria-valuenow={Math.round(normalizedProgress)}\n      aria-valuetext={ariaValueText}\n      className={clsx(\n        'str-chat__message-attachment-audio-widget--progress-track',\n        className,\n      )}\n      data-progress={normalizedProgress}\n      data-testid='audio-progress'\n      onClick={seek}\n      onKeyDown={(event) =>\n        handleProgressBarKeyboardSeek({ event, progress: normalizedProgress, seek })\n      }\n      onPointerDown={handleDragStart}\n      onPointerMove={handleDrag}\n      onPointerUp={handleDragStop}\n      ref={setRoot}\n      role='slider'\n      style={\n        {\n          '--str-chat__message-attachment-audio-widget-progress':\n            normalizedProgress + '%',\n        } as React.CSSProperties\n      }\n      tabIndex={0}\n    >\n      <div\n        aria-hidden='true'\n        className='str-chat__message-attachment-audio-widget--progress-indicator'\n        ref={setProgressIndicator}\n        style={{ insetInlineStart: `${indicatorLeft}px` }}\n      />\n    </div>\n  );\n};\n","import type { ReactNode } from 'react';\nimport type { Attachment, SharedLocationResponse } from 'stream-chat';\nimport type { ATTACHMENT_GROUPS_ORDER, AttachmentProps } from './Attachment';\nimport * as linkify from 'linkifyjs';\n\nexport const SUPPORTED_VIDEO_FORMATS = [\n  'video/mp4',\n  'video/ogg',\n  'video/webm',\n  'video/quicktime',\n];\n\nexport type AttachmentComponentType =\n  | 'card'\n  | 'gallery'\n  | 'giphy'\n  | 'image'\n  | 'media'\n  | 'audio'\n  | 'voiceRecording'\n  | 'file'\n  | 'geolocation'\n  | 'unsupported';\n\nexport type AttachmentContainerType = (typeof ATTACHMENT_GROUPS_ORDER)[number];\n\nexport type GroupedRenderedAttachment = Record<AttachmentContainerType, ReactNode[]>;\n\nexport type GalleryAttachment = {\n  items: Attachment[];\n  type: 'gallery';\n};\n\nexport type RenderAttachmentProps = Omit<AttachmentProps, 'attachments'> & {\n  attachment: Attachment;\n};\n\nexport type RenderGalleryProps = Omit<AttachmentProps, 'attachments'> & {\n  attachment: GalleryAttachment;\n};\n\nexport type RenderMediaProps = Omit<AttachmentProps, 'attachments'> & {\n  attachments: Attachment[];\n};\n\nexport type GeolocationContainerProps = Omit<AttachmentProps, 'attachments'> & {\n  location: SharedLocationResponse;\n};\n\n// This identity function determines attachment type specific to React.\n// Once made sure other SDKs support the same logic, move to stream-chat-js\nexport const isGalleryAttachmentType = (\n  attachment: Attachment | GalleryAttachment,\n): attachment is GalleryAttachment =>\n  Array.isArray((attachment as GalleryAttachment).items);\n\nexport const isSvgAttachment = (attachment: Attachment) => {\n  const filename = attachment.fallback || '';\n  return filename.toLowerCase().endsWith('.svg');\n};\n\nexport const divMod = (num: number, divisor: number) => [\n  Math.floor(num / divisor),\n  num % divisor,\n];\n\nexport const displayDuration = (totalSeconds?: number) => {\n  if (!totalSeconds || totalSeconds < 0) return '00:00';\n\n  const [hours, hoursLeftover] = divMod(totalSeconds, 3600);\n  const [minutes, seconds] = divMod(hoursLeftover, 60);\n  const roundedSeconds = Math.ceil(seconds);\n  const prependHrsZero = String(hours).padStart(2, '0');\n  const prependMinZero = String(minutes).padStart(2, '0');\n  const prependSecZero = String(roundedSeconds).padStart(2, '0');\n  const minSec = `${prependMinZero}:${prependSecZero}`;\n\n  return hours ? `${prependHrsZero}:` + minSec : minSec;\n};\nexport function getCssDimensionsVariables(url: string) {\n  const cssVars = {\n    '--original-height': 1000000,\n    '--original-width': 1000000,\n  } as Record<string, number>;\n\n  if (linkify.test(url, 'url')) {\n    const urlParams = new URL(url).searchParams;\n    const oh = Number(urlParams.get('oh'));\n    const ow = Number(urlParams.get('ow'));\n    const originalHeight = oh > 1 ? oh : 1000000;\n    const originalWidth = ow > 1 ? ow : 1000000;\n    cssVars['--original-width'] = originalWidth;\n    cssVars['--original-height'] = originalHeight;\n  }\n\n  return cssVars;\n}\n","import { divMod } from './utils';\n\nexport const resampleWaveformData = (waveformData: number[], amplitudesCount: number) =>\n  waveformData.length === amplitudesCount\n    ? waveformData\n    : waveformData.length > amplitudesCount\n      ? downSample(waveformData, amplitudesCount)\n      : upSample(waveformData, amplitudesCount);\n\n/**\n * The downSample function uses the Largest-Triangle-Three-Buckets (LTTB) algorithm.\n * See the thesis Downsampling Time Series for Visual Representation by Sveinn Steinarsson for more (https://skemman.is/bitstream/1946/15343/3/SS_MSthesis.pdf)\n * @param data\n * @param targetOutputSize\n */\nexport function downSample(data: number[], targetOutputSize: number): number[] {\n  if (data.length <= targetOutputSize || targetOutputSize === 0) {\n    return data;\n  }\n\n  if (targetOutputSize === 1) return [mean(data)];\n\n  const result: number[] = [];\n  // bucket size adjusted due to the fact that the first and the last item in the original data array is kept in target output\n  const bucketSize = (data.length - 2) / (targetOutputSize - 2);\n  let lastSelectedPointIndex = 0;\n  result.push(data[lastSelectedPointIndex]); // Always add the first point\n  let maxAreaPoint, maxArea, triangleArea;\n\n  for (let bucketIndex = 1; bucketIndex < targetOutputSize - 1; bucketIndex++) {\n    const previousBucketRefPoint = data[lastSelectedPointIndex];\n    const nextBucketMean = getNextBucketMean(data, bucketIndex, bucketSize);\n\n    const currentBucketStartIndex = Math.floor((bucketIndex - 1) * bucketSize) + 1;\n    const nextBucketStartIndex = Math.floor(bucketIndex * bucketSize) + 1;\n    const countUnitsBetweenAtoC = 1 + nextBucketStartIndex - currentBucketStartIndex;\n\n    maxArea = triangleArea = -1;\n\n    for (\n      let currentPointIndex = currentBucketStartIndex;\n      currentPointIndex < nextBucketStartIndex;\n      currentPointIndex++\n    ) {\n      const countUnitsBetweenAtoB =\n        Math.abs(currentPointIndex - currentBucketStartIndex) + 1;\n      const countUnitsBetweenBtoC = countUnitsBetweenAtoC - countUnitsBetweenAtoB;\n      const currentPointValue = data[currentPointIndex];\n\n      triangleArea = triangleAreaHeron(\n        triangleBase(\n          Math.abs(previousBucketRefPoint - currentPointValue),\n          countUnitsBetweenAtoB,\n        ),\n        triangleBase(Math.abs(currentPointValue - nextBucketMean), countUnitsBetweenBtoC),\n        triangleBase(\n          Math.abs(previousBucketRefPoint - nextBucketMean),\n          countUnitsBetweenAtoC,\n        ),\n      );\n\n      if (triangleArea > maxArea) {\n        maxArea = triangleArea;\n        maxAreaPoint = data[currentPointIndex];\n        lastSelectedPointIndex = currentPointIndex;\n      }\n    }\n\n    if (typeof maxAreaPoint !== 'undefined') result.push(maxAreaPoint);\n  }\n\n  result.push(data[data.length - 1]); // Always add the last point\n\n  return result;\n}\n\nconst triangleAreaHeron = (a: number, b: number, c: number) => {\n  const s = (a + b + c) / 2;\n  return Math.sqrt(s * (s - a) * (s - b) * (s - c));\n};\nconst triangleBase = (a: number, b: number) => Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\nconst mean = (values: number[]) =>\n  values.reduce((acc, value) => acc + value, 0) / values.length;\nconst getNextBucketMean = (\n  data: number[],\n  currentBucketIndex: number,\n  bucketSize: number,\n) => {\n  const nextBucketStartIndex = Math.floor(currentBucketIndex * bucketSize) + 1;\n  let nextNextBucketStartIndex = Math.floor((currentBucketIndex + 1) * bucketSize) + 1;\n  nextNextBucketStartIndex =\n    nextNextBucketStartIndex < data.length ? nextNextBucketStartIndex : data.length;\n\n  return mean(data.slice(nextBucketStartIndex, nextNextBucketStartIndex));\n};\nexport const upSample = (values: number[], targetSize: number) => {\n  if (!values.length) {\n    console.warn('Cannot extend empty array of amplitudes.');\n    return values;\n  }\n\n  if (values.length > targetSize) {\n    console.warn(\n      'Requested to extend the waveformData that is longer than the target list size',\n    );\n    return values;\n  }\n\n  if (targetSize === values.length) return values;\n\n  // eslint-disable-next-line prefer-const\n  let [bucketSize, remainder] = divMod(targetSize, values.length);\n  const result: number[] = [];\n\n  for (let i = 0; i < values.length; i++) {\n    const extra = remainder && remainder-- ? 1 : 0;\n    result.push(...Array(bucketSize + extra).fill(values[i]));\n  }\n  return result;\n};\n","import throttle from 'lodash.throttle';\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { resampleWaveformData } from '../../Attachment/audioSampling';\nimport type { SeekFn as AudioPlayerSeekFn } from '../AudioPlayer';\nimport { handleProgressBarKeyboardSeek } from './keyboardSeek';\nimport { getAudioTrackSliderAriaValueText } from './progressBarA11y';\nimport { useInteractiveProgressBar } from './useInteractiveProgressBar';\nimport { useTranslationContext } from '../../../context';\n\ntype SeekParams = Parameters<AudioPlayerSeekFn>[0];\n\ntype WaveProgressBarProps = {\n  /** Function that allows to change the track progress */\n  seek: (params: SeekParams) => void;\n  /** The array of fractional number values between 0 and 1 representing the height of amplitudes */\n  waveformData: number[];\n  /** Progress expressed in fractional number value btw 0 and 100. */\n  progress?: number;\n  /** Total track duration in seconds. */\n  durationSeconds?: number;\n  /** Current elapsed position in seconds. */\n  secondsElapsed?: number;\n  /** Absolute gap width between bars in px (overrides computed gap var). */\n  amplitudeBarGapWidthPx?: number;\n  relativeAmplitudeBarWidth?: number;\n  relativeAmplitudeGap?: number;\n};\n\nexport const WaveProgressBar = ({\n  amplitudeBarGapWidthPx,\n  durationSeconds,\n  progress = 0,\n  relativeAmplitudeBarWidth = 2,\n  relativeAmplitudeGap = 1,\n  secondsElapsed,\n  seek,\n  waveformData,\n}: WaveProgressBarProps) => {\n  const { t } = useTranslationContext('WaveProgressBar');\n  const [trackAxisX, setTrackAxisX] = useState<{\n    barCount: number;\n    barWidth: number;\n    gap: number;\n  }>();\n  const lastAvailableTrackWidth = useRef<number>(0);\n  const minAmplitudeBarWidthRef = useRef<number | null>(null);\n  const lastMinAmplitudeBarWidthUsed = useRef<number | null>(null);\n  const {\n    availableTrackWidth,\n    handleDrag,\n    handleDragStart,\n    handleDragStop,\n    indicatorLeft,\n    root,\n    setProgressIndicator,\n    setRoot,\n  } = useInteractiveProgressBar({ progress, seek });\n  const normalizedProgress = Math.max(0, Math.min(100, progress));\n\n  const getTrackAxisX = useMemo(\n    () =>\n      throttle((availableWidth: number) => {\n        const minAmplitudeBarWidth = minAmplitudeBarWidthRef.current;\n        const hasMinWidthChanged =\n          minAmplitudeBarWidth !== lastMinAmplitudeBarWidthUsed.current;\n        if (availableWidth === lastAvailableTrackWidth.current && !hasMinWidthChanged) {\n          return;\n        }\n        lastAvailableTrackWidth.current = availableWidth;\n        lastMinAmplitudeBarWidthUsed.current = minAmplitudeBarWidth;\n        const possibleAmpCount = Math.floor(\n          availableWidth / (relativeAmplitudeGap + relativeAmplitudeBarWidth),\n        );\n        const amplitudeBarWidthToGapRatio =\n          relativeAmplitudeBarWidth / (relativeAmplitudeBarWidth + relativeAmplitudeGap);\n        const maxCountByMinWidth =\n          typeof minAmplitudeBarWidth === 'number' && minAmplitudeBarWidth > 0\n            ? Math.floor(\n                (availableWidth * amplitudeBarWidthToGapRatio) / minAmplitudeBarWidth,\n              )\n            : possibleAmpCount;\n        const barCount = Math.max(0, Math.min(possibleAmpCount, maxCountByMinWidth));\n        const barWidth =\n          barCount && (availableWidth / barCount) * amplitudeBarWidthToGapRatio;\n\n        setTrackAxisX({\n          barCount,\n          barWidth,\n          gap: barWidth * (relativeAmplitudeGap / relativeAmplitudeBarWidth),\n        });\n      }, 1),\n    [relativeAmplitudeBarWidth, relativeAmplitudeGap],\n  );\n\n  const resampledWaveformData = useMemo(\n    () => (trackAxisX ? resampleWaveformData(waveformData, trackAxisX.barCount) : []),\n    [trackAxisX, waveformData],\n  );\n\n  useLayoutEffect(() => {\n    if (availableTrackWidth > 0) {\n      getTrackAxisX(availableTrackWidth);\n    }\n  }, [availableTrackWidth, getTrackAxisX]);\n\n  useLayoutEffect(() => {\n    if (!root || typeof window === 'undefined') return;\n    const amplitudeBar = root.querySelector<HTMLElement>(\n      '.str-chat__wave-progress-bar__amplitude-bar',\n    );\n    if (!amplitudeBar) return;\n    const computedStyle = window.getComputedStyle(amplitudeBar);\n    const parsedMinWidth = parseFloat(computedStyle.minWidth);\n    if (!Number.isNaN(parsedMinWidth) && parsedMinWidth > 0) {\n      minAmplitudeBarWidthRef.current = parsedMinWidth;\n    }\n    if (availableTrackWidth > 0) {\n      getTrackAxisX(availableTrackWidth);\n    }\n  }, [availableTrackWidth, getTrackAxisX, root, trackAxisX?.barCount]);\n\n  if (!waveformData.length || trackAxisX?.barCount === 0) return null;\n\n  const amplitudeGapWidth = amplitudeBarGapWidthPx ?? trackAxisX?.gap;\n  const ariaValueText = getAudioTrackSliderAriaValueText({\n    durationSeconds,\n    progress: normalizedProgress,\n    secondsElapsed,\n    t,\n  });\n\n  return (\n    <div\n      aria-label={t('aria/Seek audio position')}\n      aria-orientation='horizontal'\n      aria-valuemax={100}\n      aria-valuemin={0}\n      aria-valuenow={Math.round(normalizedProgress)}\n      aria-valuetext={ariaValueText}\n      className={clsx('str-chat__wave-progress-bar__track', {\n        'str-chat__wave-progress-bar__track--playback-initiated': normalizedProgress > 0,\n      })}\n      data-testid='wave-progress-bar-track'\n      onClick={seek}\n      onKeyDown={(event) =>\n        handleProgressBarKeyboardSeek({ event, progress: normalizedProgress, seek })\n      }\n      onPointerDown={handleDragStart}\n      onPointerMove={handleDrag}\n      onPointerUp={handleDragStop}\n      ref={setRoot}\n      role='slider'\n      style={\n        {\n          '--str-chat__voice-recording-amplitude-bar-gap-width':\n            typeof amplitudeGapWidth === 'number' ? `${amplitudeGapWidth}px` : undefined,\n        } as React.CSSProperties\n      }\n      tabIndex={0}\n    >\n      {resampledWaveformData.map((amplitude, i) => (\n        <div\n          aria-hidden='true'\n          className={clsx('str-chat__wave-progress-bar__amplitude-bar', {\n            ['str-chat__wave-progress-bar__amplitude-bar--active']:\n              normalizedProgress > (i / resampledWaveformData.length) * 100,\n          })}\n          data-testid='amplitude-bar'\n          key={`amplitude-${i}`}\n          style={\n            {\n              '--str-chat__voice-recording-amplitude-bar-width':\n                trackAxisX?.barWidth + 'px',\n              '--str-chat__wave-progress-bar__amplitude-bar-height': amplitude\n                ? amplitude * 100 + '%'\n                : '0%',\n            } as React.CSSProperties\n          }\n        />\n      ))}\n      <div\n        aria-hidden='true'\n        className='str-chat__wave-progress-bar__progress-indicator'\n        data-testid='wave-progress-bar-progress-indicator'\n        ref={setProgressIndicator}\n        style={{\n          insetInlineStart: `${indicatorLeft}px`,\n        }}\n      />\n    </div>\n  );\n};\n","import React from 'react';\nimport type { Attachment } from 'stream-chat';\n\nimport {\n  FileSizeIndicator as DefaultFileSizeIndicator,\n  DownloadButton,\n} from './components';\nimport type { AudioPlayerState } from '../AudioPlayback/AudioPlayer';\nimport { useAudioPlayer } from '../AudioPlayback/WithAudioPlayback';\nimport { useStateStore } from '../../store';\nimport { useComponentContext, useMessageContext } from '../../context';\nimport type { AudioPlayer } from '../AudioPlayback/AudioPlayer';\nimport { PlayButton } from '../Button/PlayButton';\nimport { FileIcon } from '../FileIcon';\nimport { DurationDisplay, ProgressBar } from '../AudioPlayback';\n\ntype AudioAttachmentUIProps = {\n  audioPlayer: AudioPlayer;\n};\n\n// todo: finish creating a BaseAudioPlayer derived from VoiceRecordingPlayerUI and AudioAttachmentUI\nconst AudioAttachmentUI = ({ audioPlayer }: AudioAttachmentUIProps) => {\n  const { FileSizeIndicator = DefaultFileSizeIndicator } = useComponentContext();\n  const dataTestId = 'audio-widget';\n  const rootClassName = 'str-chat__message-attachment-audio-widget';\n\n  const { durationSeconds, isPlaying, progress, secondsElapsed } =\n    useStateStore(audioPlayer?.state, audioPlayerStateSelector) ?? {};\n\n  return (\n    <div className={rootClassName} data-testid={dataTestId}>\n      <div className='str-chat__message-attachment-audio-widget--play-controls'>\n        <PlayButton isPlaying={!!isPlaying} onClick={audioPlayer.togglePlay} />\n      </div>\n      <div className='str-chat__message-attachment-audio-widget--data'>\n        <div className='str-chat__message-attachment-audio-widget--text-first-row'>\n          <div className='str-chat__message-attachment-audio-widget--title'>\n            {audioPlayer.title}\n          </div>\n        </div>\n        <div className='str-chat__message-attachment-audio-widget--text-second-row'>\n          {durationSeconds ? (\n            <>\n              <DurationDisplay\n                duration={durationSeconds}\n                isPlaying={!!isPlaying}\n                secondsElapsed={secondsElapsed}\n              />\n              <ProgressBar\n                durationSeconds={durationSeconds}\n                progress={progress ?? 0}\n                secondsElapsed={secondsElapsed}\n                seek={audioPlayer.seek}\n              />\n            </>\n          ) : (\n            <>\n              <FileSizeIndicator fileSize={audioPlayer.fileSize} />\n              <ProgressBar\n                durationSeconds={durationSeconds}\n                progress={progress ?? 0}\n                secondsElapsed={secondsElapsed}\n                seek={audioPlayer.seek}\n              />\n            </>\n          )}\n        </div>\n      </div>\n      <FileIcon className='str-chat__file-icon' mimeType={audioPlayer.mimeType} />\n      <DownloadButton assetUrl={audioPlayer.src} suggestedFileName={audioPlayer.title} />\n    </div>\n  );\n};\n\nexport type AudioProps = {\n  attachment: Attachment;\n};\n\nconst audioPlayerStateSelector = (state: AudioPlayerState) => ({\n  durationSeconds: state.durationSeconds,\n  isPlaying: state.isPlaying,\n  progress: state.progressPercent,\n  secondsElapsed: state.secondsElapsed,\n});\n\n/**\n * Audio attachment with play/pause button and progress bar\n */\nexport const Audio = (props: AudioProps) => {\n  const {\n    attachment: { asset_url, duration, file_size, mime_type, title },\n  } = props;\n\n  /**\n   * Introducing message context. This could be breaking change, therefore the fallback to {} is provided.\n   * If this component is used outside the message context, then there will be no audio player namespacing\n   * => scrolling away from the message in virtualized ML would create a new AudioPlayer instance.\n   *\n   * Edge case: the requester (message) has multiple attachments with the same assetURL - does not happen\n   * with the default SDK components, but can be done with custom API calls.In this case all the Audio\n   * widgets will share the state.\n   */\n  const { message, threadList } = useMessageContext() ?? {};\n\n  const audioPlayer = useAudioPlayer({\n    durationSeconds: duration,\n    fileSize: file_size,\n    mimeType: mime_type,\n    requester:\n      message?.id &&\n      `${threadList ? (message.parent_id ?? message.id) : ''}${message.id}`,\n    src: asset_url,\n    title,\n    waveformData: props.attachment.waveform_data,\n  });\n\n  return audioPlayer ? <AudioAttachmentUI audioPlayer={audioPlayer} /> : null;\n};\n","import React, { useEffect, useMemo, useRef } from 'react';\nimport type { Action, Attachment } from 'stream-chat';\n\nimport { useTranslationContext } from '../../context';\n\nimport type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';\nimport { Button } from '../Button';\nimport clsx from 'clsx';\n\nexport type AttachmentActionsProps = Attachment & {\n  /** A list of actions */\n  actions: Action[];\n  /** Unique id for action button key. Key is generated by concatenating this id with action value - {`${id}-${action.value}`} */\n  id: string;\n  /** The text for the form input */\n  text: string;\n  /** Click event handler */\n  actionHandler?: ActionHandlerReturnType;\n  /** Which action should be focused on initial render (match by action.value) */\n  defaultFocusedActionValue?: string;\n};\n\nexport type AttachmentActionsDefaultFocusByType = Partial<\n  Record<NonNullable<Attachment['type']>, string>\n>;\n\nexport const defaultAttachmentActionsDefaultFocus: AttachmentActionsDefaultFocusByType = {\n  giphy: 'send',\n};\n\nconst UnMemoizedAttachmentActions = (props: AttachmentActionsProps) => {\n  const { actionHandler, actions, defaultFocusedActionValue, id, text } = props;\n  const { t } = useTranslationContext('UnMemoizedAttachmentActions');\n  const buttonRefs = useRef<Array<HTMLButtonElement | null>>([]);\n\n  const handleActionClick = (\n    event: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n    name?: string,\n    value?: string,\n  ) => actionHandler?.(name, value, event);\n\n  const knownActionText = useMemo<Record<string, string>>(\n    () => ({\n      Cancel: t('Cancel'),\n      Send: t('Send'),\n      Shuffle: t('Shuffle'),\n    }),\n    [t],\n  );\n\n  const focusIndex = useMemo(() => {\n    if (!defaultFocusedActionValue) return null;\n    const index = actions.findIndex(\n      (action) => action.value === defaultFocusedActionValue,\n    );\n    return index >= 0 ? index : null;\n  }, [actions, defaultFocusedActionValue]);\n\n  useEffect(() => {\n    if (focusIndex === null) return;\n    const button = buttonRefs.current[focusIndex];\n    if (button && document.activeElement !== button) {\n      button.focus();\n    }\n  }, [focusIndex]);\n\n  return (\n    <div className='str-chat__message-attachment-actions'>\n      <div className='str-chat__message-attachment-actions-form'>\n        <span>{text}</span>\n        {actions.map((action, index) => (\n          <Button\n            appearance='ghost'\n            className={clsx(\n              `str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--${action.style}`,\n            )}\n            data-testid={`${action.name}`}\n            data-value={action.value}\n            key={`${id}-${action.value}`}\n            onClick={(event) => handleActionClick(event, action.name, action.value)}\n            ref={(element) => {\n              buttonRefs.current[index] = element;\n            }}\n            variant='secondary'\n          >\n            {action.text ? (knownActionText[action.text] ?? t(action.text)) : null}\n          </Button>\n        ))}\n      </div>\n    </div>\n  );\n};\n\n/**\n * A component for rendering the actions you can take on an attachment.\n */\nexport const AttachmentActions = React.memo(\n  UnMemoizedAttachmentActions,\n) as typeof UnMemoizedAttachmentActions;\n","import React from 'react';\nimport type { Attachment } from 'stream-chat';\n\nimport { FileSizeIndicator as DefaultFileSizeIndicator } from './components';\nimport { FileIcon } from '../FileIcon';\nimport {\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport {\n  type AudioPlayer,\n  type AudioPlayerState,\n  DurationDisplay,\n  PlaybackRateButton,\n  WaveProgressBar,\n} from '../AudioPlayback';\nimport { useAudioPlayer } from '../AudioPlayback/WithAudioPlayback';\nimport { useStateStore } from '../../store';\nimport { PlayButton } from '../Button';\n\nconst rootClassName = 'str-chat__message-attachment__voice-recording-widget';\n\nconst audioPlayerStateSelector = (state: AudioPlayerState) => ({\n  canPlayRecord: state.canPlayRecord,\n  durationSeconds: state.durationSeconds,\n  isPlaying: state.isPlaying,\n  playbackRate: state.currentPlaybackRate,\n  progress: state.progressPercent,\n  secondsElapsed: state.secondsElapsed,\n});\n\ntype VoiceRecordingPlayerUIProps = {\n  audioPlayer: AudioPlayer;\n};\n\n// todo: finish creating a BaseAudioPlayer derived from VoiceRecordingPlayerUI and AudioAttachmentUI\nconst VoiceRecordingPlayerUI = ({ audioPlayer }: VoiceRecordingPlayerUIProps) => {\n  const { FileSizeIndicator = DefaultFileSizeIndicator } = useComponentContext();\n  const { t } = useTranslationContext();\n  const {\n    canPlayRecord,\n    durationSeconds,\n    isPlaying,\n    playbackRate,\n    progress,\n    secondsElapsed,\n  } = useStateStore(audioPlayer?.state, audioPlayerStateSelector) ?? {};\n\n  return (\n    <div className={rootClassName} data-testid='voice-recording-widget'>\n      <div className='str-chat__message-attachment__voice-recording-widget__play-button-container'>\n        <PlayButton isPlaying={!!isPlaying} onClick={audioPlayer.togglePlay} />\n      </div>\n      <div className='str-chat__message-attachment__voice-recording-widget__metadata'>\n        <div className='str-chat__message-attachment__voice-recording-widget__audio-state'>\n          <div className='str-chat__message-attachment__voice-recording-widget__timer'>\n            {durationSeconds ? (\n              <DurationDisplay\n                duration={durationSeconds}\n                isPlaying={!!isPlaying}\n                secondsElapsed={secondsElapsed}\n                showRemaining\n              />\n            ) : (\n              <FileSizeIndicator\n                fileSize={audioPlayer.fileSize}\n                maximumFractionDigits={0}\n              />\n            )}\n          </div>\n          <WaveProgressBar\n            durationSeconds={durationSeconds}\n            progress={progress}\n            secondsElapsed={secondsElapsed}\n            seek={audioPlayer.seek}\n            waveformData={audioPlayer.waveformData || []}\n          />\n        </div>\n      </div>\n      <div className='str-chat__message-attachment__voice-recording-widget__right-section'>\n        <PlaybackRateButton\n          aria-label={t('Playback speed {{ rate }}x', {\n            rate: playbackRate?.toString() ?? '1',\n          })}\n          disabled={!canPlayRecord}\n          onClick={audioPlayer.increasePlaybackRate}\n        >\n          x{playbackRate?.toString()}\n        </PlaybackRateButton>\n      </div>\n    </div>\n  );\n};\n\nexport type VoiceRecordingPlayerProps = Pick<VoiceRecordingProps, 'attachment'> & {\n  /** An array of fractional numeric values of playback speed to override the defaults (1.0, 1.5, 2.0) */\n  playbackRates?: number[];\n};\n\nexport const VoiceRecordingPlayer = ({\n  attachment,\n  playbackRates,\n}: VoiceRecordingPlayerProps) => {\n  const { t } = useTranslationContext();\n  const {\n    asset_url,\n    duration = 0,\n    file_size,\n    mime_type,\n    title = t('Voice message'),\n    waveform_data,\n  } = attachment;\n\n  /**\n   * Introducing message context. This could be breaking change, therefore the fallback to {} is provided.\n   * If this component is used outside the message context, then there will be no audio player namespacing\n   * => scrolling away from the message in virtualized ML would create a new AudioPlayer instance.\n   *\n   * Edge case: the requester (message) has multiple attachments with the same assetURL - does not happen\n   * with the default SDK components, but can be done with custom API calls.In this case all the Audio\n   * widgets will share the state.\n   */\n  const { message, threadList } = useMessageContext() ?? {};\n\n  const audioPlayer = useAudioPlayer({\n    durationSeconds: duration ?? 0,\n    fileSize: file_size,\n    mimeType: mime_type,\n    playbackRates,\n    requester:\n      message?.id &&\n      `${threadList ? (message.parent_id ?? message.id) : ''}${message.id}`,\n    src: asset_url,\n    title,\n    waveformData: waveform_data,\n  });\n\n  return audioPlayer ? <VoiceRecordingPlayerUI audioPlayer={audioPlayer} /> : null;\n};\n\nexport type QuotedVoiceRecordingProps = Pick<VoiceRecordingProps, 'attachment'>;\n\nexport const QuotedVoiceRecording = ({ attachment }: QuotedVoiceRecordingProps) => {\n  const { FileSizeIndicator = DefaultFileSizeIndicator } = useComponentContext();\n  return (\n    <div className={rootClassName} data-testid='quoted-voice-recording-widget'>\n      <div className='str-chat__message-attachment__voice-recording-widget__metadata'>\n        <div className='str-chat__message-attachment__voice-recording-widget__audio-state'>\n          <div className='str-chat__message-attachment__voice-recording-widget__timer'>\n            {attachment.duration ? (\n              <DurationDisplay\n                duration={attachment.duration}\n                isPlaying={false}\n                secondsElapsed={undefined}\n              />\n            ) : (\n              <FileSizeIndicator\n                fileSize={attachment.file_size}\n                maximumFractionDigits={0}\n              />\n            )}\n          </div>\n        </div>\n      </div>\n      <FileIcon mimeType={attachment.mime_type} />\n    </div>\n  );\n};\n\nexport type VoiceRecordingProps = {\n  /** The attachment object from the message's attachment list. */\n  attachment: Attachment;\n  /** A boolean flag to signal whether the attachment will be rendered inside the quoted reply. */\n  isQuoted?: boolean;\n};\n\nexport const VoiceRecording = ({ attachment, isQuoted }: VoiceRecordingProps) =>\n  isQuoted ? (\n    <QuotedVoiceRecording attachment={attachment} />\n  ) : (\n    <VoiceRecordingPlayer attachment={attachment} />\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 { useComponentContext } from '../../context';\nimport ReactPlayer from 'react-player';\nimport React from 'react';\n\nexport type VideoPlayerProps = {\n  isPlaying?: boolean;\n  videoUrl?: string;\n  thumbnailUrl?: string;\n};\n\nexport const VideoPlayer = ({ isPlaying, thumbnailUrl, videoUrl }: VideoPlayerProps) => {\n  const { VideoPlayer: VideoPlayerContext } = useComponentContext();\n\n  return VideoPlayerContext ? (\n    <VideoPlayerContext thumbnailUrl={thumbnailUrl} videoUrl={videoUrl} />\n  ) : (\n    <ReactPlayer\n      className='react-player'\n      config={{ file: { attributes: { poster: thumbnailUrl } } }}\n      controls\n      height='100%'\n      playing={isPlaying}\n      url={videoUrl}\n      width='100%'\n    />\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 React, { useCallback, useState } from 'react';\nimport clsx from 'clsx';\n\nimport type { BaseImageProps } from '../BaseImage';\nimport type { GalleryItem } from '../Gallery/GalleryContext';\nimport { BaseImage as DefaultBaseImage } from '../BaseImage';\nimport { Gallery as DefaultGallery, GalleryUI } from '../Gallery';\nimport { LoadingIndicator } from '../Loading';\nimport { GlobalModal, type ModalCloseSource } from '../Modal';\nimport { useComponentContext, useTranslationContext } from '../../context';\nimport { IconRetry } from '../Icons';\nimport { VideoThumbnail } from '../VideoPlayer/VideoThumbnail';\n\nconst MAX_VISIBLE_THUMBNAILS = 4;\nconst BASE_IMAGE_PROP_KEYS = [\n  'className',\n  'crossOrigin',\n  'decoding',\n  'draggable',\n  'fetchPriority',\n  'height',\n  'loading',\n  'onError',\n  'onLoad',\n  'ref',\n  'showDownloadButtonOnError',\n  'sizes',\n  'srcSet',\n  'style',\n  'title',\n  'useMap',\n  'width',\n] as const satisfies ReadonlyArray<keyof Omit<BaseImageProps, 'src'>>;\ntype BaseImagePropsWithoutSrc = Omit<BaseImageProps, 'src'>;\ntype PartialBaseImagePropMap = Partial<\n  Record<(typeof BASE_IMAGE_PROP_KEYS)[number], unknown>\n>;\n\nexport type ModalGalleryProps = {\n  /** Array of media attachments to display */\n  items: GalleryItem[];\n  className?: string;\n  /** Whether clicking the empty gallery background should close the modal (default: true) */\n  closeOnBackgroundClick?: boolean;\n  modalClassName?: string;\n};\n\nexport const ModalGallery = ({\n  className,\n  closeOnBackgroundClick = true,\n  items,\n  modalClassName,\n}: ModalGalleryProps) => {\n  const {\n    BaseImage = DefaultBaseImage,\n    Gallery = DefaultGallery,\n    Modal = GlobalModal,\n  } = useComponentContext();\n  const [modalOpen, setModalOpen] = useState(false);\n  const [selectedIndex, setSelectedIndex] = useState(0);\n  const usesDefaultBaseImage = BaseImage === DefaultBaseImage;\n\n  const closeModal = useCallback(() => {\n    setModalOpen(false);\n  }, []);\n  const preventOverlayClose = useCallback(\n    (source: ModalCloseSource) => source !== 'overlay',\n    [],\n  );\n\n  const handleThumbnailClick = useCallback((index: number) => {\n    setSelectedIndex(index);\n    setModalOpen(true);\n  }, []);\n\n  const itemCount = items.length;\n  const visibleItems = items.slice(0, MAX_VISIBLE_THUMBNAILS);\n  const overflowCount = itemCount - MAX_VISIBLE_THUMBNAILS;\n\n  return (\n    <>\n      <div\n        className={clsx('str-chat__modal-gallery', className, {\n          'str-chat__modal-gallery--three-images': itemCount === 3,\n          'str-chat__modal-gallery--two-images': itemCount === 2,\n        })}\n      >\n        {visibleItems.map((item, index) => {\n          const isLastVisible = index === MAX_VISIBLE_THUMBNAILS - 1;\n          const showOverlay = isLastVisible && overflowCount > 0;\n\n          return (\n            <ThumbnailButton\n              BaseImage={BaseImage}\n              baseImageUsesDefaultBehavior={usesDefaultBaseImage}\n              index={index}\n              item={item}\n              itemCount={itemCount}\n              key={index}\n              onClick={() => handleThumbnailClick(index)}\n              overflowCount={overflowCount}\n              showOverlay={showOverlay}\n            />\n          );\n        })}\n      </div>\n      <Modal\n        className={clsx('str-chat__gallery-modal', modalClassName)}\n        onClose={closeModal}\n        onCloseAttempt={preventOverlayClose}\n        open={modalOpen}\n      >\n        <Gallery\n          closeOnBackgroundClick={closeOnBackgroundClick}\n          GalleryUI={GalleryUI}\n          initialIndex={selectedIndex}\n          items={items}\n          onRequestClose={closeModal}\n        />\n      </Modal>\n    </>\n  );\n};\n\ntype ThumbnailButtonProps = {\n  BaseImage: React.ComponentType<BaseImageProps>;\n  baseImageUsesDefaultBehavior: boolean;\n  index: number;\n  item: GalleryItem;\n  itemCount: number;\n  onClick: () => void;\n  overflowCount: number;\n  showOverlay: boolean;\n};\n\nconst ThumbnailButton = ({\n  BaseImage,\n  baseImageUsesDefaultBehavior,\n  index,\n  item,\n  itemCount,\n  onClick,\n  overflowCount,\n  showOverlay,\n}: ThumbnailButtonProps) => {\n  const { t } = useTranslationContext();\n  const imageUrl = item.imageUrl;\n  const [isLoadFailed, setIsLoadFailed] = useState(false);\n  const [isImageLoading, setIsImageLoading] = useState(Boolean(imageUrl));\n  // Cache-busting suffix appended to image src on retry. Using a suffix instead of\n  // a React key remount keeps the component (and its placeholder) mounted, preventing\n  // layout shifts and height collapse during the reload attempt.\n  const [retrySuffix, setRetrySuffix] = useState('');\n\n  const {\n    onError: itemOnError,\n    onLoad: itemOnLoad,\n    ...baseImageProps\n  } = getBaseImageProps(item);\n  const showRetryIndicator = isLoadFailed && !showOverlay;\n  const showLoadingIndicator = isImageLoading && !showRetryIndicator && !showOverlay;\n\n  const handleButtonClick = () => {\n    if (showRetryIndicator) {\n      setIsLoadFailed(false);\n      setIsImageLoading(true);\n      setRetrySuffix(`&retry=${Date.now()}`);\n      return;\n    }\n\n    onClick();\n  };\n\n  const buttonLabel = showRetryIndicator\n    ? t('aria/Retry upload')\n    : itemCountAwareLabel({ imageIndex: index + 1, itemCount, t });\n\n  return (\n    <button\n      aria-label={buttonLabel}\n      className={clsx('str-chat__modal-gallery__image', {\n        'str-chat__modal-gallery__image--load-failed': showRetryIndicator,\n        'str-chat__modal-gallery__image--loading': showLoadingIndicator,\n      })}\n      onClick={handleButtonClick}\n      type='button'\n    >\n      {item.videoThumbnailUrl ? (\n        <VideoThumbnail alt={t('User uploaded content')} src={item.videoThumbnailUrl} />\n      ) : (\n        <BaseImage\n          {...baseImageProps}\n          alt={item.alt ?? t('User uploaded content')}\n          onError={(event) => {\n            setIsImageLoading(false);\n            setIsLoadFailed(true);\n            itemOnError?.(event);\n          }}\n          onLoad={(event) => {\n            setIsImageLoading(false);\n            setIsLoadFailed(false);\n            itemOnLoad?.(event);\n          }}\n          src={imageUrl ? `${imageUrl}${retrySuffix}` : imageUrl}\n          {...(baseImageUsesDefaultBehavior ? { showDownloadButtonOnError: false } : {})}\n        />\n      )}\n      {showLoadingIndicator && (\n        <div\n          aria-hidden='true'\n          className='str-chat__modal-gallery__image-loading-overlay'\n          data-testid='str-chat__modal-gallery__image-loading-overlay'\n        >\n          <LoadingIndicator />\n        </div>\n      )}\n      {showRetryIndicator && (\n        <div\n          aria-hidden='true'\n          className='str-chat__modal-gallery__image-load-failed-overlay'\n          data-testid='str-chat__modal-gallery__image-load-failed-overlay'\n        >\n          <div className='str-chat__modal-gallery__image-retry-indicator'>\n            <IconRetry />\n          </div>\n        </div>\n      )}\n      {showOverlay && (\n        <div className='str-chat__modal-gallery__placeholder'>+{overflowCount}</div>\n      )}\n    </button>\n  );\n};\n\nconst itemCountAwareLabel = ({\n  imageIndex,\n  itemCount,\n  t,\n}: {\n  imageIndex: number;\n  itemCount: number;\n  t: ReturnType<typeof useTranslationContext>['t'];\n}) =>\n  itemCount === 1\n    ? t('Open image in gallery')\n    : t('Open gallery at image {{ index }}', {\n        index: imageIndex,\n      });\n\nconst getBaseImageProps = (item: GalleryItem): BaseImagePropsWithoutSrc => {\n  const baseImageProps: PartialBaseImagePropMap = {};\n  for (const key of BASE_IMAGE_PROP_KEYS) {\n    const value = item[key];\n    if (value !== undefined) {\n      baseImageProps[key] = value;\n    }\n  }\n\n  return baseImageProps as BaseImagePropsWithoutSrc;\n};\n","import React from 'react';\nimport { ModalGallery as DefaultModalGallery } from './ModalGallery';\nimport { useComponentContext } from '../../context';\nimport type { GalleryItem } from '../Gallery/GalleryContext';\n\nexport type ImageProps = GalleryItem;\n\n/**\n * Display image with tap-to-expand modal gallery.\n */\nexport const ImageComponent = (galleryItem: ImageProps) => {\n  const { ModalGallery = DefaultModalGallery } = useComponentContext();\n\n  return <ModalGallery items={[galleryItem]} modalClassName='str-chat__image-modal' />;\n};\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\n\n/**\n * Similar to a regular anchor tag, but it sanitizes the href value and prevents XSS\n */\nexport type SafeAnchorProps = {\n  /** Set the className for the anchor tag element */\n  className?: string;\n  /** Specifies that the target (href attribute) will be downloaded instead of navigating to a file */\n  download?: boolean;\n  /** Set the href attribute for the anchor tag element */\n  href?: string;\n  /** Set the rel attribute for the anchor tag element */\n  rel?: string;\n  /** Set the target attribute for the anchor tag element */\n  target?: string;\n};\n\nconst UnMemoizedSafeAnchor = (props: PropsWithChildren<SafeAnchorProps>) => {\n  const { children, className, download, href, rel, target } = props;\n  if (!href) return null;\n  const sanitized = sanitizeUrl(href);\n  return (\n    <a\n      className={className}\n      download={download}\n      href={sanitized}\n      rel={rel}\n      target={target}\n    >\n      {children}\n    </a>\n  );\n};\n\nexport const SafeAnchor = React.memo(UnMemoizedSafeAnchor) as typeof UnMemoizedSafeAnchor;\n","import type { Attachment } from 'stream-chat';\nimport { useTranslationContext } from '../../../context';\nimport clsx from 'clsx';\nimport React from 'react';\n\nexport const UnableToRenderCard = ({ type }: { type?: Attachment['type'] }) => {\n  const { t } = useTranslationContext('Card');\n\n  return (\n    <div\n      className={clsx('str-chat__message-attachment-card', {\n        [`str-chat__message-attachment-card--${type}`]: type,\n      })}\n    >\n      <div className='str-chat__message-attachment-card--content'>\n        <div className='str-chat__message-attachment-card--text'>\n          {t('this content could not be displayed')}\n        </div>\n      </div>\n    </div>\n  );\n};\n","import React from 'react';\nimport { BaseImage } from '../../BaseImage';\nimport { SafeAnchor } from '../../SafeAnchor';\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\n\nimport type { Attachment } from 'stream-chat';\nimport type { RenderAttachmentProps } from '../utils';\nimport type { Dimensions } from '../../../types/types';\nimport { IconLink } from '../../Icons';\nimport { UnableToRenderCard } from './UnableToRenderCard';\nimport clsx from 'clsx';\n\ntype CardRootProps = {\n  cardUrl: string | undefined;\n  children: React.ReactNode;\n  type?: CardProps['type'];\n};\n\nconst CardRoot = ({ cardUrl, children, type }: CardRootProps) => {\n  const className = clsx(\n    `str-chat__message-attachment-card str-chat__message-attachment-card--${type}`,\n  );\n\n  return cardUrl ? (\n    <SafeAnchor\n      className={className}\n      href={cardUrl}\n      rel='noopener noreferrer'\n      target='_blank'\n    >\n      {children}\n    </SafeAnchor>\n  ) : (\n    <div className={className}>{children}</div>\n  );\n};\n\ntype CardHeaderProps = Pick<CardProps, 'title' | 'type' | 'image_url' | 'thumb_url'> & {\n  dimensions: Dimensions;\n  image?: string;\n};\n\nconst CardHeader = (props: CardHeaderProps) => {\n  const { dimensions, image, image_url, thumb_url, title } = props;\n\n  return image ? (\n    <div\n      className='str-chat__message-attachment-card--header str-chat__message-attachment-card-react--header'\n      data-testid={'card-header'}\n    >\n      <BaseImage\n        alt={title || image}\n        data-testid='image-test'\n        src={image_url ?? thumb_url}\n        title={title || image}\n        {...dimensions}\n      />\n    </div>\n  ) : null;\n};\n\ntype CardContentProps = RenderAttachmentProps['attachment'];\n\nconst CardContent = (props: CardContentProps) => {\n  const { og_scrape_url, text, title, title_link } = props;\n  const url = title_link || og_scrape_url;\n\n  return (\n    <div className='str-chat__message-attachment-card--content'>\n      {title && <div className='str-chat__message-attachment-card--title'>{title}</div>}\n      {text && <div className='str-chat__message-attachment-card--text'>{text}</div>}\n      {url && (\n        <div\n          className='str-chat__message-attachment-card--source-link'\n          data-testid='card-source-link'\n        >\n          <IconLink />\n          <div className='str-chat__message-attachment-card--url'>{url}</div>\n        </div>\n      )}\n    </div>\n  );\n};\n\nexport type CardProps = RenderAttachmentProps['attachment'] & {\n  compact?: boolean;\n};\n\nconst UnMemoizedCard = (props: CardProps) => {\n  const { giphy, image_url, og_scrape_url, thumb_url, title, title_link, type } = props;\n  const { giphyVersion: giphyVersionName } = useChannelStateContext('');\n  const cardUrl = title_link || og_scrape_url;\n\n  let image = thumb_url || image_url;\n  const dimensions: { height?: string; width?: string } = {};\n\n  if (type === 'giphy' && typeof giphy !== 'undefined') {\n    const giphyVersion =\n      giphy[giphyVersionName as keyof NonNullable<Attachment['giphy']>];\n    image = giphyVersion.url;\n    dimensions.height = giphyVersion.height;\n    dimensions.width = giphyVersion.width;\n  }\n\n  if (!title && !cardUrl && !image) {\n    return <UnableToRenderCard />;\n  }\n\n  return (\n    <CardRoot cardUrl={cardUrl} type={type}>\n      <CardHeader {...props} dimensions={dimensions} image={image} />\n      <CardContent {...props} />\n    </CardRoot>\n  );\n};\n\n/**\n * Simple Card Layout for displaying links\n */\nexport const Card = React.memo(UnMemoizedCard) as typeof UnMemoizedCard;\n","import React from 'react';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { FileIcon } from '../FileIcon';\nimport type { Attachment } from 'stream-chat';\n\nimport {\n  FileSizeIndicator as DefaultFileSizeIndicator,\n  DownloadButton,\n} from './components';\n\nexport type FileAttachmentProps = {\n  attachment: Attachment;\n};\n\nexport const FileAttachment = ({ attachment }: FileAttachmentProps) => {\n  const { AttachmentFileIcon, FileSizeIndicator = DefaultFileSizeIndicator } =\n    useComponentContext();\n  const FileIconComponent = AttachmentFileIcon ?? FileIcon;\n  return (\n    <div\n      className='str-chat__message-attachment-file--item'\n      data-testid='attachment-file'\n    >\n      <FileIconComponent\n        className='str-chat__file-icon'\n        fileName={attachment.title}\n        mimeType={attachment.mime_type}\n      />\n      <div className='str-chat__message-attachment-file--item__info'>\n        <div className='str-chat__message-attachment-file--item__first-row'>\n          <div\n            className='str-chat__message-attachment-file--item__name'\n            data-testid='file-title'\n          >\n            {attachment.title}\n          </div>\n        </div>\n        <div className='str-chat__message-attachment-file--item__data'>\n          <FileSizeIndicator fileSize={attachment.file_size} />\n        </div>\n      </div>\n      <DownloadButton\n        assetUrl={attachment.asset_url}\n        suggestedFileName={attachment.title}\n      />\n    </div>\n  );\n};\n","import type { Attachment } from 'stream-chat';\nimport { BaseImage as DefaultBaseImage } from '../BaseImage';\nimport { toGalleryItemDescriptors } from '../Gallery';\nimport clsx from 'clsx';\nimport {\n  useChannelStateContext,\n  useComponentContext,\n  useTranslationContext,\n} from '../../context';\nimport { IconGiphy } from '../Icons';\nimport { type CSSProperties, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { ImageAttachmentConfiguration } from '../../types/types';\n\nexport type GiphyAttachmentProps = {\n  attachment: Attachment;\n};\n\nexport const Giphy = ({ attachment }: GiphyAttachmentProps) => {\n  const { giphyVersion: giphyVersionName, imageAttachmentSizeHandler } =\n    useChannelStateContext();\n  const { BaseImage = DefaultBaseImage } = useComponentContext();\n  const { t } = useTranslationContext();\n  const usesDefaultBaseImage = BaseImage === DefaultBaseImage;\n  const imageElement = useRef<HTMLImageElement>(null);\n  const [attachmentConfiguration, setAttachmentConfiguration] = useState<\n    ImageAttachmentConfiguration | undefined\n  >(undefined);\n\n  const imageDescriptors = useMemo(\n    () => toGalleryItemDescriptors(attachment, { giphyVersionName }),\n    [attachment, giphyVersionName],\n  );\n  const alt = imageDescriptors && imageDescriptors.alt;\n  const dimensions = imageDescriptors && imageDescriptors.dimensions;\n  const imageUrl = imageDescriptors && imageDescriptors.imageUrl;\n  const title = imageDescriptors && imageDescriptors.title;\n  const resolvedImageUrl = attachmentConfiguration?.url || imageUrl;\n  const imageStyleVariables = useMemo(() => {\n    const originalHeight = Number(dimensions?.height);\n    const originalWidth = Number(dimensions?.width);\n\n    return {\n      '--original-height': String(originalHeight > 1 ? originalHeight : 1000000),\n      '--original-width': String(originalWidth > 1 ? originalWidth : 1000000),\n    } as CSSProperties;\n  }, [dimensions?.height, dimensions?.width]);\n\n  useLayoutEffect(() => {\n    if (!imageElement.current || !imageAttachmentSizeHandler) return;\n\n    const config = imageAttachmentSizeHandler(attachment, imageElement.current);\n    setAttachmentConfiguration(config);\n  }, [attachment, imageAttachmentSizeHandler]);\n\n  if (!imageUrl) return null;\n\n  return (\n    <div className={clsx(`str-chat__message-attachment-giphy`)}>\n      <BaseImage\n        alt={alt ?? title ?? t('User uploaded content')}\n        height={dimensions?.height}\n        ref={imageElement}\n        src={resolvedImageUrl}\n        style={imageStyleVariables}\n        width={dimensions?.width}\n        {...(usesDefaultBaseImage ? { showDownloadButtonOnError: false } : {})}\n      />\n      <GiphyBadge />\n    </div>\n  );\n};\n\nconst GiphyBadge = () => (\n  <div className='str-chat__giphy-badge'>\n    <IconGiphy />\n    Giphy\n  </div>\n);\n","import React from 'react';\nimport type { IconProps } from '../../types/types';\n\nexport const DownloadIcon = ({ className }: IconProps) => (\n  <svg\n    className={className}\n    data-testid='download'\n    fill='none'\n    height='24'\n    viewBox='0 0 24 24'\n    width='24'\n    xmlns='http://www.w3.org/2000/svg'\n  >\n    <path\n      d='M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM13.45 10H10.55V13H8L12 17L16 13H13.45V10Z'\n      fill='black'\n    />\n  </svg>\n);\n\nexport const ExternalLinkIcon = () => (\n  <svg fill='currentColor' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'>\n    <path d='M12.586 2H10a1 1 0 1 1 0-2h5a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V3.414l-6.793 6.793a1 1 0 0 1-1.414-1.414L12.586 2zM6 1a1 1 0 1 1 0 2H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h8.967a1 1 0 0 0 1-.99L13 9.99a1 1 0 1 1 2 .02l-.033 3.023a3 3 0 0 1-3 2.967H3a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h3z' />\n  </svg>\n);\n","import type { ComponentType } from 'react';\nimport { useEffect } from 'react';\nimport { useRef, useState } from 'react';\nimport React from 'react';\nimport type { Coords, SharedLocationResponse } from 'stream-chat';\nimport { useChatContext, useTranslationContext } from '../../context';\nimport { ExternalLinkIcon } from './icons';\nimport { IconLocation } from '../Icons';\nimport { Button } from '../Button';\n\nexport type GeolocationMapProps = Coords;\n\nexport type GeolocationProps = {\n  location: SharedLocationResponse;\n  GeolocationAttachmentMapPlaceholder?: ComponentType<GeolocationAttachmentMapPlaceholderProps>;\n  GeolocationMap?: ComponentType<GeolocationMapProps>;\n};\n\nexport const Geolocation = ({\n  GeolocationAttachmentMapPlaceholder = DefaultGeolocationAttachmentMapPlaceholder,\n  GeolocationMap,\n  location,\n}: GeolocationProps) => {\n  const { channel, client } = useChatContext();\n  const { t } = useTranslationContext();\n\n  const [stoppedSharing, setStoppedSharing] = useState(\n    !!location.end_at && new Date(location.end_at).getTime() < new Date().getTime(),\n  );\n  const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n  const isMyLocation = location.user_id === client.userID;\n  const isLiveLocation = !!location.end_at;\n\n  useEffect(() => {\n    if (!location.end_at) return;\n    clearTimeout(timeoutRef.current);\n    timeoutRef.current = setTimeout(\n      () => setStoppedSharing(true),\n      new Date(location.end_at).getTime() - Date.now(),\n    );\n  }, [location.end_at]);\n\n  return (\n    <div\n      className='str-chat__message-attachment-geolocation'\n      data-testid='attachment-geolocation'\n    >\n      <div className='str-chat__message-attachment-geolocation__location-preview'>\n        {GeolocationMap ? (\n          <GeolocationMap latitude={location.latitude} longitude={location.longitude} />\n        ) : (\n          <GeolocationAttachmentMapPlaceholder location={location} />\n        )}\n      </div>\n      <div className='str-chat__message-attachment-geolocation__status'>\n        {isLiveLocation ? (\n          stoppedSharing ? (\n            t('Location sharing ended')\n          ) : isMyLocation ? (\n            <div className='str-chat__message-attachment-geolocation__status--active'>\n              <Button\n                appearance='outline'\n                className='str-chat__message-attachment-geolocation__stop-sharing-button'\n                onClick={() => channel?.stopLiveLocationSharing(location)}\n                size='sm'\n                variant='secondary'\n              >\n                {t('Stop sharing')}\n              </Button>\n              <div className='str-chat__message-attachment-geolocation__status--active-until'>\n                {t('Live until {{ timestamp }}', {\n                  timestamp: t('timestamp/LiveLocation', { timestamp: location.end_at }),\n                })}\n              </div>\n            </div>\n          ) : (\n            <div className='str-chat__message-attachment-geolocation__status--active'>\n              <div className='str-chat__message-attachment-geolocation__status--active-status'>\n                {t('Live location')}\n              </div>\n              <div className='str-chat__message-attachment-geolocation__status--active-until'>\n                {t('Live until {{ timestamp }}', {\n                  timestamp: t('timestamp/LiveLocation', { timestamp: location.end_at }),\n                })}\n              </div>\n            </div>\n          )\n        ) : (\n          t('Current location')\n        )}\n      </div>\n    </div>\n  );\n};\n\nexport type GeolocationAttachmentMapPlaceholderProps = {\n  location: SharedLocationResponse;\n};\n\nconst DefaultGeolocationAttachmentMapPlaceholder = ({\n  location,\n}: GeolocationAttachmentMapPlaceholderProps) => {\n  const { t } = useTranslationContext();\n\n  return (\n    <div\n      className='str-chat__message-attachment-geolocation__placeholder'\n      data-testid='geolocation-attachment-map-placeholder'\n    >\n      <IconLocation />\n      <a\n        aria-label={t('Open location in a map')}\n        className='str-chat__message-attachment-geolocation__placeholder-link'\n        href={`https://maps.google.com?q=${[location.latitude, location.longitude].join()}`}\n        rel='noreferrer'\n        target='_blank'\n      >\n        <ExternalLinkIcon />\n      </a>\n    </div>\n  );\n};\n","import React from 'react';\nimport type { Attachment } from 'stream-chat';\nimport { useTranslationContext } from '../../context';\nimport { IconUnsupportedAttachment } from '../Icons';\n\nexport type UnsupportedAttachmentProps = {\n  attachment: Attachment;\n};\n\nexport const UnsupportedAttachment = () => {\n  const { t } = useTranslationContext('UnsupportedAttachment');\n  return (\n    <div\n      className='str-chat__message-attachment-unsupported'\n      data-testid='attachment-unsupported'\n    >\n      <IconUnsupportedAttachment />\n      <div className='str-chat__message-attachment-unsupported__metadata'>\n        <div\n          className='str-chat__message-attachment-unsupported__title'\n          data-testid='unsupported-attachment-title'\n        >\n          {t('Unsupported attachment')}\n        </div>\n      </div>\n    </div>\n  );\n};\n","import React from 'react';\nimport { IconEyeFill } from '../Icons';\nimport { useTranslationContext } from '../../context';\n\nexport const VisibilityDisclaimer = () => {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__visibility-disclaimer'>\n      <IconEyeFill />\n      {t('Only visible to you')}\n    </div>\n  );\n};\n","import type { VideoAttachment as VideoAttachmentType } from 'stream-chat';\nimport { useChannelStateContext } from '../../context';\nimport React, { type ComponentType, useLayoutEffect, useRef, useState } from 'react';\nimport type { VideoAttachmentConfiguration } from '../../types/types';\nimport { getCssDimensionsVariables } from './utils';\nimport type { VideoPlayerProps } from '../VideoPlayer';\nimport { VideoPlayer as DefaultVideoPlayer } from '../VideoPlayer';\nimport { VideoThumbnail } from '../VideoPlayer/VideoThumbnail';\n\nexport type VideoAttachmentProps = {\n  attachment: VideoAttachmentType;\n  VideoPlayer?: ComponentType<VideoPlayerProps>;\n};\n\nexport const VideoAttachment = ({\n  attachment,\n  VideoPlayer = DefaultVideoPlayer,\n}: VideoAttachmentProps) => {\n  const { shouldGenerateVideoThumbnail, videoAttachmentSizeHandler } =\n    useChannelStateContext();\n  const videoElement = useRef<HTMLDivElement>(null);\n  const [attachmentConfiguration, setAttachmentConfiguration] =\n    useState<VideoAttachmentConfiguration>();\n  const [showVideo, setShowVideo] = React.useState(!shouldGenerateVideoThumbnail);\n\n  useLayoutEffect(() => {\n    if (videoElement.current && videoAttachmentSizeHandler) {\n      const config = videoAttachmentSizeHandler(\n        attachment,\n        videoElement.current,\n        shouldGenerateVideoThumbnail,\n      );\n      setAttachmentConfiguration(config);\n    }\n  }, [\n    videoElement,\n    videoAttachmentSizeHandler,\n    attachment,\n    shouldGenerateVideoThumbnail,\n  ]);\n\n  const renderThumbnailFirst = Boolean(\n    attachment.thumb_url && shouldGenerateVideoThumbnail,\n  );\n\n  // todo: handle failed thumbnail loading\n  return (\n    <div\n      className='str-chat__player-wrapper'\n      data-testid='video-wrapper'\n      ref={videoElement}\n      style={getCssDimensionsVariables(attachment.thumb_url || '')}\n    >\n      {renderThumbnailFirst && !showVideo ? (\n        <VideoThumbnail\n          alt={attachment.title}\n          data-testid='image-test'\n          onPlay={() => setShowVideo(true)}\n          src={attachment.thumb_url}\n          title={attachment.title}\n        />\n      ) : (\n        <VideoPlayer\n          isPlaying={renderThumbnailFirst}\n          thumbnailUrl={attachmentConfiguration?.thumbUrl}\n          videoUrl={attachmentConfiguration?.url}\n        />\n      )}\n    </div>\n  );\n};\n","import React, {\n  type PropsWithChildren,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport clsx from 'clsx';\nimport type {\n  Attachment,\n  LocalAttachment,\n  SharedLocationResponse,\n  VideoAttachment as VideoAttachmentType,\n} from 'stream-chat';\nimport {\n  isAudioAttachment,\n  isFileAttachment,\n  isSharedLocationResponse,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n} from 'stream-chat';\n\nimport { Audio as DefaultAudioAttachment } from './Audio';\nimport { AttachmentActions as DefaultAttachmentActions } from './AttachmentActions';\nimport { VoiceRecording as DefaultVoiceRecording } from './VoiceRecording';\nimport { type GalleryItem, toGalleryItemDescriptors } from '../Gallery';\nimport { ImageComponent as DefaultImage } from './Image';\nimport { Card as DefaultCard } from './LinkPreview/Card';\nimport { FileAttachment as DefaultFile } from './FileAttachment';\nimport { Giphy as DefaultGiphy } from './Giphy';\nimport { Geolocation as DefaultGeolocation } from './Geolocation';\nimport { ModalGallery as DefaultModalGallery } from './ModalGallery';\nimport { UnsupportedAttachment as DefaultUnsupportedAttachment } from './UnsupportedAttachment';\nimport {\n  type AttachmentComponentType,\n  type GalleryAttachment,\n  type GeolocationContainerProps,\n  getCssDimensionsVariables,\n  isGalleryAttachmentType,\n  isSvgAttachment,\n  type RenderAttachmentProps,\n  type RenderGalleryProps,\n  type RenderMediaProps,\n  SUPPORTED_VIDEO_FORMATS,\n} from './utils';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport type { ImageAttachmentConfiguration } from '../../types/types';\nimport { VisibilityDisclaimer } from './VisibilityDisclaimer';\nimport { VideoAttachment } from './VideoAttachment';\nimport type { AttachmentProps } from './Attachment';\n\nexport type AttachmentContainerProps = {\n  attachment: Attachment | GalleryAttachment | SharedLocationResponse;\n  componentType: AttachmentComponentType;\n};\nexport const AttachmentWithinContainer = ({\n  attachment,\n  children,\n  componentType,\n}: PropsWithChildren<AttachmentContainerProps>) => {\n  const isGAT = isGalleryAttachmentType(attachment);\n  let extra = '';\n\n  if (!isGAT && !isSharedLocationResponse(attachment)) {\n    extra =\n      componentType === 'card' && !attachment?.image_url && !attachment?.thumb_url\n        ? 'no-image'\n        : attachment?.actions?.length\n          ? 'actions'\n          : '';\n  }\n\n  const classNames = clsx(\n    'str-chat__message-attachment str-chat__message-attachment-dynamic-size',\n    {\n      [`str-chat__message-attachment--${componentType}`]: componentType,\n      [`str-chat__message-attachment--${(attachment as Attachment)?.type}`]: (\n        attachment as Attachment\n      )?.type,\n      [`str-chat__message-attachment--${componentType}--${extra}`]:\n        componentType && extra,\n      'str-chat__message-attachment--svg-image': isSvgAttachment(attachment),\n      'str-chat__message-attachment-with-actions': extra === 'actions',\n    },\n  );\n\n  return <div className={classNames}>{children}</div>;\n};\n\nexport const AttachmentActionsContainer = ({\n  actionHandler,\n  attachment,\n  AttachmentActions = DefaultAttachmentActions,\n  attachmentActionsDefaultFocus,\n}: RenderAttachmentProps) => {\n  if (!attachment.actions?.length) return null;\n\n  const defaultFocusedActionValue =\n    attachment.type && attachmentActionsDefaultFocus?.[attachment.type];\n\n  return (\n    <AttachmentActions\n      {...attachment}\n      actionHandler={actionHandler}\n      actions={attachment.actions}\n      defaultFocusedActionValue={defaultFocusedActionValue}\n      id={(attachment as LocalAttachment).localMetadata?.id || ''}\n      text={attachment.text || ''}\n    />\n  );\n};\n\nexport const MediaContainer = (props: RenderMediaProps) => {\n  const { attachments: mediaAttachments } = props;\n  if (!mediaAttachments.length) return null;\n\n  if (mediaAttachments.length > 1) {\n    return (\n      <GalleryContainer\n        {...props}\n        attachment={{ items: mediaAttachments, type: 'gallery' }}\n      />\n    );\n  }\n\n  const mediaAttachment = mediaAttachments[0];\n  const { attachments: _attachments, ...rest } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n  if (isVideoAttachment(mediaAttachment, SUPPORTED_VIDEO_FORMATS)) {\n    return <VideoContainer attachment={mediaAttachment} {...rest} />;\n  }\n\n  return <ImageContainer attachment={mediaAttachment} {...rest} />;\n};\n\nexport const CardContainer = (props: RenderAttachmentProps) => {\n  const { attachment, Card = DefaultCard } = props;\n  const componentType = 'card';\n\n  if (attachment.actions && attachment.actions.length) {\n    return (\n      <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n        <div className='str-chat__attachment'>\n          <Card {...attachment} />\n          <AttachmentActionsContainer {...props} />\n        </div>\n      </AttachmentWithinContainer>\n    );\n  }\n\n  return (\n    <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n      <Card {...attachment} />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const GiphyContainer = (props: RenderAttachmentProps) => {\n  const { attachment, Giphy = DefaultGiphy } = props;\n  const componentType = 'giphy';\n\n  if (attachment.actions && attachment.actions.length) {\n    return (\n      <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n        <div className='str-chat__attachment'>\n          <VisibilityDisclaimer />\n          <Giphy attachment={attachment} />\n          <AttachmentActionsContainer {...props} />\n        </div>\n      </AttachmentWithinContainer>\n    );\n  }\n\n  return (\n    <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n      <Giphy attachment={attachment} />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const FileContainer = (props: RenderAttachmentProps) => {\n  const { attachment } = props;\n\n  if (isVoiceRecordingAttachment(attachment)) {\n    return <VoiceRecordingContainer {...props} />;\n  }\n\n  if (isAudioAttachment(attachment)) {\n    return <AudioContainer {...props} />;\n  }\n\n  if (!attachment.asset_url || !isFileAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) {\n    return null;\n  }\n\n  return <OtherFilesContainer {...props} />;\n};\n\nexport const GalleryContainer = ({\n  attachment,\n  ModalGallery = DefaultModalGallery,\n}: RenderGalleryProps) => {\n  const items = useMemo<GalleryItem[]>(\n    () =>\n      attachment.items.reduce<GalleryItem[]>((acc, attachment) => {\n        const item = toGalleryItemDescriptors(attachment);\n        if (item) acc.push(item);\n        return acc;\n      }, []),\n    [attachment.items],\n  );\n  return (\n    <AttachmentWithinContainer attachment={attachment} componentType='gallery'>\n      <ModalGallery items={items} key='gallery' />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const ImageContainer = (props: RenderAttachmentProps) => {\n  const { attachment, Image = DefaultImage } = props;\n  const componentType = 'image';\n  const imageElement = useRef<HTMLImageElement>(null);\n  const { imageAttachmentSizeHandler } = useChannelStateContext();\n  const [attachmentConfiguration, setAttachmentConfiguration] = useState<\n    ImageAttachmentConfiguration | undefined\n  >(undefined);\n\n  useLayoutEffect(() => {\n    if (imageElement.current && imageAttachmentSizeHandler) {\n      const config = imageAttachmentSizeHandler(attachment, imageElement.current);\n      setAttachmentConfiguration(config);\n    }\n  }, [imageElement, imageAttachmentSizeHandler, attachment]);\n\n  const imgUrlFromAttachment = attachment.image_url || attachment.thumb_url || '';\n\n  const imageConfig: GalleryItem = {\n    ...toGalleryItemDescriptors({\n      ...attachment,\n      image_url: attachmentConfiguration?.url || imgUrlFromAttachment,\n    }),\n    ref: imageElement,\n    style: getCssDimensionsVariables(imgUrlFromAttachment),\n  };\n\n  if (attachment.actions && attachment.actions.length) {\n    return (\n      <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n        <div className='str-chat__attachment'>\n          <Image {...imageConfig} />\n          <AttachmentActionsContainer {...props} />\n        </div>\n      </AttachmentWithinContainer>\n    );\n  }\n\n  return (\n    <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n      <Image {...imageConfig} />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const OtherFilesContainer = ({\n  attachment,\n  File = DefaultFile,\n}: RenderAttachmentProps) => {\n  if (!attachment.asset_url) return null;\n\n  return (\n    <AttachmentWithinContainer attachment={attachment} componentType='file'>\n      <File attachment={attachment} />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const AudioContainer = ({\n  attachment,\n  Audio = DefaultAudioAttachment,\n}: RenderAttachmentProps) => (\n  <AttachmentWithinContainer attachment={attachment} componentType='audio'>\n    <div className='str-chat__attachment'>\n      <Audio attachment={attachment} />\n    </div>\n  </AttachmentWithinContainer>\n);\n\nexport const VoiceRecordingContainer = ({\n  attachment,\n  isQuoted,\n  VoiceRecording = DefaultVoiceRecording,\n}: RenderAttachmentProps) => (\n  <AttachmentWithinContainer attachment={attachment} componentType='voiceRecording'>\n    <div className='str-chat__attachment'>\n      <VoiceRecording attachment={attachment} isQuoted={isQuoted} />\n    </div>\n  </AttachmentWithinContainer>\n);\n\nexport const VideoContainer = (\n  props: Omit<AttachmentProps, 'attachments'> & { attachment: VideoAttachmentType },\n) => {\n  const { attachment, Media } = props;\n  const componentType = 'media';\n\n  return attachment.actions?.length ? (\n    <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n      <div className='str-chat__attachment'>\n        <VideoAttachment attachment={attachment} VideoPlayer={Media} />\n        <AttachmentActionsContainer {...props} />\n      </div>\n    </AttachmentWithinContainer>\n  ) : (\n    <AttachmentWithinContainer attachment={attachment} componentType={componentType}>\n      <VideoAttachment attachment={attachment} VideoPlayer={Media} />\n    </AttachmentWithinContainer>\n  );\n};\n\nexport const GeolocationContainer = ({\n  Geolocation = DefaultGeolocation,\n  location,\n}: GeolocationContainerProps) => (\n  <AttachmentWithinContainer attachment={location} componentType='geolocation'>\n    <Geolocation location={location} />\n  </AttachmentWithinContainer>\n);\n\nexport const UnsupportedAttachmentContainer = ({\n  attachment,\n  UnsupportedAttachment = DefaultUnsupportedAttachment,\n}: RenderAttachmentProps) => (\n  <AttachmentWithinContainer attachment={attachment} componentType='unsupported'>\n    <UnsupportedAttachment attachment={attachment} />\n  </AttachmentWithinContainer>\n);\n","import React, { useMemo } from 'react';\nimport type { SharedLocationResponse, Attachment as StreamAttachment } from 'stream-chat';\nimport {\n  isAudioAttachment,\n  isFileAttachment,\n  isImageAttachment,\n  isScrapedContent,\n  isSharedLocationResponse,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n} from 'stream-chat';\n\nimport {\n  CardContainer,\n  FileContainer,\n  GeolocationContainer,\n  GiphyContainer,\n  MediaContainer,\n  UnsupportedAttachmentContainer,\n} from './AttachmentContainer';\nimport type { GroupedRenderedAttachment } from './utils';\nimport { SUPPORTED_VIDEO_FORMATS } from './utils';\nimport type {\n  AttachmentActionsDefaultFocusByType,\n  AttachmentActionsProps,\n} from './AttachmentActions';\nimport { defaultAttachmentActionsDefaultFocus } from './AttachmentActions';\nimport type { AudioProps } from './Audio';\nimport type { VoiceRecordingProps } from './VoiceRecording';\nimport type { CardProps } from './LinkPreview/Card';\nimport type { FileAttachmentProps } from './FileAttachment';\nimport type { GalleryItem } from '../Gallery';\nimport type { UnsupportedAttachmentProps } from './UnsupportedAttachment';\nimport type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';\nimport type { GeolocationProps } from './Geolocation';\nimport type { GiphyAttachmentProps } from './Giphy';\nimport type { VideoPlayerProps } from '../VideoPlayer';\nimport type { ModalGalleryProps } from './ModalGallery';\nimport type { ImageProps } from './Image';\n\nexport const ATTACHMENT_GROUPS_ORDER = [\n  'media',\n  'giphy',\n  'card',\n  'geolocation',\n  'file',\n  'unsupported',\n] as const;\n\nexport type AttachmentProps = {\n  /** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/\n  attachments: (StreamAttachment | SharedLocationResponse)[];\n  /**\tThe handler function to call when an action is performed on an attachment, examples include canceling a \\/giphy command or shuffling the results. */\n  actionHandler?: ActionHandlerReturnType;\n  /**\n   * Which attachment action button receives focus on initial render, keyed by attachment type.\n   * Values must match an action's `value` (e.g. `'send'`, `'cancel'`, `'shuffle'` for giphy attachment).\n   * Default: `{ giphy: 'send' }`.\n   * To disable auto-focus (e.g. when rendering the Giphy preview above the composer so focus\n   * stays in the message input), pass an empty object: `attachmentActionsDefaultFocus={{}}`.\n   */\n  attachmentActionsDefaultFocus?: AttachmentActionsDefaultFocusByType;\n  /** Custom UI component for displaying attachment actions, defaults to and accepts same props as: [AttachmentActions](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/AttachmentActions.tsx) */\n  AttachmentActions?: React.ComponentType<AttachmentActionsProps>;\n  /** Custom UI component for displaying an audio type attachment, defaults to and accepts same props as: [Audio](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Audio.tsx) */\n  Audio?: React.ComponentType<AudioProps>;\n  /** Custom UI component for displaying a card type attachment, defaults to and accepts same props as: [Card](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Card.tsx) */\n  Card?: React.ComponentType<CardProps>;\n  /** Custom UI component for displaying a file type attachment, defaults to and accepts same props as: [File](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/FileAttachment.tsx) */\n  File?: React.ComponentType<FileAttachmentProps>;\n  /** Custom UI component for displaying a gallery of image type attachments, defaults to and accepts same props as: [ModalGallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/ModalGallery.tsx) */\n  ModalGallery?: React.ComponentType<ModalGalleryProps>;\n  Geolocation?: React.ComponentType<GeolocationProps>;\n  /** Custom UI component for displaying a Giphy image, defaults to and accepts same props as: [Giphy](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Giphy.tsx) */\n  Giphy?: React.ComponentType<GiphyAttachmentProps>;\n  /** Custom UI component for displaying an image type attachment, defaults to and accepts same props as: [Image](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/Image.tsx) */\n  Image?: React.ComponentType<ImageProps>;\n  /** Optional flag to signal that an attachment is a displayed as a part of a quoted message */\n  isQuoted?: boolean;\n  /** Custom UI component for displaying a media type attachment, defaults to `ReactPlayer` from 'react-player' */\n  Media?: React.ComponentType<VideoPlayerProps>;\n  /** Custom UI component for displaying unsupported attachment types, defaults to NullComponent */\n  UnsupportedAttachment?: React.ComponentType<UnsupportedAttachmentProps>;\n  /** Custom UI component for displaying an audio recording attachment, defaults to and accepts same props as: [VoiceRecording](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/VoiceRecording.tsx) */\n  VoiceRecording?: React.ComponentType<VoiceRecordingProps>;\n};\n\n/**\n * A component used for rendering message attachments.\n */\nexport const Attachment = (props: AttachmentProps) => {\n  const {\n    attachmentActionsDefaultFocus = defaultAttachmentActionsDefaultFocus,\n    attachments,\n    ...rest\n  } = props;\n\n  const groupedAttachments = useMemo(\n    () =>\n      renderGroupedAttachments({\n        attachmentActionsDefaultFocus,\n        attachments,\n        ...rest,\n      }),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [attachments, attachmentActionsDefaultFocus],\n  );\n\n  return (\n    <div className='str-chat__attachment-list'>\n      {ATTACHMENT_GROUPS_ORDER.reduce(\n        (acc, groupName) => [...acc, ...groupedAttachments[groupName]],\n        [] as React.ReactNode[],\n      )}\n    </div>\n  );\n};\n\nconst renderGroupedAttachments = ({\n  attachments,\n  ...rest\n}: AttachmentProps): GroupedRenderedAttachment => {\n  const mediaAttachments: GalleryItem[] = [];\n  const containers = attachments.reduce<GroupedRenderedAttachment>(\n    (typeMap, attachment) => {\n      if (isSharedLocationResponse(attachment)) {\n        typeMap.geolocation.push(\n          <GeolocationContainer\n            {...rest}\n            key={`geolocation-${typeMap.geolocation.length}`}\n            location={attachment}\n          />,\n        );\n      } else if (attachment.type === 'giphy') {\n        typeMap.card.push(\n          <GiphyContainer\n            key={`giphy-${typeMap.giphy.length}`}\n            {...rest}\n            attachment={attachment}\n          />,\n        );\n      } else if (isScrapedContent(attachment)) {\n        typeMap.card.push(\n          <CardContainer\n            key={`card-${typeMap.card.length}`}\n            {...rest}\n            attachment={attachment}\n          />,\n        );\n      } else if (\n        isImageAttachment(attachment) ||\n        isVideoAttachment(attachment, SUPPORTED_VIDEO_FORMATS)\n      ) {\n        mediaAttachments.push(attachment as GalleryItem);\n      } else if (\n        isAudioAttachment(attachment) ||\n        isVoiceRecordingAttachment(attachment) ||\n        isFileAttachment(attachment, SUPPORTED_VIDEO_FORMATS)\n      ) {\n        typeMap.file.push(\n          <FileContainer\n            key={`file-${typeMap.file.length}`}\n            {...rest}\n            attachment={attachment}\n          />,\n        );\n      } else {\n        typeMap.unsupported.push(\n          <UnsupportedAttachmentContainer\n            key={`unsupported-${typeMap.unsupported.length}`}\n            {...rest}\n            attachment={attachment}\n          />,\n        );\n      }\n\n      return typeMap;\n    },\n    {\n      card: [],\n      file: [],\n      geolocation: [],\n      giphy: [],\n      media: [],\n      unsupported: [],\n    },\n  );\n\n  if (mediaAttachments.length) {\n    containers.media.push(\n      <MediaContainer key='media-container' {...rest} attachments={mediaAttachments} />,\n    );\n  }\n\n  return containers;\n};\n","import { LiveLocationManager } from 'stream-chat';\nimport { useEffect, useMemo } from 'react';\nimport type { LiveLocationManagerConstructorParameters, StreamChat } from 'stream-chat';\n\nconst isMobile = () => /Mobi/i.test(navigator.userAgent);\n/**\n * Checks whether the current browser is Safari.\n */\nexport const isSafari = () => {\n  if (typeof navigator === 'undefined') return false;\n  return /^((?!chrome|android).)*safari/i.test(navigator.userAgent || '');\n};\n\n/**\n * Checks whether the current browser is Firefox.\n */\nexport const isFirefox = () => {\n  if (typeof navigator === 'undefined') return false;\n  return navigator.userAgent?.includes('Firefox');\n};\n\n/**\n * Checks whether the current browser is Google Chrome.\n */\nexport const isChrome = () => {\n  if (typeof navigator === 'undefined') return false;\n  return navigator.userAgent?.includes('Chrome');\n};\n\nconst browser = () => {\n  if (isChrome()) return 'chrome';\n  if (isFirefox()) return 'firefox';\n  if (isSafari()) return 'safari';\n  return 'other';\n};\n\nexport const useLiveLocationSharingManager = ({\n  client,\n  getDeviceId,\n  watchLocation,\n}: Omit<LiveLocationManagerConstructorParameters, 'client' | 'getDeviceId'> & {\n  client?: StreamChat | null;\n  getDeviceId?: () => string;\n}) => {\n  const manager = useMemo(() => {\n    if (!client) return null;\n\n    return new LiveLocationManager({\n      client,\n      getDeviceId:\n        getDeviceId ??\n        (() => `web-${isMobile() ? 'mobile' : 'desktop'}-${browser()}-${client.userID}`),\n      watchLocation,\n    });\n  }, [client, getDeviceId, watchLocation]);\n\n  useEffect(() => {\n    if (!manager) return;\n\n    manager.init();\n\n    return () => {\n      manager.unregisterSubscriptions();\n    };\n  }, [manager]);\n\n  return manager;\n};\n","import { useMessageComposerController } from './useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type { AttachmentManagerState } from 'stream-chat';\n\nconst stateSelector = (state: AttachmentManagerState) => ({\n  attachments: state.attachments,\n});\n\nexport const useAttachmentManagerState = () => {\n  const { attachmentManager } = useMessageComposerController();\n  const { attachments } = useStateStore(attachmentManager.state, stateSelector);\n  return {\n    attachments,\n    availableUploadSlots: attachmentManager.availableUploadSlots,\n    blockedUploadsCount: attachmentManager.blockedUploadsCount,\n    failedUploadsCount: attachmentManager.failedUploadsCount,\n    isUploadEnabled: attachmentManager.isUploadEnabled,\n    pendingUploadsCount: attachmentManager.pendingUploadsCount,\n    successfulUploadsCount: attachmentManager.successfulUploadsCount,\n    uploadsInProgressCount: attachmentManager.uploadsInProgressCount,\n  };\n};\n","import { useMessageComposerController } from './useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type {\n  AttachmentManagerState,\n  LocationComposerState,\n  PollComposerState,\n} from 'stream-chat';\n\nconst attachmentManagerStateSelector = (state: AttachmentManagerState) => ({\n  attachments: state.attachments,\n});\nconst pollComposerStateSelector = (state: PollComposerState) => ({\n  poll: state.data,\n});\nconst locationComposerStateSelector = (state: LocationComposerState) => ({\n  location: state.location,\n});\n\nexport const useAttachmentsForPreview = () => {\n  const { attachmentManager, locationComposer, pollComposer } =\n    useMessageComposerController();\n  const { attachments } = useStateStore(\n    attachmentManager.state,\n    attachmentManagerStateSelector,\n  );\n  const { poll } = useStateStore(pollComposer.state, pollComposerStateSelector);\n  const { location } = useStateStore(\n    locationComposer.state,\n    locationComposerStateSelector,\n  );\n\n  return {\n    attachments,\n    location,\n    poll,\n  };\n};\n","import { useMessageComposerController } from './useMessageComposerController';\nimport { useEffect, useState } from 'react';\n\nexport const useCanCreatePoll = () => {\n  const { pollComposer } = useMessageComposerController();\n  const [canCreatePoll, setCanCreatePoll] = useState(pollComposer.canCreatePoll);\n  useEffect(\n    () =>\n      pollComposer.state.subscribe(() => {\n        setCanCreatePoll(pollComposer.canCreatePoll);\n      }),\n    [pollComposer],\n  );\n  return canCreatePoll;\n};\n","import { type CooldownTimerState } from 'stream-chat';\n\nimport { useChannelStateContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst cooldownTimerStateSelector = (state: CooldownTimerState) => ({\n  cooldownRemaining: state.cooldownRemaining,\n});\n\n/**\n * Provides and initial value of cooldown, from which the countdown should start, e.g.:\n *\n * The value of channel.data.cooldown is 100s but 30s has already elapsed, user reloads the page,\n * the initial value is now 70s from which the countdown will continue using useTimer() hook.\n */\nexport const useCooldownRemaining = (): number => {\n  const { channel } = useChannelStateContext();\n  return (\n    useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector)\n      .cooldownRemaining ?? 0\n  );\n};\n","import { useEffect, useRef } from 'react';\nimport type { MessageComposerProps } from '../MessageComposer';\n\nexport const useTextareaRef = (props: MessageComposerProps) => {\n  const { focus } = props;\n  const textareaRef = useRef<HTMLTextAreaElement>(undefined);\n  // Focus\n  useEffect(() => {\n    if (focus && textareaRef.current) {\n      textareaRef.current.focus();\n    }\n  }, [focus]);\n\n  return {\n    textareaRef,\n  };\n};\n","import { useCallback } from 'react';\nimport { MessageComposer } from 'stream-chat';\nimport { useMessageComposerController } from './useMessageComposerController';\nimport { useChannelActionContext } from '../../../context/ChannelActionContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { useNotificationApi } from '../../Notifications';\nimport { discardPreEditSnapshot } from '../preEditSnapshot';\n\nimport type { MessageComposerProps } from '../MessageComposer';\n\nconst takeStateSnapshot = (messageComposer: MessageComposer) => {\n  const textComposerState = messageComposer.textComposer.state.getLatestValue();\n  const attachmentManagerState = messageComposer.attachmentManager.state.getLatestValue();\n  const linkPreviewsManagerState =\n    messageComposer.linkPreviewsManager.state.getLatestValue();\n  const pollComposerState = messageComposer.pollComposer.state.getLatestValue();\n  const customDataManagerState = messageComposer.customDataManager.state.getLatestValue();\n  const state = messageComposer.state.getLatestValue();\n\n  return () => {\n    messageComposer.state.next(state);\n    messageComposer.textComposer.state.next(textComposerState);\n    messageComposer.attachmentManager.state.next(attachmentManagerState);\n    messageComposer.linkPreviewsManager.state.next(linkPreviewsManagerState);\n    messageComposer.pollComposer.state.next(pollComposerState);\n    messageComposer.customDataManager.state.next(customDataManagerState);\n  };\n};\n\nexport const useSubmitHandler = (props: MessageComposerProps) => {\n  const { overrideSubmitHandler } = props;\n\n  const { addNotification } = useNotificationApi();\n  const { editMessage, sendMessage } = useChannelActionContext('useSubmitHandler');\n  const { t } = useTranslationContext('useSubmitHandler');\n  const messageComposer = useMessageComposerController();\n\n  const handleSubmit = useCallback(\n    async (event?: React.BaseSyntheticEvent) => {\n      event?.preventDefault();\n      const composition = await messageComposer.compose();\n      if (!composition || !composition.message) return;\n\n      const { localMessage, message, sendOptions } = composition;\n\n      if (messageComposer.editedMessage && localMessage.type !== 'error') {\n        try {\n          await editMessage(localMessage, sendOptions);\n          discardPreEditSnapshot(messageComposer);\n          messageComposer.clear();\n        } catch (err) {\n          addNotification({\n            emitter: 'MessageComposer',\n            incident: {\n              domain: 'api',\n              entity: 'message',\n              operation: 'edit',\n            },\n            message: t('Edit message request failed'),\n            severity: 'error',\n          });\n        }\n      } else {\n        const restoreComposerStateSnapshot = takeStateSnapshot(messageComposer);\n        try {\n          // FIXME: once MessageComposer has sendMessage method, then the following condition should be encapsulated by it\n          // keep attachments, text, quoted message (treat them as draft) ... if sending a poll\n          const sentPollMessage = !!message.poll_id;\n          if (sentPollMessage) {\n            messageComposer.state.partialNext({\n              id: MessageComposer.generateId(),\n              pollId: null,\n            });\n          } else {\n            messageComposer.clear();\n          }\n          // todo: get rid of overrideSubmitHandler once MessageComposer supports submission flow\n          if (overrideSubmitHandler) {\n            await overrideSubmitHandler({\n              cid: messageComposer.channel.cid,\n              localMessage,\n              message,\n              sendOptions,\n            });\n          } else {\n            await sendMessage({ localMessage, message, options: sendOptions });\n          }\n          if (messageComposer.config.text.publishTypingEvents)\n            await messageComposer.channel.stopTyping();\n        } catch (err) {\n          restoreComposerStateSnapshot();\n          addNotification({\n            emitter: 'MessageComposer',\n            incident: {\n              domain: 'api',\n              entity: 'message',\n              operation: 'send',\n            },\n            message: t('Send message request failed'),\n            severity: 'error',\n          });\n        }\n      }\n    },\n    [\n      addNotification,\n      editMessage,\n      messageComposer,\n      overrideSubmitHandler,\n      sendMessage,\n      t,\n    ],\n  );\n\n  return { handleSubmit };\n};\n","import clsx from 'clsx';\nimport { nanoid } from 'nanoid';\nimport type { ComponentProps } from 'react';\nimport React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport { useHandleFileChangeWrapper } from './utils';\nimport { useMessageComposerContext, useTranslationContext } from '../../context';\nimport { useMessageComposerController } from '../MessageComposer/hooks/useMessageComposerController';\nimport { useAttachmentManagerState } from '../MessageComposer/hooks/useAttachmentManagerState';\nimport { useIsCooldownActive } from '../MessageComposer/hooks/useIsCooldownActive';\nimport { useStateStore } from '../../store';\nimport type { MessageComposerConfig } from 'stream-chat';\nimport type { PartialSelected } from '../../types/types';\n\nconst attachmentManagerConfigStateSelector = (state: MessageComposerConfig) => ({\n  acceptedFiles: state.attachments.acceptedFiles,\n  maxNumberOfFilesPerMessage: state.attachments.maxNumberOfFilesPerMessage,\n});\n\nexport type FileInputProps = {\n  onFileChange: (files: Array<File>) => void;\n  resetOnChange?: boolean;\n} & Omit<ComponentProps<'input'>, 'type' | 'onChange'>;\n\nexport const FileInput = forwardRef(function FileInput(\n  { onFileChange, resetOnChange = true, ...rest }: FileInputProps,\n  ref: React.ForwardedRef<HTMLInputElement>,\n) {\n  const handleInputChange = useHandleFileChangeWrapper(resetOnChange, onFileChange);\n\n  return <input onChange={handleInputChange} ref={ref} type='file' {...rest} />;\n});\n\nexport const UploadFileInput = forwardRef(function UploadFileInput(\n  {\n    className,\n    onFileChange: onFileChangeCustom,\n    ...props\n  }: PartialSelected<FileInputProps, 'onFileChange'>,\n  ref: React.ForwardedRef<HTMLInputElement>,\n) {\n  const { t } = useTranslationContext('UploadFileInput');\n  const { textareaRef } = useMessageComposerContext();\n  const messageComposer = useMessageComposerController();\n  const { attachmentManager } = messageComposer;\n  const { isUploadEnabled } = useAttachmentManagerState();\n  const { acceptedFiles, maxNumberOfFilesPerMessage } = useStateStore(\n    messageComposer.configState,\n    attachmentManagerConfigStateSelector,\n  );\n  const isCooldownActive = useIsCooldownActive();\n  const id = useMemo(() => nanoid(), []);\n\n  const onFileChange = useCallback(\n    (files: Array<File>) => {\n      attachmentManager.uploadFiles(files);\n      textareaRef.current?.focus();\n      onFileChangeCustom?.(files);\n    },\n    [onFileChangeCustom, attachmentManager, textareaRef],\n  );\n\n  return (\n    <FileInput\n      accept={acceptedFiles?.join(',')}\n      aria-label={t('aria/File upload')}\n      data-testid='file-input'\n      disabled={!isUploadEnabled || isCooldownActive}\n      id={id}\n      multiple={maxNumberOfFilesPerMessage > 1}\n      {...props}\n      className={clsx('str-chat__file-input', className)}\n      onFileChange={onFileChange}\n      ref={ref}\n    />\n  );\n});\n","import { useCallback } from 'react';\nimport { useMessageComposerController } from './useMessageComposerController';\nimport { dataTransferItemsToFiles } from '../../ReactFileUtilities';\n\nexport const usePasteHandler = () => {\n  const { attachmentManager, textComposer } = useMessageComposerController();\n  const onPaste = useCallback(\n    (clipboardEvent: React.ClipboardEvent<HTMLTextAreaElement>) => {\n      (async (event) => {\n        const { items } = event.clipboardData;\n        event.preventDefault();\n        // Get a promise for the plain text in case no files are\n        // found. This needs to be done here because chrome cleans\n        // up the DataTransferItems after resolving of a promise.\n        let plainTextPromise: Promise<string> | undefined = undefined;\n        for (let i = 0; i < items.length; i++) {\n          const item = items[i];\n          if (item.kind === 'string' && item.type === 'text/plain') {\n            plainTextPromise = new Promise((resolve) => {\n              item.getAsString((string) => {\n                resolve(string);\n              });\n            });\n            break;\n          }\n        }\n\n        const fileLikes = await dataTransferItemsToFiles(Array.from(items));\n\n        if (plainTextPromise) {\n          const pastedText = await plainTextPromise;\n          textComposer.insertText({ text: pastedText });\n        } else {\n          attachmentManager.uploadFiles(fileLikes);\n        }\n      })(clipboardEvent);\n    },\n    [attachmentManager, textComposer],\n  );\n\n  return { onPaste };\n};\n","export interface SubscriptionLike {\n  closed: boolean;\n\n  unsubscribe(): void;\n}\n\nexport class Subscription implements SubscriptionLike {\n  closed = false;\n  private _unsubscribe: (() => void) | undefined;\n\n  constructor(unsubscribe?: () => void) {\n    this._unsubscribe = unsubscribe;\n  }\n\n  unsubscribe() {\n    this.closed = true;\n    this._unsubscribe?.();\n  }\n}\n","type Next<T> = (value: T) => void;\nexport type Observer<T> = {\n  next(value: T): void;\n  complete?(): void;\n  error?(error: Error): void;\n};\nexport type ObserverOrNext<T> = Next<T> | Observer<T>;\n\nexport function createObserver<T>(observerOrNext: ObserverOrNext<T>): Observer<T> {\n  return typeof observerOrNext === 'function' ? { next: observerOrNext } : observerOrNext;\n}\n","import type { ObserverOrNext } from './Observer';\nimport { createObserver } from './Observer';\nimport { Subscription } from './Subscription';\n\nexport interface Unsubscribable {\n  unsubscribe(): void;\n}\n\ntype Producer<T> = (observer: ObserverOrNext<T>) => Subscription;\n\nexport interface Subscribable<T> {\n  subscribe(observerOrNext: ObserverOrNext<T>): Unsubscribable;\n}\n\nexport class Observable<T> implements Subscribable<T> {\n  protected _closed = false;\n  private _producer: Producer<T> | undefined;\n\n  constructor(producer?: Producer<T>) {\n    if (producer) this._producer = producer;\n  }\n\n  get closed() {\n    return this._closed;\n  }\n\n  subscribe(observerOrNext: ObserverOrNext<T>): Subscription {\n    const observer = createObserver<T>(observerOrNext);\n    if (!this.closed) {\n      this._producer?.(observer);\n    }\n    return new Subscription(() => {\n      this._closed = true;\n    });\n  }\n}\n","import { Observable } from './Observable';\nimport type { SubscriptionLike } from './Subscription';\nimport { Subscription } from './Subscription';\nimport type { Observer, ObserverOrNext } from './Observer';\nimport { createObserver } from './Observer';\n\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n  private _observers: Map<number, Observer<T>> = new Map();\n  private _observerCounter = 0;\n  thrownError: Error | undefined;\n\n  constructor() {\n    super();\n  }\n\n  get observers() {\n    return Array.from(this._observers.values());\n  }\n\n  next(value: T) {\n    if (this.closed) return;\n    const observers = this.observers;\n    for (let i = 0; i < observers.length; i++) {\n      observers[i].next(value);\n    }\n  }\n\n  error(err: Error) {\n    if (this.closed) return;\n    this.thrownError = err;\n    const { observers } = this;\n    for (let i = 0; i < observers.length; i++) {\n      observers[i].error?.(err);\n    }\n    this._observers.clear();\n  }\n\n  complete() {\n    if (this.closed) return;\n    this._closed = true;\n    const { observers } = this;\n    for (let i = 0; i < observers.length; i++) {\n      observers[i].complete?.();\n    }\n    this._observers.clear();\n  }\n\n  subscribe(observerOrNext: ObserverOrNext<T>): Subscription {\n    const observer = createObserver<T>(observerOrNext);\n    if (this.thrownError || this.closed) {\n      const subscription = new Subscription();\n      subscription.closed = true;\n      return subscription;\n    }\n\n    const observerId = this._observerCounter++;\n    this._observers.set(observerId, observer);\n    return new Subscription(() => {\n      this._observers.delete(observerId);\n    });\n  }\n\n  unsubscribe(): void {\n    this._closed = true;\n    this._observers.clear();\n  }\n}\n","import { Subject } from './Subject';\nimport type { ObserverOrNext } from './Observer';\nimport { createObserver } from './Observer';\nimport type { Subscription } from './Subscription';\n\nexport class BehaviorSubject<T> extends Subject<T> {\n  constructor(private _value: T) {\n    super();\n  }\n\n  get value(): T {\n    const { _value, thrownError } = this;\n    if (thrownError) {\n      throw thrownError;\n    }\n    return _value;\n  }\n\n  subscribe(observerOrNext: ObserverOrNext<T>): Subscription {\n    const observer = createObserver<T>(observerOrNext);\n    const subscription = super.subscribe(observerOrNext);\n    if (!subscription.closed) observer.next(this._value);\n    return subscription;\n  }\n\n  next(value: T): void {\n    super.next((this._value = value));\n  }\n}\n","import type { RecordedMediaType } from '../../ReactFileUtilities';\nimport type { ChangeEvent } from 'react';\nimport { Subscription } from '../observable/Subscription';\nimport { Subject } from '../observable/Subject';\nimport { BehaviorSubject } from '../observable/BehaviorSubject';\n\nexport enum RecordingPermission {\n  CAM = 'camera',\n  MIC = 'microphone',\n}\n\nconst MEDIA_TO_PERMISSION: Record<RecordedMediaType, RecordingPermission> = {\n  audio: RecordingPermission.MIC,\n  video: RecordingPermission.CAM,\n};\n\nexport type BrowserPermissionOptions = {\n  mediaType: RecordedMediaType;\n};\n\nexport class BrowserPermission {\n  name: string;\n  state = new BehaviorSubject<PermissionState | undefined>(undefined);\n  status = new BehaviorSubject<PermissionStatus | undefined>(undefined);\n  error = new Subject<Error | undefined>();\n\n  private changeSubscriptions: Subscription[] = [];\n\n  constructor({ mediaType }: BrowserPermissionOptions) {\n    this.name = MEDIA_TO_PERMISSION[mediaType];\n  }\n\n  get isWatching() {\n    return this.changeSubscriptions.some((subscription) => !subscription.closed);\n  }\n\n  async watch() {\n    if (!this.status.value) {\n      await this.check();\n      if (!this.status.value) return;\n    }\n\n    const status = this.status.value;\n    const handlePermissionChange = (e: Event) => {\n      const { state } = (e as unknown as ChangeEvent<PermissionStatus>).target;\n      this.state.next(state);\n    };\n    status.addEventListener('change', handlePermissionChange);\n\n    this.changeSubscriptions.push(\n      new Subscription(() => {\n        status.removeEventListener('change', handlePermissionChange);\n      }),\n    );\n  }\n\n  unwatch() {\n    this.changeSubscriptions.forEach((subscription) => subscription.unsubscribe());\n  }\n\n  async check() {\n    if (!this.name) {\n      this.error.next(new Error('Unknown media recording permission'));\n      return;\n    }\n\n    let permissionState: PermissionState;\n    try {\n      const permissionStatus = await navigator.permissions.query({\n        name: this.name as unknown as PermissionName,\n      });\n      permissionState = permissionStatus.state;\n      this.status.next(permissionStatus);\n    } catch (e) {\n      // permission does not exist - cannot be queried\n      // an example would be Firefox - camera, neither microphone perms can be queried\n      permissionState = 'granted' as PermissionState;\n    }\n    this.state.next(permissionState);\n  }\n}\n","import mergeWith from 'lodash.mergewith';\n\nconst overrideEverything = (_: unknown, source: unknown) => source;\n\nexport const mergeDeep = <TObject, TSource>(target: TObject, source: TSource) =>\n  mergeWith<TObject, TSource>(target, source, overrideEverything);\n\nconst overrideUndefinedOnly = (object: unknown, source: unknown) => object ?? source;\n\nexport const mergeDeepUndefined = <TObject, TSource>(target: TObject, source: TSource) =>\n  mergeWith<TObject, TSource>(target, source, overrideUndefinedOnly);\n","import { BehaviorSubject } from '../observable/BehaviorSubject';\nimport { Subject } from '../observable/Subject';\nimport { mergeDeepUndefined } from '../../../utils/mergeDeep';\n\nconst MAX_FREQUENCY_AMPLITUDE = 255 as const;\n\nconst logError = (e?: Error) => e && console.error('[AMPLITUDE RECORDER ERROR]', e);\n\nconst rootMeanSquare = (values: Uint8Array) =>\n  Math.sqrt(values.reduce((acc, val) => acc + Math.pow(val, 2), 0) / values.length);\n\n/**\n * fftSize\n * An unsigned integer, representing the window size of the FFT, given in number of samples.\n * A higher value will result in more details in the frequency domain but fewer details\n * in the amplitude domain.\n *\n * Must be a power of 2 between 2^5 and 2^15, so one of: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, and 32768.\n * Defaults to 32.\n *\n * maxDecibels\n * A double, representing the maximum decibel value for scaling the FFT analysis data,\n * where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc.\n * The default value is -30 dB.\n *\n * minDecibels\n * A double, representing the minimum decibel value for scaling the FFT analysis data,\n * where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc.\n * The default value is -100 dB.\n */\nexport type AmplitudeAnalyserConfig = Pick<\n  AnalyserNode,\n  'fftSize' | 'maxDecibels' | 'minDecibels'\n>;\nexport type AmplitudeRecorderConfig = {\n  analyserConfig: AmplitudeAnalyserConfig;\n  sampleCount: number;\n  samplingFrequencyMs: number;\n};\n\nexport const DEFAULT_AMPLITUDE_RECORDER_CONFIG: AmplitudeRecorderConfig = {\n  analyserConfig: {\n    fftSize: 32,\n    maxDecibels: 0,\n    minDecibels: -100,\n  } as AmplitudeAnalyserConfig,\n  sampleCount: 100,\n  samplingFrequencyMs: 60,\n};\n\ntype AmplitudeAnalyserOptions = {\n  stream: MediaStream;\n  config?: AmplitudeRecorderConfig;\n};\n\nexport enum AmplitudeRecorderState {\n  CLOSED = 'closed',\n  RECORDING = 'recording',\n  STOPPED = 'stopped',\n}\n\nexport class AmplitudeRecorder {\n  audioContext: AudioContext | undefined;\n  analyserNode: AnalyserNode | undefined;\n  microphone: MediaStreamAudioSourceNode | undefined;\n  stream: MediaStream;\n\n  config: AmplitudeRecorderConfig;\n\n  amplitudeSamplingInterval: ReturnType<typeof setInterval> | undefined;\n\n  amplitudes = new BehaviorSubject<number[]>([]);\n  state = new BehaviorSubject<AmplitudeRecorderState | undefined>(undefined);\n  error = new Subject<Error | undefined>();\n\n  constructor({ config, stream }: AmplitudeAnalyserOptions) {\n    this.config = mergeDeepUndefined({ ...config }, DEFAULT_AMPLITUDE_RECORDER_CONFIG);\n    this.stream = stream;\n  }\n\n  init() {\n    this.audioContext = new AudioContext();\n    this.analyserNode = this.audioContext.createAnalyser();\n    const { analyserConfig } = this.config;\n    this.analyserNode.fftSize = analyserConfig.fftSize;\n    this.analyserNode.maxDecibels = analyserConfig.maxDecibels;\n    this.analyserNode.minDecibels = analyserConfig.minDecibels;\n\n    this.microphone = this.audioContext.createMediaStreamSource(this.stream);\n    this.microphone.connect(this.analyserNode);\n  }\n\n  stop() {\n    clearInterval(this.amplitudeSamplingInterval);\n    this.amplitudeSamplingInterval = undefined;\n    this.state.next(AmplitudeRecorderState.STOPPED);\n  }\n\n  start = () => {\n    if (this.state.value === AmplitudeRecorderState.CLOSED) return;\n    if (!this.stream) {\n      throw new Error(\n        'Missing MediaStream instance. Cannot to start amplitude recording',\n      );\n    }\n\n    if (this.state.value === AmplitudeRecorderState.RECORDING) this.stop();\n\n    if (!this.analyserNode) {\n      if (!this.stream) return;\n      this.init();\n    }\n\n    this.state.next(AmplitudeRecorderState.RECORDING);\n\n    this.amplitudeSamplingInterval = setInterval(() => {\n      if (!(this.analyserNode && this.state.value === AmplitudeRecorderState.RECORDING))\n        return;\n      const frequencyBins = new Uint8Array(this.analyserNode.frequencyBinCount);\n      try {\n        this.analyserNode.getByteFrequencyData(frequencyBins);\n      } catch (e) {\n        logError(e as Error);\n        this.error.next(e as Error);\n        return;\n      }\n      const normalizedSignalStrength =\n        rootMeanSquare(frequencyBins) / MAX_FREQUENCY_AMPLITUDE;\n      this.amplitudes.next([...this.amplitudes.value, normalizedSignalStrength]);\n    }, this.config.samplingFrequencyMs);\n  };\n\n  close() {\n    if (this.state.value !== AmplitudeRecorderState.STOPPED) this.stop();\n    this.state.next(AmplitudeRecorderState.CLOSED);\n    this.amplitudes.next([]);\n    this.microphone?.disconnect();\n    this.analyserNode?.disconnect();\n    if (this.audioContext?.state !== 'closed') this.audioContext?.close();\n  }\n}\n","import { renderAudio, toAudioBuffer } from './audioProcessing';\n\nconst WAV_HEADER_LENGTH_BYTES = 44 as const;\nconst BYTES_PER_SAMPLE = 2 as const;\nconst RIFF_FILE_MAX_BYTES = 4294967295 as const;\n\nconst HEADER = {\n  AUDIO_FORMAT: { offset: 20, value: 1 }, // PCM = 1\n  BITS_PER_SAMPLE: { offset: 34, value: BYTES_PER_SAMPLE * 8 }, // 16 bits encoding\n  BLOCK_ALIGN: { offset: 32 },\n  BYTE_RATE: { offset: 28 },\n  CHANNEL_COUNT: { offset: 22 }, // 1 - mono, 2 - stereo\n  CHUNK_ID: { offset: 0, value: 0x52494646 }, // hex representation of string \"RIFF\" (Resource Interchange File Format) - identifies the file structure that defines a class of more specific file formats, e.g. WAVE\n  CHUNK_SIZE: { offset: 4 },\n  FILE_FORMAT: { offset: 8, value: 0x57415645 }, // hex representation of string \"WAVE\"\n  SAMPLE_RATE: { offset: 24 },\n  SUBCHUNK1_ID: { offset: 12, value: 0x666d7420 }, // hex representation of string \"fmt \" - identifies the start of \"format\" section of the header\n  SUBCHUNK1_SIZE: { offset: 16, value: 16 }, // Subchunk1 Size without SUBCHUNK1_ID and SUBCHUNK1_SIZE fields\n  SUBCHUNK2_ID: { offset: 36, value: 0x64617461 }, // hex representation of string \"data\" - identifies the start of actual audio data section\n  SUBCHUNK2_SIZE: { offset: 40 }, // actual audio data size\n} as const;\n\nconst fourCharsToInt = (chars: string) =>\n  (chars.charCodeAt(0) << 24) |\n  (chars.charCodeAt(1) << 16) |\n  (chars.charCodeAt(2) << 8) |\n  chars.charCodeAt(3);\n\nconst WAV_HEADER_FLAGS = {\n  data: fourCharsToInt('data'),\n  fmt: fourCharsToInt('fmt '),\n  RIFF: fourCharsToInt('RIFF'),\n  WAVE: fourCharsToInt('WAVE'),\n};\n\ntype WriteWaveHeaderParams = {\n  arrayBuffer: ArrayBuffer;\n  // 1 - mono, 2 - stereo\n  channelCount: number;\n  // Number of samples per second, e.g. 44100Hz\n  sampleRate: number;\n};\nconst writeWavHeader = ({\n  arrayBuffer,\n  channelCount,\n  sampleRate,\n}: WriteWaveHeaderParams) => {\n  const byteRate = sampleRate * channelCount * BYTES_PER_SAMPLE; // bytes/sec\n  const blockAlign = channelCount * BYTES_PER_SAMPLE;\n\n  const dataView = new DataView(arrayBuffer);\n  /*\n   * The maximum size of a RIFF file is 4294967295 bytes and since the header takes up 44 bytes there are 4294967251 bytes left for the\n   * data chunk.\n   */\n  const dataChunkSize = Math.min(\n    dataView.byteLength - WAV_HEADER_LENGTH_BYTES,\n    RIFF_FILE_MAX_BYTES - WAV_HEADER_LENGTH_BYTES,\n  );\n\n  dataView.setUint32(HEADER.CHUNK_ID.offset, HEADER.CHUNK_ID.value); // \"RIFF\"\n  dataView.setUint32(HEADER.CHUNK_SIZE.offset, arrayBuffer.byteLength - 8, true); // adjustment for the first two headers - chunk id + file size\n  dataView.setUint32(HEADER.FILE_FORMAT.offset, HEADER.FILE_FORMAT.value); // \"WAVE\"\n\n  dataView.setUint32(HEADER.SUBCHUNK1_ID.offset, HEADER.SUBCHUNK1_ID.value); // \"fmt \"\n  dataView.setUint32(HEADER.SUBCHUNK1_SIZE.offset, HEADER.SUBCHUNK1_SIZE.value, true);\n  dataView.setUint16(HEADER.AUDIO_FORMAT.offset, HEADER.AUDIO_FORMAT.value, true);\n  dataView.setUint16(HEADER.CHANNEL_COUNT.offset, channelCount, true);\n  dataView.setUint32(HEADER.SAMPLE_RATE.offset, sampleRate, true);\n  dataView.setUint32(HEADER.BYTE_RATE.offset, byteRate, true);\n  dataView.setUint16(HEADER.BLOCK_ALIGN.offset, blockAlign, true);\n  dataView.setUint16(HEADER.BITS_PER_SAMPLE.offset, HEADER.BITS_PER_SAMPLE.value, true);\n\n  dataView.setUint32(HEADER.SUBCHUNK2_ID.offset, HEADER.SUBCHUNK2_ID.value); // \"data\"\n  dataView.setUint32(HEADER.SUBCHUNK2_SIZE.offset, dataChunkSize, true);\n};\n\nexport const readWavHeader = (dataView: DataView) => {\n  const header = dataView.getUint32(0, false);\n  if (WAV_HEADER_FLAGS.RIFF !== header) {\n    console.error('Missing RIFF header in WAVE file');\n    return;\n  }\n  if (WAV_HEADER_FLAGS.WAVE !== dataView.getUint32(HEADER.FILE_FORMAT.offset, false)) {\n    console.error('Missing WAVE header in WAVE file');\n    return;\n  }\n  if (WAV_HEADER_FLAGS.fmt !== dataView.getUint32(HEADER.SUBCHUNK1_ID.offset, false)) {\n    console.error('Missing fmt header in WAVE file');\n    return;\n  }\n\n  return {\n    audioDataSizeBytes: dataView.getUint32(HEADER.SUBCHUNK2_SIZE.offset, true),\n    audioDataStartOffset: WAV_HEADER_LENGTH_BYTES,\n    channelCount: dataView.getUint16(HEADER.CHANNEL_COUNT.offset, true),\n    sampleRate: dataView.getUint32(HEADER.SAMPLE_RATE.offset, true),\n  };\n};\n\nconst splitDataByChannel = (audioBuffer: AudioBuffer) =>\n  Array.from({ length: audioBuffer.numberOfChannels }, (_, i) =>\n    audioBuffer.getChannelData(i),\n  );\n\ntype WriteAudioDataParams = {\n  arrayBuffer: ArrayBuffer;\n  dataByChannel: Float32Array[];\n};\n\n/**\n * In a WAV file, samples for each channel are usually interleaved, meaning samples from each channel are grouped together sequentially.\n * For example, in a stereo audio file (2 channels), samples alternate between the left and right channels.\n * @param arrayBuffer\n * @param dataByChannel\n */\nconst writeWavAudioData = ({ arrayBuffer, dataByChannel }: WriteAudioDataParams) => {\n  const dataView = new DataView(arrayBuffer);\n  const channelCount = dataByChannel.length;\n\n  dataByChannel.forEach((channelData, channelIndex) => {\n    let writeOffset = WAV_HEADER_LENGTH_BYTES + channelCount * channelIndex;\n\n    channelData.forEach((float32Value) => {\n      dataView.setInt16(\n        writeOffset,\n        float32Value < 0\n          ? Math.max(-1, float32Value) * 32768\n          : Math.min(1, float32Value) * 32767,\n        true,\n      );\n      writeOffset += channelCount * BYTES_PER_SAMPLE;\n    });\n  });\n};\n\nexport const encodeToWaw = async (file: File, sampleRate: number) => {\n  const audioBuffer = await renderAudio(await toAudioBuffer(file), sampleRate);\n  const numberOfSamples = audioBuffer.duration * sampleRate;\n  const fileSizeBytes =\n    numberOfSamples * audioBuffer.numberOfChannels * BYTES_PER_SAMPLE +\n    WAV_HEADER_LENGTH_BYTES;\n\n  const arrayBuffer = new ArrayBuffer(fileSizeBytes);\n  writeWavHeader({ arrayBuffer, channelCount: audioBuffer.numberOfChannels, sampleRate });\n  writeWavAudioData({ arrayBuffer, dataByChannel: splitDataByChannel(audioBuffer) });\n  return new Blob([arrayBuffer], { type: 'audio/wav' });\n};\n","import { encodeToWaw } from './wav';\nimport { createFileFromBlobs, getExtensionFromMimeType } from '../../ReactFileUtilities';\n\nexport type TranscoderConfig = {\n  // defaults to 16000Hz\n  sampleRate: number;\n  // Custom encoder function that converts the recorded audio file into a blob with the desired MIME type\n  encoder?: (file: File, sampleRate: number) => Promise<Blob>;\n};\n\nexport type TranscodeParams = TranscoderConfig & {\n  blob: Blob;\n};\n\nexport const transcode = ({\n  blob,\n  encoder = encodeToWaw,\n  sampleRate,\n}: TranscodeParams): Promise<Blob> =>\n  encoder(\n    createFileFromBlobs({\n      blobsArray: [blob],\n      fileName: `audio_recording_${new Date().toISOString()}.${getExtensionFromMimeType(\n        blob.type,\n      )}`,\n      mimeType: blob.type,\n    }),\n    sampleRate,\n  );\n","import fixWebmDuration from 'fix-webm-duration';\nimport { nanoid } from 'nanoid';\nimport {\n  AmplitudeRecorder,\n  DEFAULT_AMPLITUDE_RECORDER_CONFIG,\n} from './AmplitudeRecorder';\nimport { BrowserPermission } from './BrowserPermission';\nimport { BehaviorSubject, Subject } from '../observable';\nimport type { TranscoderConfig } from '../transcode';\nimport { transcode } from '../transcode';\nimport { resampleWaveformData } from '../../Attachment';\nimport type { RecordedMediaType } from '../../ReactFileUtilities';\nimport {\n  createFileFromBlobs,\n  getExtensionFromMimeType,\n  getRecordedMediaTypeFromMimeType,\n} from '../../ReactFileUtilities';\nimport { defaultTranslatorFunction } from '../../../i18n';\nimport { mergeDeepUndefined } from '../../../utils/mergeDeep';\nimport type { LocalVoiceRecordingAttachment } from 'stream-chat';\nimport type { AmplitudeRecorderConfig } from './AmplitudeRecorder';\nimport type { TranslationContextValue } from '../../../context';\n\nexport const RECORDED_MIME_TYPE_BY_BROWSER = {\n  audio: {\n    others: 'audio/webm',\n    safari: 'audio/mp4;codecs=mp4a.40.2',\n  },\n} as const;\n\nexport const DEFAULT_AUDIO_TRANSCODER_CONFIG: TranscoderConfig = {\n  sampleRate: 16000,\n} as const;\n\nconst disposeOfMediaStream = (stream?: MediaStream) => {\n  if (!stream?.active) return;\n  stream.getTracks().forEach((track) => {\n    track.stop();\n    stream.removeTrack(track);\n  });\n};\n\nconst logError = (e?: Error) => e && console.error('[MEDIA RECORDER ERROR]', e);\n\ntype MediaRecorderConfig = Omit<MediaRecorderOptions, 'mimeType'> &\n  Required<Pick<MediaRecorderOptions, 'mimeType'>>;\n\nexport type AudioRecorderConfig = {\n  amplitudeRecorderConfig: AmplitudeRecorderConfig;\n  mediaRecorderConfig: MediaRecorderOptions;\n  transcoderConfig: TranscoderConfig;\n};\n\ntype PartialValues<T> = { [P in keyof T]?: Partial<T[P]> };\n\nexport type CustomAudioRecordingConfig = PartialValues<AudioRecorderConfig>;\n\nexport type AudioRecorderOptions = {\n  config?: CustomAudioRecordingConfig;\n  generateRecordingTitle?: (mimeType: string) => string;\n  t?: TranslationContextValue['t'];\n};\n\nexport enum MediaRecordingState {\n  PAUSED = 'paused',\n  RECORDING = 'recording',\n  STOPPED = 'stopped',\n}\n\nexport enum RecordingAttachmentType {\n  VOICE_RECORDING = 'voiceRecording',\n}\n\nexport class MediaRecorderController {\n  permission: BrowserPermission;\n  mediaRecorder: MediaRecorder | undefined;\n  amplitudeRecorder: AmplitudeRecorder | undefined;\n\n  amplitudeRecorderConfig: AmplitudeRecorderConfig;\n  mediaRecorderConfig: MediaRecorderConfig;\n  transcoderConfig: TranscoderConfig;\n\n  startTime: number | undefined;\n  recordedChunkDurations: number[] = [];\n  recordedData: Blob[] = [];\n  recordingUri: string | undefined;\n  mediaType: RecordedMediaType;\n\n  signalRecordingReady: ((r: LocalVoiceRecordingAttachment) => void) | undefined;\n\n  recordingState = new BehaviorSubject<MediaRecordingState | undefined>(undefined);\n  recording = new BehaviorSubject<LocalVoiceRecordingAttachment | undefined>(undefined);\n  error = new Subject<Error | undefined>();\n  notification = new Subject<{ text: string; type: 'success' | 'error' } | undefined>();\n\n  customGenerateRecordingTitle: ((mimeType: string) => string) | undefined;\n  t: TranslationContextValue['t'];\n\n  constructor({ config, generateRecordingTitle, t }: AudioRecorderOptions = {}) {\n    this.t = t || defaultTranslatorFunction;\n\n    this.amplitudeRecorderConfig = mergeDeepUndefined(\n      { ...config?.amplitudeRecorderConfig },\n      DEFAULT_AMPLITUDE_RECORDER_CONFIG,\n    );\n\n    this.mediaRecorderConfig = mergeDeepUndefined(\n      { ...config?.mediaRecorderConfig },\n      {\n        mimeType: MediaRecorder.isTypeSupported('audio/webm')\n          ? RECORDED_MIME_TYPE_BY_BROWSER.audio.others\n          : RECORDED_MIME_TYPE_BY_BROWSER.audio.safari,\n      },\n    );\n\n    this.transcoderConfig = mergeDeepUndefined(\n      { ...config?.transcoderConfig },\n      DEFAULT_AUDIO_TRANSCODER_CONFIG,\n    );\n\n    const mediaType = getRecordedMediaTypeFromMimeType(this.mediaRecorderConfig.mimeType);\n    if (!mediaType) {\n      throw new Error(\n        `Unsupported media type (supported audio or video only). Provided mimeType: ${this.mediaRecorderConfig.mimeType}`,\n      );\n    }\n    this.mediaType = mediaType;\n\n    this.permission = new BrowserPermission({ mediaType });\n\n    this.customGenerateRecordingTitle = generateRecordingTitle;\n  }\n\n  get durationMs() {\n    return this.recordedChunkDurations.reduce((acc, val) => acc + val, 0);\n  }\n\n  generateRecordingTitle = (mimeType: string) => {\n    if (this.customGenerateRecordingTitle) {\n      return this.customGenerateRecordingTitle(mimeType);\n    }\n    return `${this.mediaType}_recording_${new Date().toISOString()}.${getExtensionFromMimeType(\n      mimeType,\n    )}`; // extension needed so that desktop Safari can play the asset\n  };\n\n  makeVoiceRecording = async () => {\n    if (this.recordingUri) URL.revokeObjectURL(this.recordingUri);\n\n    if (!this.recordedData.length) return;\n    const { mimeType } = this.mediaRecorderConfig;\n    let blob = new Blob(this.recordedData, { type: mimeType });\n    if (mimeType.match('audio/webm')) {\n      // The browser does not include duration metadata with the recorded blob\n      blob = await fixWebmDuration(blob, this.durationMs, {\n        logger: () => null, // prevents polluting the browser console\n      });\n    }\n    if (!mimeType.match('audio/mp4')) {\n      blob = await transcode({\n        blob,\n        ...this.transcoderConfig,\n      });\n    }\n\n    if (!blob) return;\n\n    this.recordingUri = URL.createObjectURL(blob);\n    const file = createFileFromBlobs({\n      blobsArray: [blob],\n      fileName: this.generateRecordingTitle(blob.type),\n      mimeType: blob.type,\n    });\n\n    return {\n      asset_url: this.recordingUri,\n      duration: this.durationMs / 1000,\n      file_size: blob.size,\n      localMetadata: {\n        file,\n        id: nanoid(),\n      },\n      mime_type: blob.type,\n      title: file.name,\n      type: RecordingAttachmentType.VOICE_RECORDING,\n      waveform_data: resampleWaveformData(\n        this.amplitudeRecorder?.amplitudes.value ?? [],\n        this.amplitudeRecorderConfig.sampleCount,\n      ),\n    } as LocalVoiceRecordingAttachment;\n  };\n\n  handleErrorEvent = (e: Event) => {\n    const { error } = e as ErrorEvent;\n    logError(error);\n    this.error.next(error);\n    this.notification.next({\n      text: this.t('An error has occurred during recording'),\n      type: 'error',\n    });\n  };\n\n  handleDataavailableEvent = async (e: BlobEvent) => {\n    if (!e.data.size) return;\n    if (this.mediaType !== 'audio') return;\n    try {\n      this.recordedData.push(e.data);\n      const recording = await this.makeVoiceRecording();\n      if (!recording) return;\n      this.signalRecordingReady?.(recording);\n      this.recording.next(recording);\n    } catch (e) {\n      logError(e as Error);\n      this.error.next(e as Error);\n      this.notification.next({\n        text: this.t('An error has occurred during the recording processing'),\n        type: 'error',\n      });\n    }\n  };\n\n  resetRecordingState = () => {\n    this.recordedData = [];\n    this.recording.next(undefined);\n    this.recordingState.next(undefined);\n    this.recordedChunkDurations = [];\n    this.startTime = undefined;\n  };\n\n  cleanUp = () => {\n    this.resetRecordingState();\n    if (this.recordingUri) URL.revokeObjectURL(this.recordingUri);\n    this.amplitudeRecorder?.close();\n    if (this.mediaRecorder) {\n      disposeOfMediaStream(this.mediaRecorder.stream);\n      this.mediaRecorder.removeEventListener(\n        'dataavailable',\n        this.handleDataavailableEvent,\n      );\n      this.mediaRecorder.removeEventListener('error', this.handleErrorEvent);\n    }\n  };\n\n  start = async () => {\n    if (\n      [MediaRecordingState.RECORDING, MediaRecordingState.PAUSED].includes(\n        this.recordingState.value as MediaRecordingState,\n      )\n    ) {\n      const error = new Error('Cannot start recording. Recording already in progress');\n      logError(error);\n      this.error.next(error);\n      return;\n    }\n\n    // account for requirement on iOS as per this bug report: https://bugs.webkit.org/show_bug.cgi?id=252303\n    if (!navigator.mediaDevices) {\n      const error = new Error('Media recording is not supported');\n      logError(error);\n      this.error.next(error);\n      this.notification.next({ text: this.t('Error starting recording'), type: 'error' });\n      return;\n    }\n\n    if (this.mediaType === 'video') {\n      const error = new Error(\n        `Video recording is not supported. Provided MIME type: ${this.mediaRecorderConfig.mimeType}`,\n      );\n      logError(error);\n      this.error.next(error);\n      this.notification.next({ text: this.t('Error starting recording'), type: 'error' });\n      return;\n    }\n\n    if (!this.permission.state.value) {\n      await this.permission.check();\n    }\n\n    if (this.permission.state.value === 'denied') {\n      logError(new Error('Permission denied'));\n      return;\n    }\n\n    try {\n      const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n      this.mediaRecorder = new MediaRecorder(stream, this.mediaRecorderConfig);\n\n      this.mediaRecorder.addEventListener('dataavailable', this.handleDataavailableEvent);\n      this.mediaRecorder.addEventListener('error', this.handleErrorEvent);\n\n      this.startTime = new Date().getTime();\n      this.mediaRecorder.start();\n\n      if (this.mediaType === 'audio' && stream) {\n        this.amplitudeRecorder = new AmplitudeRecorder({\n          config: this.amplitudeRecorderConfig,\n          stream,\n        });\n        this.amplitudeRecorder.start();\n      }\n\n      this.recordingState.next(MediaRecordingState.RECORDING);\n    } catch (error) {\n      logError(error as Error);\n      this.cancel();\n      this.error.next(error as Error);\n      this.notification.next({ text: this.t('Error starting recording'), type: 'error' });\n    }\n  };\n\n  pause = () => {\n    if (this.recordingState.value !== MediaRecordingState.RECORDING) return;\n    if (this.startTime) {\n      this.recordedChunkDurations.push(new Date().getTime() - this.startTime);\n      this.startTime = undefined;\n    }\n    this.mediaRecorder?.pause();\n    // Flush current chunk so preview is available while paused.\n    this.mediaRecorder?.requestData();\n    this.amplitudeRecorder?.stop();\n    this.recordingState.next(MediaRecordingState.PAUSED);\n  };\n\n  resume = () => {\n    if (this.recordingState.value !== MediaRecordingState.PAUSED) return;\n    this.startTime = new Date().getTime();\n    this.mediaRecorder?.resume();\n    this.amplitudeRecorder?.start();\n    this.recordingState.next(MediaRecordingState.RECORDING);\n  };\n\n  stop = () => {\n    const recording = this.recording.value;\n    if (recording && this.mediaRecorder?.state === 'inactive')\n      return Promise.resolve(recording);\n\n    if (\n      ![MediaRecordingState.PAUSED, MediaRecordingState.RECORDING].includes(\n        (this.mediaRecorder?.state || '') as MediaRecordingState,\n      )\n    )\n      return Promise.resolve(undefined);\n\n    if (this.startTime) {\n      this.recordedChunkDurations.push(new Date().getTime() - this.startTime);\n      this.startTime = undefined;\n    }\n    const result = new Promise<LocalVoiceRecordingAttachment>((res) => {\n      this.signalRecordingReady = res;\n    });\n    this.mediaRecorder?.stop();\n    this.amplitudeRecorder?.stop();\n    this.recordingState.next(MediaRecordingState.STOPPED);\n    return result;\n  };\n\n  cancel = () => {\n    this.stop();\n    this.cleanUp();\n  };\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { MediaRecorderController } from '../classes';\nimport { useTranslationContext } from '../../../context';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\n\nimport type { LocalVoiceRecordingAttachment } from 'stream-chat';\nimport type { CustomAudioRecordingConfig, MediaRecordingState } from '../classes';\nimport type { MessageComposerContextValue } from '../../../context';\n\nexport type RecordingController = {\n  completeRecording: () => void;\n  permissionState?: PermissionState;\n  recorder?: MediaRecorderController;\n  recording?: LocalVoiceRecordingAttachment;\n  recordingState?: MediaRecordingState;\n};\n\ntype UseMediaRecorderParams = Pick<\n  MessageComposerContextValue,\n  'asyncMessagesMultiSendEnabled' | 'handleSubmit'\n> & {\n  enabled: boolean;\n  generateRecordingTitle?: (mimeType: string) => string;\n  recordingConfig?: CustomAudioRecordingConfig;\n};\n\nexport const useMediaRecorder = ({\n  asyncMessagesMultiSendEnabled,\n  enabled,\n  generateRecordingTitle,\n  handleSubmit,\n  recordingConfig,\n}: UseMediaRecorderParams): RecordingController => {\n  const { t } = useTranslationContext('useMediaRecorder');\n  const messageComposer = useMessageComposerController();\n  const [recording, setRecording] = useState<LocalVoiceRecordingAttachment>();\n  const [recordingState, setRecordingState] = useState<MediaRecordingState>();\n  const [permissionState, setPermissionState] = useState<PermissionState>();\n  const [isScheduledForSubmit, scheduleForSubmit] = useState(false);\n\n  const recorder = useMemo(\n    () =>\n      enabled\n        ? new MediaRecorderController({\n            config: recordingConfig ?? {},\n            generateRecordingTitle,\n            t,\n          })\n        : undefined,\n    [recordingConfig, enabled, generateRecordingTitle, t],\n  );\n\n  const completeRecording = useCallback(async () => {\n    if (!recorder) return;\n    const recording = await recorder.stop();\n    if (!recording) return;\n    await messageComposer.attachmentManager.uploadAttachment(recording);\n    if (!asyncMessagesMultiSendEnabled) {\n      // FIXME: cannot call handleSubmit() directly as the function has stale reference to attachments\n      scheduleForSubmit(true);\n    }\n    recorder.cleanUp();\n  }, [asyncMessagesMultiSendEnabled, messageComposer, recorder]);\n\n  useEffect(() => {\n    if (!isScheduledForSubmit) return;\n    handleSubmit();\n    scheduleForSubmit(false);\n  }, [handleSubmit, isScheduledForSubmit]);\n\n  useEffect(() => {\n    if (!recorder) return;\n    recorder.permission.watch();\n    const recordingSubscription = recorder.recording.subscribe(setRecording);\n    const recordingStateSubscription =\n      recorder.recordingState.subscribe(setRecordingState);\n    const permissionStateSubscription =\n      recorder.permission.state.subscribe(setPermissionState);\n\n    return () => {\n      recorder.cancel();\n      recorder.permission.unwatch();\n      recordingSubscription.unsubscribe();\n      recordingStateSubscription.unsubscribe();\n      permissionStateSubscription.unsubscribe();\n    };\n  }, [recorder]);\n\n  return {\n    completeRecording,\n    permissionState,\n    recorder,\n    recording,\n    recordingState,\n  };\n};\n","import type React from 'react';\nimport { useTextareaRef } from './useTextareaRef';\nimport { useSubmitHandler } from './useSubmitHandler';\nimport { usePasteHandler } from './usePasteHandler';\nimport type { RecordingController } from '../../MediaRecorder/hooks/useMediaRecorder';\nimport { useMediaRecorder } from '../../MediaRecorder/hooks/useMediaRecorder';\nimport type { MessageComposerProps } from '../MessageComposer';\n\nexport type UseMessageComposerBindingsParams = {\n  handleSubmit: (event?: React.BaseSyntheticEvent) => void;\n  onPaste: (event: React.ClipboardEvent<HTMLTextAreaElement>) => void;\n  recordingController: RecordingController;\n  textareaRef: React.RefObject<HTMLTextAreaElement | null | undefined>;\n};\n\nexport const useMessageComposerBindings = (\n  props: MessageComposerProps,\n): UseMessageComposerBindingsParams => {\n  const { asyncMessagesMultiSendEnabled, audioRecordingConfig, audioRecordingEnabled } =\n    props;\n\n  const { textareaRef } = useTextareaRef(props);\n\n  const { handleSubmit } = useSubmitHandler(props);\n\n  const recordingController = useMediaRecorder({\n    asyncMessagesMultiSendEnabled,\n    enabled: !!audioRecordingEnabled,\n    handleSubmit,\n    recordingConfig: audioRecordingConfig,\n  });\n\n  const { onPaste } = usePasteHandler();\n\n  return {\n    handleSubmit,\n    onPaste,\n    recordingController,\n    textareaRef,\n  };\n};\n","import { useMemo } from 'react';\nimport type { CommandResponse, MessageComposerState } from 'stream-chat';\n\nimport { useStateStore } from '../../../store';\nimport { useMessageComposerController } from './useMessageComposerController';\n\nconst messageComposerStateSelector = ({\n  editedMessage,\n  quotedMessage,\n}: MessageComposerState) => ({\n  editedMessage,\n  quotedMessage,\n});\n\nexport type MessageComposerCommand = {\n  command: CommandResponse & { name: string };\n  enabled: boolean;\n};\n\nexport const useMessageComposerCommands = () => {\n  const messageComposer = useMessageComposerController();\n  const channelConfig = messageComposer.channel.getConfig();\n  const { editedMessage, quotedMessage } = useStateStore(\n    messageComposer.state,\n    messageComposerStateSelector,\n  );\n\n  return useMemo<MessageComposerCommand[]>(\n    () =>\n      (channelConfig?.commands ?? [])\n        .filter(\n          (command): command is CommandResponse & { name: string } => !!command.name,\n        )\n        .map((command) => ({\n          command,\n          enabled: !messageComposer.isCommandDisabled(command),\n        })),\n    // editedMessage and quotedMessage are necessary in deps for reactivity\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [channelConfig, editedMessage, messageComposer, quotedMessage],\n  );\n};\n","import { useMessageComposerController } from './useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type { EditingAuditState } from 'stream-chat';\n\nconst editingAuditStateStateSelector = (state: EditingAuditState) => state;\n\nexport const useMessageComposerHasSendableData = () => {\n  const messageComposer = useMessageComposerController();\n  useStateStore(messageComposer.editingAuditState, editingAuditStateStateSelector);\n  return messageComposer.hasSendableData;\n};\n","import type { EditingAuditState } from 'stream-chat';\nimport { useMessageComposerController } from './useMessageComposerController';\nimport { useStateStore } from '../../../store';\n\nconst editingAuditStateStateSelector = (state: EditingAuditState) => state;\n\nexport const useMessageContentIsEmpty = () => {\n  const messageComposer = useMessageComposerController();\n  useStateStore(messageComposer.editingAuditState, editingAuditStateStateSelector);\n  return messageComposer.contentIsEmpty;\n};\n","import clsx from 'clsx';\nimport { IconXmarkSmall } from '../Icons';\nimport { Button } from '../Button';\nimport React, { type ComponentProps } from 'react';\nimport { useTranslationContext } from '../../context';\nimport type { AttachmentLoadingState } from 'stream-chat';\n\nexport const RemoveAttachmentPreviewButton = ({\n  className,\n  uploadState,\n  ...props\n}: ComponentProps<'button'> & {\n  uploadState?: AttachmentLoadingState;\n}) => {\n  const { t } = useTranslationContext();\n  return (\n    <Button\n      aria-label={t('aria/Remove attachment')}\n      circular\n      className={clsx('str-chat__attachment-preview__remove-button', className)}\n      data-testid='preview-item-delete-button'\n      disabled={uploadState === 'uploading'}\n      {...props}\n    >\n      <IconXmarkSmall />\n    </Button>\n  );\n};\n","import React from 'react';\nimport clsx from 'clsx';\n\nexport const QuotedMessageIndicator = ({ isOwnMessage }: { isOwnMessage?: boolean }) => (\n  <div\n    className={clsx('str-chat__quoted-message-indicator', {\n      'str-chat__quoted-message-indicator--own-message': isOwnMessage,\n    })}\n  />\n);\n","import React, {\n  type ComponentType,\n  type KeyboardEvent,\n  type MouseEventHandler,\n  type ReactElement,\n  type ReactNode,\n  useMemo,\n} from 'react';\n\nimport { displayDuration, SUPPORTED_VIDEO_FORMATS } from '../Attachment';\n\nimport { useChatContext } from '../../context/ChatContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\n\nimport { useStateStore } from '../../store';\nimport { useMessageComposerController } from './hooks';\nimport {\n  type Attachment,\n  type GiphyVersions,\n  isAudioAttachment,\n  isFileAttachment,\n  isGiphyAttachment,\n  isImageAttachment,\n  isScrapedContent,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n  type LocalMessage,\n  type LocalMessageBase,\n  type MessageComposerState,\n  type PollResponse,\n  type SharedLocationResponse,\n  type TranslationLanguages,\n} from 'stream-chat';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport type { MessageContextValue } from '../../context';\nimport { RemoveAttachmentPreviewButton } from './RemoveAttachmentPreviewButton';\nimport {\n  IconCamera,\n  IconFile,\n  IconLink,\n  IconLocation,\n  IconPlayFill,\n  IconPoll,\n  IconVideo,\n  IconVoice,\n} from '../Icons';\nimport clsx from 'clsx';\nimport { BaseImage } from '../BaseImage';\nimport { FileIcon } from '../FileIcon';\nimport { QuotedMessageIndicator } from './QuotedMessageIndicator';\n\nconst messageComposerStateStoreSelector = (state: MessageComposerState) => ({\n  quotedMessage: state.quotedMessage,\n});\n\nexport type QuotedMessagePreviewProps = {\n  getQuotedMessageAuthor?: (message: LocalMessage) => string;\n  renderText?: MessageContextValue['renderText'];\n};\n\nconst NullAttachmentIcon = () => null;\n\nconst QUOTED_GIPHY_PREVIEW_LABEL = 'Giphy';\n\ntype AttachmentType = 'documents' | 'images' | 'links' | 'videos' | 'voiceRecordings';\n\n/** Giphy GIFs: only native type (e.g. /giphy command) is recognized as Giphy. */\nconst isQuotedGiphyAttachment = (attachment: Attachment) => isGiphyAttachment(attachment);\n\nconst getAttachmentType = (attachment: Attachment) => {\n  if (isQuotedGiphyAttachment(attachment)) {\n    return 'giphy';\n  }\n  if (isScrapedContent(attachment)) {\n    return 'link';\n  } else if (isVideoAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) {\n    return 'video';\n  } else if (isImageAttachment(attachment)) {\n    return 'image';\n  } else if (isAudioAttachment(attachment)) {\n    return 'audio';\n  } else if (isVoiceRecordingAttachment(attachment)) {\n    return 'voiceRecording';\n  } else if (isFileAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) {\n    return 'file';\n  }\n\n  return 'unsupported';\n};\n\ntype GroupedAttachments = Record<AttachmentType, Attachment[]> & {\n  giphies: Attachment[];\n  locations: SharedLocationResponse[];\n  polls: PollResponse[];\n  total: number;\n};\n\nconst getGroupedAttachments = (quotedMessage: LocalMessage | null) => {\n  const groupedAttachments = {\n    documents: [],\n    giphies: [],\n    images: [],\n    links: [],\n    locations: [],\n    polls: [],\n    total: 0,\n    videos: [],\n    voiceRecordings: [],\n  };\n\n  if (!quotedMessage || !quotedMessage.attachments) return groupedAttachments;\n\n  const result = quotedMessage.attachments.reduce<GroupedAttachments>(\n    (count, attachment) => {\n      switch (getAttachmentType(attachment)) {\n        case 'giphy':\n          count.giphies.push(attachment);\n          count.total += 1;\n          break;\n        case 'link':\n          count.links.push(attachment);\n          count.total += 1;\n          break;\n        case 'video':\n          count.videos.push(attachment);\n          count.total += 1;\n          break;\n        case 'voiceRecording':\n          count.voiceRecordings.push(attachment);\n          count.total += 1;\n          break;\n        case 'audio':\n        case 'file':\n          count.documents.push(attachment);\n          count.total += 1;\n          break;\n        default:\n          if (isImageAttachment(attachment)) {\n            count.images.push(attachment);\n            count.total += 1;\n          }\n      }\n\n      return count;\n    },\n    groupedAttachments,\n  );\n  if (quotedMessage.shared_location) {\n    result.locations.push(quotedMessage.shared_location);\n    result.total += 1;\n  } else if (quotedMessage.poll) {\n    result.polls.push(quotedMessage.poll);\n    result.total += 1;\n  }\n\n  return result;\n};\n\ntype PreviewType =\n  | 'voice'\n  | 'file'\n  | 'image'\n  | 'giphy'\n  | 'link'\n  | 'location'\n  | 'poll'\n  | 'video'\n  | 'mixed';\n\nconst getAttachmentIconWithType = (\n  quotedMessage: LocalMessage | null,\n  giphyVersionName: GiphyVersions,\n): {\n  groupedAttachments: GroupedAttachments;\n  Icon: ComponentType;\n  PreviewImage: ReactElement | null;\n  previewType: PreviewType | null;\n} => {\n  const groupedAttachments = getGroupedAttachments(quotedMessage);\n  const result = {\n    groupedAttachments,\n    Icon: NullAttachmentIcon,\n    PreviewImage: null,\n    previewType: null,\n  };\n  if (!groupedAttachments.total) return result;\n  if (groupedAttachments.polls.length > 0)\n    return { ...result, Icon: IconPoll, previewType: 'poll' };\n  if (groupedAttachments.locations.length > 0)\n    // todo: we do not generate the location preview image\n    return { ...result, Icon: IconLocation, previewType: 'location' };\n  if (\n    groupedAttachments.giphies.length > 0 &&\n    groupedAttachments.giphies.length === groupedAttachments.total\n  ) {\n    const giphyAttachment = groupedAttachments.giphies[0] as Attachment & {\n      giphy?: Record<string, { url?: string } | undefined>;\n    };\n    const giphyVersion =\n      giphyAttachment.giphy?.[giphyVersionName as keyof NonNullable<Attachment['giphy']>];\n    const src =\n      giphyVersion?.url || giphyAttachment.thumb_url || giphyAttachment.image_url || '';\n    return {\n      ...result,\n      Icon: IconFile,\n      PreviewImage: (\n        <BaseImage\n          alt={QUOTED_GIPHY_PREVIEW_LABEL}\n          className='str-chat__attachment-preview__thumbnail'\n          src={src}\n          title={QUOTED_GIPHY_PREVIEW_LABEL}\n        />\n      ),\n      previewType: 'giphy',\n    };\n  }\n  if (\n    groupedAttachments.documents.length === groupedAttachments.total &&\n    groupedAttachments.documents.length === 1\n  ) {\n    const fileAttachment = groupedAttachments.documents[0] as Attachment;\n    return {\n      ...result,\n      Icon: IconFile,\n      PreviewImage: (\n        <FileIcon fileName={fileAttachment.title} mimeType={fileAttachment.mime_type} />\n      ),\n      previewType: 'file',\n    };\n  }\n  if (groupedAttachments.links.length === groupedAttachments.total) {\n    const linkAttachment = groupedAttachments.links[0];\n    return {\n      ...result,\n      Icon: IconLink,\n      PreviewImage: (\n        <BaseImage\n          alt={linkAttachment.title}\n          className='str-chat__attachment-preview__thumbnail'\n          src={linkAttachment.thumb_url || linkAttachment.image_url}\n          title={linkAttachment.title}\n        />\n      ),\n      previewType: 'link',\n    };\n  }\n  if (groupedAttachments.videos.length === groupedAttachments.total) {\n    const videoAttachment = groupedAttachments.videos[0];\n    return {\n      ...result,\n      Icon: IconVideo,\n      PreviewImage: (\n        <>\n          <BaseImage\n            alt={videoAttachment.asset_url}\n            className='str-chat__attachment-preview__thumbnail'\n            src={videoAttachment.thumb_url}\n            title={videoAttachment.title}\n          />\n          <div className='str-chat__attachment-preview__thumbnail__play-indicator'>\n            <IconPlayFill />\n          </div>\n        </>\n      ),\n      previewType: 'video',\n    };\n  }\n  if (groupedAttachments.images.length === groupedAttachments.total) {\n    const imageAttachment = groupedAttachments.images[0];\n    return {\n      ...result,\n      Icon: IconCamera,\n      PreviewImage: (\n        <BaseImage\n          alt={imageAttachment.fallback}\n          className='str-chat__attachment-preview__thumbnail'\n          src={imageAttachment.image_url}\n          title={imageAttachment.title}\n        />\n      ),\n      previewType: 'image',\n    };\n  }\n  if (groupedAttachments.voiceRecordings.length === groupedAttachments.total)\n    return { ...result, Icon: IconVoice, previewType: 'voice' };\n\n  return { ...result, Icon: IconFile, previewType: 'mixed' };\n};\n\nexport const QuotedMessagePreview = ({\n  getQuotedMessageAuthor,\n  renderText,\n}: QuotedMessagePreviewProps) => {\n  const messageComposer = useMessageComposerController();\n  const { quotedMessage } = useStateStore(\n    messageComposer.state,\n    messageComposerStateStoreSelector,\n  );\n\n  return quotedMessage ? (\n    <div className='str-chat__message-composer__quoted-message-preview-slot'>\n      <QuotedMessagePreviewUI\n        getQuotedMessageAuthor={getQuotedMessageAuthor}\n        onRemove={() => messageComposer.setQuotedMessage(null)}\n        quotedMessage={quotedMessage}\n        renderText={renderText}\n      />\n    </div>\n  ) : null;\n};\n\ntype QuotedMessagePreviewUIProps = QuotedMessagePreviewProps & {\n  quotedMessage: LocalMessageBase;\n  authorLabel?: ReactNode;\n  className?: string;\n  onClick?: MouseEventHandler<HTMLDivElement>;\n  onRemove?: () => void;\n};\n\nexport const QuotedMessagePreviewUI = ({\n  authorLabel,\n  className,\n  getQuotedMessageAuthor,\n  onClick,\n  onRemove,\n  quotedMessage,\n  renderText,\n}: QuotedMessagePreviewUIProps) => {\n  const { client } = useChatContext();\n  const { t, userLanguage } = useTranslationContext();\n  const { giphyVersion: giphyVersionName = 'fixed_height' } =\n    useChannelStateContext('QuotedMessagePreview');\n\n  const quotedMessageText = useMemo(\n    () =>\n      quotedMessage?.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] ||\n      quotedMessage?.text,\n    [quotedMessage?.i18n, quotedMessage?.text, userLanguage],\n  );\n\n  const { AttachmentIcon, PreviewImage, renderedText } = useMemo(() => {\n    if (!quotedMessage) return { AttachmentIcon: NullAttachmentIcon, renderedText: null };\n\n    const {\n      groupedAttachments,\n      Icon: AttachmentIcon,\n      PreviewImage,\n      previewType,\n    } = getAttachmentIconWithType(quotedMessage, giphyVersionName);\n\n    let renderedText: ReactNode | undefined;\n\n    if (!quotedMessageText) {\n      if (previewType === 'poll') {\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        renderedText = quotedMessage.poll!.name;\n      } else if (previewType === 'location') {\n        renderedText = t('Live location');\n      } else if (previewType === 'voice') {\n        {\n          const voiceRecording = groupedAttachments.voiceRecordings[0];\n          renderedText = t('Voice message {{ duration }}', {\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            duration: displayDuration(voiceRecording!.duration),\n          });\n        }\n      } else if (previewType === 'giphy') {\n        renderedText = QUOTED_GIPHY_PREVIEW_LABEL;\n      } else if (previewType === 'link') {\n        renderedText = groupedAttachments.links[0].title;\n      } else if (previewType === 'mixed') {\n        renderedText = t('{{ count }} files', { count: groupedAttachments.total });\n      } else if (previewType === 'video') {\n        renderedText =\n          groupedAttachments.videos.length === 1\n            ? t('Video')\n            : t('{{ count }} videos', {\n                count: groupedAttachments.videos.length,\n              });\n      } else if (previewType === 'file') {\n        renderedText = groupedAttachments.documents[0].title;\n      } else if (previewType === 'image') {\n        renderedText =\n          groupedAttachments.images.length === 1\n            ? t('Photo')\n            : t('{{ count }} photos', {\n                count: groupedAttachments.images.length,\n              });\n      }\n    } else if (renderText) {\n      renderedText = renderText(quotedMessageText, quotedMessage?.mentioned_users);\n    } else {\n      renderedText = quotedMessageText;\n    }\n\n    return {\n      AttachmentIcon,\n      PreviewImage,\n      renderedText,\n    };\n  }, [giphyVersionName, quotedMessage, quotedMessageText, renderText, t]);\n\n  const isOwnMessage = client.user?.id === quotedMessage?.user?.id;\n  const isInteractive = !!onClick;\n\n  const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    if (!onClick || (event.key !== 'Enter' && event.key !== ' ')) return;\n\n    event.preventDefault();\n    onClick(event as unknown as Parameters<NonNullable<typeof onClick>>[0]);\n  };\n\n  if (!renderedText && !AttachmentIcon && !PreviewImage) return null;\n\n  const authorName = getQuotedMessageAuthor?.(quotedMessage) ?? quotedMessage.user?.name;\n  return (\n    <div\n      aria-label={isInteractive ? t('aria/Jump to quoted message') : undefined}\n      className={clsx('str-chat__quoted-message-preview', className, {\n        'str-chat__quoted-message-preview--own': isOwnMessage,\n      })}\n      data-testid='quoted-message-preview'\n      onClick={onClick}\n      onKeyDown={isInteractive ? handleKeyDown : undefined}\n      role={isInteractive ? 'button' : undefined}\n      tabIndex={isInteractive ? 0 : undefined}\n    >\n      <QuotedMessageIndicator isOwnMessage={isOwnMessage} />\n      <div className='str-chat__quoted-message-preview__content'>\n        <div className='str-chat__quoted-message-preview__author'>\n          {authorLabel ??\n            (isOwnMessage\n              ? t('You')\n              : authorName\n                ? t('Reply to {{ authorName }}', { authorName })\n                : t('Reply'))}\n        </div>\n\n        <div\n          className='str-chat__quoted-message-preview__message'\n          data-testid='quoted-message-text'\n        >\n          <AttachmentIcon />\n          <div className='str-chat__quoted-message-preview__message-text'>\n            {renderedText}\n          </div>\n        </div>\n      </div>\n      {PreviewImage && (\n        <div className='str-chat__quoted-message-preview__image'>{PreviewImage}</div>\n      )}\n\n      {onRemove && (\n        <RemoveAttachmentPreviewButton\n          aria-label={t('aria/Cancel Reply')}\n          data-testid='quoted-message-preview-dismiss-btn'\n          onClick={onRemove}\n        />\n      )}\n    </div>\n  );\n};\n","import React from 'react';\nimport type { MessageContextValue } from '../../context/MessageContext';\nimport { useMessageContext } from '../../context/MessageContext';\nimport { useChannelActionContext } from '../../context/ChannelActionContext';\nimport { QuotedMessagePreviewUI } from '../MessageComposer/QuotedMessagePreview';\n\nexport type QuotedMessageProps = Pick<MessageContextValue, 'renderText'>;\n\nexport const QuotedMessage = ({ renderText: propsRenderText }: QuotedMessageProps) => {\n  const { message, renderText: contextRenderText } = useMessageContext('QuotedMessage');\n  const { jumpToMessage } = useChannelActionContext('QuotedMessage');\n\n  const renderText = propsRenderText ?? contextRenderText;\n\n  const { quoted_message } = message;\n\n  return quoted_message ? (\n    <QuotedMessagePreviewUI\n      onClick={(e) => {\n        if (!quoted_message) return;\n        e.stopPropagation();\n        e.preventDefault();\n        jumpToMessage(quoted_message.id);\n      }}\n      quotedMessage={quoted_message}\n      renderText={renderText}\n    />\n  ) : null;\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../context';\nimport { useStateStore } from '../../store';\nimport type { Reminder, ReminderState } from 'stream-chat';\nimport { IconBell, IconBookmark } from '../Icons';\n\nexport type ReminderNotificationProps = {\n  reminder?: Reminder;\n};\n\nconst reminderStateSelector = (state: ReminderState) => ({\n  timeLeftMs: state.timeLeftMs,\n});\n\nfunction SavedForLaterContent() {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__message-saved-for-later'>\n      <IconBookmark />\n      <span>{t('Saved for later')}</span>\n    </div>\n  );\n}\n\nconst THRESHOLD_RELATIVE_MINUTES = 59;\n\nfunction RemindMeContent({ reminder }: { reminder: Reminder }) {\n  const { t } = useTranslationContext();\n  const { timeLeftMs } = useStateStore(reminder?.state, reminderStateSelector) ?? {};\n\n  const stopRefreshBoundaryMs = reminder?.timer.stopRefreshBoundaryMs;\n  const stopRefreshTimeStamp =\n    reminder?.remindAt && stopRefreshBoundaryMs\n      ? reminder.remindAt.getTime() + stopRefreshBoundaryMs\n      : undefined;\n\n  const isBehindRefreshBoundary =\n    !!stopRefreshTimeStamp && new Date().getTime() > stopRefreshTimeStamp;\n\n  if (timeLeftMs === null || !reminder.remindAt) return null;\n\n  const nowMs = Date.now();\n  const remindAtMs = reminder.remindAt.getTime();\n  const diffMs = remindAtMs - nowMs;\n  const diffMinutes = Math.abs(diffMs) / (60 * 1000);\n  const useAbsoluteFormat = diffMinutes > THRESHOLD_RELATIVE_MINUTES;\n\n  const renderTime = () => {\n    if (isBehindRefreshBoundary) {\n      // Past: reminder time has passed\n      if (useAbsoluteFormat) {\n        // > 59 min ago: calendar + time (same as DateSeparator + HH:mm)\n        // e.g. \"Due since Today at 15:00\", \"Due since Yesterday at 09:30\"\n        return t('Due since {{ dueSince }}', {\n          dueSince: t('timestamp/ReminderNotification', {\n            timestamp: reminder.remindAt,\n          }),\n        });\n      }\n      // Within 59 min ago: relative\n      // e.g. \"Due since 5 minutes ago\", \"Due since a minute ago\"\n      return t('Due since {{ dueSince }}', {\n        dueSince: t('duration/Message reminder', {\n          milliseconds: diffMs,\n        }),\n      });\n    }\n    // Future: reminder not yet due\n    if (useAbsoluteFormat) {\n      // > 59 min from now: calendar + time (no \"Due\" prefix)\n      // e.g. \"Today at 15:00\", \"Tomorrow at 09:30\"\n      return t('timestamp/ReminderNotification', {\n        timestamp: reminder.remindAt,\n      });\n    }\n    // Within 59 min from now: relative\n    // e.g. \"Due in 30 minutes\", \"Due in a minute\"\n    return t('Due {{ timeLeft }}', {\n      timeLeft: t('duration/Message reminder', {\n        milliseconds: timeLeftMs,\n      }),\n    });\n  };\n\n  return (\n    <p className='str-chat__message-reminder'>\n      <IconBell />\n      <span>{t('Reminder set')}</span>\n      <span> · </span>\n      <span className='str-chat__message-reminder__time-left'>{renderTime()}</span>\n    </p>\n  );\n}\n\nexport const ReminderNotification = ({ reminder }: ReminderNotificationProps) => {\n  if (!reminder) return null;\n\n  if (!reminder.remindAt) {\n    return <SavedForLaterContent />;\n  }\n\n  return <RemindMeContent reminder={reminder} />;\n};\n","import React, { useEffect } from 'react';\n\nimport type { MessageTextProps } from './MessageText';\nimport { MessageText } from './MessageText';\n\nimport { useChannelStateContext, useMessageContext } from '../../context';\nimport { useMessageTextStreaming } from './hooks';\n\nexport type StreamedMessageTextProps = Pick<\n  MessageTextProps,\n  'message' | 'renderText'\n> & {\n  renderingLetterCount?: number;\n  streamingLetterIntervalMs?: number;\n};\n\nexport const StreamedMessageText = (props: StreamedMessageTextProps) => {\n  const {\n    message: messageFromProps,\n    renderingLetterCount,\n    renderText,\n    streamingLetterIntervalMs,\n  } = props;\n  const { message: messageFromContext } = useMessageContext('StreamedMessageText');\n  const { channel } = useChannelStateContext();\n  const message = messageFromProps || messageFromContext;\n  const { text = '' } = message;\n  const { skipAnimation, streamedMessageText } = useMessageTextStreaming({\n    renderingLetterCount,\n    streamingLetterIntervalMs,\n    text,\n  });\n\n  useEffect(() => {\n    channel?.on('ai_indicator.stop', () => {\n      skipAnimation();\n    });\n  }, [channel, skipAnimation]);\n\n  return (\n    <MessageText\n      message={{ ...message, text: streamedMessageText }}\n      renderText={renderText}\n    />\n  );\n};\n","import { FocusScope } from '@react-aria/focus';\nimport clsx from 'clsx';\nimport type {\n  ComponentProps,\n  ComponentType,\n  PropsWithChildren,\n  ReactNode,\n  Ref,\n} from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { createRovingFocusKeyDownHandler } from '../../a11y/a11yUtils';\nimport {\n  type PopperLikePlacement,\n  usePopoverPosition,\n} from '../Dialog/hooks/usePopoverPosition';\n\nconst DEFAULT_DROPDOWN_ITEM_SELECTOR =\n  '[role=\"option\"]:not(:disabled), [role=\"menuitem\"]:not(:disabled), button:not(:disabled), a:not(:disabled)';\n\nconst isEditableTarget = (target: EventTarget | null) =>\n  target instanceof HTMLInputElement ||\n  target instanceof HTMLTextAreaElement ||\n  (target instanceof HTMLElement && target.isContentEditable);\n\ntype DropdownContextValue = {\n  close(): void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextValue>({\n  close: () => null,\n});\n\ntype DropdownContextProviderProps = DropdownContextValue;\n\nconst DropdownContextProvider = ({\n  children,\n  ...props\n}: PropsWithChildren<DropdownContextProviderProps>) => (\n  <DropdownContext.Provider value={props}>{children}</DropdownContext.Provider>\n);\n\nexport const useDropdownContext = () => React.useContext(DropdownContext);\n\nexport type DropdownTriggerProps = Pick<\n  ComponentProps<'button'>,\n  'aria-expanded' | 'onClick'\n> & {\n  children?: ReactNode;\n  referenceRef?: Ref<HTMLElement>;\n};\n\nexport type DropdownProps = PropsWithChildren<{\n  className?: string;\n  matchReferenceWidth?: boolean;\n  onClose?: () => void;\n  onOpen?: () => void;\n  placement?: PopperLikePlacement;\n  TriggerComponent?: ComponentType<DropdownTriggerProps>;\n  triggerProps?: Omit<DropdownTriggerProps, 'aria-expanded' | 'onClick' | 'referenceRef'>;\n  referenceElement?: HTMLElement | null;\n}>;\n\nexport const Dropdown = ({\n  children,\n  className,\n  matchReferenceWidth = false,\n  onClose,\n  onOpen,\n  placement = 'bottom',\n  referenceElement,\n  TriggerComponent,\n  triggerProps,\n}: DropdownProps) => {\n  const [mountedReferenceElement, setMountedReferenceElement] =\n    useState<HTMLElement | null>(null);\n  const resolvedReferenceElement = TriggerComponent\n    ? mountedReferenceElement\n    : (referenceElement ?? null);\n  const [isOpen, setIsOpen] = useState(!TriggerComponent);\n  const [floatingElement, setFloatingElement] = useState<HTMLDivElement | null>(null);\n  const { refs, strategy, update, x, y } = usePopoverPosition({\n    placement,\n  });\n\n  useEffect(() => {\n    if (!TriggerComponent) return;\n    setIsOpen(false);\n  }, [TriggerComponent]);\n\n  const close = useCallback(() => {\n    setIsOpen(false);\n    onClose?.();\n  }, [onClose]);\n\n  const open = useCallback(() => {\n    setIsOpen(true);\n    onOpen?.();\n  }, [onOpen]);\n\n  const toggle = useCallback(() => {\n    if (isOpen) {\n      close();\n      return;\n    }\n    open();\n  }, [close, isOpen, open]);\n\n  useEffect(() => {\n    refs.setReference(resolvedReferenceElement);\n  }, [refs, resolvedReferenceElement]);\n\n  useEffect(() => {\n    refs.setFloating(floatingElement);\n  }, [floatingElement, refs]);\n\n  useEffect(() => {\n    if (!isOpen || !floatingElement || !resolvedReferenceElement) return;\n    update?.();\n  }, [floatingElement, isOpen, resolvedReferenceElement, update]);\n\n  useEffect(() => {\n    if (!isOpen) return;\n\n    const handleClickOutside = (event: MouseEvent) => {\n      if (!(event.target instanceof Node)) return;\n      if (floatingElement?.contains(event.target)) return;\n      if (resolvedReferenceElement?.contains(event.target)) return;\n      close();\n    };\n\n    document.addEventListener('mousedown', handleClickOutside);\n\n    return () => {\n      document.removeEventListener('mousedown', handleClickOutside);\n    };\n  }, [close, floatingElement, isOpen, resolvedReferenceElement]);\n\n  const rovingFocusKeyDownHandler = useMemo(\n    () =>\n      createRovingFocusKeyDownHandler<HTMLElement>({\n        getItems: (event) =>\n          Array.from(\n            event.currentTarget.querySelectorAll<HTMLElement>(\n              DEFAULT_DROPDOWN_ITEM_SELECTOR,\n            ),\n          ),\n      }),\n    [],\n  );\n\n  const escapeConsumedRef = useRef(false);\n\n  const handleKeyDown = useCallback(\n    (event: React.KeyboardEvent<HTMLElement>) => {\n      if (event.key === 'Escape') {\n        event.preventDefault();\n        event.stopPropagation();\n        escapeConsumedRef.current = true;\n        close();\n        return;\n      }\n      if (isEditableTarget(event.target)) {\n        return;\n      }\n      rovingFocusKeyDownHandler(event);\n    },\n    [close, 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  const DropdownTriggerComponent = TriggerComponent;\n\n  const trigger = DropdownTriggerComponent ? (\n    <DropdownTriggerComponent\n      aria-expanded={isOpen}\n      onClick={toggle}\n      referenceRef={setMountedReferenceElement}\n      {...triggerProps}\n    />\n  ) : null;\n\n  const content =\n    isOpen && resolvedReferenceElement ? (\n      <FocusScope autoFocus restoreFocus>\n        <DropdownContextProvider close={close}>\n          <div\n            className={clsx('str-chat__dropdown__items', className)}\n            onClick={close}\n            onKeyDown={handleKeyDown}\n            onKeyUpCapture={suppressEscapeKeyUp}\n            ref={setFloatingElement}\n            role='menu'\n            style={{\n              left: x ?? 0,\n              minWidth: matchReferenceWidth\n                ? resolvedReferenceElement.getBoundingClientRect().width\n                : undefined,\n              position: strategy,\n              top: y ?? 0,\n            }}\n          >\n            {children}\n          </div>\n        </DropdownContextProvider>\n      </FocusScope>\n    ) : null;\n\n  return (\n    <div className='str-chat__dropdown'>\n      {trigger}\n      {content}\n    </div>\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, useId, useRef, useState } from 'react';\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 = useId();\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};\n\nexport type SwitchProps = Omit<ComponentProps<'input'>, 'type'> & {\n  on?: boolean;\n  onSwitchClick?: MouseEventHandler<HTMLDivElement>;\n  switchRef?: React.RefObject<HTMLInputElement | null>;\n};\n\nconst Switch = ({ className, on, onSwitchClick, switchRef, ...props }: SwitchProps) => (\n  <div\n    className={clsx('str-chat__form__switch-field__switch', {\n      'str-chat__form__switch-field__switch--on': on,\n    })}\n    onClick={onSwitchClick}\n  >\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    <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 React, {\n  type ComponentType,\n  useCallback,\n  useEffect,\n  useMemo,\n  useState,\n} from 'react';\nimport { useTranslationContext } from '../../context';\nimport { ContextMenuBody, ContextMenuButton, ContextMenuRoot, Prompt } from '../Dialog';\nimport {\n  Dropdown,\n  type DropdownTriggerProps,\n  useDropdownContext,\n} from '../Form/Dropdown';\nimport { IconChevronDown } from '../Icons';\nimport { useMessageComposerController } from '../MessageComposer/hooks/useMessageComposerController';\nimport { SwitchField } from '../Form/SwitchField';\nimport { useNotificationApi } from '../Notifications';\nimport type { Coords } from 'stream-chat';\nimport { Button } from '../Button';\nimport clsx from 'clsx';\n\nconst MIN_LIVE_LOCATION_SHARE_DURATION = 60 * 1000; // 1 minute;\n\nconst DEFAULT_SHARE_LOCATION_DURATIONS = [\n  15 * 60 * 1000, // 15 minutes\n  60 * 60 * 1000, // 1 hour\n  8 * 60 * 60 * 1000, // 8 hours\n];\n\nexport type ShareGeolocationMapProps = Partial<Coords> & {\n  loadingLocation: boolean;\n  restartLocationWatching: () => void;\n  geolocationPositionError?: GeolocationPositionError;\n};\n\nexport type ShareLocationDialogProps = {\n  close: () => void;\n  shareDurations?: number[];\n  GeolocationMap?: ComponentType<ShareGeolocationMapProps>;\n  DurationDropdownItems?: ComponentType<DurationDropdownItemsProps>;\n};\n\nconst DefaultGeolocationMap = () => null;\n\nconst LiveLocationDurationTrigger = ({\n  children,\n  onClick,\n  referenceRef,\n  ...props\n}: DropdownTriggerProps) => (\n  <Button\n    {...props}\n    className='str-chat__live-location-sharing-duration-selector__button'\n    onClick={onClick}\n    ref={referenceRef as React.Ref<HTMLButtonElement>}\n    type='button'\n  >\n    {children}\n  </Button>\n);\n\nexport const ShareLocationDialog = ({\n  close,\n  GeolocationMap = DefaultGeolocationMap,\n  shareDurations = DEFAULT_SHARE_LOCATION_DURATIONS,\n}: ShareLocationDialogProps) => {\n  const { addNotification } = useNotificationApi();\n  const { t } = useTranslationContext();\n  const messageComposer = useMessageComposerController();\n  const [durations, setDurations] = useState<number[]>([]);\n  const [selectedDuration, setSelectedDuration] = useState<number | undefined>(undefined);\n  const [geolocationPosition, setGeolocationPosition] =\n    useState<GeolocationPosition | null>(null);\n  const [loadingLocation, setLoadingLocation] = useState<boolean>(false);\n  const [geolocationPositionError, setGeolocationPositionError] = useState<\n    GeolocationPositionError | undefined\n  >(undefined);\n\n  const validShareDurations = useMemo(\n    () => shareDurations.filter((d) => d >= MIN_LIVE_LOCATION_SHARE_DURATION),\n    [shareDurations],\n  );\n\n  const selectedDurationLabel = useMemo(\n    () =>\n      durations.length > 0\n        ? t('duration/Share Location', {\n            milliseconds: selectedDuration ?? durations[0],\n          })\n        : undefined,\n    [durations, selectedDuration, t],\n  );\n\n  const durationTriggerProps = useMemo(\n    () => ({\n      children: selectedDurationLabel ? (\n        <>\n          <span>{selectedDurationLabel}</span>\n          <IconChevronDown />\n        </>\n      ) : null,\n    }),\n    [selectedDurationLabel],\n  );\n\n  const getPosition = useCallback(\n    (): Promise<GeolocationPosition> =>\n      new Promise((resolve, reject) => {\n        navigator.geolocation.getCurrentPosition(\n          (position) => {\n            resolve(position);\n          },\n          (positionError) => {\n            console.warn(positionError);\n            reject(positionError);\n          },\n          { timeout: 1000 },\n        );\n      }),\n    [],\n  );\n\n  const setupPositionWatching = useCallback(() => {\n    setLoadingLocation(true);\n    const watch = navigator.geolocation.watchPosition(\n      (position) => {\n        setGeolocationPosition(position);\n        setLoadingLocation(false);\n        setGeolocationPositionError(undefined);\n      },\n      (error) => {\n        setGeolocationPosition(null);\n        setLoadingLocation(false);\n        setGeolocationPositionError(error);\n      },\n      { timeout: 1000 },\n    );\n\n    return () => {\n      navigator.geolocation.clearWatch(watch);\n    };\n  }, []);\n\n  useEffect(() => setupPositionWatching(), [setupPositionWatching]);\n\n  const liveLocationSwitchEnabled = durations.length > 0;\n  return (\n    <Prompt.Root\n      className='str-chat__share-location-dialog'\n      data-testid='share-location-dialog'\n    >\n      <Prompt.Header\n        close={close}\n        description={t(\n          'Select your current location and optionally enable live location sharing',\n        )}\n        title={t('Share Location')}\n      />\n      <Prompt.Body>\n        <GeolocationMap\n          geolocationPositionError={geolocationPositionError}\n          latitude={geolocationPosition?.coords.latitude}\n          loadingLocation={loadingLocation}\n          longitude={geolocationPosition?.coords.longitude}\n          restartLocationWatching={setupPositionWatching}\n        />\n        {validShareDurations.length > 0 && (\n          <div\n            className={clsx('str-chat__live-location-activation', {\n              'str-chat__live-location-activation--expanded': liveLocationSwitchEnabled,\n            })}\n          >\n            <SwitchField\n              checked={liveLocationSwitchEnabled}\n              data-testid='share-location-dialog-live-location-switch'\n              disabled={!geolocationPosition}\n              onChange={(e) => {\n                e.stopPropagation();\n                if (liveLocationSwitchEnabled) {\n                  setDurations([]);\n                  setSelectedDuration(undefined);\n                } else {\n                  setDurations(validShareDurations);\n                  setSelectedDuration(validShareDurations[0]);\n                }\n              }}\n              title={t('Share live location for')}\n            />\n            {liveLocationSwitchEnabled && selectedDurationLabel && (\n              <div className='str-chat__live-location-sharing-duration-selector'>\n                <Dropdown\n                  placement='bottom-start'\n                  TriggerComponent={LiveLocationDurationTrigger}\n                  triggerProps={durationTriggerProps}\n                >\n                  <DurationDropdownItems\n                    durations={durations}\n                    selectDuration={setSelectedDuration}\n                    selectedDuration={selectedDuration}\n                  />\n                </Dropdown>\n              </div>\n            )}\n          </div>\n        )}\n      </Prompt.Body>\n      <Prompt.Footer>\n        <Prompt.FooterControls>\n          <Prompt.FooterControlsButtonSecondary\n            className='str-chat__prompt__footer__controls-button--cancel'\n            onClick={() => {\n              messageComposer.locationComposer.initState();\n              close();\n            }}\n          >\n            {t('Cancel')}\n          </Prompt.FooterControlsButtonSecondary>\n          <Prompt.FooterControlsButtonSecondary\n            className='str-chat__prompt__footer__controls-button--submit'\n            disabled={!geolocationPosition}\n            onClick={async () => {\n              let coords = geolocationPosition && {\n                latitude: geolocationPosition.coords.latitude,\n                longitude: geolocationPosition.coords.longitude,\n              };\n              if (!coords) {\n                coords = (await getPosition()).coords;\n              }\n              messageComposer.locationComposer.setData({\n                ...coords,\n                durationMs: selectedDuration,\n              });\n              close();\n            }}\n            type='submit'\n          >\n            {t('Attach')}\n          </Prompt.FooterControlsButtonSecondary>\n          <Prompt.FooterControlsButtonPrimary\n            className='str-chat__prompt__footer__controls-button--submit'\n            disabled={!geolocationPosition}\n            onClick={async () => {\n              let coords = geolocationPosition && {\n                latitude: geolocationPosition.coords.latitude,\n                longitude: geolocationPosition.coords.longitude,\n              };\n              if (!coords) {\n                try {\n                  coords = (await getPosition()).coords;\n                } catch (e) {\n                  addNotification({\n                    emitter: 'ShareLocationDialog',\n                    error: e instanceof Error ? e : undefined,\n                    message: t('Failed to retrieve location'),\n                    severity: 'error',\n                    type: 'browser:location:get:failed',\n                  });\n                  return;\n                }\n              }\n\n              messageComposer.locationComposer.setData({\n                ...coords,\n                durationMs: selectedDuration,\n              });\n              try {\n                await messageComposer.sendLocation();\n              } catch (err) {\n                addNotification({\n                  emitter: 'ShareLocationDialog',\n                  error: err instanceof Error ? err : undefined,\n                  message: t('Failed to share location'),\n                  severity: 'error',\n                  type: 'api:location:share:failed',\n                });\n                return;\n              }\n              close();\n            }}\n            type='submit'\n          >\n            {t('Share')}\n          </Prompt.FooterControlsButtonPrimary>\n        </Prompt.FooterControls>\n      </Prompt.Footer>\n    </Prompt.Root>\n  );\n};\n\nexport type DurationDropdownItemsProps = {\n  durations: number[];\n  selectedDuration?: number;\n  selectDuration: (duration: number) => void;\n};\nconst DurationDropdownItems = ({\n  durations,\n  selectDuration,\n  selectedDuration,\n}: DurationDropdownItemsProps) => {\n  const { t } = useTranslationContext();\n  const { close } = useDropdownContext();\n  return (\n    <ContextMenuRoot>\n      <ContextMenuBody>\n        {durations.map((duration) => (\n          <ContextMenuButton\n            aria-checked={selectedDuration === duration}\n            className='str-chat__live-location-sharing-duration-option'\n            key={`duration-${duration}`}\n            onClick={() => {\n              selectDuration(duration);\n              close();\n            }}\n            role='menuitemradio'\n          >\n            {t('duration/Share Location', { milliseconds: duration })}\n          </ContextMenuButton>\n        ))}\n      </ContextMenuBody>\n    </ContextMenuRoot>\n  );\n};\n","import React, { useMemo } from 'react';\nimport { usePollContext, useTranslationContext } from '../../context';\nimport { useStateStore } from '../../store';\nimport type { PollOption, PollState } from 'stream-chat';\n\ntype PollStateSelectorReturnValue = {\n  enforce_unique_vote: boolean;\n  is_closed: boolean | undefined;\n  max_votes_allowed: number;\n  name: string;\n  options: PollOption[];\n};\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  enforce_unique_vote: nextValue.enforce_unique_vote,\n  is_closed: nextValue.is_closed,\n  max_votes_allowed: nextValue.max_votes_allowed,\n  name: nextValue.name,\n  options: nextValue.options,\n});\n\nexport const PollHeader = () => {\n  const { t } = useTranslationContext('PollHeader');\n\n  const { poll } = usePollContext();\n  const { enforce_unique_vote, is_closed, max_votes_allowed, name, options } =\n    useStateStore(poll.state, pollStateSelector);\n\n  const selectionInstructions = useMemo(() => {\n    if (is_closed) return t('Vote ended');\n    if (enforce_unique_vote || options.length === 1) return t('Select one');\n    if (max_votes_allowed)\n      return t('Select up to {{count}}', {\n        count: max_votes_allowed > options.length ? options.length : max_votes_allowed,\n      });\n    if (options.length > 1) return t('Select one or more');\n    return '';\n  }, [is_closed, enforce_unique_vote, max_votes_allowed, options.length, t]);\n\n  if (!name) return;\n\n  return (\n    <div className='str-chat__poll-header'>\n      <div className='str-chat__poll-title'>{name}</div>\n      <div className='str-chat__poll-subtitle'>{selectionInstructions}</div>\n    </div>\n  );\n};\n","import clsx from 'clsx';\nimport type { ComponentProps, ReactNode } from 'react';\nimport React from 'react';\n\nexport type FieldErrorProps = ComponentProps<'div'> & {\n  /** Error message (string or custom content e.g. icon + text) */\n  text?: ReactNode;\n};\n\nexport const FieldError = ({ className, text, ...props }: FieldErrorProps) => (\n  <div {...props} className={clsx('str-chat__form-field-error', className)}>\n    {text}\n  </div>\n);\n","import { nanoid } from 'nanoid';\nimport { useMemo } from 'react';\n\n/**\n * The ID is generated using the `nanoid` library and is memoized to ensure\n * that it remains the same across renders unless the key changes.\n */\nexport const useStableId = (key?: string) => {\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  const id = useMemo(() => nanoid(), [key]);\n\n  return id;\n};\n","import clsx from 'clsx';\nimport React, { forwardRef, useCallback } from 'react';\nimport type { ChangeEvent, ComponentProps, KeyboardEvent } from 'react';\nimport { useTranslationContext } from '../../context';\nimport { useStableId } from '../UtilityComponents/useStableId';\nimport { IconMinus, IconPlusSmall } from '../Icons';\nimport { Button } from '../Button';\n\nexport type NumericInputProps = Omit<\n  ComponentProps<'input'>,\n  'className' | 'type' | 'value' | 'onChange'\n> & {\n  value: string;\n  onChange: (e: ChangeEvent<HTMLInputElement>) => void;\n  /** Optional label above the input */\n  label?: string;\n  /** Minimum value (stepper) */\n  min?: number;\n  /** Maximum value (stepper) */\n  max?: number;\n  /** Step for increment/decrement (default 1) */\n  step?: number;\n  className?: string;\n};\n\nconst parseNumeric = (s: string): number | null => {\n  const trimmed = s.trim();\n  if (trimmed === '') return null;\n  const n = Number(trimmed);\n  return Number.isFinite(n) ? n : null;\n};\n\nconst clamp = (n: number, min: number, max: number): number =>\n  Math.min(Math.max(n, min), max);\n\nexport const NumericInput = forwardRef<HTMLInputElement, NumericInputProps>(\n  function NumericInput(\n    {\n      className,\n      disabled = false,\n      id: idProp,\n      label,\n      max,\n      min,\n      onChange,\n      step = 1,\n      value,\n      ...inputProps\n    },\n    ref,\n  ) {\n    const generatedId = useStableId();\n    const id = idProp ?? generatedId;\n    const { t } = useTranslationContext();\n\n    const num = parseNumeric(value);\n    const minDef = min ?? -Infinity;\n    const maxDef = max ?? Infinity;\n    const atMin = num !== null && num <= minDef;\n    const atMax = num !== null && num >= maxDef;\n\n    const handleInputChange = useCallback(\n      (e: ChangeEvent<HTMLInputElement>) => {\n        const next = e.target.value;\n        if (next === '' || /^\\d+$/.test(next)) {\n          onChange(e);\n        }\n      },\n      [onChange],\n    );\n\n    const createChangeEvent = useCallback(\n      (newValue: string): ChangeEvent<HTMLInputElement> =>\n        ({\n          currentTarget: { value: newValue },\n          target: { value: newValue },\n        }) as ChangeEvent<HTMLInputElement>,\n      [],\n    );\n\n    const handleDecrement = useCallback(() => {\n      if (disabled || atMin) return;\n      const next = num !== null ? clamp(num - step, minDef, maxDef) : minDef;\n      onChange(createChangeEvent(String(next)));\n    }, [disabled, atMin, num, step, minDef, maxDef, onChange, createChangeEvent]);\n\n    const handleIncrement = useCallback(() => {\n      if (disabled || atMax) return;\n      const next = num !== null ? clamp(num + step, minDef, maxDef) : minDef;\n      onChange(createChangeEvent(String(next)));\n    }, [disabled, atMax, num, step, minDef, maxDef, onChange, createChangeEvent]);\n\n    const handleKeyDown = useCallback(\n      (e: KeyboardEvent<HTMLInputElement>) => {\n        if (e.key === 'ArrowDown') {\n          e.preventDefault();\n          handleDecrement();\n        } else if (e.key === 'ArrowUp') {\n          e.preventDefault();\n          handleIncrement();\n        }\n      },\n      [handleDecrement, handleIncrement],\n    );\n\n    return (\n      <div\n        className={clsx(\n          'str-chat__form-numeric-input',\n          disabled && 'str-chat__form-numeric-input--disabled',\n          className,\n        )}\n      >\n        {!!label && (\n          <label className='str-chat__form-numeric-input__label' htmlFor={id}>\n            {label}\n          </label>\n        )}\n        <div className={clsx('str-chat__form-numeric-input__wrapper')}>\n          <Button\n            appearance='outline'\n            aria-label={t('aria/Decrease value')}\n            circular\n            className={clsx(\n              'str-chat__form-numeric-input__stepper str-chat__form-numeric-input__stepper--decrement',\n            )}\n            disabled={disabled || atMin}\n            onClick={handleDecrement}\n            size='xs'\n            variant='secondary'\n          >\n            <IconMinus className='str-chat__form-numeric-input__stepper-icon' />\n          </Button>\n          <input\n            aria-valuemax={Number.isFinite(maxDef) ? maxDef : undefined}\n            aria-valuemin={Number.isFinite(minDef) ? minDef : undefined}\n            aria-valuenow={num ?? undefined}\n            className='str-chat__form-numeric-input__input'\n            disabled={disabled}\n            id={id}\n            inputMode='numeric'\n            onChange={handleInputChange}\n            onKeyDown={handleKeyDown}\n            ref={ref}\n            role='spinbutton'\n            type='text'\n            value={value}\n            {...inputProps}\n          />\n          <Button\n            appearance='outline'\n            aria-label={t('aria/Increase value')}\n            circular\n            className={clsx(\n              'str-chat__form-numeric-input__stepper str-chat__form-numeric-input__stepper--increment',\n            )}\n            disabled={disabled || atMax}\n            onClick={handleIncrement}\n            size='xs'\n            variant='secondary'\n          >\n            <IconPlusSmall className='str-chat__form-numeric-input__stepper-icon' />\n          </Button>\n        </div>\n      </div>\n    );\n  },\n);\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 type { PropsWithChildren } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport clsx from 'clsx';\n\nexport type DragAndDropContainerProps = PropsWithChildren<{\n  className?: string;\n  draggable?: boolean;\n  onSetNewOrder?: (newOrder: number[]) => void;\n}>;\n\nexport const DragAndDropContainer = ({\n  children,\n  className,\n  draggable,\n  onSetNewOrder,\n}: DragAndDropContainerProps) => {\n  const [order, setOrder] = useState<number[]>([]);\n  const [dragStartIndex, setDragStartIndex] = useState<number | null>(null);\n  const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);\n  const [container, setContainer] = useState<HTMLDivElement | null>(null);\n\n  const moveDirection =\n    dragStartIndex === null || dragOverIndex === null\n      ? undefined\n      : dragStartIndex <= dragOverIndex\n        ? 'down'\n        : 'up';\n\n  const childrenArray = React.Children.toArray(children);\n\n  useEffect(() => {\n    setOrder(React.Children.map(children, (_, index) => index) || []);\n  }, [children]);\n\n  useEffect(() => {\n    if (!container) return;\n\n    const handleDragStart = (e: DragEvent) => {\n      const target = e.target as HTMLElement;\n      const draggableItem = target.closest('.str-chat__drag-and-drop-container__item');\n      if (e.dataTransfer) {\n        e.dataTransfer.effectAllowed = 'move';\n      }\n\n      if (draggableItem instanceof HTMLElement) {\n        const index = Array.from(draggableItem.parentElement?.children || []).indexOf(\n          draggableItem,\n        );\n        setDragStartIndex(index);\n        e.dataTransfer?.setData('text/plain', index.toString());\n        draggableItem.style.opacity = '0.3';\n      }\n    };\n\n    const handleDragOver = (e: DragEvent) => {\n      e.preventDefault();\n      const target = e.target as HTMLElement;\n      const draggableItem = target.closest('.str-chat__drag-and-drop-container__item');\n      if (draggableItem instanceof HTMLElement) {\n        const index = Array.from(draggableItem.parentElement?.children || []).indexOf(\n          draggableItem,\n        );\n        setDragOverIndex(index);\n      }\n    };\n\n    const handleDragLeave = () => {\n      setDragOverIndex(null);\n    };\n\n    const handleDrop = (e: DragEvent) => {\n      e.preventDefault();\n      const draggedIndex = parseInt(e.dataTransfer?.getData('text/plain') || '-1', 10);\n      const target = e.target as HTMLElement;\n      const draggableItem = target.closest('.str-chat__drag-and-drop-container__item');\n      if (draggableItem instanceof HTMLElement) {\n        const dropIndex = Array.from(draggableItem.parentElement?.children || []).indexOf(\n          draggableItem,\n        );\n        if (draggedIndex !== -1 && draggedIndex !== dropIndex) {\n          setOrder((prevOrder) => {\n            const newOrder = [...prevOrder];\n            const [removed] = newOrder.splice(draggedIndex, 1);\n            newOrder.splice(dropIndex, 0, removed);\n            onSetNewOrder?.(newOrder);\n            return newOrder;\n          });\n        }\n      }\n      setDragStartIndex(null);\n      setDragOverIndex(null);\n    };\n\n    const handleDragEnd = (e: DragEvent) => {\n      const target = e.target as HTMLElement;\n      if (target instanceof HTMLElement) {\n        target.style.opacity = '';\n      }\n      setDragStartIndex(null);\n      setDragOverIndex(null);\n    };\n\n    container.addEventListener('dragstart', handleDragStart);\n    container.addEventListener('dragover', handleDragOver);\n    container.addEventListener('dragleave', handleDragLeave);\n    container.addEventListener('drop', handleDrop);\n    container.addEventListener('dragend', handleDragEnd);\n\n    return () => {\n      container.removeEventListener('dragstart', handleDragStart);\n      container.removeEventListener('dragover', handleDragOver);\n      container.removeEventListener('dragleave', handleDragLeave);\n      container.removeEventListener('drop', handleDrop);\n      container.removeEventListener('dragend', handleDragEnd);\n    };\n  }, [container, onSetNewOrder]);\n\n  return (\n    <div\n      className={clsx('str-chat__drag-and-drop-container', className)}\n      ref={setContainer}\n    >\n      {order.map((originalIndex, currentIndex) => {\n        const child = childrenArray[originalIndex];\n        return (\n          <div\n            className={clsx('str-chat__drag-and-drop-container__item', {\n              'str-chat__drag-and-drop-container__item--dragged-over-from-bottom':\n                moveDirection === 'up' && dragOverIndex === currentIndex,\n              'str-chat__drag-and-drop-container__item--dragged-over-from-top':\n                moveDirection === 'down' && dragOverIndex === currentIndex,\n            })}\n            draggable={draggable}\n            key={\n              React.isValidElement(child) ? child.key : `draggable-item-${originalIndex}`\n            }\n          >\n            {child}\n          </div>\n        );\n      })}\n    </div>\n  );\n};\n","import React from 'react';\nimport clsx from 'clsx';\nimport {\n  DragAndDropContainer,\n  type DragAndDropContainerProps,\n} from '../DragAndDrop/DragAndDropContainer';\n\nexport type TextInputFieldSetProps = DragAndDropContainerProps & {\n  label?: string;\n};\n\nexport const TextInputFieldSet = ({\n  children,\n  className,\n  draggable,\n  label,\n  onSetNewOrder,\n}: TextInputFieldSetProps) => (\n  <fieldset className={clsx('str-chat__form__input-fieldset', className)}>\n    <legend className='str-chat__form__input-fieldset__label'>{label}</legend>\n    <DragAndDropContainer\n      className='str-chat__form__input-fieldset__values'\n      draggable={draggable}\n      onSetNewOrder={onSetNewOrder}\n    >\n      {children}\n    </DragAndDropContainer>\n  </fieldset>\n);\n","import type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useState } from 'react';\n\nexport type Validators<V extends Record<string, unknown>> = {\n  [K in keyof V]?: (value: V[K]) => Error | undefined;\n};\n\nexport type UseFormStateOptions<V extends Record<string, unknown>> = {\n  initialValue: V;\n  validators?: Validators<V>;\n  onSubmit: (value: V) => Promise<void>;\n};\n\nexport type UseFormStateReturn<V extends Record<string, unknown>> = {\n  value: V;\n  setValue: Dispatch<SetStateAction<V>>;\n  setFieldValue: (field: keyof V, value: V[keyof V]) => void;\n  fieldErrors: Record<string, Error>;\n  handleSubmit: (e?: React.FormEvent) => void;\n};\n\nexport function useFormState<V extends Record<string, unknown>>(\n  options: UseFormStateOptions<V>,\n): UseFormStateReturn<V> {\n  const { initialValue, onSubmit, validators = {} as Validators<V> } = options;\n  const [value, setValue] = useState<V>(initialValue);\n  const [fieldErrors, setFieldErrors] = useState<Record<string, Error>>({});\n\n  const setFieldValue = useCallback(\n    (field: keyof V, fieldValue: V[keyof V]) => {\n      setValue((prev) => ({ ...prev, [field]: fieldValue }) as V);\n      const validator = validators[field];\n      if (validator) {\n        const err = validator(fieldValue);\n        setFieldErrors((prev) => {\n          const next = { ...prev };\n          if (err) next[field as string] = err;\n          else delete next[field as string];\n          return next;\n        });\n      }\n    },\n    [validators],\n  );\n\n  const handleSubmit = useCallback(\n    (e?: React.FormEvent) => {\n      e?.preventDefault();\n      const errors: Record<string, Error> = {};\n      for (const key of Object.keys(value) as (keyof V)[]) {\n        const validator = validators[key];\n        if (validator) {\n          const err = validator(value[key]);\n          if (err) errors[key as string] = err;\n        }\n      }\n      if (Object.keys(errors).length > 0) {\n        setFieldErrors(errors);\n        return;\n      }\n      setFieldErrors({});\n      void onSubmit(value);\n    },\n    [value, validators, onSubmit],\n  );\n\n  return {\n    fieldErrors,\n    handleSubmit,\n    setFieldValue,\n    setValue,\n    value,\n  };\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useStateStore } from '../../../store';\nimport { useModalContext, usePollContext, useTranslationContext } from '../../../context';\nimport type { PollAnswer, PollState } from 'stream-chat';\nimport { Prompt } from '../../Dialog';\nimport { TextInput } from '../../Form';\nimport { useFormState } from '../../Form/hooks';\n\ntype PollStateSelectorReturnValue = { ownAnswer: PollAnswer | undefined };\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  ownAnswer: nextValue.ownAnswer,\n});\n\nexport type AddCommentPromptProps = {\n  messageId: string;\n};\n\nexport const AddCommentPrompt = ({ messageId }: AddCommentPromptProps) => {\n  const { t } = useTranslationContext();\n  const { close } = useModalContext();\n  const { poll } = usePollContext();\n  const { ownAnswer } = useStateStore(poll.state, pollStateSelector);\n  const [input, setInput] = useState<HTMLInputElement | null>(null);\n\n  const initialComment = ownAnswer?.answer_text ?? '';\n  const initialValue = useMemo(() => ({ comment: initialComment }), [initialComment]);\n  const validators = useMemo(\n    () => ({\n      comment: (v: string) => {\n        const trimmed = typeof v === 'string' ? v.trim() : '';\n        if (!trimmed) {\n          return new Error(t('This field cannot be empty or contain only spaces'));\n        }\n        return undefined;\n      },\n    }),\n    [t],\n  );\n  const onSubmit = useCallback(\n    async (formValue: { comment: string }) => {\n      await poll.addAnswer(formValue.comment, messageId);\n      close();\n    },\n    [poll, messageId, close],\n  );\n  const { fieldErrors, handleSubmit, setFieldValue, value } = useFormState<{\n    comment: string;\n  }>({\n    initialValue,\n    onSubmit,\n    validators,\n  });\n\n  useEffect(() => {\n    input?.focus();\n  }, [input]);\n\n  const title = ownAnswer ? t('Update your comment') : t('Add a comment');\n  const description = ownAnswer\n    ? t('Update the comment attached to your poll answer')\n    : t('Add a comment to your poll answer');\n  const submitDisabled =\n    !value.comment?.trim() || value.comment === ownAnswer?.answer_text;\n\n  return (\n    <Prompt.Root className='str-chat__modal__poll-add-comment'>\n      {title && <Prompt.Header close={close} description={description} title={title} />}\n      <form autoComplete='off' onSubmit={handleSubmit}>\n        <Prompt.Body>\n          <TextInput\n            aria-label={title}\n            error={!!fieldErrors.comment}\n            errorMessage={fieldErrors.comment?.message}\n            id='comment'\n            name='comment'\n            onChange={(e) => setFieldValue('comment', e.target.value)}\n            placeholder={t('placeholder/PollComment')}\n            ref={setInput}\n            required\n            type='text'\n            value={value.comment}\n          />\n        </Prompt.Body>\n        <Prompt.Footer>\n          <Prompt.FooterControls>\n            <Prompt.FooterControlsButtonSecondary\n              className='str-chat__prompt__footer__controls-button--cancel'\n              onClick={close}\n              type='button'\n            >\n              {t('Cancel')}\n            </Prompt.FooterControlsButtonSecondary>\n            <Prompt.FooterControlsButtonPrimary\n              className='str-chat__prompt__footer__controls-button--submit'\n              disabled={Object.keys(fieldErrors).length > 0 || submitDisabled}\n              type='submit'\n            >\n              {initialComment ? t('Update') : t('Send')}\n            </Prompt.FooterControlsButtonPrimary>\n          </Prompt.FooterControls>\n        </Prompt.Footer>\n      </form>\n    </Prompt.Root>\n  );\n};\n","import React from 'react';\nimport { Alert } from '../../Dialog';\nimport { useModalContext, usePollContext, useTranslationContext } from '../../../context';\nimport { Button } from '../../Button';\nimport { useNotificationApi } from '../../Notifications';\n\nexport const EndPollAlert = () => {\n  const { addNotification } = useNotificationApi();\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { close } = useModalContext();\n\n  return (\n    <Alert.Root className={'str-chat__end-poll-alert'}>\n      <Alert.Header\n        description={t(\n          'Do you want to end this poll now? Nobody will be able to vote in this poll anymore.',\n        )}\n        title={t('End this poll?')}\n      ></Alert.Header>\n      <Alert.Actions>\n        <Button\n          appearance='outline'\n          className='str-chat__end-poll-alert__end-vote-button'\n          data-testid='end-poll-alert-end-vote-button'\n          onClick={async () => {\n            try {\n              await poll.close();\n              close();\n              addNotification({\n                emitter: 'EndPollAlert',\n                message: t('Poll ended'),\n                severity: 'success',\n                type: 'api:poll:end:success',\n              });\n            } catch (e) {\n              addNotification({\n                emitter: 'EndPollAlert',\n                error: e instanceof Error ? e : undefined,\n                message: t('Failed to end the poll'),\n                severity: 'error',\n                type: 'api:poll:end:failed',\n              });\n            }\n          }}\n          size='md'\n          variant='danger'\n        >\n          {t('End poll')}\n        </Button>\n        <Button\n          appearance='outline'\n          className='str-chat__end-poll-alert__cancel-button'\n          data-testid='end-poll-alert-cancel-button'\n          onClick={close}\n          size='md'\n          variant='secondary'\n        >\n          {t('Cancel')}\n        </Button>\n      </Alert.Actions>\n    </Alert.Root>\n  );\n};\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\nimport { GlobalModal } from '../../Modal';\nimport { useComponentContext } from '../../../context';\nimport { Button } from '../../Button';\nimport clsx from 'clsx';\n\nexport type PollActionProps = {\n  buttonText: string;\n  closeModal: () => void;\n  modalIsOpen: boolean;\n  openModal: () => void;\n  /**\n   * Additional actions are shown based on the poll settings defined by the creator.\n   * Examples are \"Suggest an option\", \"Add a comment\", \"View N comment(s)\".\n   */\n  isAdditionalAction?: boolean;\n  modalClassName?: string;\n};\n\nexport const PollAction = ({\n  buttonText,\n  children,\n  closeModal,\n  isAdditionalAction,\n  modalClassName,\n  modalIsOpen,\n  openModal,\n}: PropsWithChildren<PollActionProps>) => {\n  const { Modal = GlobalModal } = useComponentContext();\n  return (\n    <>\n      <Button\n        appearance='outline'\n        className={clsx('str-chat__poll-action', {\n          'str-chat__poll-action--additional': isAdditionalAction,\n        })}\n        onClick={openModal}\n        size='md'\n        variant='secondary'\n      >\n        {buttonText}\n      </Button>\n      <Modal className={modalClassName} onClose={closeModal} open={modalIsOpen}>\n        {children}\n      </Modal>\n    </>\n  );\n};\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport {\n  useChatContext,\n  useModalContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { PollOption, PollState } from 'stream-chat';\nimport { Prompt } from '../../Dialog';\nimport { TextInput } from '../../Form';\nimport { useFormState } from '../../Form/hooks';\n\ntype PollStateSelectorReturnValue = { options: PollOption[] };\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  options: nextValue.options,\n});\n\nexport type SuggestPollOptionFormProps = Record<string, never>;\n\nexport const SuggestPollOptionPrompt = () => {\n  const { client } = useChatContext();\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { close } = useModalContext();\n  const { options } = useStateStore(poll.state, pollStateSelector);\n  const [input, setInput] = useState<HTMLInputElement | null>(null);\n\n  const initialValue = useMemo(() => ({ optionText: '' }), []);\n  const validators = useMemo(\n    () => ({\n      optionText: (v: string) => {\n        const trimmed = typeof v === 'string' ? v.trim() : '';\n        if (!trimmed) {\n          return new Error(t('This field cannot be empty or contain only spaces'));\n        }\n        const existingOption = options.find((option) => option.text === trimmed);\n        if (existingOption) {\n          return new Error(t('Option already exists'));\n        }\n        return undefined;\n      },\n    }),\n    [t, options],\n  );\n\n  const onSubmit = useCallback(\n    async (formValue: { optionText: string }) => {\n      await client.createPollOption(poll.id, {\n        text: formValue.optionText,\n      });\n      close();\n    },\n    [client, poll, close],\n  );\n\n  const { fieldErrors, handleSubmit, setFieldValue, value } = useFormState<{\n    optionText: string;\n  }>({\n    initialValue,\n    onSubmit,\n    validators,\n  });\n\n  useEffect(() => {\n    input?.focus();\n  }, [input]);\n\n  const submitDisabled = !value.optionText?.trim();\n\n  return (\n    <Prompt.Root className='str-chat__modal__suggest-poll-option-prompt'>\n      <Prompt.Header\n        close={close}\n        description={t('Suggest a new option to add to this poll')}\n        title={t('Suggest an option')}\n      />\n      <form autoComplete='off' onSubmit={handleSubmit}>\n        <Prompt.Body>\n          <TextInput\n            aria-label={t('Suggest an option')}\n            error={!!fieldErrors.optionText}\n            errorMessage={fieldErrors.optionText?.message}\n            id='optionText'\n            name='optionText'\n            onChange={(e) => setFieldValue('optionText', e.target.value)}\n            placeholder={t('placeholder/PollOptionSuggestion')}\n            ref={setInput}\n            required\n            type='text'\n            value={value.optionText}\n          />\n        </Prompt.Body>\n        <Prompt.Footer>\n          <Prompt.FooterControls>\n            <Prompt.FooterControlsButtonSecondary\n              className='str-chat__prompt__footer__controls-button--cancel'\n              onClick={close}\n            >\n              {t('Cancel')}\n            </Prompt.FooterControlsButtonSecondary>\n            <Prompt.FooterControlsButtonPrimary\n              className='str-chat__prompt__footer__controls-button--submit'\n              disabled={Object.keys(fieldErrors).length > 0 || submitDisabled}\n              type='submit'\n            >\n              {t('Send')}\n            </Prompt.FooterControlsButtonPrimary>\n          </Prompt.FooterControls>\n        </Prompt.Footer>\n      </form>\n    </Prompt.Root>\n  );\n};\n","import React, { useState } from 'react';\nimport { Avatar } from '../Avatar';\nimport { PopperTooltip } from '../Tooltip';\nimport { useEnterLeaveHandlers } from '../Tooltip/hooks';\nimport { useChatContext, useTranslationContext } from '../../context';\n\nimport type { PollVote as PollVoteType } from 'stream-chat';\n\nconst PollVoteTimestamp = ({ timestamp }: { timestamp: string }) => {\n  const { t } = useTranslationContext();\n  const { handleEnter, handleLeave, tooltipVisible } =\n    useEnterLeaveHandlers<HTMLSpanElement>();\n  const [referenceElement, setReferenceElement] = useState<HTMLSpanElement | null>(null);\n  const timestampDate = new Date(timestamp);\n  return (\n    <div\n      className='str-chat__poll-vote__timestamp'\n      onMouseEnter={handleEnter}\n      onMouseLeave={handleLeave}\n      ref={setReferenceElement}\n    >\n      {t('timestamp/PollVote', { timestamp: timestampDate })}\n      <PopperTooltip\n        offset={[0, 5]}\n        placement='bottom'\n        referenceElement={referenceElement}\n        visible={tooltipVisible}\n      >\n        {t('timestamp/PollVoteTooltip', { timestamp: timestampDate })}\n      </PopperTooltip>\n    </div>\n  );\n};\n\ntype PollVoteProps = {\n  vote: PollVoteType;\n};\n\ntype PollVoteAuthor = PollVoteProps;\n\nconst PollVoteAuthor = ({ vote }: PollVoteAuthor) => {\n  const { t } = useTranslationContext();\n  const { client } = useChatContext();\n  const displayName =\n    client.user?.id && client.user.id === vote.user?.id\n      ? t('You')\n      : vote.user?.name || vote.user?.id || t('Anonymous');\n\n  return (\n    <div className='str-chat__poll-vote__author'>\n      {vote.user && (\n        <Avatar\n          className='str-chat__avatar--poll-vote-author'\n          imageUrl={vote.user.image}\n          key={`poll-vote-${vote.id}-avatar-${vote.user.id}`}\n          size='md'\n          userName={vote.user.name}\n        />\n      )}\n      <div className='str-chat__poll-vote__author__name'>{displayName}</div>\n    </div>\n  );\n};\n\nexport const PollVote = ({ vote }: PollVoteProps) => (\n  <div className='str-chat__poll-vote'>\n    <PollVoteAuthor vote={vote} />\n    <PollVoteTimestamp timestamp={vote.created_at} />\n  </div>\n);\n\nexport type PollVoteListingProps = {\n  votes: PollVoteType[];\n};\n\nexport const PollVoteListing = ({ votes }: PollVoteListingProps) => (\n  <div className='str-chat__poll-vote-listing'>\n    {votes.map((vote) => (\n      <PollVote key={`poll-vote-${vote.id}`} vote={vote} />\n    ))}\n  </div>\n);\n","import { useEffect, useState } from 'react';\nimport { isVoteAnswer } from 'stream-chat';\nimport { useChatContext } from '../../../context';\nimport type { Event, PollAnswer, PollVote } from 'stream-chat';\n\nimport type { CursorPaginatorStateStore } from '../../InfiniteScrollPaginator/hooks/useCursorPaginator';\n\nexport function useManagePollVotesRealtime<T extends PollVote | PollAnswer = PollVote>(\n  managedVoteType: 'answer' | 'vote',\n  cursorPaginatorState?: CursorPaginatorStateStore<T>,\n  optionId?: string,\n) {\n  const { client } = useChatContext();\n  const [votesInRealtime, setVotesInRealtime] = useState<T[]>(\n    cursorPaginatorState?.getLatestValue().items ?? [],\n  );\n\n  useEffect(\n    () =>\n      cursorPaginatorState?.subscribeWithSelector(\n        (state) => [state.latestPageItems],\n        ([latestPageItems]) =>\n          setVotesInRealtime((prev) => [...prev, ...latestPageItems]),\n      ),\n    [cursorPaginatorState],\n  );\n\n  useEffect(() => {\n    const handleVoteEvent = (event: Event) => {\n      if (!event.poll_vote) return;\n      const isAnswer = isVoteAnswer(event.poll_vote);\n      if (\n        (managedVoteType === 'answer' && !isAnswer) ||\n        (managedVoteType === 'vote' &&\n          (isAnswer || event.poll_vote.option_id !== optionId))\n      )\n        return;\n\n      if (event.type === 'poll.vote_removed') {\n        setVotesInRealtime((prev) =>\n          event.poll_vote\n            ? prev.filter((vote) => vote.id !== (event.poll_vote as T).id)\n            : prev,\n        );\n      }\n      if (event.type === 'poll.vote_changed') {\n        setVotesInRealtime((prev) =>\n          event.poll_vote\n            ? prev.filter((vote) => vote.id !== (event.poll_vote as T).id)\n            : prev,\n        );\n      }\n      if (['poll.vote_casted', 'poll.vote_changed'].includes(event.type)) {\n        setVotesInRealtime((prev) =>\n          event.poll_vote ? [event.poll_vote as T, ...prev] : prev,\n        );\n      }\n    };\n\n    const voteCastedSubscription = client.on('poll.vote_casted', handleVoteEvent);\n    const voteRemovedSubscription = client.on('poll.vote_removed', handleVoteEvent);\n    const voteChangedSubscription = client.on('poll.vote_changed', handleVoteEvent);\n\n    return () => {\n      voteCastedSubscription.unsubscribe();\n      voteRemovedSubscription.unsubscribe();\n      voteChangedSubscription.unsubscribe();\n    };\n  }, [client, optionId, managedVoteType]);\n\n  return votesInRealtime;\n}\n","import uniqBy from 'lodash.uniqby';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport { StateStore } from 'stream-chat';\n\nexport type CursorPaginatorState<T> = {\n  hasNextPage: boolean;\n  items: T[];\n  latestPageItems: T[];\n  loading: boolean;\n  error?: Error;\n  next?: string | null;\n};\n\nexport type CursorPaginatorStateStore<T> = StateStore<CursorPaginatorState<T>>;\n\nexport type PaginationFn<T> = (next?: string) => Promise<{ items: T[]; next?: string }>;\n\nexport const useCursorPaginator = <T>(\n  paginationFn: PaginationFn<T>,\n  loadFirstPage?: boolean,\n) => {\n  const cursorPaginatorState = useMemo(\n    () =>\n      new StateStore<CursorPaginatorState<T>>({\n        hasNextPage: true,\n        items: [],\n        latestPageItems: [],\n        loading: false,\n      }),\n    [],\n  );\n\n  const loadMore = useCallback(async () => {\n    const { loading, next: currentNext } = cursorPaginatorState.getLatestValue();\n    if (currentNext === null || loading) return;\n\n    cursorPaginatorState.partialNext({ loading: true });\n\n    try {\n      const { items, next } = await paginationFn(currentNext);\n      cursorPaginatorState.next((prev) => ({\n        ...prev,\n        hasNextPage: !!next,\n        items: uniqBy(prev.items.concat(items), 'id'),\n        latestPageItems: items,\n        next: next || null,\n      }));\n    } catch (error) {\n      cursorPaginatorState.partialNext({ error: error as Error });\n    }\n    cursorPaginatorState.partialNext({ loading: false });\n  }, [cursorPaginatorState, paginationFn]);\n\n  useEffect(() => {\n    const { items } = cursorPaginatorState.getLatestValue();\n    if (!loadFirstPage || items.length) return;\n    loadMore();\n  }, [cursorPaginatorState, loadFirstPage, loadMore]);\n\n  return {\n    cursorPaginatorState,\n    loadMore,\n  };\n};\n","import { useCallback } from 'react';\nimport { useManagePollVotesRealtime } from './useManagePollVotesRealtime';\nimport type {\n  CursorPaginatorState,\n  PaginationFn,\n} from '../../InfiniteScrollPaginator/hooks/useCursorPaginator';\nimport { useCursorPaginator } from '../../InfiniteScrollPaginator/hooks/useCursorPaginator';\nimport { usePollContext } from '../../../context';\n\nimport { useStateStore } from '../../../store';\nimport type { PollAnswer, PollAnswersQueryParams, PollVote } from 'stream-chat';\n\nconst paginationStateSelector = (\n  state: CursorPaginatorState<PollVote>,\n): [Error | undefined, boolean, boolean] => [\n  state.error,\n  state.hasNextPage,\n  state.loading,\n];\n\ntype UsePollAnswerPaginationParams = {\n  paginationParams?: PollAnswersQueryParams;\n};\n\nexport const usePollAnswerPagination = ({\n  paginationParams,\n}: UsePollAnswerPaginationParams = {}) => {\n  const { poll } = usePollContext();\n\n  const paginationFn = useCallback<PaginationFn<PollAnswer>>(\n    async (next) => {\n      const { next: newNext, votes } = await poll.queryAnswers({\n        filter: paginationParams?.filter,\n        options: !next\n          ? paginationParams?.options\n          : { ...paginationParams?.options, next },\n        sort: { created_at: -1, ...paginationParams?.sort },\n      });\n      return { items: votes, next: newNext };\n    },\n    [paginationParams, poll],\n  );\n\n  const { cursorPaginatorState, loadMore } = useCursorPaginator(paginationFn, true);\n  const answers = useManagePollVotesRealtime<PollAnswer>('answer', cursorPaginatorState);\n  const [error, hasNextPage, loading] = useStateStore(\n    cursorPaginatorState,\n    paginationStateSelector,\n  );\n\n  return {\n    answers,\n    error,\n    hasNextPage,\n    loading,\n    loadMore,\n  };\n};\n","import { useCallback } from 'react';\nimport { useManagePollVotesRealtime } from './useManagePollVotesRealtime';\nimport type {\n  CursorPaginatorState,\n  PaginationFn,\n} from '../../InfiniteScrollPaginator/hooks/useCursorPaginator';\nimport { useCursorPaginator } from '../../InfiniteScrollPaginator/hooks/useCursorPaginator';\nimport { useStateStore } from '../../../store';\nimport { usePollContext } from '../../../context';\n\nimport type { PollOptionVotesQueryParams, PollVote } from 'stream-chat';\n\nconst paginationStateSelector = (\n  state: CursorPaginatorState<PollVote>,\n): [Error | undefined, boolean, boolean] => [\n  state.error,\n  state.hasNextPage,\n  state.loading,\n];\n\ntype UsePollOptionVotesPaginationParams = {\n  paginationParams: PollOptionVotesQueryParams;\n};\n\nexport const usePollOptionVotesPagination = ({\n  paginationParams,\n}: UsePollOptionVotesPaginationParams) => {\n  const { poll } = usePollContext();\n\n  const paginationFn = useCallback<PaginationFn<PollVote>>(\n    async (next) => {\n      const { next: newNext, votes } = await poll.queryOptionVotes({\n        filter: paginationParams.filter,\n        options: !next\n          ? paginationParams?.options\n          : { ...paginationParams?.options, next },\n        sort: { created_at: -1, ...paginationParams?.sort },\n      });\n      return { items: votes, next: newNext };\n    },\n    [paginationParams, poll],\n  );\n\n  const { cursorPaginatorState, loadMore } = useCursorPaginator(paginationFn, true);\n  const votes = useManagePollVotesRealtime<PollVote>(\n    'vote',\n    cursorPaginatorState,\n    paginationParams.filter.option_id,\n  );\n  const [error, hasNextPage, loading] = useStateStore(\n    cursorPaginatorState,\n    paginationStateSelector,\n  );\n\n  return {\n    error,\n    hasNextPage,\n    loading,\n    loadMore,\n    votes,\n  };\n};\n","import clsx from 'clsx';\nimport debounce from 'lodash.debounce';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD } from '../../constants/limits';\n\n/**\n * Prevents Chrome hangups\n * See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257\n */\nconst mousewheelListener = (event: Event) => {\n  if (event instanceof WheelEvent && event.deltaY === 1) {\n    event.preventDefault();\n  }\n};\n\nexport type InfiniteScrollPaginatorProps = React.ComponentProps<'div'> & {\n  listenToScroll?: (\n    distanceFromBottom: number,\n    distanceFromTop: number,\n    threshold: number,\n  ) => void;\n  loadNextDebounceMs?: number;\n  loadNextOnScrollToBottom?: () => void;\n  loadNextOnScrollToTop?: () => void;\n  /** Offset from when to start the loadNextPage call */\n  threshold?: number;\n  useCapture?: boolean;\n};\n\nexport const InfiniteScrollPaginator = (\n  props: PropsWithChildren<InfiniteScrollPaginatorProps>,\n) => {\n  const {\n    children,\n    className,\n    listenToScroll,\n    loadNextDebounceMs = 500,\n    loadNextOnScrollToBottom,\n    loadNextOnScrollToTop,\n    threshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,\n    useCapture = false,\n    ...componentProps\n  } = props;\n\n  const rootRef = useRef<HTMLDivElement | null>(null);\n  const childRef = useRef<HTMLDivElement | null>(null);\n\n  const scrollListener = useMemo(\n    () =>\n      debounce(() => {\n        const root = rootRef.current;\n        const child = childRef.current;\n        if (!root || root.offsetParent === null || !child) {\n          return;\n        }\n\n        const distanceFromBottom =\n          child.scrollHeight - root.scrollTop - root.clientHeight;\n        const distanceFromTop = root.scrollTop;\n\n        if (listenToScroll) {\n          listenToScroll(distanceFromBottom, distanceFromTop, threshold);\n        }\n\n        if (distanceFromTop < Number(threshold)) {\n          loadNextOnScrollToTop?.();\n        }\n\n        if (distanceFromBottom < Number(threshold)) {\n          loadNextOnScrollToBottom?.();\n        }\n      }, loadNextDebounceMs),\n    [\n      listenToScroll,\n      loadNextDebounceMs,\n      loadNextOnScrollToBottom,\n      loadNextOnScrollToTop,\n      threshold,\n    ],\n  );\n\n  useEffect(() => {\n    const scrollElement = rootRef.current;\n    if (!scrollElement) return;\n\n    scrollElement.addEventListener('scroll', scrollListener, useCapture);\n\n    return () => {\n      scrollElement.removeEventListener('scroll', scrollListener, useCapture);\n    };\n  }, [scrollListener, useCapture]);\n\n  useEffect(() => {\n    const root = rootRef.current;\n    if (!root || typeof ResizeObserver === 'undefined' || !scrollListener) return;\n    const observer = new ResizeObserver(scrollListener);\n    observer.observe(root as Element);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [scrollListener]);\n\n  useEffect(() => {\n    const root = rootRef.current;\n    if (root) {\n      root.addEventListener('wheel', mousewheelListener, { passive: false });\n    }\n    return () => {\n      if (root) {\n        root.removeEventListener('wheel', mousewheelListener, useCapture);\n      }\n    };\n  }, [useCapture]);\n\n  return (\n    <div\n      {...componentProps}\n      className={clsx('str-chat__infinite-scroll-paginator', className)}\n      ref={rootRef}\n    >\n      <div className='str-chat__infinite-scroll-paginator__content' ref={childRef}>\n        {children}\n      </div>\n    </div>\n  );\n};\n","import React from 'react';\nimport { Button } from '../../Button';\nimport { Viewer } from '../../Dialog';\nimport { PollVote } from '../PollVote';\nimport { usePollAnswerPagination } from '../hooks';\nimport { InfiniteScrollPaginator } from '../../InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport { LoadingIndicator } from '../../Loading';\nimport { useStateStore } from '../../../store';\nimport {\n  useChatContext,\n  useModalContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../../context';\n\nimport type { PollAnswer, PollState } from 'stream-chat';\n\ntype PollStateSelectorReturnValue = {\n  is_closed: boolean | undefined;\n  ownAnswer: PollAnswer | undefined;\n};\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  is_closed: nextValue.is_closed,\n  ownAnswer: nextValue.ownAnswer,\n});\n\nexport type PollAnswerListProps = {\n  onUpdateOwnAnswerClick: () => void;\n};\n\nexport const PollAnswerList = ({ onUpdateOwnAnswerClick }: PollAnswerListProps) => {\n  const { client } = useChatContext();\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { close } = useModalContext();\n  const { is_closed } = useStateStore(poll.state, pollStateSelector);\n\n  const { answers, error, hasNextPage, loading, loadMore } = usePollAnswerPagination();\n\n  return (\n    <Viewer.Root className='str-chat__modal__poll-answer-list'>\n      <Viewer.Header\n        close={close}\n        description={t('Review comments submitted with poll answers')}\n        title={t('Poll comments')}\n      />\n      <Viewer.Body className='str-chat__modal__poll-answer-list__body'>\n        <div className='str-chat__poll-answer-list'>\n          <InfiniteScrollPaginator loadNextOnScrollToBottom={loadMore} threshold={40}>\n            {answers.map((answer) => (\n              <div className='str-chat__poll-answer' key={`comment-${answer.id}`}>\n                <div className='str-chat__poll-answer__data'>\n                  {answer.answer_text && (\n                    <p className='str-chat__poll-answer__text'>{answer.answer_text}</p>\n                  )}\n                  <PollVote key={`poll-vote-${answer.id}`} vote={answer} />\n                </div>\n                {!is_closed && answer.user?.id === client.user?.id && (\n                  <div className='str-chat__poll-vote__update-vote-button-container'>\n                    <Button\n                      appearance='ghost'\n                      className='str-chat__poll-vote__update-vote-button'\n                      onClick={onUpdateOwnAnswerClick}\n                      size='md'\n                      variant='secondary'\n                    >\n                      {t('Update your comment')}\n                    </Button>\n                  </div>\n                )}\n              </div>\n            ))}\n\n            {hasNextPage && (\n              <div className='str-chat__loading-indicator-placeholder'>\n                {loading && <LoadingIndicator />}\n              </div>\n            )}\n          </InfiniteScrollPaginator>\n        </div>\n        {error?.message && <div>{error?.message}</div>}\n      </Viewer.Body>\n      {/*<Viewer.Footer>*/}\n      {/*  {answers.length > 0 && !is_closed && (*/}\n      {/*    <Viewer.FooterControls>*/}\n      {/*      <Viewer.FooterControlsButtonSecondary*/}\n      {/*        className='str-chat__poll-action'*/}\n      {/*        onClick={onUpdateOwnAnswerClick}*/}\n      {/*      >*/}\n      {/*        {ownAnswer ? t('Update your comment') : t('Add a comment')}*/}\n      {/*      </Viewer.FooterControlsButtonSecondary>*/}\n      {/*    </Viewer.FooterControls>*/}\n      {/*  )}*/}\n      {/*</Viewer.Footer>*/}\n    </Viewer.Root>\n  );\n};\n","import React from 'react';\nimport { useStateStore } from '../../../../store';\nimport { usePollContext, useTranslationContext } from '../../../../context';\nimport type { PollOption, PollState } from 'stream-chat';\nimport { IconTrophy } from '../../../Icons';\n\ntype PollStateSelectorReturnValue = {\n  maxVotedOptionIds: string[];\n  vote_counts_by_option: Record<string, number>;\n};\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  maxVotedOptionIds: nextValue.maxVotedOptionIds,\n  vote_counts_by_option: nextValue.vote_counts_by_option,\n});\n\nexport type PollResultOptionVoteCounterProps = {\n  optionId: string;\n};\n\nexport const PollResultOptionVoteCounter = ({\n  optionId,\n}: PollResultOptionVoteCounterProps) => {\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { maxVotedOptionIds, vote_counts_by_option } = useStateStore(\n    poll.state,\n    pollStateSelector,\n  );\n\n  return (\n    <div className='str-chat__poll-result-option-vote-counter'>\n      {maxVotedOptionIds.length === 1 && maxVotedOptionIds[0] === optionId && (\n        <IconTrophy />\n      )}\n      <span className='str-chat__poll-result-option-vote-count'>\n        {t('{{count}} votes', { count: vote_counts_by_option[optionId] ?? 0 })}\n      </span>\n    </div>\n  );\n};\n\nexport type PollOptionWithVotesHeaderProps = {\n  option: PollOption;\n  optionOrderNumber: number;\n};\n\nexport const PollOptionWithVotesHeader = ({\n  option,\n  optionOrderNumber,\n}: PollOptionWithVotesHeaderProps) => {\n  const { t } = useTranslationContext();\n\n  return (\n    <div className='str-chat__poll-option__header'>\n      <div className='str-chat__poll-option__header__label'>\n        {t('Question {{ optionOrderNumber}}', { optionOrderNumber })}\n      </div>\n      <div className='str-chat__poll-option__header__title'>\n        <div className='str-chat__poll-option__option-text'>{option.text}</div>\n        <PollResultOptionVoteCounter optionId={option.id} />\n      </div>\n    </div>\n  );\n};\n","import React from 'react';\nimport { PollOptionWithVotesHeader } from './PollOptionWithVotesHeader';\nimport { PollVoteListing } from '../../PollVote';\nimport { useStateStore } from '../../../../store';\nimport {\n  useChannelStateContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../../../context';\nimport type { PollOption, PollState, PollVote } from 'stream-chat';\nimport { Button } from '../../../Button';\nimport clsx from 'clsx';\n\ntype PollStateSelectorReturnValue = {\n  latest_votes_by_option: Record<string, PollVote[]>;\n};\n\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  latest_votes_by_option: nextValue.latest_votes_by_option,\n});\n\nexport type PollOptionWithVotesProps = {\n  option: PollOption;\n  orderNumber: number;\n  countVotesPreview?: number;\n  showAllVotes?: () => void;\n};\n\nexport const PollOptionWithVotes = ({\n  countVotesPreview,\n  option,\n  orderNumber,\n  showAllVotes,\n}: PollOptionWithVotesProps) => {\n  const { t } = useTranslationContext();\n  const { channelCapabilities = {} } = useChannelStateContext('PollOptionWithVotes');\n  const { poll } = usePollContext();\n  const { latest_votes_by_option } = useStateStore(poll.state, pollStateSelector);\n\n  const votes = latest_votes_by_option && latest_votes_by_option[option.id];\n  const voteCount = votes?.length ?? 0;\n  const isVotesPreview = typeof countVotesPreview === 'number';\n\n  return (\n    <div\n      className={clsx('str-chat__poll-option', {\n        'str-chat__poll-option--has-more-votes':\n          isVotesPreview && voteCount > countVotesPreview,\n        'str-chat__poll-option--has-votes': voteCount,\n      })}\n    >\n      <PollOptionWithVotesHeader option={option} optionOrderNumber={orderNumber} />\n      {!!votes && <PollVoteListing votes={votes.slice(0, countVotesPreview)} />}\n      {channelCapabilities['query-poll-votes'] &&\n        showAllVotes &&\n        isVotesPreview &&\n        votes?.length > countVotesPreview && (\n          <div className='str-chat__poll-option__show-all-votes-button-container'>\n            <Button\n              appearance='ghost'\n              className='str-chat__poll-option__show-all-votes-button'\n              onClick={showAllVotes}\n              size='md'\n              variant='secondary'\n            >\n              {t('View all')}\n            </Button>\n          </div>\n        )}\n    </div>\n  );\n};\n","export const MAX_POLL_OPTIONS = 100 as const;\n\nexport const MAX_OPTIONS_DISPLAYED = 5 as const;\nexport const COUNT_OPTION_VOTES_PREVIEW = 5 as const;\n","import { useTranslationContext } from '../../../context';\n\nexport type PollQuestionProps = {\n  question: string;\n};\n\nexport const PollQuestion = ({ question }: PollQuestionProps) => {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__modal__poll-question'>\n      <div className='str-chat__modal__poll-question__label'>{t('Question')}</div>\n      <div className='str-chat__modal__poll-question__text'>{question}</div>\n    </div>\n  );\n};\n","import React, { useMemo } from 'react';\nimport { PollVoteListing } from '../../PollVote';\nimport { usePollOptionVotesPagination } from '../../hooks';\nimport { LoadingIndicator } from '../../../Loading';\nimport { InfiniteScrollPaginator } from '../../../InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport type { PollOption, PollOptionVotesQueryParams } from 'stream-chat';\nimport { PollOptionWithVotesHeader } from './PollOptionWithVotesHeader';\n\nexport type PollOptionWithVotesListProps = {\n  option: PollOption;\n  optionOrderNumber: number;\n};\n\nexport const PollOptionWithVotesList = ({\n  option,\n  optionOrderNumber,\n}: PollOptionWithVotesListProps) => {\n  const paginationParams = useMemo<PollOptionVotesQueryParams>(\n    () => ({ filter: { option_id: option.id } }),\n    [option.id],\n  );\n  const { hasNextPage, loading, loadMore, votes } = usePollOptionVotesPagination({\n    paginationParams,\n  });\n\n  return (\n    <InfiniteScrollPaginator loadNextOnScrollToBottom={loadMore} threshold={40}>\n      <div className='str-chat_poll-option-with-votes-list'>\n        <div className='str-chat__poll-option'>\n          <div className='str-chat__poll-option__votes-paginated-list'>\n            <PollOptionWithVotesHeader\n              option={option}\n              optionOrderNumber={optionOrderNumber}\n            />\n            <PollVoteListing votes={votes} />\n            {hasNextPage && (\n              <div className='str-chat__loading-indicator-placeholder'>\n                {loading && <LoadingIndicator />}\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n    </InfiniteScrollPaginator>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useCallback, useState } from 'react';\nimport { PollOptionWithVotes } from './PollOptionWithVotes';\nimport { Viewer } from '../../../Dialog';\nimport { useStateStore } from '../../../../store';\nimport {\n  useModalContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../../../context';\nimport type { PollOption, PollState } from 'stream-chat';\nimport { COUNT_OPTION_VOTES_PREVIEW } from '../../constants';\nimport { PollQuestion } from '../PollQuestion';\nimport { PollOptionWithVotesList } from './PollOptionWithVotesList';\n\nconst pollStateSelector = ({\n  name,\n  options,\n  vote_count,\n  vote_counts_by_option,\n}: PollState) => ({\n  name,\n  options: [...options],\n  vote_count,\n  vote_counts_by_option,\n});\n\nexport const PollResults = () => {\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { close } = useModalContext();\n  const { name, options, vote_count, vote_counts_by_option } = useStateStore(\n    poll.state,\n    pollStateSelector,\n  );\n  const [optionToView, setOptionToView] = useState<{\n    option: PollOption;\n    optionOrderNumber: number;\n  } | null>(null);\n\n  const goBack = useCallback(() => setOptionToView(null), []);\n\n  return (\n    <Viewer.Root\n      className={clsx('str-chat__modal__poll-results', {\n        'str-chat__modal__poll-results--option-detail': optionToView,\n      })}\n    >\n      {optionToView?.option ? (\n        <>\n          <Viewer.Header\n            close={close}\n            description={t('Review who voted for this option')}\n            goBack={goBack}\n            title={t('Votes')}\n          />\n          <Viewer.Body className='str-chat__modal__poll-results__body'>\n            <PollOptionWithVotesList\n              option={optionToView?.option}\n              optionOrderNumber={optionToView?.optionOrderNumber}\n            />\n          </Viewer.Body>\n        </>\n      ) : (\n        <>\n          <Viewer.Header\n            close={close}\n            description={t(\n              'Review poll results and open an option to see detailed votes',\n            )}\n            title={t('Poll results')}\n          />\n          <Viewer.Body className='str-chat__modal__poll-results__body'>\n            <PollQuestion question={name} />\n            <div className='str-chat__modal__poll-results__options'>\n              <div className='str-chat__modal__poll-results__option-list'>\n                {options\n                  .sort((next, current) =>\n                    (vote_counts_by_option[current.id] ?? 0) >=\n                    (vote_counts_by_option[next.id] ?? 0)\n                      ? 1\n                      : -1,\n                  )\n                  .map((option, i) => {\n                    const optionOrderNumber = i + 1;\n                    return (\n                      <PollOptionWithVotes\n                        countVotesPreview={COUNT_OPTION_VOTES_PREVIEW}\n                        key={`poll-option-${option.id}`}\n                        option={option}\n                        orderNumber={optionOrderNumber}\n                        showAllVotes={() =>\n                          setOptionToView({ option, optionOrderNumber })\n                        }\n                      />\n                    );\n                  })}\n              </div>\n              <div className='str-chat__modal__poll-results__options__footer'>\n                <div className='str-chat__modal__poll-results__options-total-count'>\n                  {t('totalVoteCount', { count: vote_count })}\n                </div>\n              </div>\n            </div>\n          </Viewer.Body>\n        </>\n      )}\n    </Viewer.Root>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useCallback, useState } from 'react';\nimport { PollAction } from './PollAction';\nimport type { AddCommentPromptProps } from './AddCommentPrompt';\nimport { AddCommentPrompt as DefaultAddCommentPrompt } from './AddCommentPrompt';\nimport type { SuggestPollOptionFormProps } from './SuggestPollOptionPrompt';\nimport { SuggestPollOptionPrompt as DefaultSuggestPollOptionForm } from './SuggestPollOptionPrompt';\nimport { EndPollAlert as DefaultEndPollAlert } from './EndPollAlert';\nimport type { PollAnswerListProps } from './PollAnswerList';\nimport { PollAnswerList as DefaultPollAnswerList } from './PollAnswerList';\nimport { PollResults as DefaultPollResults } from './PollResults';\nimport { MAX_POLL_OPTIONS } from '../constants';\nimport {\n  useChannelStateContext,\n  useChatContext,\n  useMessageContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../../context';\nimport { useStateStore } from '../../../store';\n\nimport type { PollState } from 'stream-chat';\n\nconst COMMON_MODAL_CLASS = 'str-chat__poll-action-modal' as const;\n\ntype ModalName =\n  | 'suggest-option'\n  | 'add-comment'\n  | 'view-comments'\n  | 'view-results'\n  | 'end-vote';\n\nconst pollStateSelector = (nextValue: PollState) => ({\n  allow_answers: nextValue.allow_answers,\n  allow_user_suggested_options: nextValue.allow_user_suggested_options,\n  answers_count: nextValue.answers_count,\n  created_by_id: nextValue.created_by_id,\n  is_closed: nextValue.is_closed,\n  options: nextValue.options,\n  ownAnswer: nextValue.ownAnswer,\n  voteCount: nextValue.vote_count,\n});\n\nexport type PollActionsProps = {\n  AddCommentPrompt?: React.ComponentType<AddCommentPromptProps>;\n  EndPollAlert?: React.ComponentType;\n  PollAnswerList?: React.ComponentType<PollAnswerListProps>;\n  PollResults?: React.ComponentType;\n  SuggestPollOptionForm?: React.ComponentType<SuggestPollOptionFormProps>;\n};\n\nexport const PollActions = ({\n  AddCommentPrompt = DefaultAddCommentPrompt,\n  EndPollAlert = DefaultEndPollAlert,\n  PollAnswerList = DefaultPollAnswerList,\n  PollResults = DefaultPollResults,\n  SuggestPollOptionForm = DefaultSuggestPollOptionForm,\n}: PollActionsProps) => {\n  const { client } = useChatContext();\n  const { t } = useTranslationContext('PollActions');\n  const { channelCapabilities = {} } = useChannelStateContext('PollActions');\n  const { message } = useMessageContext('PollActions');\n  const { poll } = usePollContext();\n  const {\n    allow_answers,\n    allow_user_suggested_options,\n    answers_count,\n    created_by_id,\n    is_closed,\n    options,\n    ownAnswer,\n    voteCount,\n  } = useStateStore(poll.state, pollStateSelector);\n  const [modalOpen, setModalOpen] = useState<ModalName | undefined>();\n\n  const canCastVote = channelCapabilities['cast-poll-vote'] && !is_closed;\n  const closeModal = useCallback(() => setModalOpen(undefined), []);\n  const onUpdateAnswerClick = useCallback(() => setModalOpen('add-comment'), []);\n\n  const hasContents =\n    (!is_closed && created_by_id === client.user?.id) ||\n    !!voteCount ||\n    (canCastVote && allow_user_suggested_options && options.length < MAX_POLL_OPTIONS) ||\n    (!is_closed && allow_answers) ||\n    (answers_count > 0 && channelCapabilities['query-poll-votes']);\n\n  if (!hasContents) return null;\n\n  return (\n    <div className='str-chat__poll-actions'>\n      {!is_closed && created_by_id === client.user?.id && (\n        <PollAction\n          buttonText={t('End poll')}\n          closeModal={closeModal}\n          modalClassName={clsx(COMMON_MODAL_CLASS, 'str-chat__end-poll-modal')}\n          modalIsOpen={modalOpen === 'end-vote'}\n          openModal={() => setModalOpen('end-vote')}\n        >\n          <EndPollAlert />\n        </PollAction>\n      )}\n\n      {!!voteCount && (\n        <PollAction\n          buttonText={t('View results')}\n          closeModal={closeModal}\n          modalClassName={clsx(COMMON_MODAL_CLASS, 'str-chat__poll-results-modal')}\n          modalIsOpen={modalOpen === 'view-results'}\n          openModal={() => setModalOpen('view-results')}\n        >\n          <PollResults />\n        </PollAction>\n      )}\n\n      {canCastVote &&\n        allow_user_suggested_options &&\n        options.length < MAX_POLL_OPTIONS && (\n          <PollAction\n            buttonText={t('Suggest an option')}\n            closeModal={closeModal}\n            isAdditionalAction\n            modalClassName={clsx(\n              COMMON_MODAL_CLASS,\n              'str-chat__suggest-poll-option-modal',\n            )}\n            modalIsOpen={modalOpen === 'suggest-option'}\n            openModal={() => setModalOpen('suggest-option')}\n          >\n            <SuggestPollOptionForm />\n          </PollAction>\n        )}\n\n      {!is_closed && allow_answers && (\n        <PollAction\n          buttonText={ownAnswer ? t('Update your comment') : t('Add a comment')}\n          closeModal={closeModal}\n          isAdditionalAction\n          modalClassName={clsx(COMMON_MODAL_CLASS, 'str-chat__add-poll-answer-modal')}\n          modalIsOpen={modalOpen === 'add-comment'}\n          openModal={() => setModalOpen('add-comment')}\n        >\n          <AddCommentPrompt messageId={message.id} />\n        </PollAction>\n      )}\n\n      {answers_count > 0 && channelCapabilities['query-poll-votes'] && (\n        <PollAction\n          buttonText={t('View {{count}} comments', { count: answers_count })}\n          closeModal={closeModal}\n          isAdditionalAction\n          modalClassName={clsx(COMMON_MODAL_CLASS, 'str-chat__poll-answer-list-modal')}\n          modalIsOpen={modalOpen === 'view-comments'}\n          openModal={() => setModalOpen('view-comments')}\n        >\n          <PollAnswerList onUpdateOwnAnswerClick={onUpdateAnswerClick} />\n        </PollAction>\n      )}\n    </div>\n  );\n};\n","import clsx from 'clsx';\nimport debounce from 'lodash.debounce';\nimport React, { useMemo } from 'react';\nimport type { PollOption, PollState, PollVote, VotingVisibility } from 'stream-chat';\nimport { isVoteAnswer } from 'stream-chat';\nimport { AvatarStack as DefaultAvatarStack } from '../Avatar';\nimport {\n  useChannelStateContext,\n  useComponentContext,\n  useMessageContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../context';\nimport { useStateStore } from '../../store';\n\ntype AmountBarProps = {\n  amount: number;\n  className?: string;\n};\n\nexport const AmountBar = ({ amount, className }: AmountBarProps) => (\n  <div\n    aria-hidden='true'\n    className={clsx('str-chat__amount-bar', className)}\n    data-testid='amount-bar'\n    style={\n      {\n        '--str-chat__amount-bar-fulfillment': amount + '%',\n      } as React.CSSProperties\n    }\n  />\n);\n\nexport type CheckmarkProps = { checked?: boolean };\n\nexport const Checkmark = ({ checked }: CheckmarkProps) => (\n  <div\n    className={clsx('str-chat__checkmark', { 'str-chat__checkmark--checked': checked })}\n  />\n);\n\ntype PollStateSelectorReturnValue = {\n  is_closed: boolean | undefined;\n  latest_votes_by_option: Record<string, PollVote[]>;\n  maxVotedOptionIds: string[];\n  ownVotesByOptionId: Record<string, PollVote>;\n  vote_counts_by_option: Record<string, number>;\n  voting_visibility: VotingVisibility | undefined;\n};\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  is_closed: nextValue.is_closed,\n  latest_votes_by_option: nextValue.latest_votes_by_option,\n  maxVotedOptionIds: nextValue.maxVotedOptionIds,\n  ownVotesByOptionId: nextValue.ownVotesByOptionId,\n  vote_counts_by_option: nextValue.vote_counts_by_option,\n  voting_visibility: nextValue.voting_visibility,\n});\n\nexport type PollOptionSelectorProps = {\n  option: PollOption;\n  displayAvatarCount?: number;\n  voteCountVerbose?: boolean;\n};\n\nexport const PollOptionSelector = ({\n  displayAvatarCount,\n  option,\n  voteCountVerbose,\n}: PollOptionSelectorProps) => {\n  const { t } = useTranslationContext();\n  const { channelCapabilities = {} } = useChannelStateContext('PollOptionsShortlist');\n  const { message } = useMessageContext();\n  const { AvatarStack = DefaultAvatarStack } = useComponentContext();\n  const { poll } = usePollContext();\n  const {\n    is_closed,\n    latest_votes_by_option,\n    maxVotedOptionIds,\n    ownVotesByOptionId,\n    vote_counts_by_option,\n    voting_visibility,\n  } = useStateStore(poll.state, pollStateSelector);\n\n  const canCastVote = channelCapabilities['cast-poll-vote'] && !is_closed;\n  const isInteractive = !!canCastVote;\n  const isSelected = !!ownVotesByOptionId[option.id];\n  const winningOptionCount = maxVotedOptionIds[0]\n    ? vote_counts_by_option[maxVotedOptionIds[0]]\n    : 0;\n\n  const toggleVote = useMemo(\n    () =>\n      debounce(() => {\n        if (!canCastVote) return;\n        const haveVotedForTheOption = !!ownVotesByOptionId[option.id];\n        return haveVotedForTheOption\n          ? poll.removeVote(ownVotesByOptionId[option.id].id, message.id)\n          : poll.castVote(option.id, message.id);\n      }, 100),\n    [canCastVote, message.id, option.id, ownVotesByOptionId, poll],\n  );\n\n  const avatarDisplayInfo = useMemo(\n    () =>\n      latest_votes_by_option?.[option.id] &&\n      (latest_votes_by_option[option.id] as PollVote[])\n        .filter((vote) => !!vote.user && !isVoteAnswer(vote))\n        .slice(0, displayAvatarCount)\n        .map(({ user }) => ({\n          id: user!.id, // eslint-disable-line @typescript-eslint/no-non-null-assertion\n          imageUrl: user!.image, // eslint-disable-line @typescript-eslint/no-non-null-assertion\n          userName: user!.name, // eslint-disable-line @typescript-eslint/no-non-null-assertion\n        })),\n    [displayAvatarCount, latest_votes_by_option, option.id],\n  );\n\n  return (\n    <div\n      aria-pressed={isInteractive ? isSelected : undefined}\n      className={clsx('str-chat__poll-option', {\n        'str-chat__poll-option--votable': canCastVote,\n      })}\n      key={`base-poll-option-${option.id}`}\n      onClick={isInteractive ? toggleVote : undefined}\n      onKeyDown={\n        isInteractive\n          ? (event) => {\n              if (event.key !== 'Enter' && event.key !== ' ') return;\n              event.preventDefault();\n              toggleVote();\n            }\n          : undefined\n      }\n      role={isInteractive ? 'button' : undefined}\n      tabIndex={isInteractive ? 0 : undefined}\n    >\n      {canCastVote && <Checkmark checked={isSelected} />}\n      <div className='str-chat__poll-option-data'>\n        <p className='str-chat__poll-option-text'>{option.text}</p>\n        <div className='str-chat__poll-option-votes'>\n          {displayAvatarCount && voting_visibility === 'public' && (\n            <div className='str-chat__poll-option-voters'>\n              <AvatarStack displayInfo={avatarDisplayInfo} size='xs' />\n            </div>\n          )}\n          <div className='str-chat__poll-option-vote-count'>\n            {voteCountVerbose\n              ? t('{{count}} votes', {\n                  count: vote_counts_by_option[option.id] ?? 0,\n                })\n              : (vote_counts_by_option[option.id] ?? 0)}\n          </div>\n        </div>\n      </div>\n      <AmountBar\n        amount={\n          (winningOptionCount &&\n            (vote_counts_by_option[option.id] ?? 0) / winningOptionCount) * 100\n        }\n        className={clsx('str-chat__poll-option__votes-bar', {\n          'str-chat__poll-option__votes-bar--winner':\n            is_closed &&\n            maxVotedOptionIds.length === 1 &&\n            maxVotedOptionIds[0] === option.id,\n        })}\n      />\n    </div>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useCallback, useState } from 'react';\nimport { PollAction } from './PollActions/PollAction';\nimport { PollOptionSelector as DefaultPollOptionSelector } from './PollOptionSelector';\nimport { useStateStore } from '../../store';\nimport {\n  useComponentContext,\n  usePollContext,\n  useTranslationContext,\n} from '../../context';\nimport type { PollOption, PollState } from 'stream-chat';\nimport { PollOptionsFullList as DefaultPollOptionsFullList } from './PollActions/PollOptionsFullList';\n\ntype PollStateSelectorReturnValue = { options: PollOption[] };\n\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  options: nextValue.options,\n});\n\nexport type PollOptionListProps = {\n  optionsDisplayCount?: number;\n  PollOptionsFullList?: React.ComponentType;\n};\n\nexport const PollOptionList = ({\n  optionsDisplayCount,\n  PollOptionsFullList = DefaultPollOptionsFullList,\n}: PollOptionListProps) => {\n  const { PollOptionSelector = DefaultPollOptionSelector } = useComponentContext();\n  const { t } = useTranslationContext('PollOptionList');\n  const { poll } = usePollContext();\n  const { options } = useStateStore(poll.state, pollStateSelector);\n  const [viewAllOptionsOpen, setViewAllOptionsOpen] = useState(false);\n  const closeViewAllOptions = useCallback(() => setViewAllOptionsOpen(false), []);\n  const openViewAllOptions = useCallback(() => setViewAllOptionsOpen(true), []);\n\n  const showMoreOptionsButton =\n    typeof optionsDisplayCount === 'number' && options.length > optionsDisplayCount;\n\n  return (\n    <>\n      <div\n        className={clsx('str-chat__poll-option-list', {\n          'str-chat__poll-option-list--full': typeof optionsDisplayCount === 'undefined',\n        })}\n      >\n        {options.slice(0, optionsDisplayCount ?? options.length).map((option) => (\n          <PollOptionSelector\n            displayAvatarCount={3}\n            key={`poll-option-${option.id}`}\n            option={option}\n          />\n        ))}\n      </div>\n      {showMoreOptionsButton && (\n        <PollAction\n          buttonText={t('+{{count}} more options', {\n            count: options.length,\n          })}\n          closeModal={closeViewAllOptions}\n          isAdditionalAction\n          modalClassName='str-chat__poll-action-modal'\n          modalIsOpen={viewAllOptionsOpen}\n          openModal={openViewAllOptions}\n        >\n          <PollOptionsFullList />\n        </PollAction>\n      )}\n    </>\n  );\n};\n","import React from 'react';\nimport { Viewer } from '../../Dialog';\nimport { PollOptionList } from '../PollOptionList';\nimport { useStateStore } from '../../../store';\nimport { useModalContext, usePollContext, useTranslationContext } from '../../../context';\n\nimport type { PollState } from 'stream-chat';\nimport { PollQuestion } from './PollQuestion';\n\ntype PollStateSelectorReturnValue = { name: string };\nconst pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({\n  name: nextValue.name,\n});\n\nexport const PollOptionsFullList = () => {\n  const { t } = useTranslationContext();\n  const { poll } = usePollContext();\n  const { close } = useModalContext();\n  const { name } = useStateStore(poll.state, pollStateSelector);\n\n  return (\n    <Viewer.Root className={'str-chat__modal__poll-option-list'}>\n      <Viewer.Header\n        close={close}\n        description={t('Review all options available in this poll')}\n        title={t('Poll options')}\n      />\n      <Viewer.Body className='str-chat__modal__poll-option-list__body'>\n        <PollQuestion question={name} />\n        <PollOptionList />\n      </Viewer.Body>\n    </Viewer.Root>\n  );\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport { PollHeader as DefaultPollHeader } from './PollHeader';\nimport { PollActions as DefaultPollActions } from './PollActions';\nimport { PollOptionList } from './PollOptionList';\nimport { MAX_OPTIONS_DISPLAYED } from './constants';\nimport { useComponentContext, usePollContext } from '../../context';\nimport { useStateStore } from '../../store';\nimport type { PollState } from 'stream-chat';\n\ntype PollStateSelectorPollContentReturnValue = { is_closed: boolean | undefined };\nconst pollStateSelectorPollContent = (\n  nextValue: PollState,\n): PollStateSelectorPollContentReturnValue => ({ is_closed: nextValue.is_closed });\nexport const PollContent = () => {\n  const { PollActions = DefaultPollActions, PollHeader = DefaultPollHeader } =\n    useComponentContext();\n  const { poll } = usePollContext();\n  const { is_closed } = useStateStore(poll.state, pollStateSelectorPollContent);\n\n  return (\n    <div className={clsx('str-chat__poll', { 'str-chat__poll--closed': is_closed })}>\n      <PollHeader />\n      <PollOptionList optionsDisplayCount={MAX_OPTIONS_DISPLAYED} />\n      <PollActions />\n    </div>\n  );\n};\n","import React from 'react';\nimport { PollContent as DefaultPollContent } from './PollContent';\nimport { PollProvider, useComponentContext } from '../../context';\nimport type { Poll as PollClass } from 'stream-chat';\n\nexport const Poll = ({ poll }: { poll: PollClass }) => {\n  const { PollContent = DefaultPollContent } = useComponentContext();\n  if (!poll) return null;\n  return (\n    <PollProvider poll={poll}>\n      <PollContent />\n    </PollProvider>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { NumericInput } from '../../Form/NumericInput';\nimport { SwitchField, SwitchFieldLabel } from '../../Form/SwitchField';\nimport { useTranslationContext } from '../../../context';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type { PollComposerState } from 'stream-chat';\n\nconst pollComposerStateSelector = (state: PollComposerState) => ({\n  enforce_unique_vote: state.data.enforce_unique_vote,\n  error: state.errors.max_votes_allowed,\n  max_votes_allowed: state.data.max_votes_allowed,\n});\n\nexport const MultipleAnswersField = () => {\n  const { t } = useTranslationContext();\n  const { pollComposer } = useMessageComposerController();\n  const { enforce_unique_vote, error, max_votes_allowed } = useStateStore(\n    pollComposer.state,\n    pollComposerStateSelector,\n  );\n  const [voteLimitEnabled, setVoteLimitEnabled] = useState(false);\n  const maxVotesInputRef = useRef<HTMLInputElement | null>(null);\n\n  const knownValidationErrors = useMemo<Record<string, string>>(\n    () => ({\n      'Enforce unique vote is enabled': t('Enforce unique vote is enabled'),\n      'Type a number from 2 to 10': t('Type a number from 2 to 10'),\n    }),\n    [t],\n  );\n\n  const multipleVotesEnabled = !enforce_unique_vote;\n  const errorText = error && knownValidationErrors[error];\n  const voteLimitSwitchId = 'max_votes_allowed_enabled';\n  const voteLimitSwitchLabelId = `${voteLimitSwitchId}-label`;\n\n  return (\n    <div className={clsx('str-chat__form__switch-fieldset', {})}>\n      <SwitchField\n        checked={multipleVotesEnabled}\n        description={t('Select more than one option')}\n        id='enforce_unique_vote'\n        onChange={(e) => {\n          setVoteLimitEnabled(false);\n          pollComposer.updateFields({ enforce_unique_vote: !e.target.checked });\n        }}\n        title={t('Multiple votes')}\n      />\n      {multipleVotesEnabled && (\n        <SwitchField\n          aria-labelledby={voteLimitSwitchLabelId}\n          checked={voteLimitEnabled}\n          fieldClassName='str-chat__multiple-answers-field__votes-limit-field'\n          id={voteLimitSwitchId}\n          onChange={(event) => {\n            const nextVoteLimitEnabled = event.target.checked;\n            setVoteLimitEnabled(nextVoteLimitEnabled);\n            pollComposer.updateFields({ max_votes_allowed: '2' });\n            if (!nextVoteLimitEnabled) return;\n            requestAnimationFrame(() => {\n              maxVotesInputRef.current?.focus();\n            });\n          }}\n        >\n          <div className='str-chat__multiple-answers-field__votes-limit-field__numeric-field'>\n            <SwitchFieldLabel\n              asError={!!errorText}\n              description={t('Choose between 2 to 10 options')}\n              htmlFor={voteLimitSwitchId}\n              id={voteLimitSwitchLabelId}\n              title={t('Limit votes per person')}\n            />\n            {voteLimitEnabled && (\n              <NumericInput\n                aria-label={t('Maximum votes per person')}\n                id='max_votes_allowed'\n                max={10}\n                min={2}\n                onBlur={() => {\n                  pollComposer.handleFieldBlur('max_votes_allowed');\n                }}\n                onChange={(e) => {\n                  const raw = e.target.value;\n                  const nativeFieldValidation =\n                    raw !== '' && !/^\\d+$/.test(raw)\n                      ? { max_votes_allowed: t('Only numbers are allowed') }\n                      : undefined;\n                  pollComposer.updateFields(\n                    {\n                      max_votes_allowed: nativeFieldValidation\n                        ? pollComposer.max_votes_allowed\n                        : raw,\n                    },\n                    nativeFieldValidation,\n                  );\n                }}\n                ref={maxVotesInputRef}\n                value={max_votes_allowed ?? ''}\n              />\n            )}\n          </div>\n        </SwitchField>\n      )}\n    </div>\n  );\n};\n","import React, { useMemo } from 'react';\nimport { TextInput } from '../../Form';\nimport { useModalContext, useTranslationContext } from '../../../context';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type { PollComposerState } from 'stream-chat';\nimport { useAriaIdentifiers } from '../../../a11y/hooks/useAriaIdentifiers';\n\nconst pollComposerStateSelector = (state: PollComposerState) => ({\n  error: state.errors.name,\n  name: state.data.name,\n});\n\nexport const NameField = () => {\n  const { t } = useTranslationContext();\n  const { pollComposer } = useMessageComposerController();\n  const { dialogId } = useModalContext();\n  const { descriptionId } = useAriaIdentifiers(dialogId);\n  const { error, name } = useStateStore(pollComposer.state, pollComposerStateSelector);\n  const knownValidationErrors = useMemo<Record<string, string>>(\n    () => ({\n      'Question is required': t('Question is required'),\n    }),\n    [t],\n  );\n\n  return (\n    <TextInput\n      aria-describedby={descriptionId}\n      className='str-chat__form__input-field__value'\n      error={!!error}\n      errorMessage={\n        error ? (\n          <span data-testid='poll-name-input-field-error'>\n            {knownValidationErrors[error] ?? t('Error')}\n          </span>\n        ) : undefined\n      }\n      id='name'\n      label={t('Question')}\n      onBlur={() => {\n        pollComposer.handleFieldBlur('name');\n      }}\n      onChange={(e) => {\n        pollComposer.updateFields({ name: e.target.value });\n      }}\n      placeholder={t('Ask a question')}\n      type='text'\n      value={name}\n    />\n  );\n};\n","import clsx from 'clsx';\nimport React, { useCallback, useMemo } from 'react';\nimport { TextInput } from '../../Form/TextInput';\nimport { useTranslationContext } from '../../../context';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport { useStateStore } from '../../../store';\nimport type { PollComposerState } from 'stream-chat';\nimport { IconMinusCircle, IconReorder } from '../../Icons';\nimport { Button, type ButtonProps } from '../../Button';\nimport { TextInputFieldSet } from '../../Form/TextInputFieldSet';\n\nconst pollComposerStateSelector = (state: PollComposerState) => ({\n  errors: state.errors.options,\n  options: state.data.options,\n});\n\nexport const OptionFieldSet = () => {\n  const { pollComposer } = useMessageComposerController();\n  const { errors, options } = useStateStore(\n    pollComposer.state,\n    pollComposerStateSelector,\n  );\n  const { t } = useTranslationContext('OptionFieldSet');\n\n  const knownValidationErrors = useMemo<Record<string, string>>(\n    () => ({\n      'Option already exists': t('Option already exists'),\n      'Option is empty': t('Option is empty'),\n    }),\n    [t],\n  );\n\n  const onSetNewOrder = useCallback(\n    (newOrder: number[]) => {\n      const prevOptions = pollComposer.options;\n      pollComposer.updateFields({ options: newOrder.map((index) => prevOptions[index]) });\n    },\n    [pollComposer],\n  );\n\n  const clearOption = useCallback(\n    (removedOptionId: string) => {\n      pollComposer.updateFields({\n        options: pollComposer.options.filter((option) => option.id !== removedOptionId),\n      });\n    },\n    [pollComposer],\n  );\n\n  const draggable = options.length > 1;\n\n  return (\n    <TextInputFieldSet\n      draggable={draggable}\n      label={t('Options')}\n      onSetNewOrder={onSetNewOrder}\n    >\n      {options.map((option, i) => {\n        const error = errors?.[option.id];\n        return (\n          <div\n            className={clsx('str-chat__form__input-field', {\n              'str-chat__form__input-field--draggable': draggable,\n              'str-chat__form__input-field--has-error': error,\n            })}\n            key={`new-poll-option-${i}`}\n          >\n            <TextInput\n              className='str-chat__form__input-field__value'\n              error={!!error}\n              fieldMessagePlacement='inside'\n              id={option.id}\n              leading={\n                draggable ? <IconReorder className='str-chat__drag-handle' /> : undefined\n              }\n              message={\n                error ? (\n                  <span data-testid='poll-option-input-field-error'>\n                    {knownValidationErrors[error] ?? t('Error')}\n                  </span>\n                ) : undefined\n              }\n              onBlur={() => {\n                pollComposer.handleFieldBlur('options');\n              }}\n              onChange={(e) => {\n                pollComposer.updateFields({\n                  options: { index: i, text: e.target.value },\n                });\n              }}\n              onKeyUp={(event) => {\n                const isFocusedLastOptionField = i === options.length - 1;\n                if (event.key === 'Enter' && !isFocusedLastOptionField) {\n                  const nextInputId = options[i + 1].id;\n                  document.getElementById(nextInputId)?.focus();\n                }\n              }}\n              placeholder={t('Add an option')}\n              trailing={\n                option.text ? (\n                  <RemoveOptionButton\n                    aria-label={t('aria/Remove option')}\n                    onClick={() => clearOption(option.id)}\n                  />\n                ) : undefined\n              }\n              type='text'\n              value={option.text}\n            />\n          </div>\n        );\n      })}\n    </TextInputFieldSet>\n  );\n};\n\nconst RemoveOptionButton = ({ className, ...props }: ButtonProps) => (\n  <Button\n    appearance='ghost'\n    circular\n    className={clsx('str-chat__form__remove-option-button', className)}\n    size='xs'\n    variant='secondary'\n    {...props}\n  >\n    <IconMinusCircle />\n  </Button>\n);\n","import React from 'react';\nimport { useCanCreatePoll } from '../../MessageComposer/hooks/useCanCreatePoll';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport { useMessageComposerContext, useTranslationContext } from '../../../context';\nimport clsx from 'clsx';\nimport { IconSend } from '../../Icons';\nimport { Prompt } from '../../Dialog';\n\nexport type PollCreationDialogControlsProps = {\n  close: () => void;\n};\n\nexport const PollCreationDialogControls = ({\n  close,\n}: PollCreationDialogControlsProps) => {\n  const { t } = useTranslationContext('PollCreationDialogControls');\n  const { handleSubmit: handleSubmitMessage } = useMessageComposerContext();\n  const messageComposer = useMessageComposerController();\n  const canCreatePoll = useCanCreatePoll();\n\n  return (\n    <Prompt.Footer>\n      <Prompt.FooterControls>\n        <Prompt.FooterControlsButtonSecondary\n          className={clsx('str-chat__prompt__footer__controls-button--cancel')}\n          onClick={() => {\n            messageComposer.pollComposer.initState();\n            close();\n          }}\n          type='button'\n        >\n          {t('Cancel')}\n        </Prompt.FooterControlsButtonSecondary>\n        <Prompt.FooterControlsButtonPrimary\n          className={clsx('str-chat__prompt__footer__controls-button--submit')}\n          disabled={!canCreatePoll}\n          onClick={() => {\n            messageComposer\n              .createPoll()\n              .then(() => handleSubmitMessage())\n              .then(() => {\n                messageComposer.pollComposer.initState();\n                close();\n              })\n              .catch(console.error);\n          }}\n          type='submit'\n        >\n          <IconSend />\n          {t('Send poll')}\n        </Prompt.FooterControlsButtonPrimary>\n      </Prompt.FooterControls>\n    </Prompt.Footer>\n  );\n};\n","import React, { useCallback } from 'react';\nimport type { PollComposerState } from 'stream-chat';\nimport { VotingVisibility } from 'stream-chat';\nimport { MultipleAnswersField } from './MultipleAnswersField';\nimport { NameField } from './NameField';\nimport { OptionFieldSet } from './OptionFieldSet';\nimport { PollCreationDialogControls } from './PollCreationDialogControls';\nimport { Prompt } from '../../Dialog';\nimport { SwitchField } from '../../Form/SwitchField';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport { useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nexport type PollCreationDialogProps = {\n  close: () => void;\n};\n\nconst pollComposerStateSelector = (state: PollComposerState) => ({\n  allow_answers: state.data.allow_answers,\n  allow_user_suggested_options: state.data.allow_user_suggested_options,\n  voting_visibility: state.data.voting_visibility,\n});\n\nexport const PollCreationDialog = ({ close }: PollCreationDialogProps) => {\n  const { t } = useTranslationContext();\n  const { pollComposer } = useMessageComposerController();\n  const { allow_answers, allow_user_suggested_options, voting_visibility } =\n    useStateStore(pollComposer.state, pollComposerStateSelector);\n\n  const onClose = useCallback(() => {\n    pollComposer.initState();\n    close();\n  }, [pollComposer, close]);\n\n  return (\n    <Prompt.Root\n      className='str-chat__poll-creation-dialog'\n      data-testid='poll-creation-dialog'\n    >\n      <Prompt.Header\n        close={onClose}\n        description={t('Create a question, add options, and configure poll settings')}\n        title={t('Create poll')}\n      />\n      <Prompt.Body>\n        <form autoComplete='off'>\n          <NameField />\n          <OptionFieldSet />\n          <div className='str-chat__poll-creation-dialog__features-selectors'>\n            <MultipleAnswersField />\n            <SwitchField\n              checked={voting_visibility === 'anonymous'}\n              description={t('Hide who voted')}\n              id='voting_visibility'\n              onChange={(e) =>\n                pollComposer.updateFields({\n                  voting_visibility: e.target.checked\n                    ? VotingVisibility.anonymous\n                    : VotingVisibility.public,\n                })\n              }\n              title={t('Anonymous poll')}\n            />\n            <SwitchField\n              checked={allow_user_suggested_options}\n              description={t('Let others add options')}\n              id='allow_user_suggested_options'\n              onChange={(e) =>\n                pollComposer.updateFields({\n                  allow_user_suggested_options: e.target.checked,\n                })\n              }\n              title={t('Suggest an option')}\n            />\n            <SwitchField\n              checked={allow_answers}\n              description={t('Allow others to add comments')}\n              id='allow_answers'\n              onChange={(e) =>\n                pollComposer.updateFields({ allow_answers: e.target.checked })\n              }\n              title={t('Add a comment')}\n            />\n          </div>\n        </form>\n      </Prompt.Body>\n      <PollCreationDialogControls close={close} />\n    </Prompt.Root>\n  );\n};\n","import React, { type ComponentProps, type ComponentType, useMemo } from 'react';\nimport type { CommandResponse } from 'stream-chat';\nimport { useMessageComposerContext, useTranslationContext } from '../../../context';\nimport { useMessageComposerCommands, useMessageComposerController } from '../hooks';\nimport {\n  ContextMenuBackButton,\n  ContextMenuButton,\n  ContextMenuHeader,\n  useContextMenuContext,\n} from '../../Dialog';\nimport {\n  IconAudio,\n  IconChevronLeft,\n  IconFlag,\n  IconGiphy,\n  IconMute,\n  IconUserAdd,\n  IconUserRemove,\n} from '../../Icons';\nimport clsx from 'clsx';\n\nconst icons: Record<string, ComponentType> = {\n  ban: IconUserRemove,\n  flag: IconFlag,\n  giphy: IconGiphy,\n  mute: IconMute,\n  unban: IconUserAdd,\n  unmute: IconAudio,\n};\n\nexport const CommandsMenuClassName = 'str-chat__context-menu--commands';\n\nexport const CommandsSubmenuHeader = () => {\n  const { t } = useTranslationContext();\n  const { returnToParentMenu } = useContextMenuContext();\n  return (\n    <ContextMenuHeader className='str-chat__context-menu__header--commands str-chat__context-menu__header--submenu-commands'>\n      <ContextMenuBackButton onClick={returnToParentMenu}>\n        <IconChevronLeft />\n        <span>{t('Instant commands')}</span>\n      </ContextMenuBackButton>\n    </ContextMenuHeader>\n  );\n};\n\nexport const CommandsMenuHeader = () => {\n  const { t } = useTranslationContext();\n  return (\n    <ContextMenuHeader className='str-chat__context-menu__header--commands'>\n      <span>{t('Instant commands')}</span>\n    </ContextMenuHeader>\n  );\n};\n\nexport const CommandsMenu = () => {\n  const { closeMenu } = useContextMenuContext();\n  const messageComposer = useMessageComposerController();\n  const { textareaRef } = useMessageComposerContext();\n  const commands = useMessageComposerCommands();\n  const sortedCommands = useMemo(\n    () =>\n      [...commands].sort((a, b) =>\n        (a.command.name ?? '').localeCompare(b.command.name ?? ''),\n      ),\n    [commands],\n  );\n\n  return (\n    <>\n      {sortedCommands.map(({ command, enabled }) => (\n        <CommandContextMenuItem\n          command={command}\n          enabled={enabled}\n          key={command.name}\n          onClick={() => {\n            if (!command.name || !enabled) return;\n            messageComposer.textComposer.setCommand(command);\n            closeMenu();\n            // Defer the focus to the next frame so it wins over FocusScope's restore-to-attachment-selector-button behavior.\n            requestAnimationFrame(() => textareaRef.current?.focus());\n          }}\n        />\n      ))}\n    </>\n  );\n};\n\nexport const useCommandTranslation = (command: CommandResponse) => {\n  const { t } = useTranslationContext();\n\n  const knownArgsTranslations = useMemo<Record<string, string>>(\n    () => ({\n      ban: t('ban-command-args'),\n      giphy: t('giphy-command-args'),\n      mute: t('mute-command-args'),\n      unban: t('unban-command-args'),\n      unmute: t('unmute-command-args'),\n    }),\n    [t],\n  );\n  const knownDescriptionTranslations = useMemo<Record<string, string>>(\n    () => ({\n      ban: t('ban-command-description'),\n      giphy: t('giphy-command-description'),\n      mute: t('mute-command-description'),\n      unban: t('unban-command-description'),\n      unmute: t('unmute-command-description'),\n    }),\n    [t],\n  );\n\n  const args =\n    command.args && (knownArgsTranslations[command.name ?? ''] ?? t(command.args));\n  const description =\n    command.description &&\n    (knownDescriptionTranslations[command.name ?? ''] ?? t(command.description));\n\n  return { args, description };\n};\n\nexport const CommandContextMenuItem = ({\n  className,\n  command,\n  enabled = true,\n  ...props\n}: ComponentProps<'button'> & {\n  command: CommandResponse & { name: string };\n  enabled?: boolean;\n}) => {\n  const { args, description } = useCommandTranslation(command);\n\n  // todo: retrieve the command trigger char from textComposer - needed adjustment in LLC\n  const details = useMemo(\n    () => (args ? `/${command.name} ${args}` : `/${command.name}`),\n    [args, command.name],\n  );\n\n  return (\n    <ContextMenuButton\n      {...props}\n      className={clsx('str-chat__context-menu__button--command', className)}\n      details={details}\n      disabled={!enabled}\n      Icon={icons[command.name]}\n      key={command.name}\n      label={command.name}\n      title={`${description} ${command.args}`}\n    />\n  );\n};\n","import React, {\n  type ComponentType,\n  forwardRef,\n  useCallback,\n  useEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport {\n  useAttachmentManagerState,\n  useMessageComposerCommands,\n  useMessageComposerController,\n} from '../hooks';\nimport { CHANNEL_CONTAINER_ID } from '../../Channel/constants';\nimport {\n  ContextMenu,\n  ContextMenuButton,\n  type ContextMenuHeaderComponent,\n  type ContextMenuSubmenu,\n  useContextMenuContext,\n  useDialogIsOpen,\n  useDialogOnNearestManager,\n} from '../../Dialog';\nimport { GlobalModal } from '../../Modal';\nimport { ShareLocationDialog as DefaultLocationDialog } from '../../Location';\nimport { PollCreationDialog as DefaultPollCreationDialog } from '../../Poll';\nimport { Portal } from '../../Portal/Portal';\nimport { UploadFileInput } from '../../ReactFileUtilities';\nimport {\n  useChannelStateContext,\n  useComponentContext,\n  useTranslationContext,\n} from '../../../context';\nimport {\n  AttachmentSelectorContextProvider,\n  useAttachmentSelectorContext,\n} from '../../../context/AttachmentSelectorContext';\nimport { useStableId } from '../../UtilityComponents/useStableId';\nimport clsx from 'clsx';\nimport { Button, type ButtonProps } from '../../Button';\nimport {\n  IconAttachment,\n  IconCommand,\n  IconLocation,\n  IconPlus,\n  IconPoll,\n} from '../../Icons';\nimport { useIsCooldownActive } from '../hooks/useIsCooldownActive';\nimport {\n  CommandsMenu,\n  CommandsMenuClassName,\n  CommandsSubmenuHeader,\n} from './CommandsMenu';\n\nconst AttachmentSelectorMenuInitButtonIcon = ({ className }: { className?: string }) => {\n  const { AttachmentSelectorInitiationButtonContents } = useComponentContext();\n\n  if (AttachmentSelectorInitiationButtonContents) {\n    return (\n      <span className={className}>\n        <AttachmentSelectorInitiationButtonContents />\n      </span>\n    );\n  }\n\n  return (\n    <IconPlus\n      className={clsx('str-chat__attachment-selector__menu-button__icon', className)}\n    />\n  );\n};\n\nexport const AttachmentSelectorButton = forwardRef<\n  HTMLButtonElement,\n  ButtonProps & { iconClassName?: string }\n>(function AttachmentSelectorButton({ className, iconClassName, ...props }, ref) {\n  return (\n    <Button\n      appearance='outline'\n      circular\n      className={clsx('str-chat__attachment-selector__menu-button', className)}\n      data-testid='invoke-attachment-selector-button'\n      size='lg'\n      variant='secondary'\n      {...props}\n      ref={ref}\n    >\n      <AttachmentSelectorMenuInitButtonIcon className={iconClassName} />\n    </Button>\n  );\n});\n\nexport const SimpleAttachmentSelector = () => {\n  const { channelCapabilities } = useChannelStateContext();\n  const { t } = useTranslationContext();\n  const inputRef = useRef<HTMLInputElement | null>(null);\n  const [buttonElement, setButtonElement] = useState<HTMLButtonElement | null>(null);\n  const id = useStableId();\n  const isCooldownActive = useIsCooldownActive();\n\n  useEffect(() => {\n    if (!buttonElement) return;\n    const handleKeyUp = (event: KeyboardEvent) => {\n      if (![' ', 'Enter'].includes(event.key) || !inputRef.current) return;\n      event.preventDefault();\n      inputRef.current.click();\n    };\n    buttonElement.addEventListener('keyup', handleKeyUp);\n    return () => {\n      buttonElement.removeEventListener('keyup', handleKeyUp);\n    };\n  }, [buttonElement]);\n\n  if (!channelCapabilities['upload-file']) return null;\n\n  return (\n    <div className='str-chat__attachment-selector'>\n      <AttachmentSelectorButton\n        aria-label={t('aria/Open Attachment Selector')}\n        disabled={isCooldownActive}\n        onClick={() => inputRef.current?.click()}\n        ref={setButtonElement}\n      />\n      <UploadFileInput id={id} ref={inputRef} />\n    </div>\n  );\n};\n\nexport type AttachmentSelectorModalContentProps = {\n  close: () => void;\n};\n\nexport type AttachmentSelectorAction = {\n  ActionButton: ComponentType<AttachmentSelectorActionProps>;\n  id?: string;\n  ModalContent?: React.ComponentType<AttachmentSelectorModalContentProps>;\n  Submenu?: ContextMenuSubmenu;\n  Header?: ContextMenuHeaderComponent;\n  type: 'uploadFile' | 'createPoll' | 'addLocation' | 'selectCommand' | (string & {});\n};\n\nexport type AttachmentSelectorActionProps = {\n  openModalForAction: (actionType: AttachmentSelectorAction['type']) => void;\n  submenuItems?: ContextMenuSubmenu;\n  submenuHeader?: ContextMenuHeaderComponent;\n};\n\nexport const DefaultAttachmentSelectorComponents = {\n  Command({ submenuHeader, submenuItems }: AttachmentSelectorActionProps) {\n    const { t } = useTranslationContext();\n    const { openSubmenu } = useContextMenuContext();\n    const commands = useMessageComposerCommands();\n    const hasEnabledCommands = commands.some(({ enabled }) => enabled);\n    const hasSubmenu = !!submenuItems;\n\n    return (\n      <ContextMenuButton\n        className='str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__commands-button'\n        disabled={!hasEnabledCommands}\n        hasSubMenu={hasSubmenu}\n        Icon={IconCommand}\n        onClick={(event) => {\n          if (!hasSubmenu) return;\n          openSubmenu({\n            focusReturnTarget: event.currentTarget,\n            Header: submenuHeader,\n            menuClassName: CommandsMenuClassName,\n            Submenu: submenuItems,\n          });\n        }}\n      >\n        {t('Commands')}\n      </ContextMenuButton>\n    );\n  },\n  File() {\n    const { t } = useTranslationContext();\n    const { fileInput } = useAttachmentSelectorContext();\n    const { closeMenu } = useContextMenuContext();\n\n    return (\n      <ContextMenuButton\n        className='str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__upload-file-button'\n        Icon={IconAttachment}\n        onClick={() => {\n          fileInput?.click();\n          closeMenu();\n        }}\n      >\n        {t('File')}\n      </ContextMenuButton>\n    );\n  },\n  Location({ openModalForAction }: AttachmentSelectorActionProps) {\n    const { t } = useTranslationContext();\n    const { closeMenu } = useContextMenuContext();\n    return (\n      <ContextMenuButton\n        className='str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__add-location-button'\n        Icon={IconLocation}\n        onClick={() => {\n          openModalForAction('addLocation');\n          closeMenu();\n        }}\n      >\n        {t('Location')}\n      </ContextMenuButton>\n    );\n  },\n  Poll({ openModalForAction }: AttachmentSelectorActionProps) {\n    const { t } = useTranslationContext();\n    const { closeMenu } = useContextMenuContext();\n    return (\n      <ContextMenuButton\n        className='str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__create-poll-button'\n        Icon={IconPoll}\n        onClick={() => {\n          openModalForAction('createPoll');\n          closeMenu();\n        }}\n      >\n        {t('Poll')}\n      </ContextMenuButton>\n    );\n  },\n};\n\n/**\n * Order of AttachmentSelectorAction objects defines the order in the context menu width index 0 being at the top.\n */\nexport const defaultAttachmentSelectorActionSet: AttachmentSelectorAction[] = [\n  {\n    ActionButton: DefaultAttachmentSelectorComponents.File,\n    type: 'uploadFile',\n  },\n  {\n    ActionButton: DefaultAttachmentSelectorComponents.Poll,\n    type: 'createPoll',\n  },\n  {\n    ActionButton: DefaultAttachmentSelectorComponents.Location,\n    type: 'addLocation',\n  },\n  {\n    ActionButton: DefaultAttachmentSelectorComponents.Command,\n    Header: CommandsSubmenuHeader,\n    Submenu: CommandsMenu,\n    type: 'selectCommand',\n  },\n];\n\nexport type AttachmentSelectorProps = {\n  attachmentSelectorActionSet?: AttachmentSelectorAction[];\n  getModalPortalDestination?: () => HTMLElement | null;\n};\n\nconst useAttachmentSelectorActionsFiltered = (original: AttachmentSelectorAction[]) => {\n  const {\n    PollCreationDialog = DefaultPollCreationDialog,\n    ShareLocationDialog = DefaultLocationDialog,\n  } = useComponentContext();\n  const { channelCapabilities } = useChannelStateContext();\n  const { isUploadEnabled } = useAttachmentManagerState();\n  const messageComposer = useMessageComposerController();\n  const channelConfig = messageComposer.channel.getConfig();\n\n  return useMemo(\n    () =>\n      original\n        .filter((action) => {\n          if (action.type === 'uploadFile')\n            return (\n              channelCapabilities['upload-file'] &&\n              channelConfig?.uploads &&\n              isUploadEnabled\n            );\n\n          if (action.type === 'createPoll')\n            return (\n              channelCapabilities['send-poll'] &&\n              !messageComposer.threadId &&\n              channelConfig?.polls\n            );\n\n          if (action.type === 'addLocation') {\n            return channelConfig?.shared_locations && !messageComposer.threadId;\n          }\n\n          if (action.type === 'selectCommand') {\n            return !!channelConfig?.commands?.some((command) => !!command.name);\n          }\n\n          return true;\n        })\n        .map((action) => {\n          if (action.type === 'createPoll' && !action.ModalContent) {\n            return { ...action, ModalContent: PollCreationDialog };\n          }\n          if (action.type === 'addLocation' && !action.ModalContent) {\n            return { ...action, ModalContent: ShareLocationDialog };\n          }\n          return action;\n        }),\n    [\n      PollCreationDialog,\n      ShareLocationDialog,\n      channelCapabilities,\n      channelConfig,\n      isUploadEnabled,\n      messageComposer.threadId,\n      original,\n    ],\n  );\n};\n\nexport const AttachmentSelector = ({\n  attachmentSelectorActionSet = defaultAttachmentSelectorActionSet,\n  getModalPortalDestination,\n}: AttachmentSelectorProps) => {\n  const { t } = useTranslationContext();\n  const { ContextMenu: ContextMenuComponent = ContextMenu, Modal = GlobalModal } =\n    useComponentContext();\n  const { channelCapabilities } = useChannelStateContext();\n  const messageComposer = useMessageComposerController();\n  const isCooldownActive = useIsCooldownActive();\n  const actions = useAttachmentSelectorActionsFiltered(attachmentSelectorActionSet);\n\n  const menuDialogId = `attachment-actions-menu${messageComposer.threadId ? '-thread' : ''}`;\n  const { dialog: menuDialog, dialogManager } = useDialogOnNearestManager({\n    id: menuDialogId,\n  });\n  const menuDialogIsOpen = useDialogIsOpen(menuDialogId, dialogManager?.id);\n\n  const [modalContentAction, setModalContentActionAction] =\n    useState<AttachmentSelectorAction>();\n  const shouldRestoreFocusToTriggerRef = useRef(false);\n  const openModalForAction = useCallback(\n    (actionType: AttachmentSelectorAction['type']) => {\n      const action = actions.find((a) => a.type === actionType);\n      if (!action?.ModalContent) return;\n      setModalContentActionAction(action);\n    },\n    [actions],\n  );\n\n  const closeModal = useCallback(() => {\n    shouldRestoreFocusToTriggerRef.current = true;\n    setModalContentActionAction(undefined);\n  }, []);\n\n  const [fileInput, setFileInput] = useState<HTMLInputElement | null>(null);\n  const menuButtonRef = useRef<HTMLButtonElement>(null);\n\n  useEffect(() => {\n    if (modalContentAction || !shouldRestoreFocusToTriggerRef.current) return;\n\n    const frame = requestAnimationFrame(() => {\n      menuButtonRef.current?.focus();\n      shouldRestoreFocusToTriggerRef.current = false;\n    });\n\n    return () => cancelAnimationFrame(frame);\n  }, [modalContentAction]);\n\n  const contextMenuItems = useMemo(\n    () =>\n      actions.map((action) => (\n        <action.ActionButton\n          key={action.type}\n          openModalForAction={openModalForAction}\n          submenuHeader={action.Header}\n          submenuItems={action.Submenu}\n        />\n      )),\n    [actions, openModalForAction],\n  );\n\n  const getDefaultPortalDestination = useCallback(\n    () => document.getElementById(CHANNEL_CONTAINER_ID),\n    [],\n  );\n\n  if (actions.length === 0) return null;\n\n  if (actions.length === 1 && actions[0].type === 'uploadFile')\n    return <SimpleAttachmentSelector />;\n\n  const ModalContent = modalContentAction?.ModalContent;\n  const modalIsOpen = !!ModalContent;\n  return (\n    <AttachmentSelectorContextProvider value={{ fileInput }}>\n      <div className='str-chat__attachment-selector'>\n        {channelCapabilities['upload-file'] && <UploadFileInput ref={setFileInput} />}\n        <AttachmentSelectorButton\n          aria-expanded={menuDialogIsOpen}\n          aria-haspopup='true'\n          aria-label={t('aria/Open Attachment Selector')}\n          disabled={isCooldownActive}\n          iconClassName={clsx('str-chat__prepare-rotate45', {\n            'str-chat__rotate45': menuDialogIsOpen,\n          })}\n          onClick={() => menuDialog?.toggle()}\n          ref={menuButtonRef}\n        />\n        <ContextMenuComponent\n          allowFlip\n          aria-label={t('aria/Attachment Actions')}\n          backLabel={t('Back')}\n          className='str-chat__attachment-selector-actions-menu'\n          data-testid='attachment-selector-actions-menu'\n          dialogManagerId={dialogManager?.id}\n          id={menuDialogId}\n          onClose={menuDialog.close}\n          placement='top-start'\n          referenceElement={menuButtonRef.current}\n          tabIndex={-1}\n          trapFocus\n        >\n          {contextMenuItems}\n        </ContextMenuComponent>\n        <Portal\n          getPortalDestination={getModalPortalDestination ?? getDefaultPortalDestination}\n          isOpen={modalIsOpen}\n        >\n          <Modal\n            className={clsx({\n              'str-chat__create-poll-modal': modalContentAction?.type === 'createPoll',\n              'str-chat__share-location-modal':\n                modalContentAction?.type === 'addLocation',\n            })}\n            onClose={closeModal}\n            open={modalIsOpen}\n          >\n            {ModalContent && <ModalContent close={closeModal} />}\n          </Modal>\n        </Portal>\n      </div>\n    </AttachmentSelectorContextProvider>\n  );\n};\n","import React from 'react';\nimport type { AnyLocalAttachment, LocalUploadAttachment } from 'stream-chat';\nimport { IconUnsupportedAttachment } from '../../Icons';\nimport { useTranslationContext } from '../../../context';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\n\nexport type UnsupportedAttachmentPreviewProps<\n  CustomLocalMetadata = Record<string, unknown>,\n> = {\n  attachment: AnyLocalAttachment<CustomLocalMetadata>;\n  handleRetry: (\n    attachment: LocalUploadAttachment,\n  ) => void | Promise<LocalUploadAttachment | undefined>;\n  removeAttachments: (ids: string[]) => void;\n};\n\nexport const UnsupportedAttachmentPreview = ({\n  attachment,\n  removeAttachments,\n}: UnsupportedAttachmentPreviewProps) => {\n  const { t } = useTranslationContext();\n  const { id } = attachment.localMetadata ?? {};\n\n  return (\n    <div\n      className='str-chat__attachment-preview-unsupported'\n      data-testid='attachment-preview-unsupported'\n    >\n      <IconUnsupportedAttachment />\n      <div className='str-chat__attachment-preview-unsupported__metadata'>\n        <div\n          className='str-chat__attachment-preview-unsupported__title'\n          data-testid='unsupported-attachment-preview-title'\n        >\n          {t('Unsupported attachment')}\n        </div>\n      </div>\n      <RemoveAttachmentPreviewButton\n        data-testid='file-preview-item-delete-button'\n        onClick={() => {\n          if (id) removeAttachments([id]);\n        }}\n      />\n    </div>\n  );\n};\n","import React from 'react';\n\nimport { useComponentContext } from '../../../context';\nimport { FileSizeIndicator as DefaultFileSizeIndicator } from '../../Attachment/components/FileSizeIndicator';\nimport { UploadedSizeIndicator as DefaultUploadedSizeIndicator } from '../../Loading/UploadedSizeIndicator';\n\nfunction resolveAttachmentFullByteSize(attachment: {\n  file_size?: number | string;\n  localMetadata?: { file?: { size?: unknown } } | null;\n}): number | undefined {\n  const fromFile = attachment.localMetadata?.file?.size;\n  if (typeof fromFile === 'number' && Number.isFinite(fromFile) && fromFile >= 0) {\n    return fromFile;\n  }\n  const raw = attachment.file_size;\n  if (typeof raw === 'number' && Number.isFinite(raw) && raw >= 0) return raw;\n  if (typeof raw === 'string') {\n    const n = parseFloat(raw);\n    if (Number.isFinite(n) && n >= 0) return n;\n  }\n  return undefined;\n}\n\nexport type AttachmentUploadedSizeIndicatorProps = {\n  attachment: {\n    file_size?: number | string;\n    localMetadata?: {\n      file?: { size?: unknown };\n      uploadProgress?: number;\n      uploadState?: string;\n    } | null;\n  };\n};\n\nexport const AttachmentUploadedSizeIndicator = ({\n  attachment,\n}: AttachmentUploadedSizeIndicatorProps) => {\n  const {\n    FileSizeIndicator = DefaultFileSizeIndicator,\n    UploadedSizeIndicator = DefaultUploadedSizeIndicator,\n  } = useComponentContext();\n  const { uploadProgress, uploadState } = attachment.localMetadata ?? {};\n  const fullBytes = resolveAttachmentFullByteSize(attachment);\n  const uploaded =\n    uploadProgress !== undefined && fullBytes !== undefined\n      ? Math.round((uploadProgress / 100) * fullBytes)\n      : undefined;\n\n  if (uploadState === 'uploading' && uploaded !== undefined && fullBytes !== undefined) {\n    return <UploadedSizeIndicator fullBytes={fullBytes} uploadedBytes={uploaded} />;\n  }\n\n  if (uploadState === 'finished') {\n    return <FileSizeIndicator fileSize={attachment.file_size} />;\n  }\n\n  return null;\n};\n","import React, {\n  type ComponentProps,\n  type KeyboardEvent,\n  type MouseEvent,\n  useState,\n} from 'react';\nimport { useTranslationContext } from '../../../../context';\nimport {\n  isImageAttachment,\n  isVideoAttachment,\n  type LocalUploadAttachment,\n} from 'stream-chat';\n\ntype AttachmentPreviewRootProps = Omit<ComponentProps<'div'>, 'onClick' | 'onKeyDown'> & {\n  attachment: LocalUploadAttachment;\n  /**\n   * Called when the attachment preview is pressed and can be previewed.\n   * The parent is responsible for opening the gallery at the correct index.\n   */\n  openPreview?: () => void;\n  /**\n   * Returns boolean value to signal whether the event handling should be terminated immediately (return false)\n   *  or default logic can be executed next (return true)\n   */\n  onPressed?: (e: MouseEvent<Element> | KeyboardEvent<Element>) => boolean;\n};\n\nconst INTERACTIVE_SELECTOR =\n  'button, a, input, textarea, select, [role=\"button\"], [role=\"link\"], [data-interactive=\"true\"]';\n\nfunction hasInteractiveAncestorBeforeRoot(\n  target: EventTarget | null,\n  root: HTMLElement | null,\n): boolean {\n  if (!(target instanceof Element) || !root) return false;\n\n  let el: Element | null = target;\n  while (el && el !== root) {\n    if (el.matches(INTERACTIVE_SELECTOR)) return true;\n    el = el.parentElement;\n  }\n  return false;\n}\n\n// todo: use this component for all the attachment previews\nexport const AttachmentPreviewRoot = ({\n  attachment,\n  onPressed,\n  openPreview,\n  tabIndex = 0,\n  ...props\n}: AttachmentPreviewRootProps) => {\n  const { t } = useTranslationContext();\n  const [root, setRoot] = useState<HTMLDivElement | null>(null);\n  const url =\n    attachment.asset_url || attachment.image_url || attachment.localMetadata.previewUri;\n\n  const canDownloadAttachment = false; //!!url;\n\n  const canPreviewAttachment =\n    !!openPreview &&\n    ((!!url && isImageAttachment(attachment)) || isVideoAttachment(attachment));\n\n  const handlePressed = (e: MouseEvent<Element> | KeyboardEvent<Element>) => {\n    if (e.defaultPrevented) return;\n\n    if (hasInteractiveAncestorBeforeRoot(e.target as Element, root)) return;\n\n    if (onPressed) {\n      const shouldContinue = onPressed(e);\n      if (!shouldContinue) return;\n    }\n\n    if (canPreviewAttachment) {\n      openPreview();\n      return;\n    }\n\n    if (canDownloadAttachment) {\n      window.open(url, '_blank', 'noopener,noreferrer');\n    }\n  };\n\n  const isInteractive = canPreviewAttachment || canDownloadAttachment;\n\n  return (\n    <div\n      aria-label={\n        isInteractive\n          ? t(canPreviewAttachment ? 'aria/Show preview' : 'aria/Download attachment')\n          : undefined\n      }\n      {...props}\n      onClick={handlePressed}\n      onKeyDown={\n        isInteractive\n          ? (e) => {\n              if (e.key !== 'Enter' && e.key !== ' ') return;\n              handlePressed(e);\n              e.preventDefault();\n            }\n          : undefined\n      }\n      ref={setRoot}\n      role={isInteractive ? 'button' : undefined}\n      tabIndex={isInteractive ? tabIndex : -1}\n    >\n      {props.children}\n    </div>\n  );\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../../context';\nimport { FileIcon } from '../../FileIcon';\nimport { UploadProgressIndicator } from '../../Loading/UploadProgressIndicator';\nimport { AttachmentUploadedSizeIndicator } from './AttachmentUploadedSizeIndicator';\nimport type { LocalAudioAttachment, LocalFileAttachment } from 'stream-chat';\nimport type { UploadAttachmentPreviewProps } from './types';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\nimport { AttachmentPreviewRoot } from './utils/AttachmentPreviewRoot';\nimport { IconExclamationMark, IconExclamationTriangleFill } from '../../Icons';\n\nexport type FileAttachmentPreviewProps<CustomLocalMetadata = unknown> =\n  UploadAttachmentPreviewProps<\n    LocalFileAttachment<CustomLocalMetadata> | LocalAudioAttachment<CustomLocalMetadata>\n  >;\n\nexport const FileAttachmentPreview = ({\n  attachment,\n  handleRetry,\n  removeAttachments,\n}: FileAttachmentPreviewProps) => {\n  const { t } = useTranslationContext('FilePreview');\n  const { id, uploadPermissionCheck, uploadProgress, uploadState } =\n    attachment.localMetadata ?? {};\n\n  const hasSizeLimitError = uploadPermissionCheck?.reason === 'size_limit';\n  const hasFatalError = uploadState === 'blocked' || hasSizeLimitError;\n  const hasRetriableError = uploadState === 'failed' && !!handleRetry;\n\n  return (\n    <AttachmentPreviewRoot\n      attachment={attachment}\n      className='str-chat__attachment-preview-file'\n      data-testid='attachment-preview-file'\n    >\n      <div className='str-chat__attachment-preview-file__icon'>\n        <FileIcon fileName={attachment.title} mimeType={attachment.mime_type} />\n      </div>\n\n      <div className='str-chat__attachment-preview-file__info'>\n        <div className='str-chat__attachment-preview-file-name' title={attachment.title}>\n          {attachment.title}\n        </div>\n        <div className='str-chat__attachment-preview-file__data'>\n          {uploadState === 'uploading' && (\n            <UploadProgressIndicator uploadProgress={uploadProgress} />\n          )}\n          <AttachmentUploadedSizeIndicator attachment={attachment} />\n          {hasFatalError && (\n            <div className='str-chat__attachment-preview-file__fatal-error'>\n              <IconExclamationMark />\n              <span>\n                {hasSizeLimitError\n                  ? t('File too large')\n                  : uploadState === 'blocked'\n                    ? t('Upload blocked')\n                    : t('Upload failed')}\n              </span>\n            </div>\n          )}\n          {hasRetriableError && (\n            <div className='str-chat__attachment-preview-file__retriable-error'>\n              <IconExclamationTriangleFill />\n              <span>{t('Upload error')}</span>\n              <button\n                aria-label={t('aria/Retry upload')}\n                className='str-chat__attachment-preview-file__retry-upload-button'\n                data-testid='file-preview-item-retry-button'\n                onClick={() => {\n                  handleRetry(attachment);\n                }}\n                type='button'\n              >\n                {t('Retry upload')}\n              </button>\n            </div>\n          )}\n        </div>\n      </div>\n\n      <RemoveAttachmentPreviewButton\n        data-testid='file-preview-item-delete-button'\n        onClick={() => {\n          if (id) removeAttachments([id]);\n        }}\n        uploadState={uploadState}\n      />\n    </AttachmentPreviewRoot>\n  );\n};\n","import type { UploadAttachmentPreviewProps } from './types';\nimport {\n  isVoiceRecordingAttachment,\n  type LocalAudioAttachment,\n  type LocalVoiceRecordingAttachment,\n} from 'stream-chat';\nimport { useTranslationContext } from '../../../context';\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport { UploadProgressIndicator } from '../../Loading/UploadProgressIndicator';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\nimport { AttachmentPreviewRoot } from './utils/AttachmentPreviewRoot';\nimport { IconExclamationMark, IconExclamationTriangleFill } from '../../Icons';\nimport { PlayButton } from '../../Button';\nimport {\n  type AudioPlayerState,\n  DurationDisplay,\n  PlaybackRateButton,\n  WaveProgressBar,\n} from '../../AudioPlayback';\nimport { useAudioPlayer } from '../../AudioPlayback/WithAudioPlayback';\nimport { useStateStore } from '../../../store';\nimport { AttachmentUploadedSizeIndicator } from './AttachmentUploadedSizeIndicator';\n\nexport type AudioAttachmentPreviewProps<CustomLocalMetadata = Record<string, unknown>> =\n  UploadAttachmentPreviewProps<\n    | LocalAudioAttachment<CustomLocalMetadata>\n    | LocalVoiceRecordingAttachment<CustomLocalMetadata>\n  >;\n\nconst audioPlayerStateSelector = (state: AudioPlayerState) => ({\n  canPlayRecord: state.canPlayRecord,\n  isPlaying: state.isPlaying,\n  playbackRate: state.currentPlaybackRate,\n  progressPercent: state.progressPercent,\n  secondsElapsed: state.secondsElapsed,\n});\n\nexport const AudioAttachmentPreview = ({\n  attachment,\n  handleRetry,\n  removeAttachments,\n}: AudioAttachmentPreviewProps) => {\n  const { t } = useTranslationContext();\n  const { id, previewUri, uploadPermissionCheck, uploadProgress, uploadState } =\n    attachment.localMetadata ?? {};\n  const url = attachment.asset_url || previewUri;\n\n  const audioPlayer = useAudioPlayer({\n    fileSize: attachment.localMetadata.file?.size ?? attachment.file_size,\n    mimeType: attachment.localMetadata.file?.type ?? attachment.mime_type,\n    requester: attachment.localMetadata.id,\n    src: url,\n    title: attachment.title,\n    waveformData: attachment.waveform_data,\n  });\n\n  useEffect(() => {\n    audioPlayer?.cancelScheduledRemoval();\n    return () => {\n      audioPlayer?.scheduleRemoval();\n    };\n  }, [audioPlayer]);\n\n  const { canPlayRecord, isPlaying, playbackRate, progressPercent, secondsElapsed } =\n    useStateStore(audioPlayer?.state, audioPlayerStateSelector) ?? {};\n\n  const resolvedDuration = audioPlayer?.durationSeconds ?? attachment.duration;\n\n  const hasWaveform = !!audioPlayer?.waveformData?.length;\n  const hasSizeLimitError = uploadPermissionCheck?.reason === 'size_limit';\n  const hasFatalError = uploadState === 'blocked' || hasSizeLimitError;\n  const hasRetriableError = uploadState === 'failed' && !!handleRetry;\n  const hasError = hasRetriableError || hasFatalError;\n\n  const showProgressControls = !hasError || (hasError && isPlaying);\n\n  return (\n    <AttachmentPreviewRoot\n      attachment={attachment}\n      className={clsx('str-chat__attachment-preview-audio')}\n      data-testid='attachment-preview-audio'\n    >\n      <PlayButton\n        isPlaying={Boolean(isPlaying)}\n        onClick={() => {\n          audioPlayer?.togglePlay();\n        }}\n      />\n\n      <div className='str-chat__attachment-preview-file__info'>\n        <div className='str-chat__attachment-preview-file-name' title={attachment.title}>\n          {isVoiceRecordingAttachment(attachment) ? t('Voice message') : attachment.title}\n        </div>\n        <div className='str-chat__attachment-preview-file__data'>\n          {uploadState === 'uploading' && (\n            <UploadProgressIndicator uploadProgress={uploadProgress} />\n          )}\n          {showProgressControls ? (\n            <>\n              {!resolvedDuration && !progressPercent && !isPlaying && (\n                <AttachmentUploadedSizeIndicator attachment={attachment} />\n              )}\n              {hasWaveform ? (\n                <>\n                  <DurationDisplay\n                    duration={resolvedDuration}\n                    isPlaying={Boolean(isPlaying)}\n                    secondsElapsed={secondsElapsed}\n                    showRemaining\n                  />\n                  <WaveProgressBar\n                    durationSeconds={resolvedDuration}\n                    progress={progressPercent}\n                    relativeAmplitudeBarWidth={1}\n                    relativeAmplitudeGap={1}\n                    secondsElapsed={secondsElapsed}\n                    seek={audioPlayer.seek}\n                    waveformData={audioPlayer.waveformData}\n                  />\n                </>\n              ) : (\n                <DurationDisplay\n                  duration={resolvedDuration}\n                  isPlaying={Boolean(isPlaying)}\n                  secondsElapsed={secondsElapsed}\n                />\n              )}\n            </>\n          ) : hasFatalError ? (\n            <div className='str-chat__attachment-preview-file__fatal-error'>\n              <IconExclamationMark />\n              <span>\n                {hasSizeLimitError\n                  ? t('File too large')\n                  : uploadState === 'blocked'\n                    ? t('Upload blocked')\n                    : t('Upload failed')}\n              </span>\n            </div>\n          ) : (\n            <div className='str-chat__attachment-preview-file__retriable-error'>\n              <IconExclamationTriangleFill />\n              <span>{t('Upload error')}</span>\n              <button\n                aria-label={t('aria/Retry upload')}\n                className='str-chat__attachment-preview-file__retry-upload-button'\n                data-testid='file-preview-item-retry-button'\n                onClick={() => {\n                  handleRetry(attachment);\n                }}\n                type='button'\n              >\n                {t('Retry upload')}\n              </button>\n            </div>\n          )}\n        </div>\n      </div>\n      {audioPlayer && canPlayRecord && (\n        <PlaybackRateButton\n          aria-label={t('Playback speed {{ rate }}x', {\n            rate: playbackRate?.toString() ?? '1',\n          })}\n          onClick={audioPlayer.increasePlaybackRate}\n        >\n          x{playbackRate?.toString()}\n        </PlaybackRateButton>\n      )}\n      <RemoveAttachmentPreviewButton\n        data-testid='audio-preview-item-delete-button'\n        onClick={() => {\n          if (id) removeAttachments([id]);\n        }}\n        uploadState={uploadState}\n      />\n    </AttachmentPreviewRoot>\n  );\n};\n","import { IconMicrophoneSolid, IconVideoFill } from '../Icons';\nimport React, { type ComponentType } from 'react';\nimport type { LocalAttachment } from 'stream-chat';\nimport clsx from 'clsx';\n\nexport type MediaBadgeVariant = 'video' | 'voice-recording' | string;\n\nexport type MediaBadgeProps = {\n  attachment: LocalAttachment;\n  variant: 'video' | 'voice-recording' | string;\n};\n\nconst MediaBadgeVariantToIcon: Record<MediaBadgeVariant, ComponentType> = {\n  video: IconVideoFill,\n  voiceRecording: IconMicrophoneSolid,\n};\n\nexport const MediaBadge = ({ attachment, variant }: MediaBadgeProps) => {\n  const Icon = MediaBadgeVariantToIcon[variant];\n  return (\n    <div\n      className={clsx('str-chat__media-badge', {\n        [`str-chat__media-badge--${variant}`]: variant,\n      })}\n    >\n      {Icon && <Icon />}\n      {attachment.duration && <div>{attachment.duration}</div>}\n    </div>\n  );\n};\n","import type { UploadAttachmentPreviewProps } from './types';\nimport {\n  isVideoAttachment,\n  type LocalImageAttachment,\n  type LocalVideoAttachment,\n} from 'stream-chat';\nimport { useComponentContext, useTranslationContext } from '../../../context';\nimport { BaseImage as DefaultBaseImage } from '../../BaseImage';\nimport React, {\n  type KeyboardEvent,\n  type MouseEvent,\n  useCallback,\n  useMemo,\n  useState,\n} from 'react';\nimport clsx from 'clsx';\nimport { IconExclamationMark, IconRetry } from '../../Icons';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\nimport { Button } from '../../Button';\nimport { UploadProgressIndicator } from '../../Loading/UploadProgressIndicator';\nimport { AttachmentPreviewRoot } from './utils/AttachmentPreviewRoot';\nimport { MediaBadge } from '../../Badge/MediaBadge';\n\nexport type MediaAttachmentPreviewProps<CustomLocalMetadata = Record<string, unknown>> =\n  UploadAttachmentPreviewProps<\n    LocalVideoAttachment<CustomLocalMetadata> | LocalImageAttachment<CustomLocalMetadata>\n  > & {\n    openPreview?: () => void;\n  };\n\nexport const MediaAttachmentPreview = ({\n  attachment,\n  handleRetry,\n  openPreview,\n  removeAttachments,\n}: MediaAttachmentPreviewProps) => {\n  const { t } = useTranslationContext();\n  const { BaseImage = DefaultBaseImage } = useComponentContext();\n  const [thumbnailPreviewError, setThumbnailPreviewError] = useState(false);\n\n  const { id, uploadPermissionCheck, uploadProgress, uploadState } =\n    attachment.localMetadata ?? {};\n\n  const isUploading = uploadState === 'uploading';\n  const handleThumbnailLoadError = useCallback(() => setThumbnailPreviewError(true), []);\n  const hasSizeLimitError = uploadPermissionCheck?.reason === 'size_limit';\n  const hasFatalError = uploadState === 'blocked' || hasSizeLimitError;\n  const hasRetriableError = uploadState === 'failed' && !!handleRetry;\n  const hasUploadError = hasRetriableError || hasFatalError;\n\n  const retry = (e: MouseEvent<Element> | KeyboardEvent<Element>) => {\n    e.stopPropagation();\n    handleRetry(attachment);\n    return false;\n  };\n\n  const thumbnail = useMemo(\n    () =>\n      isVideoAttachment(attachment)\n        ? {\n            alt: attachment.title,\n            title: attachment.title,\n            url: attachment.thumb_url,\n          }\n        : {\n            alt: attachment.fallback,\n            title: attachment.fallback,\n            url: attachment.image_url || attachment.localMetadata.previewUri,\n          },\n    [attachment],\n  );\n\n  return (\n    <AttachmentPreviewRoot\n      attachment={attachment}\n      className={clsx('str-chat__attachment-preview-media', {\n        'str-chat__attachment-preview-media--thumbnail-preview-error':\n          thumbnailPreviewError,\n        'str-chat__attachment-preview-media--upload-error': hasUploadError,\n        'str-chat__attachment-preview-media--uploading': isUploading,\n      })}\n      data-testid='attachment-preview-media'\n      onPressed={hasRetriableError ? retry : undefined}\n      openPreview={!isUploading && !hasUploadError ? openPreview : undefined}\n    >\n      <div className='str-chat__attachment-preview-media__thumbnail-wrapper'>\n        {thumbnail.url && (\n          <BaseImage\n            alt={thumbnail.alt}\n            className='str-chat__attachment-preview-media__thumbnail'\n            onError={handleThumbnailLoadError}\n            src={thumbnail.url}\n            title={thumbnail.title}\n          />\n        )}\n\n        <div className={clsx('str-chat__attachment-preview-media__overlay')}>\n          {isUploading && <UploadProgressIndicator uploadProgress={uploadProgress} />}\n\n          {isVideoAttachment(attachment) &&\n            !hasUploadError &&\n            uploadState !== 'uploading' && (\n              <MediaBadge attachment={attachment} variant='video' />\n            )}\n\n          {hasFatalError && <IconExclamationMark />}\n\n          {hasRetriableError && (\n            <Button\n              appearance='solid'\n              aria-label={t('aria/Retry upload')}\n              circular\n              className='str-chat__attachment-preview-media__retry-upload-button'\n              data-testid='video-preview-item-retry-button'\n              onClick={retry}\n              size='sm'\n              variant='danger'\n            >\n              <IconRetry />\n            </Button>\n          )}\n        </div>\n      </div>\n\n      <RemoveAttachmentPreviewButton\n        data-testid='video-preview-item-delete-button'\n        onClick={() => {\n          if (id) removeAttachments([id]);\n        }}\n        uploadState={uploadState}\n      />\n    </AttachmentPreviewRoot>\n  );\n};\n","import React, { type ComponentType, useCallback, useMemo, useRef, useState } from 'react';\nimport {\n  isLocalAttachment,\n  isLocalAudioAttachment,\n  isLocalFileAttachment,\n  isLocalImageAttachment,\n  isLocalVideoAttachment,\n  isLocalVoiceRecordingAttachment,\n  isScrapedContent,\n  isVoiceRecordingAttachment,\n} from 'stream-chat';\nimport {\n  UnsupportedAttachmentPreview as DefaultUnknownAttachmentPreview,\n  type UnsupportedAttachmentPreviewProps,\n} from './UnsupportedAttachmentPreview';\nimport {\n  FileAttachmentPreview as DefaultFileAttachmentPreview,\n  type FileAttachmentPreviewProps,\n} from './FileAttachmentPreview';\nimport { type AudioAttachmentPreviewProps } from './AudioAttachmentPreview';\nimport { type ImageAttachmentPreviewProps } from './ImageAttachmentPreview';\nimport { useAttachmentsForPreview, useMessageComposerController } from '../hooks';\nimport {\n  MediaAttachmentPreview,\n  type MediaAttachmentPreviewProps,\n} from './MediaAttachmentPreview';\nimport { toBaseImageDescriptors } from '../../BaseImage';\nimport { Gallery } from '../../Gallery';\nimport { GlobalModal, type ModalCloseSource } from '../../Modal';\nimport { useComponentContext } from '../../../context';\n\nexport type AttachmentPreviewListProps = {\n  AudioAttachmentPreview?:\n    | ComponentType<AudioAttachmentPreviewProps>\n    | ComponentType<FileAttachmentPreviewProps>;\n  FileAttachmentPreview?: ComponentType<FileAttachmentPreviewProps>;\n  ImageAttachmentPreview?: ComponentType<ImageAttachmentPreviewProps>;\n  UnsupportedAttachmentPreview?: ComponentType<UnsupportedAttachmentPreviewProps>;\n  VideoAttachmentPreview?: ComponentType<MediaAttachmentPreviewProps>;\n};\n\nexport const AttachmentPreviewList = ({\n  AudioAttachmentPreview = DefaultFileAttachmentPreview,\n  FileAttachmentPreview = DefaultFileAttachmentPreview,\n  ImageAttachmentPreview = MediaAttachmentPreview,\n  UnsupportedAttachmentPreview = DefaultUnknownAttachmentPreview,\n  VideoAttachmentPreview = MediaAttachmentPreview,\n}: AttachmentPreviewListProps) => {\n  const messageComposer = useMessageComposerController();\n  const { Modal = GlobalModal } = useComponentContext();\n  const [showPreview, setShowPreview] = useState(false);\n  const initialIndexRef = useRef(0);\n  const preventOverlayClose = useCallback(\n    (source: ModalCloseSource) => source !== 'overlay',\n    [],\n  );\n\n  const { attachments } = useAttachmentsForPreview();\n  const filteredAttachments = useMemo(\n    () => attachments.filter((a) => !isVoiceRecordingAttachment(a)),\n    [attachments],\n  );\n\n  const { galleryItems, previewIndexById } = useMemo(() => {\n    const items: NonNullable<ReturnType<typeof toBaseImageDescriptors>>[] = [];\n    const indexById: Record<string, number> = {};\n    for (const a of attachments) {\n      if (isLocalImageAttachment(a) || isLocalVideoAttachment(a)) {\n        const descriptor = toBaseImageDescriptors(a);\n        if (descriptor) {\n          indexById[a.localMetadata.id] = items.length;\n          items.push(descriptor);\n        }\n      }\n    }\n    return { galleryItems: items, previewIndexById: indexById };\n  }, [attachments]);\n\n  const openPreviewAtIndex = useCallback((index: number) => {\n    initialIndexRef.current = index;\n    setShowPreview(true);\n  }, []);\n\n  if (!filteredAttachments.length) return null;\n\n  return (\n    <div\n      className='str-chat__attachment-preview-list'\n      data-testid='attachment-preview-list'\n    >\n      {attachments.map((attachment) => {\n        if (isScrapedContent(attachment)) return null;\n        // Voice recordings are rendered in the dedicated slot above (VoiceRecordingPreviewSlot)\n        if (isLocalVoiceRecordingAttachment(attachment)) return null;\n        if (isLocalAudioAttachment(attachment)) {\n          return (\n            <AudioAttachmentPreview\n              attachment={attachment}\n              handleRetry={messageComposer.attachmentManager.uploadAttachment}\n              key={attachment.localMetadata.id || attachment.asset_url}\n              removeAttachments={messageComposer.attachmentManager.removeAttachments}\n            />\n          );\n        } else if (isLocalVideoAttachment(attachment)) {\n          return (\n            <VideoAttachmentPreview\n              attachment={attachment}\n              handleRetry={messageComposer.attachmentManager.uploadAttachment}\n              key={attachment.localMetadata.id || attachment.asset_url}\n              openPreview={() =>\n                openPreviewAtIndex(previewIndexById[attachment.localMetadata.id] ?? 0)\n              }\n              removeAttachments={messageComposer.attachmentManager.removeAttachments}\n            />\n          );\n        } else if (isLocalImageAttachment(attachment)) {\n          return (\n            <ImageAttachmentPreview\n              attachment={attachment}\n              handleRetry={messageComposer.attachmentManager.uploadAttachment}\n              key={attachment.localMetadata.id || attachment.image_url}\n              openPreview={() =>\n                openPreviewAtIndex(previewIndexById[attachment.localMetadata.id] ?? 0)\n              }\n              removeAttachments={messageComposer.attachmentManager.removeAttachments}\n            />\n          );\n        } else if (isLocalFileAttachment(attachment)) {\n          return (\n            <FileAttachmentPreview\n              attachment={attachment}\n              handleRetry={messageComposer.attachmentManager.uploadAttachment}\n              key={attachment.localMetadata.id || attachment.asset_url}\n              removeAttachments={messageComposer.attachmentManager.removeAttachments}\n            />\n          );\n        } else if (isLocalAttachment(attachment)) {\n          return (\n            <UnsupportedAttachmentPreview\n              attachment={attachment}\n              handleRetry={messageComposer.attachmentManager.uploadAttachment}\n              key={attachment.localMetadata.id}\n              removeAttachments={messageComposer.attachmentManager.removeAttachments}\n            />\n          );\n        }\n        return null;\n      })}\n      {galleryItems.length > 0 && (\n        <Modal\n          className='str-chat__gallery-modal'\n          onClose={() => setShowPreview(false)}\n          onCloseAttempt={preventOverlayClose}\n          open={showPreview}\n        >\n          <Gallery initialIndex={initialIndexRef.current} items={galleryItems} />\n        </Modal>\n      )}\n    </div>\n  );\n};\n","import type { ComponentType } from 'react';\nimport React from 'react';\nimport {\n  isLocalVoiceRecordingAttachment,\n  type LocalVoiceRecordingAttachment,\n} from 'stream-chat';\nimport { useAttachmentsForPreview, useMessageComposerController } from '../hooks';\nimport { AudioAttachmentPreview } from './AudioAttachmentPreview';\nimport type { UploadAttachmentPreviewProps } from './types';\n\nexport type VoiceRecordingPreviewProps<CustomLocalMetadata = Record<string, unknown>> =\n  UploadAttachmentPreviewProps<LocalVoiceRecordingAttachment<CustomLocalMetadata>>;\n\nexport type VoiceRecordingPreviewSlotProps = {\n  /** Custom UI component for each voice recording preview in the slot; defaults to AudioAttachmentPreview */\n  VoiceRecordingPreview?: ComponentType<VoiceRecordingPreviewProps>;\n};\n\n/**\n * Dedicated slot for voice recording preview(s), rendered apart from the main attachment preview list\n */\nexport const VoiceRecordingPreviewSlot = ({\n  VoiceRecordingPreview = AudioAttachmentPreview,\n}: VoiceRecordingPreviewSlotProps) => {\n  const messageComposer = useMessageComposerController();\n  const { attachments } = useAttachmentsForPreview();\n\n  const voiceAttachments = attachments.filter(isLocalVoiceRecordingAttachment);\n  const firstVoice = voiceAttachments[0];\n  if (!firstVoice) return null;\n\n  return (\n    <div\n      className='str-chat__message-composer-voice-preview-slot'\n      data-testid='voice-preview-slot'\n    >\n      <VoiceRecordingPreview\n        attachment={firstVoice}\n        handleRetry={messageComposer.attachmentManager.uploadAttachment}\n        removeAttachments={messageComposer.attachmentManager.removeAttachments}\n      />\n    </div>\n  );\n};\n","import { useMessageComposerController } from './hooks';\nimport type { TextComposerState } from 'stream-chat';\nimport { IconBolt, IconXmark } from '../Icons';\nimport { useMessageComposerContext, useTranslationContext } from '../../context';\n\nexport type CommandChipProps = {\n  command?: TextComposerState['command'];\n};\n\nexport const CommandChip = ({ command }: CommandChipProps) => {\n  const { textComposer } = useMessageComposerController();\n  const { textareaRef } = useMessageComposerContext();\n  const { t } = useTranslationContext();\n  if (!command) return null;\n\n  return (\n    <div className='str-chat__command-chip'>\n      <IconBolt />\n      <span>{command.name}</span>\n      <button\n        aria-label={t('Exit command {{ command }}', { command: command.name })}\n        className={'str-chat__command-chip__close-button'}\n        onClick={() => {\n          textComposer.setCommand(null);\n          textareaRef.current?.focus();\n        }}\n      >\n        <IconXmark />\n      </button>\n    </div>\n  );\n};\n","import React from 'react';\nimport { useCooldownRemaining } from './hooks';\n\nexport const CooldownTimer = () => {\n  const secondsLeft = useCooldownRemaining();\n\n  return (\n    <div className='str-chat__message-composer-cooldown' data-testid='cooldown-timer'>\n      {secondsLeft}\n    </div>\n  );\n};\n","import { useTranslationContext } from '../../context/TranslationContext';\n\nexport const UploadIcon = () => {\n  const { t } = useTranslationContext('UploadIcon');\n  return (\n    <svg\n      data-testid='attach-icon'\n      fill='none'\n      height='24'\n      viewBox='0 0 24 24'\n      width='24'\n      xmlns='http://www.w3.org/2000/svg'\n    >\n      <title>{t('Attach files')}</title>\n      <g clipPath='url(#clip0_10878_5)'>\n        <path\n          d='M12.9997 6.99993L10.9997 6.99993L10.9997 10.9999L6.99972 10.9999L6.99972 12.9999L10.9997 12.9999L10.9997 16.9999L12.9997 16.9999L12.9997 12.9999L16.9997 12.9999L16.9997 10.9999L12.9997 10.9999L12.9997 6.99993ZM11.9997 1.99992C6.47972 1.99992 1.99972 6.47993 1.99972 11.9999C1.99972 17.5199 6.47972 21.9999 11.9997 21.9999C17.5197 21.9999 21.9997 17.5199 21.9997 11.9999C21.9997 6.47993 17.5197 1.99992 11.9997 1.99992ZM11.9997 19.9999C7.58972 19.9999 3.99972 16.4099 3.99972 11.9999C3.99972 7.58993 7.58972 3.99993 11.9997 3.99993C16.4097 3.99993 19.9997 7.58993 19.9997 11.9999C19.9997 16.4099 16.4097 19.9999 11.9997 19.9999Z'\n          fill='black'\n        />\n      </g>\n      <defs>\n        <clipPath id='clip0_10878_5'>\n          <rect fill='white' height='24' width='24' />\n        </clipPath>\n      </defs>\n    </svg>\n  );\n};\n\nexport const BinIcon = () => (\n  <svg fill='currentColor' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'>\n    <path d='M8.00033 25.3333C8.00033 26.8 9.20033 28 10.667 28H21.3337C22.8003 28 24.0003 26.8 24.0003 25.3333V12C24.0003 10.5333 22.8003 9.33333 21.3337 9.33333H10.667C9.20033 9.33333 8.00033 10.5333 8.00033 12V25.3333ZM24.0003 5.33333H20.667L19.7203 4.38667C19.4803 4.14667 19.1337 4 18.787 4H13.2137C12.867 4 12.5203 4.14667 12.2803 4.38667L11.3337 5.33333H8.00033C7.26699 5.33333 6.66699 5.93333 6.66699 6.66667C6.66699 7.4 7.26699 8 8.00033 8H24.0003C24.7337 8 25.3337 7.4 25.3337 6.66667C25.3337 5.93333 24.7337 5.33333 24.0003 5.33333Z' />\n  </svg>\n);\n\nexport const PauseIcon = () => (\n  <svg\n    data-testid='str-chat__pause-icon'\n    fill='currentColor'\n    viewBox='0 0 16 20'\n    xmlns='http://www.w3.org/2000/svg'\n  >\n    <path d='M0 19.3333H5.33333V0.666626H0V19.3333ZM10.6667 0.666626V19.3333H16V0.666626H10.6667Z' />\n  </svg>\n);\n\nexport const PlayIcon = () => (\n  <svg\n    data-testid='str-chat__play-icon'\n    fill='currentColor'\n    viewBox='0 0 14 18'\n    xmlns='http://www.w3.org/2000/svg'\n  >\n    <path d='M0.236328 2.09338V15.9067C0.236328 16.9601 1.39633 17.6001 2.28966 17.0267L13.143 10.1201C13.9697 9.60005 13.9697 8.40005 13.143 7.86672L2.28966 0.973385C1.39633 0.400051 0.236328 1.04005 0.236328 2.09338Z' />\n  </svg>\n);\n\nexport const CheckSignIcon = () => (\n  <svg fill='currentColor' viewBox='0 0 18 14' xmlns='http://www.w3.org/2000/svg'>\n    <path d='M5.79457 10.875L2.32457 7.40502C1.93457 7.01502 1.30457 7.01502 0.91457 7.40502C0.52457 7.79502 0.52457 8.42502 0.91457 8.81502L5.09457 12.995C5.48457 13.385 6.11457 13.385 6.50457 12.995L17.0846 2.41502C17.4746 2.02502 17.4746 1.39502 17.0846 1.00502C16.6946 0.615024 16.0646 0.615024 15.6746 1.00502L5.79457 10.875Z' />\n  </svg>\n);\n","import clsx from 'clsx';\nimport React, { useState } from 'react';\nimport type { LinkPreview, LinkPreviewsManagerState } from 'stream-chat';\nimport { LinkPreviewsManager } from 'stream-chat';\nimport { useStateStore } from '../../store';\nimport { PopperTooltip } from '../Tooltip';\nimport { useEnterLeaveHandlers } from '../Tooltip/hooks';\nimport { useMessageComposerController } from './hooks';\nimport { BaseImage } from '../BaseImage';\nimport { RemoveAttachmentPreviewButton } from './RemoveAttachmentPreviewButton';\nimport { IconLink } from '../Icons';\n\nexport type LinkPreviewListProps = {\n  displayLinkCount?: number;\n};\n\nconst linkPreviewsManagerStateSelector = (state: LinkPreviewsManagerState) => ({\n  linkPreviews: Array.from(state.previews.values()).filter(\n    (preview) =>\n      LinkPreviewsManager.previewIsLoaded(preview) ||\n      LinkPreviewsManager.previewIsLoading(preview),\n  ),\n});\n\nexport const LinkPreviewList = ({ displayLinkCount = 1 }: LinkPreviewListProps) => {\n  const messageComposer = useMessageComposerController();\n  const { linkPreviewsManager } = messageComposer;\n  const { linkPreviews } = useStateStore(\n    linkPreviewsManager.state,\n    linkPreviewsManagerStateSelector,\n  );\n\n  if (linkPreviews.length === 0) return null;\n\n  return (\n    <div className='str-chat__link-preview-list'>\n      {linkPreviews.slice(0, displayLinkCount).map((linkPreview) => (\n        <LinkPreviewCard key={linkPreview.og_scrape_url} linkPreview={linkPreview} />\n      ))}\n    </div>\n  );\n};\n\ntype LinkPreviewProps = {\n  linkPreview: LinkPreview;\n};\n\nexport const LinkPreviewCard = ({ linkPreview }: LinkPreviewProps) => {\n  const { linkPreviewsManager } = useMessageComposerController();\n  const { handleEnter, handleLeave, tooltipVisible } =\n    useEnterLeaveHandlers<HTMLDivElement>();\n  const [referenceElement, setReferenceElement] = useState<HTMLDivElement | null>(null);\n  const { image_url, thumb_url, title, title_link } = linkPreview;\n\n  if (\n    !LinkPreviewsManager.previewIsLoaded(linkPreview) &&\n    !LinkPreviewsManager.previewIsLoading(linkPreview)\n  )\n    return null;\n\n  const previewImageSrc = title_link || image_url || thumb_url;\n  return (\n    <div\n      className={clsx('str-chat__link-preview-card', {\n        'str-chat__link-preview-card--loading':\n          LinkPreviewsManager.previewIsLoading(linkPreview),\n      })}\n      data-testid='link-preview-card'\n      onMouseEnter={handleEnter}\n      onMouseLeave={handleLeave}\n      ref={setReferenceElement}\n    >\n      <PopperTooltip\n        offset={[0, 5]}\n        referenceElement={referenceElement}\n        visible={tooltipVisible}\n      >\n        {linkPreview.og_scrape_url}\n      </PopperTooltip>\n\n      {previewImageSrc && (\n        <BaseImage\n          alt={title}\n          className='str-chat__attachment-preview__thumbnail'\n          src={previewImageSrc}\n          title={title}\n        />\n      )}\n      <div className='str-chat__link-preview-card__content'>\n        <div className='str-chat__link-preview-card__content-title'>\n          {linkPreview.title}\n        </div>\n        <div className='str-chat__link-preview-card__content-description'>\n          {linkPreview.text}\n        </div>\n        <div className='str-chat__link-preview-card__content__url'>\n          <IconLink />\n          <span>{linkPreview.og_scrape_url}</span>\n        </div>\n      </div>\n\n      <RemoveAttachmentPreviewButton\n        className='str-chat__link-preview-card__dismiss-button'\n        data-testid='link-preview-card-dismiss-btn'\n        onClick={() => linkPreviewsManager.dismissPreview(linkPreview.og_scrape_url)}\n      />\n    </div>\n  );\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../context';\nimport type { RecordingPermission } from './classes/BrowserPermission';\n\nexport type RecordingPermissionDeniedNotificationProps = {\n  permissionName: RecordingPermission;\n};\n\nexport const RecordingPermissionDeniedNotification = ({\n  permissionName,\n}: RecordingPermissionDeniedNotificationProps) => {\n  const { t } = useTranslationContext();\n  const permissionTranslations = {\n    body: {\n      camera: t('To start recording, allow the camera access in your browser'),\n      microphone: t('To start recording, allow the microphone access in your browser'),\n    },\n    heading: {\n      camera: t('Allow access to camera'),\n      microphone: t('Allow access to microphone'),\n    },\n  };\n\n  return (\n    <div className='str-chat__recording-permission-denied-notification'>\n      <div className='str-chat__recording-permission-denied-notification__heading'>\n        {permissionTranslations.heading[permissionName]}\n      </div>\n      <p className='str-chat__recording-permission-denied-notification__message'>\n        {permissionTranslations.body[permissionName]}\n      </p>\n    </div>\n  );\n};\n","import React, { useEffect } from 'react';\nimport { DurationDisplay, WaveProgressBar } from '../../AudioPlayback';\nimport type { AudioPlayerState } from '../../AudioPlayback/AudioPlayer';\nimport { useAudioPlayer } from '../../AudioPlayback/WithAudioPlayback';\nimport { useStateStore } from '../../../store';\nimport { IconPauseFill, IconPlayFill } from '../../Icons';\nimport { Button } from '../../Button';\nimport { useTranslationContext } from '../../../context';\nimport clsx from 'clsx';\n\nconst audioPlayerStateSelector = (state: AudioPlayerState) => ({\n  isPlaying: state.isPlaying,\n  progress: state.progressPercent,\n  secondsElapsed: state.secondsElapsed,\n});\n\nexport type AudioRecordingPlayerProps = {\n  durationSeconds: number;\n  mimeType?: string;\n  src?: string;\n  waveformData?: number[];\n};\n\nexport const AudioRecordingPlayback = ({\n  durationSeconds,\n  mimeType,\n  src,\n  waveformData,\n}: AudioRecordingPlayerProps) => {\n  const { t } = useTranslationContext();\n  const audioPlayer = useAudioPlayer({\n    durationSeconds,\n    mimeType,\n    src,\n    waveformData,\n  });\n\n  const { isPlaying, progress, secondsElapsed } =\n    useStateStore(audioPlayer?.state, audioPlayerStateSelector) ?? {};\n\n  const displayedDuration = secondsElapsed || durationSeconds;\n\n  useEffect(() => {\n    audioPlayer?.cancelScheduledRemoval();\n    return () => {\n      audioPlayer?.scheduleRemoval();\n    };\n  }, [audioPlayer]);\n\n  if (!audioPlayer) return;\n\n  return (\n    <div\n      className={clsx('str-chat__audio-recorder__recording-playback', {\n        'str-chat__audio-recorder__recording-playback--isPlaying': isPlaying,\n      })}\n    >\n      <Button\n        appearance='ghost'\n        aria-label={isPlaying ? t('aria/Pause') : t('aria/Play')}\n        circular\n        className='str-chat__audio_recorder__toggle-playback-button'\n        data-testid='audio-recording-preview-toggle-play-btn'\n        onClick={audioPlayer.togglePlay}\n        size='sm'\n        variant='secondary'\n      >\n        {isPlaying ? <IconPauseFill /> : <IconPlayFill />}\n      </Button>\n      <DurationDisplay\n        className={clsx('str-chat__recording-timer', {\n          'str-chat__recording-timer--hours': displayedDuration >= 3600,\n        })}\n        duration={durationSeconds}\n        isPlaying={!!isPlaying}\n        secondsElapsed={secondsElapsed}\n      />\n      <div className='str-chat__wave-progress-bar__track-container'>\n        <WaveProgressBar\n          durationSeconds={durationSeconds}\n          progress={progress}\n          secondsElapsed={secondsElapsed}\n          seek={audioPlayer.seek}\n          waveformData={waveformData || []}\n        />\n      </div>\n    </div>\n  );\n};\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseTimeElapsedParams = {\n  initialSeconds?: number;\n  startOnMount?: boolean;\n};\n\n// todo: provide start timestamp\nexport const useTimeElapsed = ({\n  initialSeconds = 0,\n  startOnMount,\n}: UseTimeElapsedParams = {}) => {\n  const [secondsElapsed, setSecondsElapsed] = useState<number>(initialSeconds);\n  const updateInterval = useRef<ReturnType<typeof setInterval>>(undefined);\n\n  const startCounter = useCallback(() => {\n    if (updateInterval.current) return;\n    updateInterval.current = setInterval(() => {\n      setSecondsElapsed((prev) => prev + 1);\n    }, 1000);\n  }, []);\n\n  const stopCounter = useCallback(() => {\n    clearInterval(updateInterval.current);\n    updateInterval.current = undefined;\n  }, []);\n\n  useEffect(() => {\n    if (updateInterval.current) return;\n    setSecondsElapsed(initialSeconds);\n  }, [initialSeconds]);\n\n  useEffect(() => {\n    if (!startOnMount) return;\n    startCounter();\n    return () => {\n      stopCounter();\n    };\n  }, [startCounter, startOnMount, stopCounter]);\n\n  return {\n    secondsElapsed,\n    startCounter,\n    stopCounter,\n  };\n};\n","import clsx from 'clsx';\nimport { displayDuration } from '../../Attachment';\nimport React from 'react';\n\nexport type RecordingTimerProps = {\n  durationSeconds: number;\n};\n\nexport const RecordingTimer = ({ durationSeconds }: RecordingTimerProps) => (\n  <div\n    className={clsx('str-chat__recording-timer', {\n      'str-chat__recording-timer--hours': durationSeconds >= 3600,\n    })}\n  >\n    {displayDuration(durationSeconds)}\n  </div>\n);\n","import React, { useEffect, useState } from 'react';\nimport { useTimeElapsed } from './hooks/useTimeElapsed';\nimport { useMessageComposerContext } from '../../../context';\nimport { RecordingTimer } from './RecordingTimer';\nimport { IconVoice } from '../../Icons';\n\ntype WaveformProps = {\n  maxDataPointsDrawn?: number;\n};\n\nconst AudioRecordingWaveform = ({ maxDataPointsDrawn = 200 }: WaveformProps) => {\n  const {\n    recordingController: { recorder },\n  } = useMessageComposerContext();\n\n  const [amplitudes, setAmplitudes] = useState<number[]>([]);\n\n  useEffect(() => {\n    if (!recorder?.amplitudeRecorder) return;\n    const amplitudesSubscription =\n      recorder.amplitudeRecorder.amplitudes.subscribe(setAmplitudes);\n    return () => {\n      amplitudesSubscription.unsubscribe();\n    };\n  }, [recorder]);\n\n  if (!recorder) return null;\n\n  return (\n    <div className='str-chat__waveform-box-container'>\n      <div className='str-chat__wave-progress-bar__track'>\n        {amplitudes.slice(-maxDataPointsDrawn).map((amplitude, i) => (\n          <div\n            className='str-chat__wave-progress-bar__amplitude-bar'\n            key={`amplitude-${i}-voice-recording`}\n            style={\n              {\n                '--str-chat__wave-progress-bar__amplitude-bar-height': amplitude\n                  ? amplitude * 100 + '%'\n                  : '0%',\n              } as React.CSSProperties\n            }\n          />\n        ))}\n      </div>\n    </div>\n  );\n};\nexport const AudioRecordingPreview = () => {\n  const {\n    recordingController: { recorder },\n  } = useMessageComposerContext();\n\n  const initialSeconds = recorder?.durationMs ? recorder.durationMs / 1000 : 0;\n  const { secondsElapsed, startCounter, stopCounter } = useTimeElapsed({\n    initialSeconds,\n  });\n\n  useEffect(() => {\n    if (!recorder?.mediaRecorder) return;\n    const { mediaRecorder } = recorder;\n\n    if (mediaRecorder.state === 'recording') {\n      startCounter();\n    }\n\n    mediaRecorder.addEventListener('start', startCounter);\n    mediaRecorder.addEventListener('resume', startCounter);\n    mediaRecorder.addEventListener('stop', stopCounter);\n    mediaRecorder.addEventListener('pause', stopCounter);\n\n    return () => {\n      mediaRecorder.removeEventListener('start', startCounter);\n      mediaRecorder.removeEventListener('resume', startCounter);\n      mediaRecorder.removeEventListener('stop', stopCounter);\n      mediaRecorder.removeEventListener('pause', stopCounter);\n    };\n  }, [recorder, startCounter, stopCounter]);\n\n  return (\n    <div className='str-chat__audio-recorder__recording-preview'>\n      <IconVoice />\n      <RecordingTimer durationSeconds={secondsElapsed} />\n      <AudioRecordingWaveform />\n    </div>\n  );\n};\n","import { MediaRecordingState } from '../classes';\n\nexport const isPaused = (recordingState?: MediaRecordingState) =>\n  recordingState === MediaRecordingState.PAUSED;\nexport const isStopped = (recordingState?: MediaRecordingState) =>\n  recordingState === MediaRecordingState.STOPPED;\nexport const isRecording = (recordingState?: MediaRecordingState) =>\n  recordingState === MediaRecordingState.RECORDING;\n","import { CheckSignIcon } from '../../MessageComposer/icons';\nimport { IconDelete, IconPauseFill, IconVoice } from '../../Icons';\nimport React from 'react';\nimport { useMessageComposerContext, useTranslationContext } from '../../../context';\nimport { isRecording } from './recordingStateIdentity';\nimport { Button } from '../../Button';\nimport { useNotificationApi } from '../../Notifications';\nimport { UploadProgressIndicator } from '../../Loading/UploadProgressIndicator';\n\nconst ToggleRecordingButton = () => {\n  const { t } = useTranslationContext();\n  const {\n    recordingController: { recorder, recordingState },\n  } = useMessageComposerContext();\n\n  const recording = isRecording(recordingState);\n\n  return (\n    <Button\n      appearance='outline'\n      aria-label={recording ? t('aria/Pause recording') : t('aria/Resume recording')}\n      circular\n      className='str-chat__audio_recorder__toggle-recording-button'\n      onClick={() => (recording ? recorder?.pause() : recorder?.resume())}\n      size='sm'\n      variant='secondary'\n    >\n      {recording ? <IconPauseFill /> : <IconVoice />}\n    </Button>\n  );\n};\n\nexport const AudioRecorderRecordingControls = () => {\n  const { addNotification } = useNotificationApi();\n  const { t } = useTranslationContext();\n  const {\n    recordingController: { completeRecording, recorder, recording, recordingState },\n  } = useMessageComposerContext();\n  const isUploadingFile = recording?.localMetadata?.uploadState === 'uploading';\n  const uploadProgress = recording?.localMetadata?.uploadProgress;\n\n  if (!recorder) return null;\n\n  return (\n    <div className='str-chat__audio_recorder__recording-controls'>\n      {!isRecording(recordingState) && (\n        <Button\n          appearance='ghost'\n          aria-label={t('aria/Cancel recording')}\n          circular\n          className='str-chat__audio_recorder__cancel-button'\n          data-testid={'cancel-recording-audio-button'}\n          disabled={isUploadingFile}\n          onClick={() => {\n            recorder.cancel();\n            addNotification({\n              emitter: 'AudioRecorder',\n              message: t('Voice message deleted'),\n              severity: 'info',\n              type: 'audioRecording:cancel:success',\n            });\n          }}\n          size='sm'\n          variant='secondary'\n        >\n          <IconDelete />\n        </Button>\n      )}\n      <ToggleRecordingButton />\n      <Button\n        appearance='solid'\n        aria-label={t('aria/Complete recording')}\n        circular\n        className='str-chat__audio_recorder__stop-button'\n        data-testid='audio-recorder-stop-button'\n        onClick={completeRecording}\n        size='sm'\n        variant='primary'\n      >\n        {isUploadingFile ? (\n          <UploadProgressIndicator uploadProgress={uploadProgress} />\n        ) : (\n          <CheckSignIcon />\n        )}\n      </Button>\n    </div>\n  );\n};\n","import React, { useMemo } from 'react';\nimport { AudioRecordingPlayback } from './AudioRecordingPlayback';\nimport { AudioRecordingPreview } from './AudioRecordingPreview';\nimport { MediaRecordingState } from '../classes';\nimport { useMessageComposerContext } from '../../../context/MessageComposerContext';\nimport { AudioRecorderRecordingControls } from './AudioRecorderRecordingControls';\nimport { isStopped } from './recordingStateIdentity';\n\nexport const AudioRecorder = () => {\n  const {\n    recordingController: { recorder, recording, recordingState },\n  } = useMessageComposerContext();\n\n  const state = useMemo(\n    () => ({\n      paused: recordingState === MediaRecordingState.PAUSED,\n      recording: recordingState === MediaRecordingState.RECORDING,\n      stopped: recordingState === MediaRecordingState.STOPPED,\n    }),\n    [recordingState],\n  );\n\n  if (!recorder) return null;\n\n  return (\n    <div className='str-chat__audio_recorder' data-testid={'audio-recorder'}>\n      {(isStopped(recordingState) || state.paused) && recording?.asset_url ? (\n        <AudioRecordingPlayback\n          durationSeconds={recording.duration ?? 0}\n          mimeType={recording.mime_type}\n          src={recording.asset_url}\n          waveformData={recording.waveform_data}\n        />\n      ) : state.recording ? (\n        <AudioRecordingPreview />\n      ) : null}\n\n      <AudioRecorderRecordingControls />\n    </div>\n  );\n};\n","import { RecordingAttachmentType, RecordingPermission } from '../classes';\nimport { RecordingPermissionDeniedNotification as DefaultRecordingPermissionDeniedNotification } from '../RecordingPermissionDeniedNotification';\nimport React, { forwardRef, useRef } from 'react';\nimport { useAttachmentManagerState } from '../../MessageComposer/hooks/useAttachmentManagerState';\nimport {\n  useComponentContext,\n  useMessageComposerContext,\n  useTranslationContext,\n} from '../../../context';\nimport { Callout, useDialogOnNearestManager } from '../../Dialog';\nimport { Button } from '../../Button';\nimport { IconVoice } from '../../Icons';\n\nconst dialogId = 'recording-permission-denied-notification';\n\nexport const AudioRecordingButtonWithNotification = () => {\n  const {\n    RecordingPermissionDeniedNotification = DefaultRecordingPermissionDeniedNotification,\n    StartRecordingAudioButton = DefaultStartRecordingAudioButton,\n  } = useComponentContext();\n  const { asyncMessagesMultiSendEnabled, recordingController } =\n    useMessageComposerContext();\n  const { attachments } = useAttachmentManagerState();\n\n  const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n\n  const audioRecordingBtnRef = useRef<HTMLButtonElement | null>(null);\n  const isRecording = !!recordingController.recordingState;\n\n  return (\n    <>\n      <StartRecordingAudioButton\n        disabled={\n          isRecording ||\n          (!asyncMessagesMultiSendEnabled &&\n            attachments.some((a) => a.type === RecordingAttachmentType.VOICE_RECORDING))\n        }\n        onClick={() => {\n          recordingController.recorder?.start();\n\n          const recordingEnabled = !!(\n            recordingController.recorder && navigator.mediaDevices\n          );\n\n          const shouldShowNotification =\n            recordingEnabled && recordingController.permissionState === 'denied';\n          if (shouldShowNotification) dialog.open();\n        }}\n        ref={audioRecordingBtnRef}\n      />\n      <Callout\n        className='str-chat__recording-permission-denied-notification'\n        dialogManagerId={dialogManager?.id}\n        id={dialogId}\n        onClose={dialog.close}\n        placement={'top-start'}\n        referenceElement={audioRecordingBtnRef.current}\n      >\n        <RecordingPermissionDeniedNotification permissionName={RecordingPermission.MIC} />\n      </Callout>\n    </>\n  );\n};\n\nexport type StartRecordingAudioButtonProps = React.ComponentProps<'button'>;\n\nexport const DefaultStartRecordingAudioButton = forwardRef<\n  HTMLButtonElement,\n  StartRecordingAudioButtonProps\n>(function StartRecordingAudioButton(props, ref) {\n  const { t } = useTranslationContext();\n\n  return (\n    <Button\n      appearance='ghost'\n      aria-label={t('aria/Start recording audio')}\n      circular\n      className='str-chat__start-recording-audio-button'\n      data-testid='start-recording-audio-button'\n      size='sm'\n      variant='secondary'\n      {...props}\n      ref={ref}\n    >\n      <IconVoice />\n    </Button>\n  );\n});\n","import React from 'react';\nimport { QuotedMessagePreviewUI } from './QuotedMessagePreview';\nimport type { LocalMessage } from 'stream-chat';\nimport { useTranslationContext } from '../../context';\n\nexport type EditedMessagePreviewProps = {\n  message: LocalMessage;\n  onCancel: () => void;\n};\n\nexport const EditedMessagePreview = ({\n  message,\n  onCancel,\n}: EditedMessagePreviewProps) => {\n  const { t } = useTranslationContext();\n\n  return (\n    <QuotedMessagePreviewUI\n      authorLabel={t('Edit Message')}\n      onRemove={onCancel}\n      quotedMessage={message}\n    />\n  );\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport { useMessageComposerController } from './hooks';\nimport { IconCheckmark } from '../Icons';\nimport type { MessageComposerState } from 'stream-chat';\nimport { useStateStore } from '../../store';\nimport { useTranslationContext } from '../../context';\n\nconst stateSelector = (state: MessageComposerState) => ({\n  showReplyInChannel: state.showReplyInChannel,\n});\n\nexport const SendToChannelCheckbox = () => {\n  const { t } = useTranslationContext();\n  const messageComposer = useMessageComposerController();\n  const { showReplyInChannel } = useStateStore(messageComposer.state, stateSelector);\n\n  if (messageComposer.editedMessage || !messageComposer.threadId) return null;\n\n  const labelText =\n    Object.keys(messageComposer.channel.state.members).length === 2\n      ? t('Also send as a direct message')\n      : t('Also send in channel');\n\n  return (\n    <div\n      className={clsx('str-chat__send-to-channel-checkbox__container', {\n        'str-chat__send-to-channel-checkbox__container--checked': showReplyInChannel,\n      })}\n      data-testid='send-to-channel-checkbox'\n    >\n      <label\n        className='str-chat__send-to-channel-checkbox__field'\n        htmlFor='send-to-channel-checkbox'\n      >\n        <input\n          aria-checked={showReplyInChannel}\n          checked={showReplyInChannel}\n          className='str-chat__send-to-channel-checkbox__input'\n          id='send-to-channel-checkbox'\n          onChange={() => messageComposer.toggleShowReplyInChannel()}\n          type='checkbox'\n        />\n        <span aria-hidden className='str-chat__send-to-channel-checkbox__visual'>\n          <span className='str-chat__send-to-channel-checkbox__checkmark'>\n            <IconCheckmark />\n          </span>\n        </span>\n        <span className='str-chat__send-to-channel-checkbox__label'>{labelText}</span>\n      </label>\n    </div>\n  );\n};\n","import type { ComponentProps, PropsWithChildren } from 'react';\nimport React from 'react';\nimport type { CommandResponse, MessageComposerState } from 'stream-chat';\nimport { CommandContextMenuItem } from '../../MessageComposer/AttachmentSelector/CommandsMenu';\nimport { useStateStore } from '../../../store';\nimport { useMessageComposerController } from '../../MessageComposer/hooks';\n\nexport type CommandItemProps = {\n  entity: CommandResponse;\n  enabled?: boolean;\n  focused?: boolean;\n} & ComponentProps<'button'>;\n\nconst messageComposerStateSelector = ({\n  editedMessage,\n  quotedMessage,\n}: MessageComposerState) => ({\n  editedMessage,\n  quotedMessage,\n});\n\nexport const CommandItem = (props: PropsWithChildren<CommandItemProps>) => {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const { enabled, entity, focused: _, ...buttonProps } = props;\n  const messageComposer = useMessageComposerController();\n  useStateStore(messageComposer.state, messageComposerStateSelector);\n\n  if (!entity.name) return null;\n\n  const resolvedEnabled =\n    enabled ??\n    !messageComposer.isCommandDisabled(entity as CommandResponse & { name: string });\n\n  return (\n    <CommandContextMenuItem\n      {...buttonProps}\n      command={entity as CommandResponse & { name: string }}\n      enabled={resolvedEnabled}\n    />\n  );\n};\n","import clsx from 'clsx';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\nimport { EmojiContextMenuButton } from '../../Dialog';\n\nexport type EmoticonItemProps = {\n  entity: {\n    /** Name for emoticon */\n    name: string;\n    /** Native value or actual emoticon */\n    native: string;\n    /** The parts of the Name property of the entity (or id if no name) that can be matched to the user input value.\n     * Default is bold for matches, but can be overwritten in css.\n     * */\n    tokenizedDisplayName: { token: string; parts: string[] };\n  };\n  focused?: boolean;\n} & ComponentProps<'button'>;\n\nexport const EmoticonItem = (props: EmoticonItemProps) => {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const { className, entity, focused: _, ...buttonProps } = props;\n  const hasEntity = Object.keys(entity).length;\n  if (!hasEntity) return null;\n\n  const { parts, token } = entity.tokenizedDisplayName ?? ({} as EmoticonItemProps);\n\n  return (\n    <EmojiContextMenuButton\n      {...buttonProps}\n      className={clsx('str-chat__emoji-item', className)}\n      emoji={entity.native}\n    >\n      {parts?.map((part, i) =>\n        part.toLowerCase() === token ? (\n          <span className='str-chat__emoji-item--highlight' key={`part-${i}`}>\n            {part}\n          </span>\n        ) : (\n          <span className='str-chat__emoji-item--part' key={`part-${i}`}>\n            {part}\n          </span>\n        ),\n      ) ?? null}\n    </EmojiContextMenuButton>\n  );\n};\n","import clsx from 'clsx';\nimport { type ComponentProps, useRef } from 'react';\nimport React, { useCallback, useLayoutEffect } from 'react';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\nimport type { TextComposerSuggestion } from 'stream-chat';\nimport type { UserItemProps } from './UserItem';\nimport type { CommandItemProps } from './CommandItem';\nimport type { EmoticonItemProps } from './EmoticonItem';\nimport { useMessageComposerContext } from '../../../context';\n\nexport type DefaultSuggestionListItemEntity =\n  | UserItemProps['entity']\n  | CommandItemProps['entity']\n  | EmoticonItemProps['entity'];\n\nexport type SuggestionListItemComponentProps = {\n  entity: DefaultSuggestionListItemEntity | unknown;\n  focused: boolean;\n} & ComponentProps<'button'>;\n\nexport type SuggestionItemProps = ComponentProps<'button'> & {\n  component: React.ComponentType<SuggestionListItemComponentProps>;\n  item: TextComposerSuggestion;\n  focused: boolean;\n};\n\nexport const SuggestionListItem = ({\n  className,\n  component: Component,\n  focused,\n  item,\n  onClick,\n  onKeyDown,\n  onMouseEnter,\n  ...restProps\n}: SuggestionItemProps) => {\n  const { textComposer } = useMessageComposerController();\n  const { textareaRef } = useMessageComposerContext();\n  const componentRef = useRef<HTMLButtonElement | null>(null);\n\n  const handleSelect = useCallback(() => {\n    textComposer.handleSelect(item);\n    textareaRef.current?.focus();\n  }, [item, textareaRef, textComposer]);\n\n  useLayoutEffect(() => {\n    if (!focused) return;\n    componentRef.current?.scrollIntoView({ behavior: 'instant', block: 'nearest' });\n  }, [focused]);\n\n  return (\n    <Component\n      {...restProps}\n      className={clsx('str-chat__suggestion-list-item', className, {\n        'str-chat__suggestion-list-item--selected': focused,\n      })}\n      entity={item}\n      focused={focused}\n      onClick={(e) => {\n        handleSelect();\n        onClick?.(e);\n      }}\n      onKeyDown={(event) => {\n        if (event.key === 'Enter') handleSelect();\n        onKeyDown?.(event);\n      }}\n      onMouseEnter={onMouseEnter}\n      ref={componentRef}\n    />\n  );\n};\n","import type { ComponentProps } from 'react';\nimport React from 'react';\nimport clsx from 'clsx';\nimport { UserContextMenuButton } from '../../Dialog';\n\nexport type UserItemProps = {\n  /** The user */\n  entity: {\n    /** The parts of the Name property of the entity (or id if no name) that can be matched to the user input value.\n     * Default is bold for matches, but can be overwritten in css.\n     * */\n    tokenizedDisplayName: { token: string; parts: string[] };\n    /** Id of the user */\n    id?: string;\n    /** Image of the user */\n    image?: string;\n    /** Name of the user */\n    name?: string;\n  };\n  focused?: boolean;\n} & ComponentProps<'button'>;\n\n/**\n * UI component for mentions rendered in suggestion list\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const UserItem = ({ entity, focused: _, ...buttonProps }: UserItemProps) => {\n  const hasEntity = !!Object.keys(entity).length;\n  if (!hasEntity) return null;\n\n  const { parts, token } = entity.tokenizedDisplayName;\n  const renderName = () =>\n    parts.map((part, i) => {\n      const matches = part.toLowerCase() === token;\n      const partWithHTMLSpacesAround = part.replace(/^\\s+|\\s+$/g, '\\u00A0');\n      return (\n        <span\n          className={clsx({\n            'str-chat__emoji-item-part': !matches,\n            'str-chat__suggestion-item-part--match': matches,\n          })}\n          key={`part-${i}`}\n        >\n          {partWithHTMLSpacesAround}\n        </span>\n      );\n    });\n\n  return (\n    <UserContextMenuButton\n      {...buttonProps}\n      imageUrl={entity.image}\n      title={entity.name || entity.id}\n      userName={entity.name || entity.id}\n    >\n      {renderName()}\n    </UserContextMenuButton>\n  );\n};\n","const CARET_MIRROR_CLASS = 'str-chat__textarea-caret-mirror';\nconst CARET_MARKER_CLASS = 'str-chat__textarea-caret-marker';\n\nexport type TextareaCaretRect = DOMRect | null;\n\n/**\n * Returns the caret rectangle for a textarea using a mirror-measure hack.\n * It clones computed styles and content into a hidden element to infer the\n * caret position because textarea doesn't expose caret geometry.\n */\n\nexport const getTextareaCaretRect = (\n  textarea: HTMLTextAreaElement | null,\n  selectionEnd?: number,\n): TextareaCaretRect => {\n  if (!textarea || typeof window === 'undefined') return null;\n\n  const caretIndex = Math.max(0, selectionEnd ?? textarea.selectionEnd ?? 0);\n  const value = textarea.value ?? '';\n  const valueBeforeCaret = value.slice(0, caretIndex);\n  const valueAfterCaret = value.slice(caretIndex);\n\n  const computedStyle = window.getComputedStyle(textarea);\n  const mirror = document.createElement('div');\n  mirror.className = CARET_MIRROR_CLASS;\n  mirror.style.position = 'absolute';\n  mirror.style.visibility = 'hidden';\n  mirror.style.top = '0';\n  mirror.style.left = '-9999px';\n  mirror.style.whiteSpace = 'pre-wrap';\n  mirror.style.wordWrap = 'break-word';\n\n  for (const property of computedStyle) {\n    mirror.style.setProperty(property, computedStyle.getPropertyValue(property));\n  }\n\n  mirror.textContent = valueBeforeCaret;\n\n  const caretMarker = document.createElement('span');\n  caretMarker.className = CARET_MARKER_CLASS;\n  caretMarker.textContent = valueAfterCaret.length ? valueAfterCaret : '.';\n  mirror.appendChild(caretMarker);\n\n  document.body.appendChild(mirror);\n  mirror.scrollTop = textarea.scrollTop;\n  mirror.scrollLeft = textarea.scrollLeft;\n\n  const textareaRect = textarea.getBoundingClientRect();\n  const mirrorRect = mirror.getBoundingClientRect();\n  const caretRect = caretMarker.getBoundingClientRect();\n\n  document.body.removeChild(mirror);\n\n  const left = textareaRect.left + (caretRect.left - mirrorRect.left);\n  const top = textareaRect.top + (caretRect.top - mirrorRect.top);\n  const height = caretRect.height || parseFloat(computedStyle.lineHeight) || 0;\n\n  return new DOMRect(left, top, 0, height);\n};\n","import clsx from 'clsx';\nimport React, {\n  useCallback,\n  useEffect,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport type { VirtualElement } from '@floating-ui/react';\nimport type { CommandItemProps } from './CommandItem';\nimport { CommandItem } from './CommandItem';\nimport type { EmoticonItemProps } from './EmoticonItem';\nimport { EmoticonItem } from './EmoticonItem';\nimport type { SuggestionListItemComponentProps } from './SuggestionListItem';\nimport { SuggestionListItem as DefaultSuggestionListItem } from './SuggestionListItem';\nimport type { UserItemProps } from './UserItem';\nimport { UserItem } from './UserItem';\nimport { useComponentContext } from '../../../context/ComponentContext';\nimport { useMessageComposerContext } from '../../../context/MessageComposerContext';\nimport { useStateStore } from '../../../store';\nimport { getTextareaCaretRect } from '../../../utils/getTextareaCaretRect';\nimport type { ContextMenuItemComponent, ContextMenuItemProps } from '../../Dialog';\nimport { ContextMenu } from '../../Dialog';\nimport { usePopoverPosition } from '../../Dialog/hooks/usePopoverPosition';\nimport { InfiniteScrollPaginator } from '../../InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport {\n  useMessageComposerCommands,\n  useMessageComposerController,\n} from '../../MessageComposer/hooks';\nimport { useTranslationContext } from '../../../context';\nimport type {\n  SearchSourceState,\n  TextComposerState,\n  TextComposerSuggestion,\n} from 'stream-chat';\nimport {\n  CommandsMenuClassName,\n  CommandsMenuHeader,\n} from '../../MessageComposer/AttachmentSelector/CommandsMenu';\n\ntype SuggestionTrigger = '/' | ':' | '@' | string;\n\nexport type SuggestionListProps = Partial<{\n  suggestionItemComponents: Record<\n    SuggestionTrigger,\n    React.ComponentType<SuggestionListItemComponentProps>\n  >;\n  className?: string;\n  closeOnClickOutside?: boolean;\n  containerClassName?: string;\n  focusedItemIndex: number;\n  setFocusedItemIndex: (index: number) => void;\n}>;\n\nconst textComposerStateSelector = ({ selection, suggestions }: TextComposerState) => ({\n  selection,\n  suggestions,\n});\n\nconst searchSourceStateSelector = (\n  nextValue: SearchSourceState<TextComposerSuggestion>,\n): { items: TextComposerSuggestion[] } => ({\n  items: nextValue.items ?? [],\n});\n\nexport const defaultComponents: Record<\n  SuggestionTrigger,\n  React.ComponentType<SuggestionListItemComponentProps>\n> = {\n  '/': (props: SuggestionListItemComponentProps) => (\n    <CommandItem {...props} entity={props.entity as CommandItemProps['entity']} />\n  ),\n  ':': (props: SuggestionListItemComponentProps) => (\n    <EmoticonItem {...props} entity={props.entity as EmoticonItemProps['entity']} />\n  ),\n  '@': (props: SuggestionListItemComponentProps) => (\n    <UserItem {...props} entity={props.entity as UserItemProps['entity']} />\n  ),\n} as const;\n\nexport const SuggestionList = ({\n  className,\n  closeOnClickOutside = true,\n  containerClassName,\n  focusedItemIndex,\n  setFocusedItemIndex,\n  suggestionItemComponents = defaultComponents,\n}: SuggestionListProps) => {\n  const { t } = useTranslationContext();\n  const {\n    AutocompleteSuggestionItem = DefaultSuggestionListItem,\n    ContextMenu: ContextMenuComponent = ContextMenu,\n  } = useComponentContext();\n  const { textareaRef } = useMessageComposerContext();\n  const messageComposer = useMessageComposerController();\n  const commands = useMessageComposerCommands();\n  const { textComposer } = messageComposer;\n  const { selection, suggestions } = useStateStore(\n    textComposer.state,\n    textComposerStateSelector,\n  );\n  const { items } =\n    useStateStore(suggestions?.searchSource.state, searchSourceStateSelector) ?? {};\n  const hasEnabledCommandSuggestions = useMemo(\n    () =>\n      suggestions?.searchSource.type !== 'commands' ||\n      commands.some(({ enabled }) => enabled),\n    [commands, suggestions?.searchSource.type],\n  );\n\n  const [container, setContainer] = useState<HTMLDivElement | null>(null);\n  const caretRectRef = useRef<DOMRect | null>(null);\n  const virtualCaretReference = useMemo<VirtualElement>(\n    () => ({\n      getBoundingClientRect: () => caretRectRef.current ?? new DOMRect(),\n    }),\n    [],\n  );\n\n  const { refs, strategy, update, x, y } = usePopoverPosition({\n    allowFlip: false,\n    offset: 8,\n    placement: 'top-start',\n    // For top placements, the cross-axis is X; we need this to allow flipping the list to the right when it overflows the right edge.\n    shiftOptions: { crossAxis: true },\n  });\n\n  const component = suggestions?.trigger\n    ? suggestionItemComponents[suggestions?.trigger]\n    : undefined;\n\n  const contextMenuItems = useMemo<ContextMenuItemComponent[]>(() => {\n    if (!component) return [];\n    const sortedItems =\n      suggestions?.searchSource.type === 'commands'\n        ? [...(items ?? [])].sort((a, b) =>\n            String((a as { name?: string }).name ?? '').localeCompare(\n              String((b as { name?: string }).name ?? ''),\n            ),\n          )\n        : (items ?? []);\n    return sortedItems.map((item, i) => {\n      const Item: ContextMenuItemComponent = ({ ...props }: ContextMenuItemProps) => (\n        <AutocompleteSuggestionItem\n          {...props}\n          component={component}\n          focused={focusedItemIndex === i}\n          item={item}\n          key={item.id.toString()}\n          onMouseEnter={() => setFocusedItemIndex?.(i)}\n        />\n      );\n      return Item;\n    });\n  }, [\n    items,\n    component,\n    focusedItemIndex,\n    setFocusedItemIndex,\n    AutocompleteSuggestionItem,\n    suggestions?.searchSource.type,\n  ]);\n\n  const ItemsWrapper = useCallback(\n    ({ children }: React.ComponentProps<'div'>) => (\n      <InfiniteScrollPaginator\n        loadNextOnScrollToBottom={suggestions?.searchSource.search}\n        threshold={100}\n      >\n        {children}\n      </InfiniteScrollPaginator>\n    ),\n    [suggestions?.searchSource.search],\n  );\n\n  useEffect(() => {\n    if (!closeOnClickOutside || !suggestions || !container) return;\n    const handleClick = (event: MouseEvent) => {\n      if (container.contains(event.target as Node)) return;\n      textComposer.closeSuggestions();\n    };\n    document.addEventListener('click', handleClick);\n    return () => {\n      document.removeEventListener('click', handleClick);\n    };\n  }, [closeOnClickOutside, suggestions, container, textComposer]);\n\n  useEffect(() => {\n    refs.setFloating(container);\n  }, [container, refs]);\n\n  useLayoutEffect(() => {\n    if (!suggestions || !update) return;\n    const updatePosition = () => {\n      const rect = getTextareaCaretRect(textareaRef.current ?? null, selection?.end);\n      if (!rect) {\n        caretRectRef.current = null;\n        refs.setReference(null);\n        return;\n      }\n      caretRectRef.current = rect;\n      virtualCaretReference.contextElement = textareaRef.current ?? undefined;\n      refs.setReference(virtualCaretReference);\n      update();\n    };\n\n    updatePosition();\n  }, [\n    container,\n    items?.length,\n    refs,\n    selection?.end,\n    suggestions,\n    textareaRef,\n    update,\n    virtualCaretReference,\n  ]);\n\n  if (!suggestions || !items?.length || !component || !hasEnabledCommandSuggestions)\n    return null;\n\n  const suggestionMenuLabel =\n    suggestions.searchSource.type === 'commands'\n      ? t('aria/Command Suggestions')\n      : suggestions.searchSource.type === 'emojis'\n        ? t('aria/Emoji Suggestions')\n        : suggestions.searchSource.type === 'mentions'\n          ? t('aria/User Suggestions')\n          : t('aria/Suggestions');\n\n  return (\n    <div\n      className={clsx('str-chat__suggestion-list-container', containerClassName)}\n      ref={setContainer}\n      style={{\n        left: x ?? 0,\n        position: strategy,\n        top: y ?? 0,\n        visibility: x == null || y == null ? 'hidden' : undefined,\n        zIndex: 1000,\n      }}\n    >\n      <ContextMenuComponent\n        aria-label={suggestionMenuLabel}\n        className={clsx('str-chat__suggestion-list', className)}\n        Header={\n          suggestions.searchSource.type === 'commands' ? CommandsMenuHeader : undefined\n        }\n        items={contextMenuItems}\n        ItemsWrapper={ItemsWrapper}\n        menuClassName={\n          suggestions.searchSource.type === 'commands' ? CommandsMenuClassName : undefined\n        }\n      />\n    </div>\n  );\n};\n","import { useMemo } from 'react';\nimport type { TextComposerState } from 'stream-chat';\nimport { useMessageComposerContext, useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport { useCooldownRemaining } from '../../MessageComposer/hooks/useCooldownRemaining';\nimport { useMessageComposerController } from '../../MessageComposer/hooks/useMessageComposerController';\n\ntype UseTextareaPlaceholderProps = {\n  placeholder?: string;\n};\n\nconst textComposerStateSelector = ({ command }: TextComposerState) => ({ command });\n\nexport const useTextareaPlaceholder = ({\n  placeholder,\n}: UseTextareaPlaceholderProps = {}) => {\n  const { t } = useTranslationContext();\n  const { additionalTextareaProps } = useMessageComposerContext();\n  const cooldownRemaining = useCooldownRemaining();\n  const messageComposer = useMessageComposerController();\n  const { command } = useStateStore(\n    messageComposer.textComposer.state,\n    textComposerStateSelector,\n  );\n\n  const knownArgsTranslations = useMemo<Record<string, string>>(\n    () => ({\n      ban: t('ban-command-args'),\n      giphy: t('giphy-command-args'),\n      mute: t('mute-command-args'),\n      unban: t('unban-command-args'),\n      unmute: t('unmute-command-args'),\n    }),\n    [t],\n  );\n\n  const commandArgs =\n    command?.args && (knownArgsTranslations[command.name ?? ''] ?? t(command.args));\n  const commandPlaceholder =\n    command?.name === 'giphy' ? t('Search GIFs') : (commandArgs ?? undefined);\n\n  const defaultPlaceholder =\n    placeholder ?? additionalTextareaProps?.placeholder ?? t('Send a message');\n\n  if (cooldownRemaining) {\n    return t('Slow mode, wait {{ seconds }}s...', { seconds: cooldownRemaining });\n  }\n\n  return commandPlaceholder ?? defaultPlaceholder;\n};\n","import clsx from 'clsx';\nimport React, {\n  type ChangeEventHandler,\n  type SyntheticEvent,\n  type TextareaHTMLAttributes,\n  type UIEventHandler,\n  useCallback,\n  useEffect,\n  useLayoutEffect,\n  useRef,\n  useState,\n} from 'react';\nimport Textarea from 'react-textarea-autosize';\nimport { useCooldownRemaining } from '../MessageComposer/hooks/useCooldownRemaining';\nimport { useMessageComposerController } from '../MessageComposer/hooks/useMessageComposerController';\nimport type {\n  AttachmentManagerState,\n  MessageComposerConfig,\n  MessageComposerState,\n  SearchSourceState,\n  TextComposerState,\n} from 'stream-chat';\nimport { useComponentContext, useMessageComposerContext } from '../../context';\nimport { useStateStore } from '../../store';\nimport { SuggestionList as DefaultSuggestionList } from './SuggestionList';\nimport { useTextareaPlaceholder } from './hooks/useTextareaPlaceholder';\n\nconst textComposerStateSelector = (state: TextComposerState) => ({\n  selection: state.selection,\n  suggestions: state.suggestions,\n  text: state.text,\n});\n\nconst searchSourceStateSelector = (state: SearchSourceState) => ({\n  isLoadingItems: state.isLoading,\n  items: state.items,\n});\n\nconst configStateSelector = (state: MessageComposerConfig) => ({\n  enabled: state.text.enabled,\n});\n\nconst messageComposerStateSelector = (state: MessageComposerState) => ({\n  quotedMessage: state.quotedMessage,\n});\n\nconst attachmentManagerStateSelector = (state: AttachmentManagerState) => ({\n  attachments: state.attachments,\n});\n\n/**\n * isComposing prevents double submissions in Korean and other languages.\n * starting point for a read:\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing\n * In the long term, the fix should happen by handling keypress, but changing this has unknown implications.\n */\nconst defaultShouldSubmit = (event: React.KeyboardEvent<HTMLTextAreaElement>) =>\n  event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing;\n\nexport const shouldBackspaceExitCommandMode = (text: string) => text.length === 0;\n\nexport type TextareaComposerProps = Omit<\n  TextareaHTMLAttributes<HTMLTextAreaElement>,\n  'style' | 'defaultValue' | 'disabled' | 'value'\n> & {\n  closeSuggestionsOnClickOutside?: boolean;\n  containerClassName?: string;\n  listClassName?: string;\n  maxRows?: number;\n  minRows?: number;\n  shouldSubmit?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => boolean;\n};\n\nexport const TextareaComposer = ({\n  className,\n  closeSuggestionsOnClickOutside,\n  containerClassName,\n  listClassName,\n  maxRows: maxRowsProp,\n  minRows: minRowsProp,\n  onBlur,\n  onChange,\n  onKeyDown,\n  onScroll,\n  onSelect,\n  placeholder: placeholderProp,\n  shouldSubmit: shouldSubmitProp,\n  ...restTextareaProps\n}: TextareaComposerProps) => {\n  const { AutocompleteSuggestionList = DefaultSuggestionList } = useComponentContext();\n  const {\n    additionalTextareaProps,\n    focus,\n    handleSubmit,\n    maxRows: maxRowsContext,\n    minRows: minRowsContext,\n    onPaste,\n    shouldSubmit: shouldSubmitContext,\n    textareaRef,\n  } = useMessageComposerContext();\n  const cooldownRemaining = useCooldownRemaining();\n\n  const placeholder = useTextareaPlaceholder({ placeholder: placeholderProp });\n\n  const maxRows = maxRowsProp ?? maxRowsContext ?? 10;\n  const minRows = minRowsProp ?? minRowsContext;\n\n  const shouldSubmit = shouldSubmitProp ?? shouldSubmitContext ?? defaultShouldSubmit;\n\n  const messageComposer = useMessageComposerController();\n  const { textComposer } = messageComposer;\n  const { selection, suggestions, text } = useStateStore(\n    textComposer.state,\n    textComposerStateSelector,\n  );\n  // react-textarea-autosize can measure placeholder content as multi-line in narrow layouts,\n  // producing an inflated initial height (e.g. 2 rows) before the user types.\n  // Clamp to a single row only while empty unless the integrator explicitly set minRows.\n  const autosizeRows = !text && minRows == null ? 1 : undefined;\n  const textareaStyle = text\n    ? undefined\n    : ({\n        overflow: 'hidden',\n        textOverflow: 'ellipsis',\n        whiteSpace: 'nowrap',\n      } satisfies React.CSSProperties);\n\n  const { enabled } = useStateStore(messageComposer.configState, configStateSelector);\n  const { quotedMessage } = useStateStore(\n    messageComposer.state,\n    messageComposerStateSelector,\n  );\n  const { attachments } = useStateStore(\n    messageComposer.attachmentManager.state,\n    attachmentManagerStateSelector,\n  );\n\n  const { isLoadingItems } =\n    useStateStore(suggestions?.searchSource.state, searchSourceStateSelector) ?? {};\n\n  const containerRef = useRef<HTMLDivElement>(null);\n  const [focusedItemIndex, setFocusedItemIndex] = useState(0);\n\n  const [isComposing, setIsComposing] = useState(false);\n\n  const changeHandler: ChangeEventHandler<HTMLTextAreaElement> = useCallback(\n    (e) => {\n      if (onChange) {\n        onChange(e);\n        return;\n      }\n      if (!textareaRef.current) return;\n      textComposer.handleChange({\n        selection: {\n          end: textareaRef.current.selectionEnd,\n          start: textareaRef.current.selectionStart,\n        },\n        text: e.target.value,\n      });\n    },\n    [onChange, textComposer, textareaRef],\n  );\n\n  const onCompositionEnd = useCallback(() => {\n    setIsComposing(false);\n  }, []);\n\n  const onCompositionStart = useCallback(() => {\n    setIsComposing(true);\n  }, []);\n\n  const keyDownHandler = useCallback(\n    (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n      if (onKeyDown) {\n        onKeyDown(event);\n        return;\n      }\n\n      // use the textarea value directly as the composer state is a step behind\n      const textareaValue = textareaRef.current?.value ?? event.currentTarget.value;\n\n      if (\n        textComposer.suggestions &&\n        textComposer.suggestions.searchSource.items?.length\n      ) {\n        if (event.key === 'Escape') return textComposer.closeSuggestions();\n        const loadedItems = textComposer.suggestions.searchSource.items;\n        if (event.key === 'Enter') {\n          event.preventDefault();\n          textComposer.handleSelect(loadedItems[focusedItemIndex]);\n        }\n        if (event.key === 'ArrowUp') {\n          event.preventDefault();\n          setFocusedItemIndex((prev) => {\n            let nextIndex = prev - 1;\n            if (suggestions?.searchSource.hasNext) {\n              nextIndex = prev;\n            } else if (nextIndex < 0) {\n              nextIndex = loadedItems.length - 1;\n            }\n            return nextIndex;\n          });\n        }\n        if (event.key === 'ArrowDown') {\n          event.preventDefault();\n          setFocusedItemIndex((prev) => {\n            let nextIndex = prev + 1;\n            if (suggestions?.searchSource.hasNext) {\n              nextIndex = prev;\n            } else if (nextIndex >= loadedItems.length) {\n              nextIndex = 0;\n            }\n\n            return nextIndex;\n          });\n        }\n      } else if (\n        textComposer.command &&\n        (event.key === 'Escape' ||\n          (event.key === 'Backspace' && shouldBackspaceExitCommandMode(textareaValue)))\n      ) {\n        event.preventDefault();\n        textComposer.clearCommand();\n      } else if (\n        shouldSubmit(event) &&\n        textareaRef.current &&\n        messageComposer.hasSendableData\n      ) {\n        if (event.key === 'Enter') {\n          // prevent adding newline when submitting a message with\n          event.preventDefault();\n        }\n        handleSubmit();\n      }\n    },\n    [\n      focusedItemIndex,\n      handleSubmit,\n      messageComposer,\n      onKeyDown,\n      shouldSubmit,\n      suggestions,\n      textComposer,\n      textareaRef,\n    ],\n  );\n\n  const scrollHandler: UIEventHandler<HTMLTextAreaElement> = useCallback(\n    (event) => {\n      if (onScroll) {\n        onScroll(event);\n      } else {\n        textComposer.closeSuggestions();\n      }\n    },\n    [onScroll, textComposer],\n  );\n\n  const setSelection = useCallback(\n    (e: SyntheticEvent<HTMLTextAreaElement>) => {\n      onSelect?.(e);\n      textComposer.setSelection({\n        end: (e.target as HTMLTextAreaElement).selectionEnd,\n        start: (e.target as HTMLTextAreaElement).selectionStart,\n      });\n    },\n    [onSelect, textComposer],\n  );\n\n  useEffect(() => {\n    if (textComposer.suggestions) {\n      setFocusedItemIndex(0);\n    }\n  }, [textComposer.suggestions]);\n\n  useEffect(() => {\n    const textareaIsFocused = textareaRef.current?.matches(':focus');\n    if (!textareaRef.current || textareaIsFocused || !focus) return;\n    textareaRef.current.focus();\n  }, [attachments, focus, quotedMessage, textareaRef]);\n\n  useLayoutEffect(() => {\n    /**\n     * It is important to perform set text and after that the range\n     * to prevent cursor reset to the end of the textarea if doing it in separate effects.\n     */\n    const textarea = textareaRef.current;\n    if (!textarea || isComposing) return;\n\n    /**\n     * The textarea value has to be overridden outside the render cycle so that the events like compositionend can be triggered.\n     * If we have overridden the value during the component rendering, the compositionend event would not be triggered, and\n     * it would not be possible to type composed characters (ô).\n     * On the other hand, just removing the value override via prop (value={text}) would not allow us to change the text based on\n     * middleware results (e.g. replace characters with emojis)\n     */\n    if (textarea.value !== text) {\n      textarea.value = text;\n    }\n\n    const length = textarea.value.length;\n    const start = Math.max(0, Math.min(selection.start, length));\n    const end = Math.max(start, Math.min(selection.end, length));\n\n    if (textarea.selectionStart === start && textarea.selectionEnd === end) return;\n\n    textarea.setSelectionRange(start, end, 'forward');\n  }, [text, selection.start, selection.end, isComposing, textareaRef]);\n\n  return (\n    <div\n      className={clsx('rta', 'str-chat__textarea', containerClassName, {\n        ['rta--loading']: isLoadingItems,\n      })}\n      ref={containerRef}\n    >\n      <Textarea\n        {...{ ...additionalTextareaProps, ...restTextareaProps }}\n        aria-label={placeholder}\n        className={clsx(\n          'rta__textarea',\n          'str-chat__textarea__textarea str-chat__message-textarea',\n          className,\n        )}\n        data-testid='message-input'\n        disabled={!enabled || !!cooldownRemaining}\n        maxRows={autosizeRows ?? maxRows}\n        minRows={autosizeRows ?? minRows}\n        onBlur={onBlur}\n        onChange={changeHandler}\n        onCompositionEnd={onCompositionEnd}\n        onCompositionStart={onCompositionStart}\n        onKeyDown={keyDownHandler}\n        onPaste={onPaste}\n        onScroll={scrollHandler}\n        onSelect={setSelection}\n        placeholder={placeholder}\n        ref={(ref) => {\n          textareaRef.current = ref;\n        }}\n        style={textareaStyle}\n      />\n      {/* todo: X document the layout change for the accessibility purpose (tabIndex) */}\n      {!isComposing && (\n        <AutocompleteSuggestionList\n          className={listClassName}\n          closeOnClickOutside={closeSuggestionsOnClickOutside}\n          focusedItemIndex={focusedItemIndex}\n          setFocusedItemIndex={setFocusedItemIndex}\n        />\n      )}\n    </div>\n  );\n};\n","import type { CSSProperties, ElementType, PropsWithChildren } from 'react';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef } from 'react';\nimport { useDropzone } from 'react-dropzone';\nimport clsx from 'clsx';\nimport type { MessageComposerConfig } from 'stream-chat';\n\nimport { useMessageComposerContext, useTranslationContext } from '../../context';\nimport { useAttachmentManagerState, useMessageComposerController } from './hooks';\nimport { useStateStore } from '../../store';\nimport { useIsCooldownActive } from './hooks/useIsCooldownActive';\nimport { IconUpload } from '../Icons';\n\nconst DragAndDropUploadContext = React.createContext<{\n  subscribeToDrop: ((fn: (files: File[]) => void) => () => void) | null;\n}>({\n  subscribeToDrop: null,\n});\n\nexport const useDragAndDropUploadContext = () => useContext(DragAndDropUploadContext);\n\n/**\n * @private This hook should be used only once directly in the `MessageComposerProvider` to\n * register `uploadNewFiles` functions of the rendered message composers. Each `MessageComposer`\n * will then be notified when the drop event occurs from within the `WithDragAndDropUpload`\n * component.\n */\nexport const useRegisterDropHandlers = () => {\n  const { subscribeToDrop } = useDragAndDropUploadContext();\n\n  const messageComposer = useMessageComposerController();\n\n  useEffect(() => {\n    const unsubscribe = subscribeToDrop?.(messageComposer.attachmentManager.uploadFiles);\n\n    return unsubscribe;\n  }, [subscribeToDrop, messageComposer]);\n};\n\nconst attachmentManagerConfigStateSelector = (state: MessageComposerConfig) => ({\n  acceptedFiles: state.attachments.acceptedFiles,\n  multipleUploads: state.attachments.maxNumberOfFilesPerMessage > 1,\n});\n\n/**\n * Wrapper to replace now deprecated `Channel.dragAndDropWindow` option.\n *\n * @example\n * ```tsx\n * <Channel>\n *  <WithDragAndDropUpload component=\"section\" className=\"message-list-dnd-wrapper\">\n *    <Window>\n *      <MessageList />\n *      <MessageComposer />\n *    </Window>\n *  </WithDragAndDropUpload>\n *  <Thread />\n * <Channel>\n * ```\n */\nexport const WithDragAndDropUpload = ({\n  children,\n  className,\n  component: Component = 'div',\n  style,\n}: PropsWithChildren<{\n  acceptedFiles?: string[];\n  /**\n   * @description An element to render as a wrapper onto which drag & drop functionality will be applied.\n   * @default 'div'\n   */\n  component?: ElementType;\n  className?: string;\n  style?: CSSProperties;\n}>) => {\n  const dropHandlersRef = useRef<Set<(f: File[]) => void>>(new Set());\n  const messageComposerContext = useMessageComposerContext();\n  const dragAndDropUploadContext = useDragAndDropUploadContext();\n  const messageComposer = useMessageComposerController();\n  const { isUploadEnabled } = useAttachmentManagerState();\n  const { acceptedFiles, multipleUploads } = useStateStore(\n    messageComposer.configState,\n    attachmentManagerConfigStateSelector,\n  );\n\n  const isCooldownActive = useIsCooldownActive();\n  // if message composer context is available, there's no need to use the queue\n  const isWithinMessageComposerContext = Object.keys(messageComposerContext).length > 0;\n\n  const accept = useMemo(\n    () =>\n      acceptedFiles.reduce<Record<string, Array<string>>>((mediaTypeMap, mediaType) => {\n        mediaTypeMap[mediaType] ??= [];\n        return mediaTypeMap;\n      }, {}),\n    [acceptedFiles],\n  );\n\n  const subscribeToDrop = useCallback((fn: (files: File[]) => void) => {\n    dropHandlersRef.current.add(fn);\n\n    return () => {\n      dropHandlersRef.current.delete(fn);\n    };\n  }, []);\n\n  const handleDrop = useCallback((files: File[]) => {\n    dropHandlersRef.current.forEach((fn) => fn(files));\n  }, []);\n\n  const {\n    getRootProps,\n    isDragActive,\n    isDragReject: isDragRejected,\n  } = useDropzone({\n    accept,\n    // apply `disabled` rules if available, otherwise allow anything and\n    // let the `uploadNewFiles` handle the limitations internally\n    disabled: isWithinMessageComposerContext\n      ? !isUploadEnabled || isCooldownActive\n      : false,\n    multiple: multipleUploads,\n    noClick: true,\n    noKeyboard: true,\n    onDrop: isWithinMessageComposerContext\n      ? messageComposer.attachmentManager.uploadFiles\n      : handleDrop,\n  });\n\n  // nested WithDragAndDropUpload components render wrappers without functionality\n  // (MessageComposerUI has a default WithDragAndDropUpload)\n  if (dragAndDropUploadContext.subscribeToDrop !== null) {\n    return <Component className={className}>{children}</Component>;\n  }\n\n  const rootClassName = clsx('str-chat__dropzone-root', className);\n\n  return (\n    <DragAndDropUploadContext.Provider value={{ subscribeToDrop }}>\n      <Component {...getRootProps({ className: rootClassName, style })}>\n        {isDragActive && (\n          <div\n            className={clsx('str-chat__dropzone-container', {\n              'str-chat__dropzone-container--not-accepted': isDragRejected,\n            })}\n            role='presentation'\n          >\n            <FileDragAndDropContent isDragRejected={isDragRejected} />\n          </div>\n        )}\n        {children}\n      </Component>\n    </DragAndDropUploadContext.Provider>\n  );\n};\n\nexport type FileDragAndDropContentProps = {\n  isDragRejected: boolean;\n};\n\nexport const FileDragAndDropContent = ({\n  isDragRejected,\n}: FileDragAndDropContentProps) => {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__dropzone-container__content'>\n      {isDragRejected ? (\n        <p>{t('Some of the files will not be accepted')}</p>\n      ) : (\n        <>\n          <IconUpload />\n          <p>{t('Drag your files here')}</p>\n        </>\n      )}\n    </div>\n  );\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../context';\n\nexport type StopAIGenerationButtonProps = React.ComponentProps<'button'>;\n\nexport const StopAIGenerationButton = ({\n  onClick,\n  ...restProps\n}: StopAIGenerationButtonProps) => {\n  const { t } = useTranslationContext();\n  return (\n    <button\n      aria-label={t('aria/Stop AI Generation')}\n      className='str-chat__stop-ai-generation-button'\n      data-testid='stop-ai-generation-button'\n      onClick={onClick}\n      {...restProps}\n    />\n  );\n};\n","import React from 'react';\nimport { useMessageComposerHasSendableData } from './hooks';\nimport { useTranslationContext } from '../../context';\nimport { IconSend } from '../Icons';\nimport { Button } from '../Button';\n\nexport type SendButtonProps = {\n  sendMessage: (event: React.BaseSyntheticEvent) => void;\n} & React.ComponentProps<'button'>;\n\nexport const SendButton = ({ children, sendMessage, ...rest }: SendButtonProps) => {\n  const { t } = useTranslationContext();\n  const hasSendableData = useMessageComposerHasSendableData();\n  return (\n    <Button\n      appearance='solid'\n      aria-label={t('aria/Send')}\n      circular\n      className='str-chat__send-button'\n      data-testid='send-button'\n      disabled={!hasSendableData}\n      onClick={sendMessage}\n      size='sm'\n      variant='primary'\n      {...rest}\n    >\n      {children ?? <IconSend />}\n    </Button>\n  );\n};\n","import React, { useCallback } from 'react';\nimport { StopAIGenerationButton as DefaultStopAIGenerationButton } from './StopAIGenerationButton';\nimport { CooldownTimer as DefaultCooldownTimer } from './CooldownTimer';\nimport { SendButton as DefaultSendButton } from './SendButton';\nimport {\n  useChannelStateContext,\n  useComponentContext,\n  useMessageComposerContext,\n} from '../../context';\nimport { AIStates, useAIState } from '../AIStateIndicator';\nimport { useMessageComposerController, useMessageContentIsEmpty } from './hooks';\nimport { AudioRecordingButtonWithNotification } from '../MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification';\nimport { useIsCooldownActive } from './hooks/useIsCooldownActive';\nimport type { MessageComposerState, TextComposerState } from 'stream-chat';\nimport { useStateStore } from '../../store';\nimport { IconCheckmark, IconSend } from '../Icons';\n\nconst messageComposerStateSelector = ({ editedMessage }: MessageComposerState) => ({\n  editedMessage,\n});\n\nconst textComposerStateSelector = ({ command, text }: TextComposerState) => ({\n  command,\n  text,\n});\n\nexport const MessageComposerActions = () => {\n  const { channel } = useChannelStateContext();\n  const { hideSendButton } = useMessageComposerContext();\n  const messageComposer = useMessageComposerController();\n  const {\n    CooldownTimer = DefaultCooldownTimer,\n    SendButton,\n    StopAIGenerationButton: StopAIGenerationButtonOverride,\n  } = useComponentContext();\n\n  const { editedMessage } = useStateStore(\n    messageComposer.state,\n    messageComposerStateSelector,\n  );\n\n  const { command } = useStateStore(\n    messageComposer.textComposer.state,\n    textComposerStateSelector,\n  );\n\n  const contentIsEmpty = useMessageContentIsEmpty();\n  /**\n   * This bit here is needed to make sure that we can get rid of the default behaviour\n   * if need be. Essentially, this allows us to pass StopAIGenerationButton={null} and\n   * completely circumvent the default logic if it's not what we want. We need it as a\n   * prop because there is no other trivial way to override the SendMessage button otherwise.\n   */\n  const StopAIGenerationButton =\n    StopAIGenerationButtonOverride === undefined\n      ? DefaultStopAIGenerationButton\n      : StopAIGenerationButtonOverride;\n\n  const { handleSubmit, recordingController } = useMessageComposerContext();\n  const isCooldownActive = useIsCooldownActive();\n\n  const { aiState } = useAIState(channel);\n  const stopGenerating = useCallback(() => channel?.stopAIResponse(), [channel]);\n  const shouldDisplayStopAIGeneration =\n    [AIStates.Thinking, AIStates.Generating].includes(aiState) &&\n    !!StopAIGenerationButton;\n\n  const recordingEnabled = !!(recordingController.recorder && navigator.mediaDevices); // account for requirement on iOS as per this bug report: https://bugs.webkit.org/show_bug.cgi?id=252303\n\n  let content = SendButton ? (\n    <SendButton sendMessage={handleSubmit} />\n  ) : (\n    <DefaultSendButton sendMessage={handleSubmit}>\n      {editedMessage || command ? <IconCheckmark /> : <IconSend />}\n    </DefaultSendButton>\n  );\n\n  if (shouldDisplayStopAIGeneration) {\n    content = <StopAIGenerationButton onClick={stopGenerating} />;\n  } else if (hideSendButton) return null;\n\n  if (isCooldownActive) {\n    content = <CooldownTimer />;\n  } else if (contentIsEmpty && !editedMessage && !command && recordingEnabled) {\n    content = <AudioRecordingButtonWithNotification />;\n  }\n\n  return <div className='str-chat__message-composer__actions'>{content}</div>;\n};\n\nexport const AdditionalMessageComposerActions = () => {\n  const { EmojiPicker } = useComponentContext();\n  const isCooldownActive = useIsCooldownActive();\n\n  return (\n    <div className='str-chat__message-composer__additional-actions'>\n      {!isCooldownActive && EmojiPicker ? <EmojiPicker /> : null}\n    </div>\n  );\n};\n","import type { LiveLocationPreview, StaticLocationPreview } from 'stream-chat';\nimport type { ComponentType } from 'react';\nimport React from 'react';\nimport { useTranslationContext } from '../../../context';\nimport { IconLocation } from '../../Icons';\nimport { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';\n\ntype GeolocationPreviewImageProps = {\n  location: StaticLocationPreview | LiveLocationPreview;\n};\n\nconst GeolocationPreviewImage = () => (\n  <div className='str-chat__location-preview-image'>\n    <IconLocation />\n  </div>\n);\n\nexport type GeolocationPreviewProps = {\n  location: StaticLocationPreview | LiveLocationPreview;\n  PreviewImage?: ComponentType<GeolocationPreviewImageProps>;\n  remove?: () => void;\n};\n\nexport const GeolocationPreview = ({\n  location,\n  PreviewImage = GeolocationPreviewImage,\n  remove,\n}: GeolocationPreviewProps) => {\n  const { t } = useTranslationContext();\n  const shareDuration = (location as LiveLocationPreview).durationMs;\n  const title = shareDuration ? t('Live location') : t('Current location');\n\n  return (\n    <div className='str-chat__location-preview' data-testid='location-preview'>\n      <PreviewImage location={location} />\n      <div className='str-chat__location-preview__data'>\n        <div\n          className='str-chat__location-preview__data__title'\n          title={t('Shared location')}\n        >\n          {title}\n        </div>\n        <div className='str-chat__location-preview__data__subtitle'>\n          {t('Location: {{ coordinates }}', {\n            coordinates: `${location.latitude}, ${location.longitude}`,\n          })}\n        </div>\n        {shareDuration && (\n          <div className='str-chat__location-preview__data__sharing-duration'>\n            {t('Live for {{duration}}', {\n              duration: t('duration/Share Location', {\n                milliseconds: shareDuration,\n              }),\n            })}\n          </div>\n        )}\n      </div>\n      {remove && (\n        <RemoveAttachmentPreviewButton\n          aria-label={t('aria/Remove location attachment')}\n          className='str-chat__attachment-preview__remove-button'\n          data-testid='location-preview-item-delete-button'\n          onClick={remove}\n        />\n      )}\n    </div>\n  );\n};\n","import React from 'react';\nimport clsx from 'clsx';\n\nimport {\n  AttachmentSelector as DefaultAttachmentSelector,\n  SimpleAttachmentSelector,\n} from './AttachmentSelector/AttachmentSelector';\nimport {\n  AttachmentPreviewList as DefaultAttachmentPreviewList,\n  VoiceRecordingPreviewSlot as DefaultVoiceRecordingPreviewSlot,\n} from './AttachmentPreviewList';\nimport { AudioRecorder as DefaultAudioRecorder } from '../MediaRecorder';\nimport { EditedMessagePreview as DefaultEditedMessagePreview } from './EditedMessagePreview';\nimport { QuotedMessagePreview as DefaultQuotedMessagePreview } from './QuotedMessagePreview';\nimport { LinkPreviewList as DefaultLinkPreviewList } from './LinkPreviewList';\nimport { SendToChannelCheckbox as DefaultSendToChannelCheckbox } from './SendToChannelCheckbox';\nimport { TextareaComposer as DefaultTextareaComposer } from '../TextareaComposer';\nimport { useMessageComposerContext as useMessageComposerContext } from '../../context/MessageComposerContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useMessageContext } from '../../context';\nimport { restorePreEditSnapshot } from './preEditSnapshot';\nimport { WithDragAndDropUpload } from './WithDragAndDropUpload';\nimport {\n  AdditionalMessageComposerActions as DefaultAdditionalMessageComposerActions,\n  MessageComposerActions,\n} from './MessageComposerActions';\nimport { useMessageComposerController } from './hooks';\nimport { useStateStore } from '../../store';\nimport {\n  type AttachmentManagerState,\n  LinkPreviewsManager,\n  type LinkPreviewsManagerState,\n  type LocationComposerState,\n  type MessageComposerState,\n  type TextComposerState,\n} from 'stream-chat';\nimport { CommandChip as DefaultCommandChip } from './CommandChip';\nimport { GeolocationPreview } from './AttachmentPreviewList/GeolocationPreview';\n\nconst messageComposerStateSelector = ({\n  editedMessage,\n  quotedMessage,\n}: MessageComposerState) => ({\n  editedMessage,\n  quotedMessage,\n});\n\nconst attachmentManagerStateSelector = (state: AttachmentManagerState) => ({\n  attachments: state.attachments,\n});\n\nconst linkPreviewsManagerStateSelector = (state: LinkPreviewsManagerState) => ({\n  linkPreviews: Array.from(state.previews.values()).filter(\n    (preview) =>\n      LinkPreviewsManager.previewIsLoaded(preview) ||\n      LinkPreviewsManager.previewIsLoading(preview),\n  ),\n});\n\nconst locationComposerStateSelector = (state: LocationComposerState) => ({\n  location: state.location,\n});\n\nconst textComposerCommandSelector = ({ command }: TextComposerState) => ({ command });\n\nconst MessageComposerPreviews = () => {\n  const {\n    AttachmentPreviewList = DefaultAttachmentPreviewList,\n    EditedMessagePreview = DefaultEditedMessagePreview,\n    LinkPreviewList = DefaultLinkPreviewList,\n    QuotedMessagePreview = DefaultQuotedMessagePreview,\n    VoiceRecordingPreviewSlot = DefaultVoiceRecordingPreviewSlot,\n  } = useComponentContext();\n\n  const messageComposer = useMessageComposerController();\n  const { editedMessage, quotedMessage } = useStateStore(\n    messageComposer.state,\n    messageComposerStateSelector,\n  );\n\n  const { attachments } = useStateStore(\n    messageComposer.attachmentManager.state,\n    attachmentManagerStateSelector,\n  );\n\n  const { location } = useStateStore(\n    messageComposer.locationComposer.state,\n    locationComposerStateSelector,\n  );\n\n  const { linkPreviewsManager } = messageComposer;\n  const { linkPreviews } = useStateStore(\n    linkPreviewsManager.state,\n    linkPreviewsManagerStateSelector,\n  );\n\n  if (\n    !quotedMessage &&\n    attachments.length === 0 &&\n    linkPreviews.length === 0 &&\n    !location &&\n    !editedMessage\n  )\n    return null;\n\n  // todo: pass the entity arrays from here so that the preview lists do not have to subscribe to the composer state changes too?\n  return (\n    <div className='str-chat__message-composer-previews'>\n      {editedMessage ? (\n        <div className='str-chat__message-composer-previews'>\n          <EditedMessagePreview\n            message={editedMessage}\n            onCancel={() => {\n              restorePreEditSnapshot(messageComposer);\n            }}\n          />\n        </div>\n      ) : (\n        <QuotedMessagePreview />\n      )}\n      <VoiceRecordingPreviewSlot />\n      <AttachmentPreviewList />\n      <LinkPreviewList />\n      {location && (\n        <GeolocationPreview\n          location={location}\n          // It is not possible to nullify shared_location field so we do not show a preview when editing\n          // to prevent a user from wanting to remove the location\n          remove={\n            messageComposer.editedMessage\n              ? undefined\n              : messageComposer.locationComposer.initState\n          }\n        />\n      )}\n    </div>\n  );\n};\n\nexport const MessageComposerUI = () => {\n  const { message } = useMessageContext();\n  const { recordingController } = useMessageComposerContext();\n  const messageComposerController = useMessageComposerController();\n  const { command } = useStateStore(\n    messageComposerController.textComposer.state,\n    textComposerCommandSelector,\n  );\n\n  const {\n    AdditionalMessageComposerActions = DefaultAdditionalMessageComposerActions,\n    AttachmentSelector = message ? SimpleAttachmentSelector : DefaultAttachmentSelector,\n    AudioRecorder = DefaultAudioRecorder,\n    CommandChip = DefaultCommandChip,\n    SendToChannelCheckbox = DefaultSendToChannelCheckbox,\n    TextareaComposer = DefaultTextareaComposer,\n  } = useComponentContext();\n\n  return (\n    <WithDragAndDropUpload\n      className='str-chat__message-composer-container'\n      component='div'\n    >\n      <div\n        className={clsx('str-chat__message-composer', {\n          'str-chat__message-composer--command-active': !!command,\n        })}\n      >\n        {recordingController.recordingState ? (\n          <AudioRecorder />\n        ) : (\n          <>\n            <AttachmentSelector />\n            <div className='str-chat__message-composer-compose-area'>\n              <MessageComposerPreviews />\n              <div className='str-chat__message-composer-controls'>\n                <div className='str-chat__message-composer-controls__text-composition-controls'>\n                  <div className='str-chat__message-composer-controls__text-composition-controls__text'>\n                    {command && (\n                      <div className='str-chat__message-composer-controls__text-composition-controls__command-chip-container'>\n                        <CommandChip command={command} />\n                      </div>\n                    )}\n                    <TextareaComposer />\n                  </div>\n                  <SendToChannelCheckbox />\n                </div>\n                <AdditionalMessageComposerActions />\n                <MessageComposerActions />\n              </div>\n            </div>\n          </>\n        )}\n      </div>\n    </WithDragAndDropUpload>\n  );\n};\n","import { useMemo } from 'react';\n\nimport type { MessageComposerContextValue } from '../../../context/MessageComposerContext';\n\nexport const useCreateMessageComposerContext = (value: MessageComposerContextValue) => {\n  const {\n    additionalTextareaProps,\n    asyncMessagesMultiSendEnabled,\n    audioRecordingEnabled,\n    emojiSearchIndex,\n    focus,\n    handleSubmit,\n    hideSendButton,\n    maxRows,\n    minRows,\n    onPaste,\n    parent,\n    recordingController,\n    shouldSubmit,\n    textareaRef,\n  } = value;\n\n  const parentId = parent?.id;\n\n  const messageComposerContext: MessageComposerContextValue = useMemo(\n    () => ({\n      additionalTextareaProps,\n      asyncMessagesMultiSendEnabled,\n      audioRecordingEnabled,\n      emojiSearchIndex,\n      focus,\n      handleSubmit,\n      hideSendButton,\n      maxRows,\n      minRows,\n      onPaste,\n      parent,\n      recordingController,\n      shouldSubmit,\n      textareaRef,\n    }),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      asyncMessagesMultiSendEnabled,\n      audioRecordingEnabled,\n      emojiSearchIndex,\n      handleSubmit,\n      hideSendButton,\n      minRows,\n      parentId,\n      recordingController,\n    ],\n  );\n\n  return messageComposerContext;\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useEffect } from 'react';\n\nimport { MessageComposerUI as DefaultMessageComposerUI } from './MessageComposerUI';\nimport { useMessageComposerController } from './hooks';\nimport { useCreateMessageComposerContext } from './hooks/useCreateMessageComposerContext';\nimport { useMessageComposerBindings } from './hooks/useMessageComposerBindings';\nimport type { ComponentContextValue } from '../../context/ComponentContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { MessageComposerContextProvider } from '../../context/MessageComposerContext';\nimport { DialogManagerProvider } from '../../context';\nimport { useStableId } from '../UtilityComponents/useStableId';\n\nimport type { LocalMessage, Message, SendMessageOptions } from 'stream-chat';\n\nimport type { CustomAudioRecordingConfig } from '../MediaRecorder';\nimport { useRegisterDropHandlers } from './WithDragAndDropUpload';\n\nexport type EmojiSearchIndexResult = {\n  id: string;\n  name: string;\n  skins: Array<{ native: string }>;\n  emoticons?: Array<string>;\n  native?: string;\n};\n\nexport interface EmojiSearchIndex {\n  search: (\n    query: string,\n  ) => PromiseLike<Array<EmojiSearchIndexResult>> | Array<EmojiSearchIndexResult> | null;\n}\n\nexport type MessageComposerProps = {\n  /**\n   * Additional props to be passed to the underlying `AutoCompleteTextarea` component.\n   * Default value is handled via MessageComposer.\n   * [Available props](https://www.npmjs.com/package/react-textarea-autosize)\n   */\n  additionalTextareaProps?: Omit<\n    React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n    'defaultValue' | 'style' | 'disabled' | 'value'\n  >;\n  /**\n   * When enabled, recorded messages won’t be sent immediately.\n   * Instead, they will “stack up” with other attachments in the message composer allowing the user to send multiple attachments as part of the same message.\n   */\n  asyncMessagesMultiSendEnabled?: boolean;\n  /** Allows to configure the audio recording parameters for voice messages. */\n  audioRecordingConfig?: CustomAudioRecordingConfig;\n  /** Controls whether the users will be provided with the UI to record voice messages. */\n  audioRecordingEnabled?: boolean;\n  /** Mechanism to be used with autocomplete and text replace features of the `MessageComposer` component, see [emoji-mart `SearchIndex`](https://github.com/missive/emoji-mart#%EF%B8%8F%EF%B8%8F-headless-search) */\n  emojiSearchIndex?: ComponentContextValue['emojiSearchIndex'];\n  /** If true, focuses the text input on component mount */\n  focus?: boolean;\n  // todo: what sense does hideSendButton prop make, when we have message composer actions (recording, send msg). Can we remove it?\n  // /** Allows to hide MessageComposer's send button. */\n  hideSendButton?: boolean;\n  /** Max number of rows the underlying `textarea` component is allowed to grow */\n  maxRows?: number;\n  /** Min number of rows the underlying `textarea` will start with. The `grow` on MessageComposer prop has to be enabled for `minRows` to take effect. */\n  minRows?: number;\n  /** Function to override the default message sending process. Not message updating process. */\n  overrideSubmitHandler?: (params: {\n    cid: string;\n    localMessage: LocalMessage;\n    message: Message;\n    sendOptions: SendMessageOptions;\n  }) => Promise<void> | void;\n  /** When replying in a thread, the parent message object */\n  parent?: LocalMessage;\n  /**\n   * Currently, `Enter` is the default submission key and  `Shift`+`Enter` is the default combination for the new line.\n   * If specified, this function overrides the default behavior specified previously.\n   *\n   * Example of default behavior:\n   * ```tsx\n   * const defaultShouldSubmit = (event) => event.key === \"Enter\" && !event.shiftKey;\n   * ```\n   */\n  shouldSubmit?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => boolean;\n};\n\nconst MessageComposerProvider = (props: PropsWithChildren<MessageComposerProps>) => {\n  const messageComposerBindings = useMessageComposerBindings(props);\n  const { emojiSearchIndex } = useComponentContext('MessageComposer');\n\n  const messageComposerContextValue = useCreateMessageComposerContext({\n    ...messageComposerBindings,\n    ...props,\n    emojiSearchIndex: props.emojiSearchIndex ?? emojiSearchIndex,\n  });\n\n  const messageComposer = useMessageComposerController();\n\n  useEffect(\n    () => () => {\n      messageComposer.createDraft().finally(() => messageComposer.clear());\n    },\n    [messageComposer],\n  );\n\n  useEffect(() => {\n    const threadId = messageComposer.threadId;\n    if (\n      !threadId ||\n      !messageComposer.channel ||\n      !messageComposer.contentIsEmpty ||\n      !messageComposer.config.drafts.enabled\n    )\n      return;\n    // get draft data for legacy thead composer\n    messageComposer.channel\n      .getDraft({ parent_id: threadId })\n      .then(({ draft }) => {\n        if (draft) {\n          messageComposer.initState({ composition: draft });\n        }\n      })\n      .catch(console.error);\n  }, [messageComposer]);\n\n  useRegisterDropHandlers();\n\n  return (\n    <MessageComposerContextProvider value={messageComposerContextValue}>\n      {props.children}\n    </MessageComposerContextProvider>\n  );\n};\n\nconst UnMemoizedMessageComposer = (props: MessageComposerProps) => {\n  const { MessageComposerUI = DefaultMessageComposerUI } =\n    useComponentContext('MessageComposer');\n  const messageComposer = useMessageComposerController();\n  const id = useStableId();\n\n  const dialogManagerId = messageComposer.threadId\n    ? `message-input-dialog-manager-thread-${id}`\n    : `message-input-dialog-manager-${id}`;\n\n  return (\n    <DialogManagerProvider id={dialogManagerId}>\n      <MessageComposerProvider {...props}>\n        <MessageComposerUI />\n      </MessageComposerProvider>\n    </DialogManagerProvider>\n  );\n};\n\n/**\n * A high level component that has provides all functionality to the Input it renders.\n */\nexport const MessageComposer = React.memo(\n  UnMemoizedMessageComposer,\n) as typeof UnMemoizedMessageComposer;\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 = (channel: Channel): 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  const currentUserId = channel.getClient().userID ?? undefined;\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): 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 currentUserId = channel.getClient().userID ?? undefined;\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 ? computeChannelDisplayName(channel, directMessageLabel) : undefined,\n  );\n\n  useEffect(() => {\n    if (!channel) {\n      setDisplayName(undefined);\n      return;\n    }\n    const updateDisplayName = () =>\n      setDisplayName(computeChannelDisplayName(channel, directMessageLabel));\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 ? (overrideImage ?? getChannelDisplayImage(channel)) : 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));\n      setGroupChannelDisplayInfo(getGroupChannelDisplayInfo(channel) ?? emptyGroupInfo);\n    };\n\n    updateInfo();\n    client.on('user.updated', updateInfo);\n    return () => {\n      client.off('user.updated', updateInfo);\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 React from 'react';\n\n/** Three dots for typing indicator; fill and opacity animation come from TypingIndicator.scss (--chat-text-typing-indicator). */\nexport const TypingIndicatorDots = () => (\n  <svg\n    aria-hidden\n    fill='none'\n    height='5'\n    viewBox='0 0 23 5'\n    width='23'\n    xmlns='http://www.w3.org/2000/svg'\n  >\n    <circle cx='2.5' cy='2.5' r='2.5' />\n    <circle cx='11.5' cy='2.5' r='2.5' />\n    <circle cx='20.5' cy='2.5' r='2.5' />\n  </svg>\n);\n","import { useEffect, useMemo, useRef, useState } from 'react';\n\nconst DEFAULT_HIDE_DELAY_MS = 2000;\n\nexport type TypingEntry = {\n  user?: { id?: string; name?: string; image?: string };\n  parent_id?: string;\n};\n\n/**\n * Derive a stable key from typing users so that the effect only runs when the\n * actual set of users (by id) changes, not on every render due to new array\n * references.\n *\n * Important: callers must pass entries where `user` is an object with an `id`\n * field (not a plain string). If `user?.id` is undefined for every entry the\n * key degenerates to an empty string, the memo returns a new array each time\n * it is \"invalidated\" by React, and `setDisplayUsers` in the effect below will\n * loop infinitely because it always receives a fresh reference.\n */\nconst useStableTypingUsers = (typingUsers: readonly TypingEntry[]) => {\n  const key = typingUsers\n    .map((entry) => entry.user?.id ?? '')\n    .sort()\n    .join(',');\n\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  return useMemo(() => [...typingUsers], [key]);\n};\n\n/**\n * Debounces hiding the typing indicator: when typing users go to zero, keep showing for delayMs\n * to avoid flicker when typing stops and starts again quickly. Returns the list to display\n * (current typers or last non-empty list during the debounce period). Show the indicator\n * when displayUsers.length > 0.\n */\nexport function useDebouncedTypingActive(\n  typingUsers: readonly TypingEntry[],\n  delayMs: number = DEFAULT_HIDE_DELAY_MS,\n): { displayUsers: TypingEntry[] } {\n  const stableTypingUsers = useStableTypingUsers(typingUsers);\n  const [displayUsers, setDisplayUsers] = useState<TypingEntry[]>([]);\n  const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n  const hadTypersRef = useRef(false);\n\n  useEffect(() => {\n    if (stableTypingUsers.length > 0) {\n      if (timerRef.current) {\n        clearTimeout(timerRef.current);\n        timerRef.current = null;\n      }\n      hadTypersRef.current = true;\n      setDisplayUsers(stableTypingUsers);\n      return;\n    }\n\n    if (stableTypingUsers.length === 0 && hadTypersRef.current && !timerRef.current) {\n      timerRef.current = setTimeout(() => {\n        timerRef.current = null;\n        hadTypersRef.current = false;\n        setDisplayUsers([]);\n      }, delayMs);\n    }\n  }, [stableTypingUsers, delayMs]);\n\n  useEffect(\n    () => () => {\n      if (timerRef.current) clearTimeout(timerRef.current);\n    },\n    [],\n  );\n\n  return { displayUsers };\n}\n","import type { TypingEntry } from '../hooks/useDebouncedTypingActive';\n\ntype TranslationFunction = (\n  key: string,\n  options?: Record<string, number | string>,\n) => string;\n\n/**\n * Build a localized typing-status message for screen-reader and inline indicator text.\n */\nexport const getTypingStatusMessage = (\n  displayUsers: readonly TypingEntry[],\n  t: TranslationFunction,\n) => {\n  const namedUsers = displayUsers\n    .map(({ user }) => user?.name?.trim() || user?.id || '')\n    .filter(Boolean);\n  const count = displayUsers.length;\n\n  if (count === 1 && namedUsers.length === 1) {\n    return t('{{ typing }} is typing', { typing: namedUsers[0] });\n  }\n\n  if (count === 2 && namedUsers.length === 2) {\n    return t('{{ typing }} are typing', {\n      typing: `${namedUsers[0]} and ${namedUsers[1]}`,\n    });\n  }\n\n  return t('{{ count }} people are typing', { count });\n};\n","import React from 'react';\nimport clsx from 'clsx';\n\nimport { TypingIndicatorDots } from './TypingIndicatorDots';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useTypingContext } from '../../context/TypingContext';\nimport { useThreadContext } from '../Threads';\n\nimport { useDebouncedTypingActive } from './hooks/useDebouncedTypingActive';\nimport { getTypingStatusMessage } from './utils/getTypingStatusMessage';\n\nexport type TypingIndicatorHeaderProps = {\n  /** When true, show typing in the current thread only; when false, show typing in the channel. */\n  threadList?: boolean;\n};\n\n/**\n * Inline typing indicator for ChannelHeader or ThreadHeader: text (1/2/3+ people) followed by animated dots.\n * Only shows other participants; respects channelConfig.typing_events.\n */\nexport const TypingIndicatorHeader = (props: TypingIndicatorHeaderProps) => {\n  const { threadList = false } = props;\n\n  const { t } = useTranslationContext();\n  const { channelConfig, thread } = useChannelStateContext('TypingIndicatorHeader');\n  const threadInstance = useThreadContext();\n  const parentId = threadInstance?.id ?? thread?.id;\n  const { client } = useChatContext('TypingIndicatorHeader');\n  const { typing = {} } = useTypingContext('TypingIndicatorHeader');\n\n  const typingInChannel = !threadList\n    ? Object.values(typing).filter(\n        ({ parent_id, user }) => user?.id !== client.user?.id && !parent_id,\n      )\n    : [];\n\n  const typingInThread = threadList\n    ? Object.values(typing).filter(\n        ({ parent_id, user }) => user?.id !== client.user?.id && parent_id === parentId,\n      )\n    : [];\n\n  const typingUsers = threadList ? typingInThread : typingInChannel;\n  const { displayUsers } = useDebouncedTypingActive(typingUsers);\n  const label = getTypingStatusMessage(displayUsers, t);\n\n  if (channelConfig?.typing_events === false || displayUsers.length === 0) {\n    return null;\n  }\n\n  return (\n    <span\n      className={clsx('str-chat__typing-indicator-header', {\n        'str-chat__typing-indicator-header--thread': threadList,\n      })}\n      data-testid='typing-indicator-header'\n    >\n      <span className='str-chat__typing-indicator-header__text'>{label}</span>\n      <span className='str-chat__typing-indicator__dots str-chat__typing-indicator-header__dots'>\n        <TypingIndicatorDots />\n      </span>\n    </span>\n  );\n};\n","import React from 'react';\n\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useStateStore } from '../../store';\nimport { useChannelPreviewInfo } from '../ChannelListItem/hooks/useChannelPreviewInfo';\nimport { TypingIndicatorHeader } from '../TypingIndicator/TypingIndicatorHeader';\nimport { useThreadContext } from '../Threads';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useTypingContext } from '../../context/TypingContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ThreadState } from 'stream-chat';\nimport { Button } from '../Button';\nimport { IconXmark } from '../Icons';\nimport { useChatViewContext } from '../ChatView';\n\nconst threadStateSelector = ({ replyCount }: ThreadState) => ({ replyCount });\n\n/** Fallback when channel has no display title: parent message author (name only). */\nconst displayNameFromParentMessage = (message: LocalMessage): string | undefined =>\n  message.user?.name ?? undefined;\n\n/** Subtitle: replyCount, threadDisplayName, defaultSubtitle (name · reply count), and when typing also TypingIndicatorHeader. */\nconst ThreadHeaderSubtitle = ({\n  replyCount,\n  threadDisplayName,\n  threadList,\n}: {\n  replyCount: number | undefined;\n  threadDisplayName: string | undefined;\n  threadList: boolean;\n}) => {\n  const { t } = useTranslationContext();\n  const { channelConfig, thread } = useChannelStateContext('ThreadHeaderSubtitle');\n  const threadInstance = useThreadContext();\n  const parentId = threadInstance?.id ?? thread?.id;\n  const { client } = useChatContext('ThreadHeaderSubtitle');\n  const { typing = {} } = useTypingContext('ThreadHeaderSubtitle');\n  const typingInThread = Object.values(typing).filter(\n    ({ parent_id, user }) => user?.id !== client.user?.id && parent_id === parentId,\n  );\n  const hasTyping = channelConfig?.typing_events !== false && typingInThread.length > 0;\n  const replyCountText = t('replyCount', { count: replyCount ?? 0 });\n  const defaultSubtitle = threadDisplayName\n    ? `${threadDisplayName} · ${replyCountText}`\n    : replyCountText;\n  return (\n    <div className='str-chat__thread-header-subtitle'>\n      <span\n        className='str-chat__subtitle-content-transition'\n        key={hasTyping ? 'typing' : 'default'}\n      >\n        {hasTyping ? (\n          <TypingIndicatorHeader threadList={threadList} />\n        ) : (\n          <>{defaultSubtitle}</>\n        )}\n      </span>\n    </div>\n  );\n};\n\nexport type ThreadHeaderProps = {\n  /** Callback for closing the thread */\n  closeThread: (event?: React.BaseSyntheticEvent) => void;\n  /** The thread parent message */\n  thread: LocalMessage;\n  /** Override the thread display title */\n  overrideTitle?: string;\n};\n\nexport const ThreadHeader = (props: ThreadHeaderProps) => {\n  const { closeThread, overrideTitle, thread } = props;\n\n  const { t } = useTranslationContext();\n  const { channel } = useChannelStateContext();\n  const { HeaderStartContent } = useComponentContext();\n  const { activeChatView } = useChatViewContext();\n  const { displayTitle: channelDisplayTitle } = useChannelPreviewInfo({ channel });\n\n  const threadInstance = useThreadContext();\n  const { replyCount: replyCountThreadInstance } =\n    useStateStore(threadInstance?.state, threadStateSelector) ?? {};\n\n  const replyCount = threadInstance\n    ? replyCountThreadInstance\n    : thread\n      ? (thread.reply_count ?? 0)\n      : 0;\n\n  // Subtitle: channel display title (from parent or hook), with override and fallback to parent message author\n  const threadDisplayName =\n    overrideTitle ??\n    channelDisplayTitle ??\n    displayNameFromParentMessage(thread) ??\n    undefined;\n\n  return (\n    <div className='str-chat__thread-header'>\n      <div className='str-chat__thread-header__start'>\n        {activeChatView === 'threads' && HeaderStartContent && <HeaderStartContent />}\n      </div>\n      <div className='str-chat__thread-header-details'>\n        <div className='str-chat__thread-header-title'>{t('Thread')}</div>\n        <ThreadHeaderSubtitle\n          replyCount={replyCount}\n          threadDisplayName={threadDisplayName}\n          threadList\n        />\n      </div>\n      {!threadInstance && (\n        <div className='str-chat__thread-header__end'>\n          <Button\n            appearance='ghost'\n            aria-label={t('aria/Close thread')}\n            circular\n            className='str-chat__close-thread-button'\n            data-testid='close-thread-button'\n            onClick={closeThread}\n            size='md'\n            variant='secondary'\n          >\n            <IconXmark />\n          </Button>\n        </div>\n      )}\n    </div>\n  );\n};\n","import React from 'react';\n\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useThreadContext } from '../Threads';\nimport { useStateStore } from '../../store';\nimport type { ThreadState } from 'stream-chat';\n\nconst threadStateSelector = ({ replyCount }: ThreadState) => ({\n  replyCount,\n});\n\nexport const ThreadStart = () => {\n  const { thread } = useChannelStateContext('ThreadStart');\n  const { t } = useTranslationContext('ThreadStart');\n  const threadInstance = useThreadContext();\n  const { replyCount: replyCountThreadInstance } =\n    useStateStore(threadInstance?.state, threadStateSelector) ?? {};\n\n  const replyCount = threadInstance\n    ? replyCountThreadInstance\n    : thread\n      ? (thread.reply_count ?? 0)\n      : 0;\n\n  if (!replyCount) return null;\n\n  return (\n    <div className='str-chat__thread-start'>{t('replyCount', { count: replyCount })}</div>\n  );\n};\n","import clsx from 'clsx';\nimport React from 'react';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { getDateString } from '../../i18n/utils';\n\nimport type { TimestampFormatterOptions } from '../../i18n/types';\n\nexport type DateSeparatorProps = TimestampFormatterOptions & {\n  /** Optional className for the root element */\n  className?: string;\n  /** The date to format */\n  date: Date;\n  /** When true, applies floating positioning (fixed at top when scrolling) */\n  floating?: boolean;\n  /** Override the default formatting of the date. This is a function that has access to the original date object. */\n  formatDate?: (date: Date) => string;\n  // todo: position and unread are not necessary anymore\n  /** Set the position of the date in the separator, options are 'left', 'center', 'right', @default right */\n  position?: 'left' | 'center' | 'right';\n  /** If following messages are not new */\n  unread?: boolean;\n};\n\nconst UnMemoizedDateSeparator = (props: DateSeparatorProps) => {\n  const {\n    calendar,\n    className,\n    date: messageCreatedAt,\n    floating,\n    formatDate,\n    ...restTimestampFormatterOptions\n  } = props;\n\n  const { t, tDateTimeParser } = useTranslationContext('DateSeparator');\n\n  const formattedDate = getDateString({\n    calendar,\n    ...restTimestampFormatterOptions,\n    formatDate,\n    messageCreatedAt,\n    t,\n    tDateTimeParser,\n    timestampTranslationKey: 'timestamp/DateSeparator',\n  });\n\n  return (\n    <div\n      className={clsx(\n        'str-chat__date-separator',\n        { 'str-chat__date-separator--floating': floating },\n        className,\n      )}\n      data-date={messageCreatedAt.toISOString()}\n      data-testid={floating ? 'floating-date-separator' : 'date-separator'}\n    >\n      <div className='str-chat__date-separator-date'>{formattedDate}</div>\n    </div>\n  );\n};\n\n/**\n * A simple date separator between messages.\n */\nexport const DateSeparator = React.memo(\n  UnMemoizedDateSeparator,\n) as typeof UnMemoizedDateSeparator;\n","import React from 'react';\n\nimport type { MessageProps } from '../Message';\nimport { Message } from '../Message';\nimport { ThreadStart as DefaultThreadStart } from './ThreadStart';\n\nimport { useComponentContext } from '../../context';\nimport { DateSeparator } from '../DateSeparator';\n\nexport const ThreadHead = (props: MessageProps) => {\n  const { ThreadStart = DefaultThreadStart } = useComponentContext('ThreadHead');\n  return (\n    <div className='str-chat__parent-message-li'>\n      <DateSeparator date={props.message.created_at} />\n      <Message initialMessage threadList {...props} />\n      <ThreadStart />\n    </div>\n  );\n};\n","import React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { LegacyThreadContext } from './LegacyThreadContext';\nimport { MESSAGE_ACTIONS } from '../Message';\nimport type { MessageComposerProps } from '../MessageComposer';\nimport { MessageComposer } from '../MessageComposer';\nimport type { MessageListProps, VirtualizedMessageListProps } from '../MessageList';\nimport { MessageList, VirtualizedMessageList } from '../MessageList';\nimport { ThreadHeader as DefaultThreadHeader } from './ThreadHeader';\nimport { ThreadHead as DefaultThreadHead } from '../Thread/ThreadHead';\n\nimport {\n  useChannelActionContext,\n  useChannelStateContext,\n  useChatContext,\n  useComponentContext,\n} from '../../context';\nimport { useThreadContext } from '../Threads';\nimport { useStateStore } from '../../store';\n\nimport type { MessageProps, MessageUIComponentProps } from '../Message/types';\nimport type { MessageActionsArray } from '../Message/utils';\nimport type { ThreadState } from 'stream-chat';\n\nexport type ThreadProps = {\n  /** Additional props for `MessageComposer` component: [available props](https://getstream.io/chat/docs/sdk/react/message-composer-components/message_composer/#props) */\n  additionalMessageComposerProps?: MessageComposerProps;\n  /** Additional props for `MessageList` component: [available props](https://getstream.io/chat/docs/sdk/react/core-components/message_list/#props) */\n  additionalMessageListProps?: MessageListProps;\n  /** Additional props for `Message` component of the parent message: [available props](https://getstream.io/chat/docs/sdk/react/message-components/message/#props) */\n  additionalParentMessageProps?: Partial<MessageProps>;\n  /** Additional props for `VirtualizedMessageList` component: [available props](https://getstream.io/chat/docs/sdk/react/core-components/virtualized_list/#props) */\n  additionalVirtualizedMessageListProps?: VirtualizedMessageListProps;\n  /** If true, focuses the `MessageComposer` component on opening a thread */\n  autoFocus?: boolean;\n  /** Injects date separator components into `Thread`, defaults to `false`. To be passed to the underlying `MessageList` or `VirtualizedMessageList` components */\n  enableDateSeparator?: boolean;\n  /** Custom thread message UI component used to override the default `Message` value stored in `ComponentContext` */\n  Message?: React.ComponentType<MessageUIComponentProps>;\n  /** Array of allowed message actions (ex: ['edit', 'delete', 'flag', 'mute', 'pin', 'quote', 'react', 'reply']). To disable all actions, provide an empty array. */\n  messageActions?: MessageActionsArray;\n  /** If true, render the `VirtualizedMessageList` instead of the standard `MessageList` component */\n  virtualized?: boolean;\n};\n\n/**\n * The Thread component renders a parent Message with a list of replies\n */\nexport const Thread = (props: ThreadProps) => {\n  const { channel, channelConfig, thread } = useChannelStateContext('Thread');\n  const threadInstance = useThreadContext();\n\n  if (!thread && !threadInstance) return null;\n  if (channelConfig?.replies === false) return null;\n\n  // the wrapper ensures a key variable is set and the component recreates on thread switch\n  return (\n    // FIXME: TS is having trouble here as at least one of the two would always be defined\n    <ThreadInner\n      {...props}\n      key={`thread-${(thread ?? threadInstance)?.id}-${channel?.cid}`}\n    />\n  );\n};\n\nconst selector = (nextValue: ThreadState) => ({\n  isLoadingNext: nextValue.pagination.isLoadingNext,\n  isLoadingPrev: nextValue.pagination.isLoadingPrev,\n  parentMessage: nextValue.parentMessage,\n  replies: nextValue.replies,\n});\n\nconst ThreadInner = (props: ThreadProps & { key: string }) => {\n  const {\n    additionalMessageComposerProps,\n    additionalMessageListProps,\n    additionalParentMessageProps,\n    additionalVirtualizedMessageListProps,\n    autoFocus = true,\n    enableDateSeparator = false,\n    Message: PropMessage,\n    messageActions = Object.keys(MESSAGE_ACTIONS),\n    virtualized,\n  } = props;\n  const threadInstance = useThreadContext();\n\n  const {\n    thread,\n    threadHasMore,\n    threadLoadingMore,\n    threadMessages = [],\n    threadSuppressAutoscroll,\n  } = useChannelStateContext('Thread');\n  const { closeThread, loadMoreThread } = useChannelActionContext('Thread');\n  const { customClasses } = useChatContext('Thread');\n  const {\n    Message: ContextMessage,\n    ThreadHead = DefaultThreadHead,\n    ThreadHeader = DefaultThreadHeader,\n    VirtualMessage,\n  } = useComponentContext('Thread');\n\n  const { isLoadingNext, isLoadingPrev, parentMessage, replies } =\n    useStateStore(threadInstance?.state, selector) ?? {};\n\n  const ThreadMessage = PropMessage || additionalMessageListProps?.Message;\n  const FallbackMessage = virtualized && VirtualMessage ? VirtualMessage : ContextMessage;\n  const MessageUIComponent = ThreadMessage || FallbackMessage;\n\n  const ThreadMessageList = virtualized ? VirtualizedMessageList : MessageList;\n\n  useEffect(() => {\n    if (threadInstance) return;\n\n    if ((thread?.reply_count ?? 0) > 0) {\n      // FIXME: integrators can customize channel query options but cannot customize channel.getReplies() options\n      loadMoreThread();\n    }\n  }, [thread, loadMoreThread, threadInstance]);\n\n  const threadProps: Pick<\n    VirtualizedMessageListProps,\n    | 'hasMoreNewer'\n    | 'loadMoreNewer'\n    | 'loadingMoreNewer'\n    | 'hasMore'\n    | 'loadMore'\n    | 'loadingMore'\n    | 'messages'\n  > = threadInstance\n    ? {\n        loadingMore: isLoadingPrev,\n        loadingMoreNewer: isLoadingNext,\n        loadMore: threadInstance.loadPrevPage,\n        loadMoreNewer: threadInstance.loadNextPage,\n        messages: replies,\n      }\n    : {\n        hasMore: threadHasMore,\n        loadingMore: threadLoadingMore,\n        loadMore: loadMoreThread,\n        messages: threadMessages,\n      };\n\n  const messageAsThread = thread ?? parentMessage;\n\n  if (!messageAsThread) return null;\n\n  const threadClass =\n    customClasses?.thread ||\n    clsx('str-chat__thread-container str-chat__thread', {\n      'str-chat__thread--virtualized': virtualized,\n    });\n\n  const head = (\n    <ThreadHead\n      key={messageAsThread.id}\n      message={messageAsThread}\n      Message={MessageUIComponent}\n      {...additionalParentMessageProps}\n    />\n  );\n\n  return (\n    // Thread component needs a context which we can use for message composer\n    <LegacyThreadContext.Provider\n      value={{\n        legacyThread: thread ?? undefined,\n      }}\n    >\n      <div className={threadClass}>\n        <ThreadHeader closeThread={closeThread} thread={messageAsThread} />\n        <ThreadMessageList\n          disableDateSeparator={!enableDateSeparator}\n          head={head}\n          Message={MessageUIComponent}\n          messageActions={messageActions}\n          suppressAutoscroll={threadSuppressAutoscroll}\n          threadList\n          {...threadProps}\n          {...(virtualized\n            ? additionalVirtualizedMessageListProps\n            : additionalMessageListProps)}\n        />\n        <MessageComposer\n          focus={autoFocus}\n          parent={thread ?? parentMessage}\n          {...additionalMessageComposerProps}\n        />\n      </div>\n    </LegacyThreadContext.Provider>\n  );\n};\n","/* eslint-disable sort-keys */\n\nimport React from 'react';\n\ntype LegacyReactionOptions = Array<{\n  Component: React.ComponentType;\n  type: string;\n  name?: string;\n}>;\n\ntype ReactionOptionData = {\n  Component: React.ComponentType;\n  name?: string;\n  unicode?: string;\n};\n\nexport type ReactionOptions =\n  | LegacyReactionOptions\n  | {\n      quick: {\n        [key: string]: ReactionOptionData;\n      };\n      extended?: {\n        [key: string]: ReactionOptionData;\n      };\n    };\n\nexport const mapEmojiMartData = (\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  emojiMartData: any,\n): NonNullable<Exclude<ReactionOptions, LegacyReactionOptions>['extended']> => {\n  if (!emojiMartData || !emojiMartData.emojis) {\n    return {};\n  }\n\n  const newMap: ReturnType<typeof mapEmojiMartData> = {};\n\n  for (const emojiId in emojiMartData.emojis) {\n    const emojiData = emojiMartData.emojis[emojiId];\n    const [firstEmoji] = emojiData.skins;\n\n    if (!firstEmoji || !firstEmoji.native) continue;\n\n    const nativeEmoji = firstEmoji.native as string;\n\n    const unicode = emojiToUnicode(nativeEmoji);\n\n    newMap[unicode] = {\n      Component: () => <>{nativeEmoji}</>,\n      name: emojiData.name,\n    };\n  }\n\n  return newMap;\n};\n\nexport type AdvancedReactionOptions = {\n  quick: ReactionOptions;\n  extended: ReactionOptions;\n};\n\nexport const emojiToUnicode = (emoji: string) => {\n  const unicodeStrings = [];\n  for (const c of emoji) {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const codePoint = c.codePointAt(0)!;\n    unicodeStrings.push(`U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`);\n  }\n\n  return unicodeStrings.join('-');\n};\n\nexport const unicodeToEmoji = (unicode: string) =>\n  unicode\n    .split('-')\n    .map((code) => String.fromCodePoint(parseInt(code.replace('U+', ''), 16)))\n    .join('');\n\nexport const defaultReactionOptions: ReactionOptions = {\n  quick: {\n    haha: {\n      Component: () => <>😂</>,\n      name: 'Joy',\n      unicode: emojiToUnicode('😂'),\n    },\n    like: {\n      Component: () => <>👍</>,\n      name: 'Thumbs up',\n      unicode: emojiToUnicode('👍'),\n    },\n    love: {\n      Component: () => <>❤️</>,\n      name: 'Heart',\n      unicode: emojiToUnicode('❤️'),\n    },\n    sad: { Component: () => <>😔</>, name: 'Sad', unicode: emojiToUnicode('😔') },\n    wow: {\n      Component: () => <>😮</>,\n      name: 'Astonished',\n      unicode: emojiToUnicode('😮'),\n    },\n    fire: {\n      Component: () => <>🔥</>,\n      name: 'Fire',\n      unicode: emojiToUnicode('🔥'),\n    },\n  },\n};\n","import React, { type ReactNode, useMemo, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useDialogOnNearestManager } from '../Dialog';\nimport { defaultReactionOptions } from './reactionOptions';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useMessageContext } from '../../context/MessageContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { Button } from '../Button';\nimport { IconPlus } from '../Icons';\n\nimport type { ReactionResponse } from 'stream-chat';\n\nexport type ReactionSelectorProps = {\n  /** Override dialog id used by the selector popover. */\n  dialogId?: string;\n  /** Function that adds/removes a reaction on a message (overrides the function stored in `MessageContext`) */\n  handleReaction?: (\n    reactionType: string,\n    event: React.BaseSyntheticEvent,\n  ) => Promise<void>;\n  /** An array of the own reaction objects to distinguish own reactions visually */\n  own_reactions?: ReactionResponse[];\n};\n\ninterface ReactionSelectorInterface {\n  (props: ReactionSelectorProps): ReactNode;\n  getDialogId: (_: { messageId: string; threadList?: boolean }) => string;\n  displayName: string;\n  ExtendedList: React.ComponentType<ReactionSelectorProps & { dialogId?: string }>;\n}\n\nconst stableOwnReactions: ReactionResponse[] = [];\n\nexport const ReactionSelector: ReactionSelectorInterface = (props) => {\n  const {\n    dialogId: propDialogId,\n    handleReaction: propHandleReaction,\n    own_reactions: propOwnReactions,\n  } = props;\n  const [extendedListOpen, setExtendedListOpen] = useState(false);\n\n  const {\n    reactionOptions = defaultReactionOptions,\n    ReactionSelectorExtendedList = ReactionSelector.ExtendedList,\n  } = useComponentContext('ReactionSelector');\n\n  const {\n    closeReactionSelectorOnClick,\n    handleReaction: contextHandleReaction,\n    message,\n    threadList,\n  } = useMessageContext('ReactionSelector');\n  const { t } = useTranslationContext('ReactionSelector');\n  const dialogId =\n    propDialogId ??\n    ReactionSelector.getDialogId({\n      messageId: message.id,\n      threadList,\n    });\n  const { dialog } = useDialogOnNearestManager({ id: dialogId });\n\n  const handleReaction = propHandleReaction ?? contextHandleReaction;\n  const ownReactions = propOwnReactions ?? message?.own_reactions ?? stableOwnReactions;\n\n  const ownReactionByType = useMemo(() => {\n    const map: { [key: string]: ReactionResponse } = {};\n\n    for (const reaction of ownReactions) {\n      map[reaction.type] ??= reaction;\n    }\n\n    return map;\n  }, [ownReactions]);\n\n  const adjustedQuickReactionOptions = useMemo(() => {\n    if (Array.isArray(reactionOptions)) return reactionOptions;\n\n    return Object.entries(reactionOptions.quick).map(\n      ([type, { Component, name, unicode }]) => ({\n        Component,\n        name,\n        type,\n        unicode,\n      }),\n    );\n  }, [reactionOptions]);\n\n  const hasExtendedReactions =\n    !Array.isArray(reactionOptions) &&\n    reactionOptions.extended &&\n    Object.keys(reactionOptions.extended).length > 0;\n\n  return (\n    <div\n      aria-label={t('aria/Reaction list')}\n      className='str-chat__reaction-selector'\n      data-testid='reaction-selector'\n      role='group'\n    >\n      {!extendedListOpen ? (\n        <>\n          <ul\n            className='str-chat__reaction-selector-list'\n            data-testid='reaction-selector-list'\n          >\n            {adjustedQuickReactionOptions.map(\n              ({ Component, name: reactionName, type: reactionType }) => (\n                <li className='str-chat__reaction-list-selector__item' key={reactionType}>\n                  <button\n                    aria-label={t('aria/Select Reaction: {{ reactionName }}', {\n                      reactionName: reactionName || reactionType,\n                    })}\n                    aria-pressed={typeof ownReactionByType[reactionType] !== 'undefined'}\n                    className={clsx('str-chat__reaction-selector-list__item-button')}\n                    data-testid='select-reaction-button'\n                    data-text={reactionType}\n                    onClick={(event) => {\n                      handleReaction(reactionType, event);\n                      if (closeReactionSelectorOnClick) {\n                        dialog.close();\n                      }\n                    }}\n                    type='button'\n                  >\n                    <span className='str-chat__reaction-icon'>\n                      <Component />\n                    </span>\n                  </button>\n                </li>\n              ),\n            )}\n          </ul>\n          {hasExtendedReactions && (\n            <Button\n              appearance='outline'\n              aria-label={t('aria/Open Reaction Selector')}\n              circular\n              className='str-chat__reaction-selector__add-button'\n              data-testid='reaction-selector-add-button'\n              onClick={() => {\n                setExtendedListOpen(true);\n              }}\n              size='sm'\n              variant='secondary'\n            >\n              <IconPlus />\n            </Button>\n          )}\n        </>\n      ) : (\n        <ReactionSelectorExtendedList\n          {...props}\n          dialogId={dialogId}\n          handleReaction={async (reactionType, event) => {\n            await handleReaction(reactionType, event);\n            if (closeReactionSelectorOnClick) {\n              dialog.close();\n            }\n          }}\n        />\n      )}\n    </div>\n  );\n};\n\nReactionSelector.getDialogId = ({ messageId, threadList }) => {\n  const dialogIdNamespace = threadList ? '-thread' : '';\n  return `reaction-selector${dialogIdNamespace}-${messageId}`;\n};\n\nReactionSelector.displayName = 'ReactionSelector';\n\nReactionSelector.ExtendedList = function ReactionSelectorExtendedList({\n  dialogId,\n  handleReaction: propHandleReaction,\n  own_reactions: propOwnReactions,\n}) {\n  const { reactionOptions = defaultReactionOptions } = useComponentContext(\n    'ReactionSelector.ExtendedList',\n  );\n  const {\n    closeReactionSelectorOnClick,\n    handleReaction: contextHandleReaction,\n    message,\n  } = useMessageContext('ReactionSelector');\n  const { t } = useTranslationContext('ReactionSelector');\n\n  const handleReaction = propHandleReaction ?? contextHandleReaction;\n  const ownReactions = propOwnReactions ?? message?.own_reactions ?? stableOwnReactions;\n\n  const { dialog } = useDialogOnNearestManager({ id: dialogId || '' });\n\n  const ownReactionByType = useMemo(() => {\n    const map: { [key: string]: ReactionResponse } = {};\n\n    for (const reaction of ownReactions) {\n      map[reaction.type] ??= reaction;\n    }\n\n    return map;\n  }, [ownReactions]);\n\n  if (Array.isArray(reactionOptions) || !reactionOptions.extended) {\n    return null;\n  }\n\n  return (\n    <div\n      aria-label={t('aria/Reaction list')}\n      className='str-chat__reaction-selector-extended-list'\n      data-testid='reaction-selector-extended-list'\n      role='group'\n    >\n      {Object.entries(reactionOptions.extended).map(\n        ([reactionType, { Component, name: reactionName }]) => (\n          <button\n            aria-label={t('aria/Select Reaction: {{ reactionName }}', {\n              reactionName: reactionName || reactionType,\n            })}\n            aria-pressed={typeof ownReactionByType[reactionType] !== 'undefined'}\n            className='str-chat__reaction-selector-extended-list__button str-chat__button str-chat__button--ghost str-chat__button--size-sm str-chat__button--circular'\n            data-testid='select-reaction-button'\n            data-text={reactionType}\n            key={reactionType}\n            onClick={(event) => {\n              handleReaction(reactionType, event);\n              if (closeReactionSelectorOnClick) {\n                dialog.close();\n              }\n            }}\n            type='button'\n          >\n            <span className='str-chat__reaction-icon'>\n              <Component />\n            </span>\n          </button>\n        ),\n      )}\n    </div>\n  );\n};\n","import { useCallback, useEffect, useState } from 'react';\nimport type { ReactionResponse, ReactionSort } from 'stream-chat';\nimport type { MessageContextValue } from '../../../context';\nimport { useMessageContext, useTranslationContext } from '../../../context';\nimport { useNotificationApi } from '../../Notifications';\n\nimport type { ReactionType } from '../types';\n\nexport interface FetchReactionsOptions {\n  reactionType: ReactionType | null;\n  shouldFetch: boolean;\n  handleFetchReactions?: MessageContextValue['handleFetchReactions'];\n  sort?: ReactionSort;\n}\n\nexport function useFetchReactions(options: FetchReactionsOptions) {\n  const { addNotification } = useNotificationApi();\n  const { handleFetchReactions: contextHandleFetchReactions } =\n    useMessageContext('useFetchReactions');\n  const { t } = useTranslationContext('useFetchReactions');\n  const [reactions, setReactions] = useState<ReactionResponse[]>([]);\n  const {\n    handleFetchReactions: propHandleFetchReactions,\n    reactionType,\n    shouldFetch,\n    sort,\n  } = options;\n  const [isLoading, setIsLoading] = useState(shouldFetch);\n  const handleFetchReactions = propHandleFetchReactions ?? contextHandleFetchReactions;\n  const [refetchNonce, setRefetchNonce] = useState<number | null>(null);\n\n  useEffect(() => {\n    if (!shouldFetch) {\n      return;\n    }\n\n    let cancel = false;\n\n    (async () => {\n      try {\n        setIsLoading(true);\n        const reactions = await handleFetchReactions(reactionType ?? undefined, sort);\n\n        if (!cancel) {\n          setReactions(reactions);\n        }\n      } catch (e) {\n        if (!cancel) {\n          setReactions([]);\n          addNotification({\n            emitter: 'Reactions',\n            error: e instanceof Error ? e : undefined,\n            message: t('Error fetching reactions'),\n            severity: 'error',\n            type: 'api:message:reactions:fetch:failed',\n          });\n        }\n      } finally {\n        if (!cancel) {\n          setIsLoading(false);\n        }\n      }\n    })();\n\n    return () => {\n      cancel = true;\n    };\n  }, [\n    addNotification,\n    handleFetchReactions,\n    reactionType,\n    refetchNonce,\n    shouldFetch,\n    sort,\n    t,\n  ]);\n\n  const refetch = useCallback(() => {\n    setRefetchNonce(Math.random());\n  }, []);\n\n  return { isLoading, reactions, refetch };\n}\n","import React, { useMemo, useState } from 'react';\n\nimport type { ReactionSummary, ReactionType } from './types';\n\nimport { useFetchReactions } from './hooks/useFetchReactions';\nimport { Avatar as DefaultAvatar } from '../Avatar';\nimport type { MessageContextValue } from '../../context';\nimport {\n  useChatContext,\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport type { ReactionSort } from 'stream-chat';\nimport { defaultReactionOptions } from './reactionOptions';\nimport type { useProcessReactions } from './hooks/useProcessReactions';\nimport { IconEmojiAdd } from '../Icons';\nimport { ReactionSelector, type ReactionSelectorProps } from './ReactionSelector';\n\nexport type MessageReactionsDetailProps = Partial<\n  Pick<MessageContextValue, 'handleFetchReactions' | 'reactionDetailsSort'>\n> & {\n  reactions: ReactionSummary[];\n  selectedReactionType: ReactionType | null;\n  onSelectedReactionTypeChange?: (reactionType: ReactionType | null) => void;\n  sort?: ReactionSort;\n  totalReactionCount?: number;\n  reactionGroups?: ReturnType<typeof useProcessReactions>['reactionGroups'];\n} & ReactionSelectorProps;\n\nconst defaultReactionDetailsSort = { created_at: -1 } as const;\n\nexport const MessageReactionsDetailLoadingIndicator = () => {\n  const elements = useMemo(\n    () =>\n      Array.from({ length: 3 }, (_, index) => (\n        <div className='str-chat__message-reactions-detail__skeleton-item' key={index}>\n          <div className='str-chat__message-reactions-detail__skeleton-avatar' />\n          <div className='str-chat__message-reactions-detail__skeleton-line' />\n        </div>\n      )),\n    [],\n  );\n\n  return <>{elements}</>;\n};\n\ninterface MessageReactionsDetailInterface {\n  (props: MessageReactionsDetailProps): React.ReactNode;\n  displayName: string;\n  getDialogId: (_: { messageId: string }) => string;\n}\n\nexport const MessageReactionsDetail: MessageReactionsDetailInterface = ({\n  handleFetchReactions,\n  handleReaction,\n  onSelectedReactionTypeChange,\n  own_reactions,\n  reactionDetailsSort: propReactionDetailsSort,\n  reactionGroups,\n  reactions,\n  selectedReactionType,\n  totalReactionCount,\n}) => {\n  const [extendedReactionListOpen, setExtendedReactionListOpen] = useState(false);\n  const { client } = useChatContext();\n  const {\n    Avatar = DefaultAvatar,\n    LoadingIndicator = MessageReactionsDetailLoadingIndicator,\n    reactionOptions = defaultReactionOptions,\n    ReactionSelectorExtendedList = ReactionSelector.ExtendedList,\n  } = useComponentContext(MessageReactionsDetail.name);\n  const { t } = useTranslationContext();\n\n  const {\n    handleReaction: contextHandleReaction,\n    message,\n    reactionDetailsSort: contextReactionDetailsSort,\n  } = useMessageContext(MessageReactionsDetail.name);\n\n  const reactionDetailsSort =\n    propReactionDetailsSort ?? contextReactionDetailsSort ?? defaultReactionDetailsSort;\n\n  const {\n    isLoading: areReactionsLoading,\n    reactions: reactionDetails,\n    refetch,\n  } = useFetchReactions({\n    handleFetchReactions,\n    reactionType: selectedReactionType,\n    shouldFetch: true,\n    sort: reactionDetailsSort,\n  });\n\n  const getReactionName = (reactionType: string) => {\n    if (Array.isArray(reactionOptions)) {\n      return (\n        reactionOptions.find((reactionOption) => reactionOption.type === reactionType)\n          ?.name ?? reactionType\n      );\n    }\n\n    return (\n      reactionOptions.quick[reactionType]?.name ??\n      reactionOptions.extended?.[reactionType]?.name ??\n      reactionType\n    );\n  };\n\n  if (extendedReactionListOpen) {\n    return (\n      <div\n        className='str-chat__message-reactions-detail'\n        data-testid='message-reactions-detail'\n      >\n        <ReactionSelectorExtendedList\n          dialogId={MessageReactionsDetail.getDialogId({ messageId: message.id })}\n          handleReaction={handleReaction}\n          own_reactions={own_reactions}\n        />\n      </div>\n    );\n  }\n\n  return (\n    <div\n      className='str-chat__message-reactions-detail'\n      data-testid='message-reactions-detail'\n    >\n      {typeof totalReactionCount === 'number' && (\n        <div className='str-chat__message-reactions-detail__total-count'>\n          {t('{{ count }} reactions', { count: totalReactionCount })}\n        </div>\n      )}\n      <div className='str-chat__message-reactions-detail__reaction-type-list-container'>\n        <ul\n          className='str-chat__message-reactions-detail__reaction-type-list'\n          data-testid='reaction-type-list'\n        >\n          <li className='str-chat__message-reactions-detail__reaction-type-list-item'>\n            <button\n              aria-label={t('Add reaction')}\n              className='str-chat__message-reactions-detail__reaction-type-list-item-button'\n              data-testid='add-reaction-button'\n              onClick={() => setExtendedReactionListOpen(true)}\n              type='button'\n            >\n              <span className='str-chat__message-reactions-detail__reaction-type-list-item-icon'>\n                <IconEmojiAdd />\n              </span>\n            </button>\n          </li>\n\n          {reactions.map(\n            ({ EmojiComponent, reactionCount, reactionType }) =>\n              EmojiComponent && (\n                <li\n                  className='str-chat__message-reactions-detail__reaction-type-list-item'\n                  key={reactionType}\n                >\n                  <button\n                    aria-label={t('aria/Select Reaction: {{ reactionName }}', {\n                      reactionName: reactionType,\n                    })}\n                    aria-pressed={reactionType === selectedReactionType}\n                    className='str-chat__message-reactions-detail__reaction-type-list-item-button'\n                    onClick={() =>\n                      onSelectedReactionTypeChange?.(\n                        selectedReactionType === reactionType ? null : reactionType,\n                      )\n                    }\n                    type='button'\n                  >\n                    <span className='str-chat__message-reactions-detail__reaction-type-list-item-icon'>\n                      <EmojiComponent />\n                    </span>\n                    <span\n                      className='str-chat__message-reactions-detail__reaction-type-list-item-count'\n                      data-testid='reaction-type-count'\n                    >\n                      {reactionCount}\n                    </span>\n                  </button>\n                </li>\n              ),\n          )}\n        </ul>\n      </div>\n      <div className='str-chat__message-reactions-detail__user-list-container'>\n        <div\n          className='str-chat__message-reactions-detail__user-list'\n          data-testid='all-reacting-users'\n        >\n          {areReactionsLoading && <LoadingIndicator />}\n          {!areReactionsLoading && (\n            <>\n              {reactionDetails.map(({ type, user }) => {\n                const belongsToCurrentUser = client.user?.id === user?.id;\n                const reactionName = getReactionName(type);\n                const EmojiComponent = Array.isArray(reactionOptions)\n                  ? undefined\n                  : (reactionOptions.quick[type]?.Component ??\n                    reactionOptions.extended?.[type]?.Component);\n\n                return (\n                  <div\n                    className='str-chat__message-reactions-detail__user-list-item'\n                    key={`${user?.id}-${type}`}\n                  >\n                    <Avatar\n                      className='str-chat__avatar--with-border'\n                      data-testid='avatar'\n                      imageUrl={user?.image as string | undefined}\n                      size='md'\n                      userName={user?.name || user?.id}\n                    />\n                    <div className='str-chat__message-reactions-detail__user-list-item-info'>\n                      <span\n                        className='str-chat__message-reactions-detail__user-list-item-username'\n                        data-testid='reaction-user-username'\n                      >\n                        {belongsToCurrentUser ? t('You') : user?.name || user?.id}\n                      </span>\n                      {belongsToCurrentUser && (\n                        <button\n                          aria-label={t('Tap to remove: {{ reactionName }}', {\n                            reactionName,\n                          })}\n                          className='str-chat__message-reactions-detail__user-list-item-button'\n                          data-testid='remove-reaction-button'\n                          onClick={async (e) => {\n                            const reactionCountBeforeRemoval =\n                              reactionGroups?.[type]?.count ?? 0;\n\n                            await contextHandleReaction(type, e);\n\n                            // was 1, should be 0 after removal, display all reactions\n                            if (\n                              selectedReactionType !== null &&\n                              reactionCountBeforeRemoval <= 1\n                            ) {\n                              onSelectedReactionTypeChange?.(null);\n                            } else {\n                              refetch();\n                            }\n                          }}\n                          type='button'\n                        >\n                          {t('Tap to remove')}\n                        </button>\n                      )}\n                    </div>\n                    <span className='str-chat__message-reactions-detail__user-list-item-icon'>\n                      {!selectedReactionType && EmojiComponent && <EmojiComponent />}\n                    </span>\n                  </div>\n                );\n              })}\n            </>\n          )}\n        </div>\n      </div>\n    </div>\n  );\n};\n\nMessageReactionsDetail.displayName = 'MessageReactionsDetail';\n\nMessageReactionsDetail.getDialogId = ({ messageId }) =>\n  `message-reactions-detail-${messageId}`;\n","import { useCallback, useMemo } from 'react';\n\nimport { useComponentContext, useMessageContext } from '../../../context';\nimport { defaultReactionOptions } from '../reactionOptions';\n\nimport type { MessageReactionsProps } from '../MessageReactions';\nimport type { ReactionsComparator, ReactionSummary } from '../types';\n\nexport type UseProcessReactionsParams = Pick<\n  MessageReactionsProps,\n  'own_reactions' | 'reaction_groups' | 'reactions'\n> & {\n  sortReactions?: ReactionsComparator;\n};\n\nexport const defaultReactionsSort: ReactionsComparator = (a, b) => {\n  if (a.firstReactionAt && b.firstReactionAt) {\n    return +a.firstReactionAt - +b.firstReactionAt;\n  }\n\n  return a.reactionType.localeCompare(b.reactionType, 'en');\n};\n\nexport const useProcessReactions = (params: UseProcessReactionsParams) => {\n  const {\n    own_reactions: propOwnReactions,\n    reaction_groups: propReactionGroups,\n    reactions: propReactions,\n    sortReactions: propSortReactions,\n  } = params;\n  const { message, sortReactions: contextSortReactions } =\n    useMessageContext('useProcessReactions');\n  const { reactionOptions = defaultReactionOptions } =\n    useComponentContext('useProcessReactions');\n\n  const sortReactions = propSortReactions ?? contextSortReactions ?? defaultReactionsSort;\n  const latestReactions = propReactions ?? message.latest_reactions;\n  const ownReactions = propOwnReactions ?? message?.own_reactions;\n  const reactionGroups = propReactionGroups ?? message?.reaction_groups ?? undefined;\n\n  const isOwnReaction = useCallback(\n    (reactionType: string) =>\n      ownReactions?.some((reaction) => reaction.type === reactionType) ?? false,\n    [ownReactions],\n  );\n\n  const getEmojiByReactionType = useCallback(\n    (reactionType: string) => {\n      if (Array.isArray(reactionOptions)) {\n        return (\n          reactionOptions.find(({ type }) => type === reactionType)?.Component ?? null\n        );\n      }\n\n      return (\n        reactionOptions.quick[reactionType]?.Component ??\n        reactionOptions.extended?.[reactionType]?.Component ??\n        null\n      );\n    },\n    [reactionOptions],\n  );\n\n  const isSupportedReaction = useCallback(\n    (reactionType: string) => {\n      if (Array.isArray(reactionOptions)) {\n        return reactionOptions.some(\n          (reactionOption) => reactionOption.type === reactionType,\n        );\n      }\n\n      return (\n        typeof reactionOptions.quick[reactionType] !== 'undefined' ||\n        typeof reactionOptions.extended?.[reactionType] !== 'undefined'\n      );\n    },\n    [reactionOptions],\n  );\n\n  /**\n   * Amount of unique reaction types (\"haha\", \"like\", etc.) on a message.\n   */\n  const uniqueReactionTypeCount = useMemo(() => {\n    if (!reactionGroups) {\n      return 0;\n    }\n\n    return Object.keys(reactionGroups).filter((reactionType) =>\n      isSupportedReaction(reactionType),\n    ).length;\n  }, [isSupportedReaction, reactionGroups]);\n\n  const getLatestReactedUserNames = useCallback(\n    (reactionType?: string) =>\n      latestReactions?.flatMap((reaction) => {\n        if (reactionType && reactionType === reaction.type) {\n          const username = reaction.user?.name || reaction.user?.id;\n          return username ? [username] : [];\n        }\n        return [];\n      }) ?? [],\n    [latestReactions],\n  );\n\n  const existingReactions: ReactionSummary[] = useMemo(() => {\n    if (!reactionGroups) {\n      return [];\n    }\n\n    const unsortedReactions = Object.entries(reactionGroups).flatMap(\n      ([reactionType, { count, first_reaction_at, last_reaction_at }]) => {\n        if (count === 0 || !isSupportedReaction(reactionType)) {\n          return [];\n        }\n\n        const latestReactedUserNames = getLatestReactedUserNames(reactionType);\n\n        return [\n          {\n            EmojiComponent: getEmojiByReactionType(reactionType),\n            firstReactionAt: first_reaction_at ? new Date(first_reaction_at) : null,\n            isOwnReaction: isOwnReaction(reactionType),\n            lastReactionAt: last_reaction_at ? new Date(last_reaction_at) : null,\n            latestReactedUserNames,\n            reactionCount: count,\n            reactionType,\n            unlistedReactedUserCount: count - latestReactedUserNames.length,\n          },\n        ];\n      },\n    );\n\n    return unsortedReactions.sort(sortReactions);\n  }, [\n    getEmojiByReactionType,\n    getLatestReactedUserNames,\n    isOwnReaction,\n    isSupportedReaction,\n    reactionGroups,\n    sortReactions,\n  ]);\n\n  const hasReactions = existingReactions.length > 0;\n\n  const totalReactionCount = useMemo(\n    () =>\n      Object.values(reactionGroups ?? {}).reduce((total, { count }) => total + count, 0),\n\n    [reactionGroups],\n  );\n\n  return {\n    existingReactions,\n    hasReactions,\n    reactionGroups,\n    totalReactionCount,\n    uniqueReactionTypeCount,\n  } as const;\n};\n","import React, {\n  type ComponentPropsWithoutRef,\n  type ComponentRef,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport clsx from 'clsx';\n\nimport { MessageReactionsDetail as DefaultMessageReactionsDetail } from './MessageReactionsDetail';\nimport { useProcessReactions } from './hooks/useProcessReactions';\nimport type { MessageContextValue } from '../../context';\nimport {\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\n\nimport { MAX_MESSAGE_REACTIONS_TO_FETCH } from '../Message/hooks';\n\nimport type { ReactionGroupResponse, ReactionResponse } from 'stream-chat';\nimport type { ReactionsComparator, ReactionType } from './types';\nimport { DialogAnchor, useDialogIsOpen, useDialogOnNearestManager } from '../Dialog';\n\nexport type MessageReactionsProps = Partial<\n  Pick<MessageContextValue, 'handleFetchReactions' | 'reactionDetailsSort'>\n> & {\n  /** An array of the own reaction objects to distinguish own reactions visually */\n  own_reactions?: ReactionResponse[];\n  /** An object containing summary for each reaction type on a message */\n  reaction_groups?: Record<string, ReactionGroupResponse>;\n  /** An array of the reaction objects to display in the list */\n  reactions?: ReactionResponse[];\n  /** Display the reactions in the list in reverse order, defaults to false */\n  reverse?: boolean;\n  /** Comparator function to sort reactions, defaults to chronological order */\n  sortReactions?: ReactionsComparator;\n  /**\n   * Positioning of the reactions list relative to the message. Position is flipped by default for the messages of other users.\n   */\n  flipHorizontalPosition?: boolean;\n  verticalPosition?: 'top' | 'bottom' | null;\n  visualStyle?: 'clustered' | 'segmented' | null;\n  capLimit?: {\n    [key in Extract<MessageReactionsProps['visualStyle'], string>]?: number;\n  };\n};\n\n/**\n * Renders a button if `buttonIf` is true, otherwise renders a fragment. No props but children are passed to fragment, but all props are passed to button if it's rendered.\n */\nconst FragmentOrButton = ({\n  buttonIf: renderButton = false,\n  children,\n  type = 'button',\n  ...props\n}: ComponentPropsWithoutRef<'button'> & { buttonIf?: boolean }) => {\n  if (renderButton) {\n    return (\n      <button {...props} type={type}>\n        {children}\n      </button>\n    );\n  }\n\n  return <>{children}</>;\n};\n\nconst UnMemoizedMessageReactions = (props: MessageReactionsProps) => {\n  const {\n    capLimit: { clustered: capLimitClustered = 5, segmented: capLimitSegmented = 4 } = {},\n    flipHorizontalPosition = false,\n    handleFetchReactions,\n    reactionDetailsSort,\n    verticalPosition = 'top',\n    visualStyle = 'clustered',\n    ...rest\n  } = props;\n\n  const {\n    existingReactions,\n    hasReactions,\n    reactionGroups,\n    totalReactionCount,\n    uniqueReactionTypeCount,\n  } = useProcessReactions(rest);\n  const [selectedReactionType, setSelectedReactionType] = useState<ReactionType | null>(\n    null,\n  );\n  const { t } = useTranslationContext('MessageReactions');\n  const { MessageReactionsDetail = DefaultMessageReactionsDetail } =\n    useComponentContext();\n  const { isMyMessage, message } = useMessageContext('MessageReactions');\n\n  const divRef = useRef<ComponentRef<'div'>>(null);\n  const dialogId = DefaultMessageReactionsDetail.getDialogId({\n    messageId: message.id,\n  });\n  const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n  const isDialogOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n  const handleReactionButtonClick = (reactionType: ReactionType | null) => {\n    if (totalReactionCount > MAX_MESSAGE_REACTIONS_TO_FETCH) {\n      return;\n    }\n\n    setSelectedReactionType(reactionType);\n\n    dialog.open();\n  };\n\n  /**\n   * In segmented style with top position we show max 4 reactions and a\n   * count of the rest, so we need to cap the existing reactions to display\n   * at 4 and calculate the count of the rest. For clustered(top/bottom) we cap\n   * the existing reactions to 5 but we don't calculate the count of the rest\n   * because we show the total count instead. For segmented style with bottom\n   * position we don't cap the existing reactions and we show all of them.\n   */\n  const cappedExistingReactions = useMemo(() => {\n    if (visualStyle === 'segmented' && verticalPosition !== 'top') return null;\n\n    const capLimit = visualStyle === 'segmented' ? capLimitSegmented : capLimitClustered;\n\n    const sliced = existingReactions.slice(0, capLimit);\n\n    return {\n      /**\n       * Accumulated reaction count of capped reaction types, first four in case of\n       * segmented(top) and first five in case of clustered(top/bottom) variations.\n       */\n      reactionCountToDisplay: sliced.reduce(\n        (accumulatedCount, { reactionCount }) => accumulatedCount + reactionCount,\n        0,\n      ),\n      reactionsToDisplay: sliced,\n    } as const;\n  }, [\n    capLimitClustered,\n    capLimitSegmented,\n    existingReactions,\n    verticalPosition,\n    visualStyle,\n  ]);\n\n  if (!hasReactions) return null;\n\n  return (\n    <>\n      <div\n        aria-label={t('aria/Reaction list')}\n        className={clsx('str-chat__message-reactions', {\n          [`str-chat__message-reactions--flipped-horizontally`]: flipHorizontalPosition,\n          [`str-chat__message-reactions--${verticalPosition}`]:\n            typeof verticalPosition === 'string',\n          [`str-chat__message-reactions--${visualStyle}`]:\n            typeof visualStyle === 'string',\n        })}\n        ref={divRef}\n        role='figure'\n      >\n        <FragmentOrButton\n          aria-expanded={isDialogOpen}\n          aria-label={t('aria/Reaction list')}\n          aria-pressed={isDialogOpen}\n          buttonIf={visualStyle === 'clustered'}\n          className='str-chat__message-reactions__list-button'\n          data-testid='message-reactions-list-button'\n          onClick={() => handleReactionButtonClick(null)}\n        >\n          <ul className='str-chat__message-reactions__list'>\n            {(cappedExistingReactions?.reactionsToDisplay ?? existingReactions).map(\n              ({ EmojiComponent, reactionCount, reactionType }) =>\n                EmojiComponent && (\n                  <li\n                    className='str-chat__message-reactions__list-item'\n                    data-testid='message-reactions-list-item'\n                    key={reactionType}\n                  >\n                    <FragmentOrButton\n                      aria-label={t('aria/Select Reaction: {{ reactionName }}', {\n                        reactionName: reactionType,\n                      })}\n                      buttonIf={visualStyle === 'segmented'}\n                      className='str-chat__message-reactions__list-item-button'\n                      onClick={() => handleReactionButtonClick(reactionType)}\n                    >\n                      <span\n                        className='str-chat__message-reactions__list-item-icon'\n                        data-testid='message-reactions-list-item-icon'\n                      >\n                        <EmojiComponent />\n                      </span>\n                      {visualStyle === 'segmented' && reactionCount > 1 && (\n                        <span\n                          className='str-chat__message-reactions__list-item-count'\n                          data-testclass='message-reactions-item-count'\n                        >\n                          {reactionCount}\n                        </span>\n                      )}\n                    </FragmentOrButton>\n                  </li>\n                ),\n            )}\n            {uniqueReactionTypeCount > 4 &&\n              cappedExistingReactions &&\n              visualStyle === 'segmented' && (\n                <li className='str-chat__message-reactions__list-item str-chat__message-reactions__list-item--more'>\n                  <button\n                    aria-label={t('aria/Reaction list')}\n                    className='str-chat__message-reactions__list-item-button'\n                    onClick={() => handleReactionButtonClick(null)}\n                    type='button'\n                  >\n                    <span className='str-chat__message-reactions__overflow-count'>\n                      +\n                      {totalReactionCount -\n                        cappedExistingReactions.reactionCountToDisplay}\n                    </span>\n                  </button>\n                </li>\n              )}\n          </ul>\n          {visualStyle === 'clustered' && (\n            <span\n              className='str-chat__message-reactions__total-count'\n              data-testid='message-reactions-total-count'\n            >\n              {totalReactionCount}\n            </span>\n          )}\n        </FragmentOrButton>\n      </div>\n\n      <DialogAnchor\n        dialogManagerId={dialogManager?.id}\n        id={dialogId}\n        offset={8}\n        placement={isMyMessage() ? 'bottom-end' : 'bottom-start'}\n        referenceElement={divRef.current}\n        trapFocus\n        updatePositionOnContentResize\n      >\n        <MessageReactionsDetail\n          handleFetchReactions={handleFetchReactions}\n          onSelectedReactionTypeChange={setSelectedReactionType}\n          reactionDetailsSort={reactionDetailsSort}\n          reactionGroups={reactionGroups}\n          reactions={existingReactions}\n          selectedReactionType={selectedReactionType}\n          totalReactionCount={totalReactionCount}\n        />\n      </DialogAnchor>\n    </>\n  );\n};\n\n/**\n * Component that displays a list of reactions on a message.\n */\nexport const MessageReactions = React.memo(\n  UnMemoizedMessageReactions,\n) as typeof UnMemoizedMessageReactions;\n","import type { ForwardedRef, MutableRefObject } from 'react';\n\nexport const isMutableRef = <T>(\n  ref: ForwardedRef<T> | null,\n): ref is MutableRefObject<T> => {\n  if (ref) {\n    return (ref as MutableRefObject<T>).current !== undefined;\n  }\n  return false;\n};\n\nexport const getImageDimensions = (source: string) =>\n  new Promise<[number, number]>((resolve, reject) => {\n    const image = new Image();\n\n    image.addEventListener(\n      'load',\n      () => {\n        resolve([image.width, image.height]);\n      },\n      { once: true },\n    );\n\n    image.addEventListener('error', () => reject(`Couldn't load image from ${source}`), {\n      once: true,\n    });\n\n    image.src = source;\n  });\n","import React, { useEffect, useState } from 'react';\n\nimport { getImageDimensions } from './utils/utils';\n\nexport type SpriteImageProps = {\n  columns: number;\n  position: [number, number];\n  rows: number;\n  spriteUrl: string;\n  fallback?: React.ReactNode;\n  height?: number;\n  style?: React.CSSProperties;\n  width?: number;\n};\n\nexport const SpriteImage = ({\n  columns,\n  fallback,\n  height,\n  position,\n  rows,\n  spriteUrl,\n  style,\n  width,\n}: SpriteImageProps) => {\n  const [[spriteWidth, spriteHeight], setSpriteDimensions] = useState([0, 0]);\n\n  useEffect(() => {\n    getImageDimensions(spriteUrl).then(setSpriteDimensions).catch(console.error);\n  }, [spriteUrl]);\n\n  const [x, y] = position;\n\n  if (!spriteHeight || !spriteWidth) return <>{fallback}</>;\n\n  return (\n    <div\n      data-testid='sprite-image'\n      style={\n        {\n          ...style,\n          '--str-chat__sprite-image-resize-ratio':\n            'var(--str-chat__sprite-image-resize-ratio-x, var(--str-chat__sprite-image-resize-ratio-y, 1))',\n          '--str-chat__sprite-image-resize-ratio-x':\n            'calc(var(--str-chat__sprite-image-width) / var(--str-chat__sprite-item-width))',\n          '--str-chat__sprite-image-resize-ratio-y':\n            'calc(var(--str-chat__sprite-image-height) / var(--str-chat__sprite-item-height))',\n          '--str-chat__sprite-item-height': `${spriteHeight / rows}`,\n          '--str-chat__sprite-item-width': `${spriteWidth / columns}`,\n          ...(Number.isFinite(height)\n            ? { '--str-chat__sprite-image-height': `${height}px` }\n            : {}),\n          ...(Number.isFinite(width)\n            ? { '--str-chat__sprite-image-width': `${width}px` }\n            : {}),\n          backgroundImage: `url('${spriteUrl}')`,\n          backgroundPosition: `${x * (100 / (columns - 1))}% ${y * (100 / (rows - 1))}%`,\n          backgroundSize: `${columns * 100}% ${rows * 100}%`,\n          height:\n            'var(--str-chat__sprite-image-height, calc(var(--str-chat__sprite-item-height) * var(--str-chat__sprite-image-resize-ratio)))',\n          width:\n            'var(--str-chat__sprite-image-width, calc(var(--str-chat__sprite-item-width) * var(--str-chat__sprite-image-resize-ratio)))',\n        } as React.CSSProperties\n      }\n    />\n  );\n};\n","import type { ComponentRef } from 'react';\nimport React, { useRef } from 'react';\nimport { ReactionSelector as DefaultReactionSelector } from './ReactionSelector';\nimport { DialogAnchor, useDialogIsOpen, useDialogOnNearestManager } from '../Dialog';\nimport {\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\n\nimport type { IconProps } from '../../types/types';\nimport { QuickMessageActionsButton } from '../MessageActions';\n\ntype ReactionSelectorWithButtonProps = {\n  /* Custom component rendering the icon used in a button invoking reactions selector for a given message. */\n  ReactionIcon: React.ComponentType<IconProps>;\n};\n\n/**\n * Internal convenience component - not to be exported. It just groups the button and the dialog anchor and thus prevents\n * cluttering the parent component.\n */\nexport const ReactionSelectorWithButton = ({\n  ReactionIcon,\n}: ReactionSelectorWithButtonProps) => {\n  const { t } = useTranslationContext('ReactionSelectorWithButton');\n  const { isMyMessage, message, threadList } = useMessageContext('MessageOptions');\n  const { ReactionSelector = DefaultReactionSelector } =\n    useComponentContext('MessageOptions');\n  const buttonRef = useRef<ComponentRef<'button'>>(null);\n  const dialogId = DefaultReactionSelector.getDialogId({\n    messageId: message.id,\n    threadList,\n  });\n  const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n  const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n  return (\n    <>\n      <DialogAnchor\n        dialogManagerId={dialogManager?.id}\n        id={dialogId}\n        offset={8}\n        placement={isMyMessage() ? 'top-end' : 'top-start'}\n        referenceElement={buttonRef.current}\n        trapFocus\n        updatePositionOnContentResize\n      >\n        <ReactionSelector />\n      </DialogAnchor>\n      <QuickMessageActionsButton\n        aria-expanded={dialogIsOpen}\n        aria-label={t('aria/Open Reaction Selector')}\n        className='str-chat__message-reactions-button'\n        data-testid='message-reaction-action'\n        onClick={() => dialog?.toggle()}\n        ref={buttonRef}\n      >\n        <ReactionIcon className='str-chat__message-action-icon' />\n      </QuickMessageActionsButton>\n    </>\n  );\n};\n","import React from 'react';\nimport { useChatContext, useMessageContext, useTranslationContext } from '../../context';\nimport { useNotificationApi } from '../Notifications';\nimport {\n  ContextMenuBackButton,\n  ContextMenuButton,\n  ContextMenuHeader,\n  useContextMenuContext,\n} from '../Dialog';\nimport { IconChevronLeft } from '../Icons';\n\nconst getErrorMessage = (error: unknown, fallback: string) =>\n  error instanceof Error && error.message ? error.message : fallback;\n\nconst getNotificationError = (error: unknown): Error | undefined => {\n  if (error instanceof Error) return error;\n  if (typeof error === 'string') return new Error(error);\n  if (error && typeof error === 'object' && 'message' in error) {\n    const message = error.message;\n    if (typeof message === 'string') return new Error(message);\n  }\n  return undefined;\n};\n\nexport const RemindMeSubmenuHeader = () => {\n  const { t } = useTranslationContext();\n  const { returnToParentMenu } = useContextMenuContext();\n  return (\n    <ContextMenuHeader>\n      <ContextMenuBackButton onClick={returnToParentMenu}>\n        <IconChevronLeft />\n        <span>{t('Remind Me')}</span>\n      </ContextMenuBackButton>\n    </ContextMenuHeader>\n  );\n};\n\nexport const RemindMeSubmenu = () => {\n  const { t } = useTranslationContext();\n  const { client } = useChatContext();\n  const { message } = useMessageContext();\n  const { closeMenu } = useContextMenuContext();\n  const { addNotification } = useNotificationApi();\n  return (\n    <div\n      aria-label={t('aria/Remind Me Options')}\n      className='str-chat__message-actions-box__submenu'\n      role='menu'\n    >\n      {client.reminders.scheduledOffsetsMs.map((offsetMs) => (\n        <ContextMenuButton\n          className='str-chat__message-actions-list-item-button'\n          key={`reminder-offset-option--${offsetMs}`}\n          onClick={async () => {\n            try {\n              await client.reminders.upsertReminder({\n                messageId: message.id,\n                remind_at: new Date(new Date().getTime() + offsetMs).toISOString(),\n              });\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                message: t('Reminder set'),\n                severity: 'success',\n                type: 'api:message:reminder:set:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(error, 'Error setting reminder'),\n                severity: 'error',\n                type: 'api:message:reminder:set:failed',\n              });\n            } finally {\n              closeMenu();\n            }\n          }}\n        >\n          {t('duration/Remind Me', { milliseconds: offsetMs })}\n        </ContextMenuButton>\n      ))}\n      {/* todo: potential improvement to add a custom option that would trigger rendering modal with custom date picker - we need date picker */}\n    </div>\n  );\n};\n","import { Button, type ButtonProps } from '../Button';\nimport clsx from 'clsx';\nimport React from 'react';\n\nexport const QuickMessageActionsButton = ({ className, ...props }: ButtonProps) => (\n  <Button\n    appearance='ghost'\n    circular\n    className={clsx('str-chat__message-actions-box-button', className)}\n    size='sm'\n    variant='secondary'\n    {...props}\n  />\n);\n","import { Alert } from '../Dialog';\nimport { Button } from '../Button';\nimport React from 'react';\nimport { useModalContext, useTranslationContext } from '../../context';\n\nexport type DeleteMessageAlertProps = {\n  onCancel: () => void;\n  onDelete: () => void;\n};\n\nexport const DeleteMessageAlert = ({ onCancel, onDelete }: DeleteMessageAlertProps) => {\n  const { t } = useTranslationContext();\n  const { close } = useModalContext();\n\n  return (\n    <Alert.Root\n      className='str-chat__delete-message-alert'\n      data-testid='message-delete-alert'\n    >\n      <Alert.Header\n        description={t('Are you sure you want to delete this message?')}\n        title={t('Delete message')}\n      />\n      <Alert.Actions>\n        <Button\n          appearance='outline'\n          className='str-chat__delete-message-alert__delete-button'\n          data-testid='delete-message-alert-delete-button'\n          onClick={onDelete}\n          size='md'\n          variant='danger'\n        >\n          {t('Delete message')}\n        </Button>\n        <Button\n          appearance='outline'\n          autoFocus\n          className='str-chat__delete-message-alert__cancel-button'\n          data-testid='delete-message-alert-cancel-button'\n          onClick={() => {\n            onCancel();\n            close();\n          }}\n          size='md'\n          variant='secondary'\n        >\n          {t('Cancel')}\n        </Button>\n      </Alert.Actions>\n    </Alert.Root>\n  );\n};\n","import {\n  type Attachment,\n  isAudioAttachment,\n  isFileAttachment,\n  isImageAttachment,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n  type LocalAttachment,\n  type LocalUploadAttachment,\n} from 'stream-chat';\n\n/**\n * Download behavior notes:\n *\n * - Remote attachments prefer `fetch -> blob -> objectURL` instead of direct link clicks.\n * - In Chromium, direct sequential clicks on cross-origin URLs can yield only one actual\n *   downloaded file even when multiple anchor clicks are fired.\n * - Blob URLs are same-document downloads and preserve caller-provided `a.download` names\n *   more reliably than direct remote URLs.\n * - If remote fetch fails (e.g. CORS/policy/network), the code falls back to direct URL\n *   download so the action remains functional.\n */\nexport type DownloadableAttachment = {\n  asset_url?: string;\n  image_url?: string;\n  localMetadata?: LocalUploadAttachment['localMetadata'];\n  title?: string;\n};\n\nexport const isDownloadableAttachment = (\n  attachment: unknown,\n): attachment is DownloadableAttachment => {\n  if (!attachment || typeof attachment !== 'object') return false;\n  const typedAttachment = attachment as Attachment | LocalAttachment;\n\n  return (\n    isFileAttachment(typedAttachment) ||\n    isImageAttachment(typedAttachment) ||\n    isVideoAttachment(typedAttachment) ||\n    isAudioAttachment(typedAttachment) ||\n    isVoiceRecordingAttachment(typedAttachment)\n  );\n};\n\nconst triggerUrlDownload = ({\n  filename,\n  openInNewTab,\n  revokeObjectUrl,\n  url,\n}: {\n  openInNewTab?: boolean;\n  revokeObjectUrl?: boolean;\n  url: string;\n  filename: string;\n}) => {\n  const anchor = document.createElement('a');\n  anchor.download = filename;\n  anchor.href = url;\n  anchor.rel = 'noopener noreferrer';\n  // Keep chat in place for direct remote URLs by opening in a new tab when requested.\n  if (openInNewTab && !url.startsWith('blob:')) {\n    anchor.target = '_blank';\n  }\n  document.body.append(anchor);\n  anchor.click();\n  anchor.remove();\n\n  // Revoke object URLs by default; direct network URLs are never revoked.\n  const shouldRevokeObjectUrl = revokeObjectUrl ?? url.startsWith('blob:');\n  if (shouldRevokeObjectUrl && url.startsWith('blob:')) {\n    setTimeout(() => URL.revokeObjectURL(url), 0);\n  }\n};\n\nconst fetchRemoteAttachmentAsObjectUrl = async (url: string) => {\n  if (typeof fetch !== 'function') return null;\n\n  const response = await fetch(url);\n  if (!response.ok) {\n    throw new Error(`Failed to fetch attachment, status ${response.status}`);\n  }\n  const blob = await response.blob();\n  return URL.createObjectURL(blob);\n};\n\nexport const downloadAttachment = async (\n  attachment: DownloadableAttachment,\n  options: { openRemoteInNewTab?: boolean; preferRemoteFetch?: boolean } = {},\n) => {\n  const { openRemoteInNewTab = true, preferRemoteFetch = true } = options;\n  const titleFallback = attachment.title ?? 'downloaded-attachment';\n  const rawFile = attachment.localMetadata?.file;\n\n  if (rawFile instanceof Blob) {\n    const filename =\n      rawFile instanceof File && rawFile.name ? rawFile.name : titleFallback;\n    triggerUrlDownload({\n      filename,\n      url: URL.createObjectURL(rawFile),\n    });\n    return;\n  }\n\n  const filename =\n    rawFile &&\n    typeof rawFile === 'object' &&\n    'name' in rawFile &&\n    typeof (rawFile as { name: unknown }).name === 'string'\n      ? (rawFile as { name: string }).name\n      : titleFallback;\n\n  const url = attachment.asset_url ?? attachment.image_url;\n  if (!url) return;\n\n  // Prefer blob-based download for remote files when requested.\n  if (preferRemoteFetch) {\n    try {\n      const objectUrl = await fetchRemoteAttachmentAsObjectUrl(url);\n      if (objectUrl) {\n        triggerUrlDownload({\n          filename,\n          url: objectUrl,\n        });\n        return;\n      }\n    } catch {\n      // Fall back to direct URL download when fetch is blocked (e.g. CORS/policy).\n    }\n  }\n\n  triggerUrlDownload({ filename, openInNewTab: openRemoteInNewTab, url });\n};\n\nexport const downloadAllAttachments = async (attachments: DownloadableAttachment[]) => {\n  // Sequential execution keeps user intent clear and avoids bursting simultaneous requests.\n  for (const attachment of attachments) {\n    await downloadAttachment(attachment, {\n      openRemoteInNewTab: true,\n      preferRemoteFetch: true,\n    });\n  }\n};\n","/* eslint-disable sort-keys */\nimport React, { forwardRef, useState } from 'react';\n\nimport { GlobalModal } from '../Modal';\nimport {\n  IconAudio,\n  IconBell,\n  IconBellOff,\n  IconBookmark,\n  IconBookmarkRemove,\n  IconChevronLeft,\n  IconCopy,\n  IconDelete,\n  IconDownload,\n  IconEdit,\n  IconEmoji,\n  IconFlag,\n  IconMore,\n  IconMute,\n  IconNoSign,\n  IconNotification,\n  IconPin,\n  IconQuote,\n  IconReply,\n  IconRetry,\n  IconThread,\n  IconUnpin,\n  IconUserCheck,\n} from '../Icons';\nimport { isMessageDeleted, isUserMuted } from '../Message/utils';\nimport { useMessageComposerController } from '../MessageComposer/hooks/useMessageComposerController';\nimport { savePreEditSnapshot } from '../MessageComposer/preEditSnapshot';\nimport { useNotificationApi } from '../Notifications';\nimport { useMessageReminder } from '../Message/hooks/useMessageReminder';\nimport { ReactionSelector as DefaultReactionSelector } from '../Reactions';\nimport { ReactionSelectorWithButton } from '../Reactions/ReactionSelectorWithButton';\nimport {\n  useChatContext,\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport { RemindMeSubmenu, RemindMeSubmenuHeader } from './RemindMeSubmenu';\nimport {\n  ContextMenuBackButton,\n  ContextMenuButton,\n  ContextMenuHeader,\n  DialogAnchor,\n  useContextMenuContext,\n  useDialogIsOpen,\n  useDialogOnNearestManager,\n} from '../Dialog';\nimport { MessageActions, type MessageActionSetItem } from './MessageActions';\nimport { QuickMessageActionsButton } from './QuickMessageActionButton';\nimport clsx from 'clsx';\nimport { DeleteMessageAlert } from './DeleteMessageAlert';\nimport {\n  downloadAllAttachments,\n  downloadAttachment,\n  isDownloadableAttachment,\n} from './downloadUtils';\n\nconst msgActionsBoxButtonClassName =\n  'str-chat__message-actions-list-item-button' as const;\n\nconst MessageActionsMenuItemButton = (\n  props: React.ComponentProps<typeof ContextMenuButton>,\n) => <ContextMenuButton {...props} />;\n\nconst getErrorMessage = (error: unknown, fallback: string) =>\n  error instanceof Error && error.message ? error.message : fallback;\n\nconst getNotificationError = (error: unknown): Error | undefined => {\n  if (error instanceof Error) return error;\n  if (typeof error === 'string') return new Error(error);\n  if (error && typeof error === 'object' && 'message' in error) {\n    const message = error.message;\n    if (typeof message === 'string') return new Error(message);\n  }\n  return undefined;\n};\n\nconst DefaultMessageActionComponents = {\n  dropdown: {\n    React() {\n      const { ReactionSelector = DefaultReactionSelector } = useComponentContext();\n      const { anchorReferenceElement } = useContextMenuContext();\n      const { isMyMessage, message, threadList } = useMessageContext();\n      const { t } = useTranslationContext();\n      const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n      const dialogId = `${DefaultReactionSelector.getDialogId({\n        messageId: message.id,\n        threadList,\n      })}-dropdown`;\n      const { dialog, dialogManager } = useDialogOnNearestManager({\n        id: dialogId,\n      });\n      const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n      return (\n        <>\n          <DialogAnchor\n            dialogManagerId={dialogManager?.id}\n            id={dialogId}\n            offset={8}\n            placement={isMyMessage() ? 'top-end' : 'top-start'}\n            referenceElement={referenceElement}\n            trapFocus\n            updatePositionOnContentResize\n          >\n            <ReactionSelector dialogId={dialogId} />\n          </DialogAnchor>\n          <MessageActionsMenuItemButton\n            aria-expanded={dialogIsOpen}\n            aria-label={t('aria/Open Reaction Selector')}\n            className={clsx(\n              msgActionsBoxButtonClassName,\n              'str-chat__message-actions-list-item-button--react',\n            )}\n            data-testid='dropdown-react-action'\n            Icon={IconEmoji}\n            onClick={(event) => {\n              if (dialogIsOpen) {\n                dialog.close();\n                return;\n              }\n              setReferenceElement(\n                anchorReferenceElement instanceof HTMLElement\n                  ? anchorReferenceElement\n                  : event.currentTarget,\n              );\n              dialog.open();\n            }}\n          >\n            {t('Add reaction')}\n          </MessageActionsMenuItemButton>\n        </>\n      );\n    },\n    ThreadReply() {\n      const { closeMenu } = useContextMenuContext();\n      const { handleOpenThread } = useMessageContext();\n      const { t } = useTranslationContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Open Thread')}\n          className={msgActionsBoxButtonClassName}\n          data-testid='thread-action'\n          Icon={IconThread}\n          onClick={(e) => {\n            handleOpenThread(e);\n            closeMenu();\n          }}\n        >\n          {t('Thread Reply')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Quote() {\n      const { closeMenu } = useContextMenuContext();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n      const messageComposer = useMessageComposerController();\n\n      const handleQuote = () => {\n        messageComposer.setQuotedMessage(message);\n\n        const elements = message.parent_id\n          ? document.querySelectorAll('.str-chat__thread .str-chat__textarea__textarea')\n          : document.getElementsByClassName('str-chat__textarea__textarea');\n        const textarea = elements.item(0);\n\n        if (textarea instanceof HTMLTextAreaElement) {\n          textarea.focus();\n        }\n      };\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Quote Message')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconQuote}\n          onClick={() => {\n            handleQuote();\n            closeMenu();\n          }}\n        >\n          {t('Quote Reply')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Download() {\n      const { closeMenu, openSubmenu } = useContextMenuContext();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n\n      const downloadableAttachments = (message.attachments ?? []).filter(\n        isDownloadableAttachment,\n      );\n\n      if (!downloadableAttachments.length) return null;\n\n      const DownloadSubmenuHeader = () => {\n        const { returnToParentMenu: goBack } = useContextMenuContext();\n        const { t: translate } = useTranslationContext();\n        return (\n          <ContextMenuHeader>\n            <ContextMenuBackButton onClick={goBack}>\n              <IconChevronLeft />\n              <span>{translate('Download Attachment')}</span>\n            </ContextMenuBackButton>\n          </ContextMenuHeader>\n        );\n      };\n\n      const DownloadSubmenu = () => (\n        <div\n          aria-label={t('aria/Download attachment')}\n          className='str-chat__message-actions-box__submenu str-chat__message-actions-box__submenu--download-attachments'\n          role='menu'\n        >\n          {downloadableAttachments.map((attachment, index) => {\n            const fileName =\n              attachment.localMetadata?.file?.name ??\n              attachment.title ??\n              t('Download Attachment');\n\n            return (\n              <MessageActionsMenuItemButton\n                className={msgActionsBoxButtonClassName}\n                Icon={IconDownload}\n                key={\n                  attachment.localMetadata?.id ??\n                  attachment.asset_url ??\n                  attachment.image_url ??\n                  `${fileName}-${index}`\n                }\n                onClick={() => {\n                  void downloadAttachment(attachment);\n                  closeMenu();\n                }}\n              >\n                {`Download ${fileName}`}\n              </MessageActionsMenuItemButton>\n            );\n          })}\n          <MessageActionsMenuItemButton\n            className={msgActionsBoxButtonClassName}\n            Icon={IconDownload}\n            onClick={() => {\n              void downloadAllAttachments(downloadableAttachments);\n              closeMenu();\n            }}\n          >\n            {t('Download All')}\n          </MessageActionsMenuItemButton>\n        </div>\n      );\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Download attachment')}\n          className={msgActionsBoxButtonClassName}\n          hasSubMenu={downloadableAttachments.length > 1}\n          Icon={IconDownload}\n          onClick={(event) => {\n            if (downloadableAttachments.length > 1) {\n              openSubmenu({\n                focusReturnTarget: event.currentTarget,\n                Header: DownloadSubmenuHeader,\n                Submenu: DownloadSubmenu,\n              });\n              return;\n            }\n\n            void downloadAttachment(downloadableAttachments[0]);\n            closeMenu();\n          }}\n        >\n          {t('Download Attachment')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Pin() {\n      const { closeMenu } = useContextMenuContext();\n      const { handlePin, message } = useMessageContext();\n      const { addNotification } = useNotificationApi();\n      const { t } = useTranslationContext();\n      const isPinned = !!message.pinned;\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={isPinned ? t('aria/Unpin Message') : t('aria/Pin Message')}\n          className={msgActionsBoxButtonClassName}\n          Icon={isPinned ? IconUnpin : IconPin}\n          onClick={async (event) => {\n            try {\n              await handlePin(event);\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                message: isPinned ? t('Message unpinned') : t('Message pinned'),\n                severity: 'success',\n                type: isPinned ? 'api:message:unpin:success' : 'api:message:pin:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(\n                  error,\n                  isPinned ? t('Error removing message pin') : t('Error pinning message'),\n                ),\n                severity: 'error',\n                type: isPinned ? 'api:message:unpin:failed' : 'api:message:pin:failed',\n              });\n            }\n            closeMenu();\n          }}\n        >\n          {isPinned ? t('Unpin') : t('Pin')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    CopyMessageText() {\n      const { closeMenu } = useContextMenuContext();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Copy Message Text')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconCopy}\n          onClick={() => {\n            if (message.text) navigator.clipboard.writeText(message.text);\n            closeMenu();\n          }}\n        >\n          {t('Copy Message')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Resend() {\n      const { closeMenu } = useContextMenuContext();\n      const { handleRetry, message } = useMessageContext();\n      const { t } = useTranslationContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Resend Message')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconRetry}\n          onClick={() => {\n            handleRetry(message);\n            closeMenu();\n          }}\n        >\n          {t('Resend')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Edit() {\n      const messageComposer = useMessageComposerController();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n      const { closeMenu } = useContextMenuContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Edit Message')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconEdit}\n          onClick={() => {\n            savePreEditSnapshot(messageComposer);\n            messageComposer.initState({ composition: message });\n            closeMenu();\n          }}\n        >\n          {t('Edit Message')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    MarkUnread() {\n      const { closeMenu } = useContextMenuContext();\n      const { handleMarkUnread, message } = useMessageContext();\n      const { addNotification } = useNotificationApi();\n      const { t } = useTranslationContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Mark Message Unread')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconNotification}\n          onClick={async (event) => {\n            try {\n              await handleMarkUnread(event);\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                message: t('Message marked as unread'),\n                severity: 'success',\n                type: 'api:message:markUnread:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(\n                  error,\n                  t(\n                    'Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.',\n                  ),\n                ),\n                severity: 'error',\n                type: 'api:message:markUnread:failed',\n              });\n            }\n            closeMenu();\n          }}\n        >\n          {t('Mark as unread')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    RemindMe() {\n      const { closeMenu, openSubmenu } = useContextMenuContext();\n      const { client } = useChatContext();\n      const { addNotification } = useNotificationApi();\n      const { t } = useTranslationContext();\n      const { message } = useMessageContext();\n      const reminder = useMessageReminder(message.id);\n      const messageAlreadyBookmarked = reminder && !reminder?.remindAt;\n\n      if (messageAlreadyBookmarked) return null;\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={reminder ? t('aria/Remind Me Message') : t('aria/Remove Reminder')}\n          className={msgActionsBoxButtonClassName}\n          hasSubMenu={!reminder}\n          Icon={reminder ? IconBellOff : IconBell}\n          onClick={async (event) => {\n            if (reminder) {\n              try {\n                await client.reminders.deleteReminder(reminder.id);\n                addNotification({\n                  context: {\n                    message,\n                  },\n                  emitter: 'MessageActions',\n                  message: t('Remove reminder'),\n                  severity: 'success',\n                  type: 'api:message:reminder:delete:success',\n                });\n              } catch (error) {\n                addNotification({\n                  context: {\n                    message,\n                  },\n                  emitter: 'MessageActions',\n                  error: getNotificationError(error),\n                  message: getErrorMessage(error, 'Error removing reminder'),\n                  severity: 'error',\n                  type: 'api:message:reminder:delete:failed',\n                });\n              } finally {\n                closeMenu();\n              }\n            } else {\n              openSubmenu({\n                focusReturnTarget: event.currentTarget,\n                Header: RemindMeSubmenuHeader,\n                Submenu: RemindMeSubmenu,\n              });\n            }\n          }}\n        >\n          {reminder ? t('Remove reminder') : t('Remind me')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    SaveForLater() {\n      const { closeMenu } = useContextMenuContext();\n      const { client } = useChatContext();\n      const { addNotification } = useNotificationApi();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n      const reminder = useMessageReminder(message.id);\n      const messageAlreadyHasReminderScheduled = Boolean(reminder && reminder?.remindAt);\n\n      if (messageAlreadyHasReminderScheduled) return null;\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={\n            reminder ? t('aria/Remove Save For Later') : t('aria/Bookmark Message')\n          }\n          className={msgActionsBoxButtonClassName}\n          Icon={reminder ? IconBookmarkRemove : IconBookmark}\n          onClick={async () => {\n            try {\n              if (reminder) {\n                await client.reminders.deleteReminder(reminder.id);\n                addNotification({\n                  context: {\n                    message,\n                  },\n                  emitter: 'MessageActions',\n                  message: t('Remove save for later'),\n                  severity: 'success',\n                  type: 'api:message:saveForLater:delete:success',\n                });\n              } else {\n                await client.reminders.createReminder({ messageId: message.id });\n                addNotification({\n                  context: {\n                    message,\n                  },\n                  emitter: 'MessageActions',\n                  message: t('Saved for later'),\n                  severity: 'success',\n                  type: 'api:message:saveForLater:create:success',\n                });\n              }\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(\n                  error,\n                  reminder\n                    ? 'Error removing message from saved for later'\n                    : 'Error saving message for later',\n                ),\n                severity: 'error',\n                type: reminder\n                  ? 'api:message:saveForLater:delete:failed'\n                  : 'api:message:saveForLater:create:failed',\n              });\n            } finally {\n              closeMenu();\n            }\n          }}\n        >\n          {reminder ? t('Remove save for later') : t('Save for later')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Flag() {\n      const { closeMenu } = useContextMenuContext();\n      const { handleFlag, message } = useMessageContext();\n      const { addNotification } = useNotificationApi();\n      const { t } = useTranslationContext();\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={t('aria/Flag Message')}\n          className={msgActionsBoxButtonClassName}\n          Icon={IconFlag}\n          onClick={async (event) => {\n            try {\n              await handleFlag(event);\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                message: t('Message has been successfully flagged'),\n                severity: 'success',\n                type: 'api:message:flag:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(error, t('Error adding flag')),\n                severity: 'error',\n                type: 'api:message:flag:failed',\n              });\n            }\n            closeMenu();\n          }}\n        >\n          {t('Flag')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Mute() {\n      const { closeMenu } = useContextMenuContext();\n      const { handleMute, message } = useMessageContext();\n      const { addNotification } = useNotificationApi();\n      const { mutes } = useChatContext();\n      const { t } = useTranslationContext();\n\n      const isMuted = isUserMuted(message, mutes);\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={isMuted ? t('aria/Unmute User') : t('aria/Mute User')}\n          className={msgActionsBoxButtonClassName}\n          Icon={isMuted ? IconAudio : IconMute}\n          onClick={async (event) => {\n            try {\n              await handleMute(event);\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                message: isMuted\n                  ? t('{{ user }} has been unmuted', {\n                      user: message.user?.name || message.user?.id,\n                    })\n                  : t('{{ user }} has been muted', {\n                      user: message.user?.name || message.user?.id,\n                    }),\n                severity: 'success',\n                type: isMuted ? 'api:user:unmute:success' : 'api:user:mute:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  message,\n                },\n                emitter: 'MessageActions',\n                error: getNotificationError(error),\n                message: getErrorMessage(\n                  error,\n                  isMuted ? t('Error unmuting a user ...') : t('Error muting a user ...'),\n                ),\n                severity: 'error',\n                type: isMuted ? 'api:user:unmute:failed' : 'api:user:mute:failed',\n              });\n            }\n            closeMenu();\n          }}\n        >\n          {isMuted ? t('Unmute') : t('Mute')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n    Delete() {\n      const { closeMenu } = useContextMenuContext();\n      const { addNotification } = useNotificationApi();\n      const { Modal = GlobalModal } = useComponentContext();\n      const { handleDelete, message } = useMessageContext();\n      const { t } = useTranslationContext();\n      const [openModal, setOpenModal] = useState(false);\n\n      if (isMessageDeleted(message)) return null;\n\n      return (\n        <>\n          <MessageActionsMenuItemButton\n            aria-label={t('aria/Delete Message')}\n            className={msgActionsBoxButtonClassName}\n            Icon={IconDelete}\n            onClick={() => {\n              setOpenModal(true);\n            }}\n            variant='destructive'\n          >\n            {t('Delete message')}\n          </MessageActionsMenuItemButton>\n          <Modal open={openModal} role='alertdialog'>\n            <DeleteMessageAlert\n              onCancel={() => {\n                setOpenModal(false);\n                closeMenu();\n              }}\n              onDelete={async () => {\n                try {\n                  await handleDelete();\n                  addNotification({\n                    context: {\n                      message,\n                    },\n                    emitter: 'MessageActions',\n                    message: t('Message deleted'),\n                    severity: 'success',\n                    type: 'api:message:delete:success',\n                  });\n                } catch (error) {\n                  addNotification({\n                    context: {\n                      message,\n                    },\n                    emitter: 'MessageActions',\n                    error: getNotificationError(error),\n                    message: getErrorMessage(error, t('Error deleting message')),\n                    severity: 'error',\n                    type: 'api:message:delete:failed',\n                  });\n                } finally {\n                  setOpenModal(false);\n                  closeMenu();\n                }\n              }}\n            />\n          </Modal>\n        </>\n      );\n    },\n    BlockUser() {\n      const { closeMenu } = useContextMenuContext();\n      const { client } = useChatContext();\n      const { message } = useMessageContext();\n      const { t } = useTranslationContext();\n      const isBlocked =\n        !message.user?.id ||\n        new Set(client.blockedUsers.getLatestValue().userIds).has(message.user?.id);\n\n      return (\n        <MessageActionsMenuItemButton\n          aria-label={isBlocked ? t('aria/Unblock User') : t('aria/Block User')}\n          className={clsx(msgActionsBoxButtonClassName)}\n          Icon={isBlocked ? IconUserCheck : IconNoSign}\n          onClick={() => {\n            const targetId = message.user?.id;\n            if (targetId) {\n              if (isBlocked) client.unBlockUser(targetId);\n              else client.blockUser(targetId);\n            }\n            closeMenu();\n          }}\n        >\n          {isBlocked ? t('Unblock User') : t('Block User')}\n        </MessageActionsMenuItemButton>\n      );\n    },\n  },\n  quick: {\n    // eslint-disable-next-line react/display-name\n    DropdownToggle: forwardRef<HTMLButtonElement>((_, ref) => {\n      const { t } = useTranslationContext();\n      const { message, threadList } = useMessageContext();\n      const dropdownDialogIsOpen = useDialogIsOpen(\n        MessageActions.getDialogId({ messageId: message.id }),\n      );\n      const { dialog } = useDialogOnNearestManager({\n        id: MessageActions.getDialogId({ messageId: message.id }),\n      });\n      const reactionSelectorDialogId = DefaultReactionSelector.getDialogId({\n        messageId: message.id,\n        threadList,\n      });\n      const { dialog: dropdownReactionSelectorDialog } = useDialogOnNearestManager({\n        id: `${reactionSelectorDialogId}-dropdown`,\n      });\n\n      return (\n        <QuickMessageActionsButton\n          aria-expanded={dropdownDialogIsOpen}\n          aria-haspopup='true'\n          aria-label={t('aria/Open Message Actions Menu')}\n          className='str-chat__message-actions-box-button'\n          data-testid='message-actions-toggle-button'\n          onClick={() => {\n            // Close dropdown-anchored reaction selectors before toggling actions menu\n            // to avoid stale selector re-anchoring.\n            dropdownReactionSelectorDialog?.close();\n            dialog?.toggle();\n          }}\n          ref={ref}\n        >\n          <IconMore className='str-chat__message-action-icon' />\n        </QuickMessageActionsButton>\n      );\n    }),\n    React() {\n      return <ReactionSelectorWithButton ReactionIcon={IconEmoji} />;\n    },\n    Reply() {\n      const { handleOpenThread } = useMessageContext();\n      const { t } = useTranslationContext();\n\n      return (\n        <QuickMessageActionsButton\n          aria-label={t('aria/Open Thread')}\n          className='str-chat__message-reply-in-thread-button'\n          data-testid='thread-action'\n          onClick={handleOpenThread}\n        >\n          <IconReply className='str-chat__message-action-icon' />\n        </QuickMessageActionsButton>\n      );\n    },\n  },\n};\n\nexport const defaultMessageActionSet: MessageActionSetItem[] = [\n  {\n    Component: DefaultMessageActionComponents.quick.DropdownToggle,\n    placement: 'quick-dropdown-toggle',\n  },\n  {\n    Component: DefaultMessageActionComponents.quick.Reply,\n    placement: 'quick',\n    type: 'reply',\n  },\n  {\n    Component: DefaultMessageActionComponents.quick.React,\n    placement: 'quick',\n    type: 'react',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.React,\n    placement: 'dropdown',\n    type: 'react',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.ThreadReply,\n    placement: 'dropdown',\n    type: 'reply',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Quote,\n    placement: 'dropdown',\n    type: 'quote',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Download,\n    placement: 'dropdown',\n    type: 'download',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Pin,\n    placement: 'dropdown',\n    type: 'pin',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.CopyMessageText,\n    placement: 'dropdown',\n    type: 'copyMessageText',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Resend,\n    placement: 'dropdown',\n    type: 'resendMessage',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Edit,\n    placement: 'dropdown',\n    type: 'edit',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.MarkUnread,\n    placement: 'dropdown',\n    type: 'markUnread',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.RemindMe,\n    placement: 'dropdown',\n    type: 'remindMe',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.SaveForLater,\n    placement: 'dropdown',\n    type: 'saveForLater',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Flag,\n    placement: 'dropdown',\n    type: 'flag',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Mute,\n    placement: 'dropdown',\n    type: 'mute',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.Delete,\n    placement: 'dropdown',\n    type: 'delete',\n  },\n  {\n    Component: DefaultMessageActionComponents.dropdown.BlockUser,\n    placement: 'dropdown',\n    type: 'blockUser',\n  },\n] as const;\n","import { useMemo } from 'react';\n\nexport const useSplitActionSet = <\n  T extends\n    | { placement: 'quick' }\n    | { placement: 'dropdown' }\n    | { placement: 'quick-dropdown-toggle' },\n>(\n  actionSet: T[],\n) =>\n  useMemo(() => {\n    const quickActionSet: Extract<T, { placement: 'quick' }>[] = [];\n    const dropdownActionSet: Extract<T, { placement: 'dropdown' }>[] = [];\n    let quickDropdownToggleAction:\n      | Extract<T, { placement: 'quick-dropdown-toggle' }>\n      | undefined;\n\n    for (const action of actionSet) {\n      if (action.placement === 'quick')\n        quickActionSet.push(action as (typeof quickActionSet)[number]);\n      if (action.placement === 'dropdown')\n        dropdownActionSet.push(action as (typeof dropdownActionSet)[number]);\n      if (action.placement === 'quick-dropdown-toggle') {\n        quickDropdownToggleAction ??= action as Extract<\n          T,\n          { placement: 'quick-dropdown-toggle' }\n        >;\n      }\n    }\n\n    return { dropdownActionSet, quickActionSet, quickDropdownToggleAction } as const;\n  }, [actionSet]);\n","import clsx from 'clsx';\nimport React, { type ComponentPropsWithRef, useState } from 'react';\n\nimport {\n  useComponentContext,\n  useMessageContext,\n  useTranslationContext,\n} from '../../context';\nimport {\n  ContextMenu,\n  type ContextMenuItemProps,\n  useDialogIsOpen,\n  useDialogOnNearestManager,\n} from '../Dialog';\nimport { useBaseMessageActionSetFilter } from './hooks';\nimport { defaultMessageActionSet } from './MessageActions.defaults';\nimport { type MESSAGE_ACTIONS } from '../Message';\nimport { ReactionSelector } from '../Reactions';\nimport { useSplitActionSet } from '../Chat/hooks/useSplitActionSet';\n\ntype BaseMessageActionSetItem = {\n  type: keyof typeof MESSAGE_ACTIONS | (string & {});\n};\n\nexport type QuickMessageActionSetItem = BaseMessageActionSetItem & {\n  Component: React.ComponentType;\n  placement: 'quick';\n};\n\nexport type DropdownMessageActionSetItem = BaseMessageActionSetItem & {\n  Component: React.ComponentType<ContextMenuItemProps>;\n  placement: 'dropdown';\n};\n\nexport type QuickDropdownToggleActionSetItem = {\n  Component: React.ComponentType<ComponentPropsWithRef<'button'>>;\n  placement: 'quick-dropdown-toggle';\n};\n\nexport type MessageActionSetItem =\n  | QuickMessageActionSetItem\n  | DropdownMessageActionSetItem\n  | QuickDropdownToggleActionSetItem;\n\nexport type MessageActionsProps = {\n  disableBaseMessageActionSetFilter?: boolean;\n  messageActionSet?: MessageActionSetItem[];\n};\n\ninterface MessageActionsInterface {\n  (props: MessageActionsProps): React.ReactNode;\n  getDialogId: (_: { messageId: string }) => string;\n  displayName: string;\n}\n\n/**\n * A new actions component to replace current `MessageOptions` component.\n * Exports from `stream-chat-react/experimental` __MIGHT__ change - use with caution\n * and follow release notes in case you notice unexpected behavior.\n */\nexport const MessageActions: MessageActionsInterface = ({\n  disableBaseMessageActionSetFilter = false,\n  messageActionSet = defaultMessageActionSet,\n}) => {\n  const { isMyMessage, message, threadList } = useMessageContext();\n  const { ContextMenu: ContextMenuComponent = ContextMenu } = useComponentContext();\n  const { t } = useTranslationContext();\n  const [actionsBoxButtonElement, setActionsBoxButtonElement] =\n    useState<HTMLButtonElement | null>(null);\n\n  const filteredMessageActionSet = useBaseMessageActionSetFilter(\n    messageActionSet,\n    disableBaseMessageActionSetFilter,\n  );\n\n  const { dropdownActionSet, quickActionSet, quickDropdownToggleAction } =\n    useSplitActionSet(filteredMessageActionSet);\n\n  const messageActionsDialogId = MessageActions.getDialogId({ messageId: message.id });\n  const reactionSelectorDialogId = ReactionSelector.getDialogId({\n    messageId: message.id,\n    threadList,\n  });\n  const dropdownReactionSelectorDialogId = `${reactionSelectorDialogId}-dropdown`;\n  const { dialog, dialogManager } = useDialogOnNearestManager({\n    id: messageActionsDialogId,\n  });\n  const messageActionsDialogIsOpen = useDialogIsOpen(\n    messageActionsDialogId,\n    dialogManager?.id,\n  );\n  const reactionSelectorDialogIsOpen = useDialogIsOpen(\n    reactionSelectorDialogId,\n    dialogManager?.id,\n  );\n  const dropdownReactionSelectorDialogIsOpen = useDialogIsOpen(\n    dropdownReactionSelectorDialogId,\n    dialogManager?.id,\n  );\n\n  // do not render anything if total action count is zero\n  if (dropdownActionSet.length + quickActionSet.length === 0) {\n    return null;\n  }\n\n  return (\n    <div\n      className={clsx('str-chat__message-options', {\n        'str-chat__message-options--active':\n          messageActionsDialogIsOpen ||\n          reactionSelectorDialogIsOpen ||\n          dropdownReactionSelectorDialogIsOpen,\n      })}\n    >\n      {quickDropdownToggleAction && dropdownActionSet.length > 0 && (\n        <>\n          <quickDropdownToggleAction.Component ref={setActionsBoxButtonElement} />\n\n          <ContextMenuComponent\n            aria-label={t('aria/Message Actions')}\n            backLabel={t('Back')}\n            className={clsx('str-chat__message-actions-box', {\n              'str-chat__message-actions-box--hidden':\n                dropdownReactionSelectorDialogIsOpen,\n              'str-chat__message-actions-box--open': messageActionsDialogIsOpen,\n            })}\n            dialogManagerId={dialogManager?.id}\n            id={messageActionsDialogId}\n            onClose={dialog?.close}\n            placement={isMyMessage() ? 'top-end' : 'top-start'}\n            referenceElement={actionsBoxButtonElement}\n            tabIndex={-1}\n            trapFocus\n          >\n            {dropdownActionSet.map(({ Component, type }) => (\n              <Component key={type} />\n            ))}\n          </ContextMenuComponent>\n        </>\n      )}\n      {quickActionSet.map(({ Component: QuickActionComponent, type }) => (\n        <QuickActionComponent key={type} />\n      ))}\n    </div>\n  );\n};\n\nMessageActions.getDialogId = ({ messageId }) => `message-actions-${messageId}`;\n\nMessageActions.displayName = 'MessageActions';\n","import React, { useMemo, useState } from 'react';\nimport clsx from 'clsx';\nimport { MessageBouncePrompt as DefaultMessageBouncePrompt } from '../MessageBounce';\nimport { MessageDeletedBubble as DefaultMessageDeletedBubble } from './MessageDeletedBubble';\nimport { MessageBlocked as DefaultMessageBlocked } from './MessageBlocked';\nimport { MessageActions as DefaultMessageActions } from '../MessageActions';\nimport { MessageRepliesCountButton as DefaultMessageRepliesCountButton } from './MessageRepliesCountButton';\nimport { MessageStatus as DefaultMessageStatus } from './MessageStatus';\nimport { MessageText } from './MessageText';\nimport { MessageEditedIndicator as DefaultMessageEditedIndicator } from './MessageEditedIndicator';\nimport { MessageTimestamp as DefaultMessageTimestamp } from './MessageTimestamp';\nimport { StreamedMessageText as DefaultStreamedMessageText } from './StreamedMessageText';\nimport { isDateSeparatorMessage } from '../MessageList';\nimport { MessageAlsoSentInChannelIndicator as DefaultMessageAlsoSentInChannelIndicator } from './MessageAlsoSentInChannelIndicator';\nimport { ReminderNotification as DefaultReminderNotification } from './ReminderNotification';\nimport { MessageTranslationIndicator as DefaultMessageTranslationIndicator } from './MessageTranslationIndicator';\nimport { useMessageReminder } from './hooks';\nimport {\n  areMessageUIPropsEqual,\n  countEmojis,\n  isMessageBlocked,\n  isMessageBounced,\n  isMessageDeleted,\n  isMessageEdited,\n  isMessageErrorRetryable,\n  messageHasAttachments,\n  messageHasGiphyAttachment,\n  messageHasQuotedMessage,\n  messageHasReactions,\n  messageHasSingleAttachment,\n  messageTextHasEmojisOnly,\n} from './utils';\n\nimport { Avatar as DefaultAvatar } from '../Avatar';\nimport { Attachment as DefaultAttachment } from '../Attachment';\nimport { Poll } from '../Poll';\nimport { MessageReactions as DefaultMessageReactions } from '../Reactions';\nimport { MessageBounceModal } from '../MessageBounce/MessageBounceModal';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport type { MessageContextValue } from '../../context/MessageContext';\nimport { useMessageContext } from '../../context/MessageContext';\n\nimport {\n  useChannelStateContext,\n  useChatContext,\n  useTranslationContext,\n} from '../../context';\n\nimport type { MessageUIComponentProps } from './types';\nimport { PinIndicator as DefaultPinIndicator } from './PinIndicator';\nimport { QuotedMessage as DefaultQuotedMessage } from './QuotedMessage';\nimport { MessageBubble } from './MessageBubble';\nimport { ErrorBadge } from '../Badge';\n\ntype MessageUIWithContextProps = MessageContextValue;\n\nconst MessageUIWithContext = ({\n  endOfGroup,\n  firstOfGroup,\n  groupedByUser,\n  handleAction,\n  handleOpenThread,\n  highlighted,\n  isMessageAIGenerated,\n  isMyMessage,\n  message,\n  onUserClick,\n  onUserHover,\n  renderText,\n  showAvatar = 'incoming',\n  threadList,\n}: MessageUIWithContextProps) => {\n  const { channel } = useChannelStateContext();\n  const { client } = useChatContext();\n  const { t } = useTranslationContext('MessageUI');\n  const [isBounceDialogOpen, setIsBounceDialogOpen] = useState(false);\n  const reminder = useMessageReminder(message.id);\n\n  const {\n    Attachment = DefaultAttachment,\n    Avatar = DefaultAvatar,\n    MessageActions = DefaultMessageActions,\n    MessageAlsoSentInChannelIndicator = DefaultMessageAlsoSentInChannelIndicator,\n    MessageBlocked = DefaultMessageBlocked,\n    MessageBouncePrompt = DefaultMessageBouncePrompt,\n    MessageDeleted,\n    MessageDeletedBubble = DefaultMessageDeletedBubble,\n    MessageEditedIndicator = DefaultMessageEditedIndicator,\n    MessageReactions = DefaultMessageReactions,\n    MessageRepliesCountButton = DefaultMessageRepliesCountButton,\n    MessageStatus = DefaultMessageStatus,\n    MessageTimestamp = DefaultMessageTimestamp,\n    MessageTranslationIndicator = DefaultMessageTranslationIndicator,\n    PinIndicator = DefaultPinIndicator,\n    QuotedMessage = DefaultQuotedMessage,\n    ReminderNotification = DefaultReminderNotification,\n    StreamedMessageText = DefaultStreamedMessageText,\n  } = useComponentContext('MessageUI');\n\n  const isAIGenerated = useMemo(\n    () => isMessageAIGenerated?.(message),\n    [isMessageAIGenerated, message],\n  );\n  const isDeleted = isMessageDeleted(message);\n\n  const finalAttachments = useMemo(\n    () =>\n      !message.shared_location && !message.attachments\n        ? []\n        : !message.shared_location\n          ? message.attachments\n          : [message.shared_location, ...(message.attachments ?? [])],\n    [message],\n  );\n\n  if (isDateSeparatorMessage(message)) {\n    return null;\n  }\n\n  if (MessageDeleted && isDeleted) {\n    return <MessageDeleted message={message} />;\n  }\n\n  if (isMessageBlocked(message)) {\n    return <MessageBlocked />;\n  }\n\n  const poll = message.poll_id && client.polls.fromState(message.poll_id);\n\n  const memberCount = Object.keys(channel?.state?.members ?? {}).length;\n  const hasAttachment = !isDeleted && messageHasAttachments(message);\n  const hasSingleAttachment = !isDeleted && messageHasSingleAttachment(message);\n  const hasGiphyAttachment = !isDeleted && messageHasGiphyAttachment(message);\n  const hasReactions = !isDeleted && messageHasReactions(message);\n  const hasQuotedMessage = !isDeleted && messageHasQuotedMessage(message);\n  const textHasEmojisOnly = !isDeleted && messageTextHasEmojisOnly(message);\n\n  const allowRetry = isMessageErrorRetryable(message);\n  const isBounced = isMessageBounced(message);\n  const isEdited = isMessageEdited(message) && !isAIGenerated;\n\n  const showMetadata = !groupedByUser || endOfGroup;\n  const showReplyCountButton = !threadList && !!message.reply_count;\n\n  const rootClassName = clsx(\n    'str-chat__message',\n    `str-chat__message--${message.type}`,\n    `str-chat__message--${message.status}`,\n    {\n      'str-chat__message--has-attachment': hasAttachment,\n      'str-chat__message--has-giphy-attachment': hasGiphyAttachment,\n      'str-chat__message--has-no-text': !message.text,\n      'str-chat__message--has-quoted-message': hasQuotedMessage,\n      'str-chat__message--has-single-attachment': hasSingleAttachment,\n      'str-chat__message--has-text': !!message.text,\n      'str-chat__message--highlighted': highlighted,\n      'str-chat__message--is-emoji-only': textHasEmojisOnly,\n      [`str-chat__message--is-emoji-only-count-${countEmojis(message.text)}`]:\n        textHasEmojisOnly,\n      'str-chat__message--me': isMyMessage(),\n      'str-chat__message--other': !isMyMessage(),\n      'str-chat__message--pinned': message.pinned,\n      'str-chat__message--with-avatar': (() => {\n        if (!message.user) return false;\n        if (showAvatar === 'incoming') return !isMyMessage();\n        if (showAvatar === 'outgoing') return isMyMessage();\n        return showAvatar;\n      })(),\n      'str-chat__message--with-reactions': hasReactions,\n      'str-chat__message-send-can-be-retried':\n        message?.status === 'failed' && message?.error?.status !== 403,\n      'str-chat__message-with-thread-link': showReplyCountButton,\n      'str-chat__virtual-message__wrapper--end': endOfGroup,\n      'str-chat__virtual-message__wrapper--first': firstOfGroup,\n      'str-chat__virtual-message__wrapper--group': groupedByUser,\n    },\n  );\n\n  let handleClick: (() => void) | undefined;\n\n  if (isBounced) {\n    handleClick = () => setIsBounceDialogOpen(true);\n  }\n\n  const isMessageInnerInteractive = !!handleClick;\n  const messageInnerAriaLabel = isMessageInnerInteractive\n    ? t('aria/Review bounced message')\n    : undefined;\n\n  const handleMessageInnerKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    if (!handleClick || (event.key !== 'Enter' && event.key !== ' ')) return;\n\n    event.preventDefault();\n    handleClick();\n  };\n\n  return (\n    <>\n      {isBounceDialogOpen && (\n        <MessageBounceModal\n          MessageBouncePrompt={MessageBouncePrompt}\n          onClose={() => setIsBounceDialogOpen(false)}\n          open={isBounceDialogOpen}\n        />\n      )}\n      <div className={rootClassName} key={message.id}>\n        {message.pinned && <PinIndicator message={message} />}\n        {message.show_in_channel && <MessageAlsoSentInChannelIndicator />}\n        {!!reminder && <ReminderNotification reminder={reminder} />}\n        <MessageTranslationIndicator message={message} />\n        {message.user && (\n          <Avatar\n            className='str-chat__avatar--with-border'\n            imageUrl={message.user.image}\n            onClick={onUserClick}\n            onMouseOver={onUserHover}\n            size='md'\n            userName={message.user.name || message.user.id}\n          />\n        )}\n        <div\n          aria-label={messageInnerAriaLabel}\n          className={clsx('str-chat__message-inner', {\n            'str-chat__message-inner--error': allowRetry || isBounced,\n          })}\n          data-testid='message-inner'\n          onClick={handleClick}\n          onKeyDown={isMessageInnerInteractive ? handleMessageInnerKeyDown : undefined}\n          role={isMessageInnerInteractive ? 'button' : undefined}\n          tabIndex={isMessageInnerInteractive ? 0 : undefined}\n        >\n          {!isDeleted && <MessageActions />}\n          {showReplyCountButton && (\n            <MessageRepliesCountButton\n              onClick={handleOpenThread}\n              reply_count={message.reply_count}\n              thread_participants={message.thread_participants}\n            />\n          )}\n          {isDeleted ? (\n            <MessageDeletedBubble />\n          ) : (\n            <>\n              <MessageBubble>\n                {poll && <Poll poll={poll} />}\n                {message.quoted_message && <QuotedMessage />}\n                {finalAttachments?.length ? (\n                  <Attachment\n                    actionHandler={handleAction}\n                    attachments={finalAttachments}\n                  />\n                ) : null}\n                {isAIGenerated ? (\n                  <StreamedMessageText message={message} renderText={renderText} />\n                ) : (\n                  <MessageText message={message} renderText={renderText} />\n                )}\n              </MessageBubble>\n              <div className='str-chat__message-reactions-host'>\n                {hasReactions && <MessageReactions reverse />}\n              </div>\n              <div className='str-chat__message-error-indicator'>\n                <ErrorBadge />\n              </div>\n            </>\n          )}\n        </div>\n        {showMetadata && (\n          <div className='str-chat__message-metadata'>\n            <MessageStatus />\n            {!isMyMessage() && !!message.user && memberCount > 2 && (\n              <span className='str-chat__message-metadata__name'>\n                {message.user.name || message.user.id}\n              </span>\n            )}\n            <MessageTimestamp customClass='str-chat__message-metadata__timestamp' />\n            {!isDeleted && isEdited && <MessageEditedIndicator />}\n          </div>\n        )}\n      </div>\n    </>\n  );\n};\n\nconst MemoizedMessageUI = React.memo(\n  MessageUIWithContext,\n  areMessageUIPropsEqual,\n) as typeof MessageUIWithContext;\n\n/**\n * The default UI component that renders a message and receives functionality and logic from the MessageContext.\n */\nexport const MessageUI = (props: MessageUIComponentProps) => {\n  const messageContext = useMessageContext('MessageUI');\n\n  return <MemoizedMessageUI {...messageContext} {...props} />;\n};\n","import React, { useCallback, useMemo } from 'react';\n\nimport {\n  useActionHandler,\n  useDeleteHandler,\n  useFlagHandler,\n  useMarkUnreadHandler,\n  useMentionsHandler,\n  useMuteHandler,\n  useOpenThreadHandler,\n  usePinHandler,\n  useReactionHandler,\n  useReactionsFetcher,\n  useRetryHandler,\n  useUserHandler,\n  useUserRole,\n} from './hooks';\nimport { areMessagePropsEqual, getMessageActions, MESSAGE_ACTIONS } from './utils';\n\nimport type { MessageContextValue } from '../../context';\nimport {\n  MessageProvider,\n  useChannelStateContext,\n  useChatContext,\n  useComponentContext,\n  useMessageTranslationViewContext,\n} from '../../context';\n\nimport { MessageUI as DefaultMessageUI } from './MessageUI';\n\nimport type { MessageProps } from './types';\n\ntype MessagePropsToOmit =\n  | 'onMentionsClick'\n  | 'onMentionsHover'\n  | 'openThread'\n  | 'retrySendMessage';\n\ntype MessageContextPropsToPick =\n  | 'handleAction'\n  | 'handleDelete'\n  | 'handleFetchReactions'\n  | 'handleFlag'\n  | 'handleMarkUnread'\n  | 'handleMute'\n  | 'handleOpenThread'\n  | 'handlePin'\n  | 'handleReaction'\n  | 'handleRetry'\n  | 'mutes'\n  | 'onMentionsClickMessage'\n  | 'onMentionsHoverMessage'\n  | 'reactionDetailsSort'\n  | 'sortReactions';\n\ntype MessageWithContextProps = Omit<MessageProps, MessagePropsToOmit> &\n  Pick<MessageContextValue, MessageContextPropsToPick> & {\n    canPin: boolean;\n    userRoles: ReturnType<typeof useUserRole>;\n  };\n\nconst MessageWithContext = (props: MessageWithContextProps) => {\n  const {\n    canPin,\n    Message: propMessage,\n    message,\n    messageActions = Object.keys(MESSAGE_ACTIONS),\n    onUserClick: propOnUserClick,\n    onUserHover: propOnUserHover,\n    userRoles,\n  } = props;\n\n  const { client, isMessageAIGenerated } = useChatContext('Message');\n  const { channelConfig, read } = useChannelStateContext('Message');\n  const {\n    Message: contextMessage = DefaultMessageUI,\n    // TODO: remove this passthrough once we drop Message from the ComponentContext\n    MessageUI: contextMessageUI = contextMessage,\n  } = useComponentContext('Message');\n  const { getTranslationView, setTranslationView: setTranslationViewInContext } =\n    useMessageTranslationViewContext();\n\n  const translationView = getTranslationView(message.id, !!message.i18n);\n  const setTranslationView = useCallback(\n    (view: 'original' | 'translated') => setTranslationViewInContext(message.id, view),\n    [message.id, setTranslationViewInContext],\n  );\n\n  const actionsEnabled = message.type === 'regular' && message.status === 'received';\n  const MessageUIComponent = propMessage ?? contextMessageUI;\n\n  const { onUserClick, onUserHover } = useUserHandler(message, {\n    onUserClickHandler: propOnUserClick,\n    onUserHoverHandler: propOnUserHover,\n  });\n\n  const {\n    canDelete,\n    canEdit,\n    canFlag,\n    canMarkUnread,\n    canMute,\n    canQuote,\n    canReact,\n    canReply,\n    isMyMessage,\n  } = userRoles;\n\n  const messageIsUnread = useMemo(\n    () =>\n      !!(\n        !isMyMessage &&\n        client.user?.id &&\n        read &&\n        (!read[client.user.id] ||\n          (message?.created_at &&\n            new Date(message.created_at).getTime() >\n              read[client.user.id].last_read.getTime()))\n      ),\n    [client, isMyMessage, message.created_at, read],\n  );\n\n  const messageActionsHandler = useCallback(\n    () =>\n      getMessageActions(\n        messageActions,\n        {\n          canDelete,\n          canEdit,\n          canFlag,\n          canMarkUnread,\n          canMute,\n          canPin,\n          canQuote,\n          canReact,\n          canReply,\n        },\n        channelConfig,\n      ),\n\n    [\n      messageActions,\n      canDelete,\n      canEdit,\n      canFlag,\n      canMarkUnread,\n      canMute,\n      canPin,\n      canQuote,\n      canReact,\n      canReply,\n      channelConfig,\n    ],\n  );\n\n  const {\n    canPin: canPinPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    messageActions: messageActionsPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    onUserClick: onUserClickPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    onUserHover: onUserHoverPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    userRoles: userRolesPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    ...rest\n  } = props;\n\n  const messageContextValue: MessageContextValue = {\n    ...rest,\n    actionsEnabled,\n    getMessageActions: messageActionsHandler,\n    isMessageAIGenerated,\n    isMyMessage: () => isMyMessage,\n    messageIsUnread,\n    onUserClick,\n    onUserHover,\n    setTranslationView,\n    translationView,\n  };\n\n  return (\n    <MessageProvider value={messageContextValue}>\n      <MessageUIComponent />\n    </MessageProvider>\n  );\n};\n\nconst MemoizedMessage = React.memo(\n  MessageWithContext,\n  areMessagePropsEqual,\n) as typeof MessageWithContext;\n\n/**\n * The Message component is a context provider which implements all the logic required for rendering\n * an individual message. The actual UI of the message is delegated via the Message prop on Channel.\n */\nexport const Message = (props: MessageProps) => {\n  const {\n    closeReactionSelectorOnClick,\n    disableQuotedMessages,\n    message,\n    onMentionsClick: propOnMentionsClick,\n    onMentionsHover: propOnMentionsHover,\n    openThread: propOpenThread,\n    reactionDetailsSort,\n    retrySendMessage: propRetrySendMessage,\n    sortReactions,\n  } = props;\n\n  const { highlightedMessageId, mutes } = useChannelStateContext('Message');\n\n  const handleAction = useActionHandler(message);\n  const handleOpenThread = useOpenThreadHandler(message, propOpenThread);\n  const handleReaction = useReactionHandler(message);\n  const handleRetry = useRetryHandler(propRetrySendMessage);\n  const userRoles = useUserRole(message, disableQuotedMessages);\n\n  const handleFetchReactions = useReactionsFetcher(message);\n\n  const handleDelete = useDeleteHandler(message);\n\n  const handleFlag = useFlagHandler(message);\n\n  const handleMarkUnread = useMarkUnreadHandler(message);\n\n  const handleMute = useMuteHandler(message);\n\n  const { onMentionsClick, onMentionsHover } = useMentionsHandler(message, {\n    onMentionsClick: propOnMentionsClick,\n    onMentionsHover: propOnMentionsHover,\n  });\n\n  const { canPin, handlePin } = usePinHandler(message);\n\n  const highlighted = highlightedMessageId === message.id;\n\n  return (\n    <MemoizedMessage\n      additionalMessageComposerProps={props.additionalMessageComposerProps}\n      autoscrollToBottom={props.autoscrollToBottom}\n      canPin={canPin}\n      closeReactionSelectorOnClick={closeReactionSelectorOnClick}\n      deliveredTo={props.deliveredTo}\n      disableQuotedMessages={props.disableQuotedMessages}\n      formatDate={props.formatDate}\n      groupStyles={props.groupStyles}\n      handleAction={handleAction}\n      handleDelete={handleDelete}\n      handleFetchReactions={handleFetchReactions}\n      handleFlag={handleFlag}\n      handleMarkUnread={handleMarkUnread}\n      handleMute={handleMute}\n      handleOpenThread={handleOpenThread}\n      handlePin={handlePin}\n      handleReaction={handleReaction}\n      handleRetry={handleRetry}\n      highlighted={highlighted}\n      initialMessage={props.initialMessage}\n      lastOwnMessage={props.lastOwnMessage}\n      lastReceivedId={props.lastReceivedId}\n      message={message}\n      Message={props.Message}\n      messageActions={props.messageActions}\n      messageListRect={props.messageListRect}\n      mutes={mutes}\n      onMentionsClickMessage={onMentionsClick}\n      onMentionsHoverMessage={onMentionsHover}\n      onUserClick={props.onUserClick}\n      onUserHover={props.onUserHover}\n      reactionDetailsSort={reactionDetailsSort}\n      readBy={props.readBy}\n      renderText={props.renderText}\n      returnAllReadData={props.returnAllReadData}\n      sortReactions={sortReactions}\n      threadList={props.threadList}\n      unsafeHTML={props.unsafeHTML}\n      userRoles={userRoles}\n    />\n  );\n};\n","import React from 'react';\n\nimport { Message } from '../Message/Message';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type GiphyPreviewMessageProps = {\n  message: LocalMessage;\n};\n\nexport const GiphyPreviewMessage = (props: GiphyPreviewMessageProps) => {\n  const { message } = props;\n\n  return (\n    <div className='giphy-preview-message'>\n      <Message message={message} />\n    </div>\n  );\n};\n","import { useMemo } from 'react';\n\nimport type { GroupStyle, ProcessMessagesParams, RenderedMessage } from '../../utils';\nimport { getGroupStyles, insertIntro, processMessages } from '../../utils';\n\nimport { useChatContext } from '../../../../context/ChatContext';\nimport { useComponentContext } from '../../../../context/ComponentContext';\n\nimport type { Channel, LocalMessage } from 'stream-chat';\n\nexport const useEnrichedMessages = (args: {\n  channel: Channel;\n  disableDateSeparator: boolean;\n  hideDeletedMessages: boolean;\n  hideNewMessageSeparator: boolean;\n  messages: LocalMessage[];\n  noGroupByUser: boolean;\n  groupStyles?: (\n    message: RenderedMessage,\n    previousMessage: RenderedMessage,\n    nextMessage: RenderedMessage,\n    noGroupByUser: boolean,\n    maxTimeBetweenGroupedMessages?: number,\n  ) => GroupStyle;\n  headerPosition?: number;\n  maxTimeBetweenGroupedMessages?: number;\n  reviewProcessedMessage?: ProcessMessagesParams['reviewProcessedMessage'];\n}) => {\n  const {\n    channel,\n    disableDateSeparator,\n    groupStyles,\n    headerPosition,\n    hideDeletedMessages,\n    hideNewMessageSeparator,\n    maxTimeBetweenGroupedMessages,\n    messages,\n    noGroupByUser,\n    reviewProcessedMessage,\n  } = args;\n\n  const { client } = useChatContext('useEnrichedMessages');\n  const { HeaderComponent } = useComponentContext('useEnrichedMessages');\n\n  const lastRead = useMemo(() => channel.lastRead?.(), [channel]);\n\n  const enableDateSeparator = !disableDateSeparator;\n\n  let messagesWithDates =\n    !enableDateSeparator && !hideDeletedMessages && hideNewMessageSeparator\n      ? messages\n      : processMessages({\n          enableDateSeparator,\n          hideDeletedMessages,\n          hideNewMessageSeparator,\n          lastRead,\n          messages,\n          reviewProcessedMessage,\n          userId: client.userID || '',\n        });\n\n  if (HeaderComponent) {\n    messagesWithDates = insertIntro(messagesWithDates, headerPosition);\n  }\n\n  const groupStylesFn = groupStyles || getGroupStyles;\n  const messageGroupStyles = useMemo(\n    () =>\n      messagesWithDates.reduce<Record<string, GroupStyle>>((acc, message, i) => {\n        const style = groupStylesFn(\n          message,\n          messagesWithDates[i - 1],\n          messagesWithDates[i + 1],\n          noGroupByUser,\n          maxTimeBetweenGroupedMessages,\n        );\n        if (style) acc[message.id] = style;\n        return acc;\n      }, {}),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [maxTimeBetweenGroupedMessages, messagesWithDates, noGroupByUser],\n  );\n\n  return { messageGroupStyles, messages: messagesWithDates };\n};\n","import { useCallback, useEffect, useState } from 'react';\nimport throttle from 'lodash.throttle';\n\nimport type { RenderedMessage } from '../../utils';\n\nconst DATE_SEPARATOR_SELECTOR =\n  '.str-chat__date-separator:not(.str-chat__date-separator--floating)';\nconst THROTTLE_MS = 100;\n\nexport type UseFloatingDateSeparatorMessageListParams = {\n  disableDateSeparator: boolean;\n  listElement: HTMLDivElement | null;\n  processedMessages: RenderedMessage[];\n};\n\nexport type UseFloatingDateSeparatorMessageListResult = {\n  floatingDate: Date | null;\n  showFloatingDate: boolean;\n};\n\n/**\n * For non-virtualized MessageList: keeps the floating date synced with the\n * separator currently pinned to the top boundary of the list viewport.\n */\nexport const useFloatingDateSeparatorMessageList = ({\n  disableDateSeparator,\n  listElement,\n  processedMessages,\n}: UseFloatingDateSeparatorMessageListParams): UseFloatingDateSeparatorMessageListResult => {\n  const [state, setState] = useState<{ date: Date | null; visible: boolean }>({\n    date: null,\n    visible: false,\n  });\n\n  const update = useCallback(() => {\n    if (disableDateSeparator || !listElement || processedMessages.length === 0) {\n      setState({ date: null, visible: false });\n      return;\n    }\n\n    const separators = listElement.querySelectorAll<HTMLElement>(DATE_SEPARATOR_SELECTOR);\n    if (separators.length === 0) {\n      setState({ date: null, visible: false });\n      return;\n    }\n\n    const containerRect = listElement.getBoundingClientRect();\n    let bestDate: Date | null = null;\n    let bestTop = -Infinity;\n\n    for (const el of separators) {\n      const rect = el.getBoundingClientRect();\n      const dataDate = el.getAttribute('data-date');\n      if (!dataDate) continue;\n\n      const isAtOrAboveTopBoundary = rect.top <= containerRect.top;\n\n      if (isAtOrAboveTopBoundary && rect.top > bestTop) {\n        bestTop = rect.top;\n        const d = new Date(dataDate);\n        if (!isNaN(d.getTime())) bestDate = d;\n      }\n    }\n\n    setState({\n      date: bestDate,\n      visible: bestDate !== null,\n    });\n  }, [disableDateSeparator, listElement, processedMessages]);\n\n  useEffect(() => {\n    if (!listElement) return;\n\n    const throttled = throttle(update, THROTTLE_MS);\n\n    throttled();\n    listElement.addEventListener('scroll', throttled);\n\n    if (typeof ResizeObserver === 'undefined') {\n      return () => {\n        listElement.removeEventListener('scroll', throttled);\n        throttled.cancel();\n      };\n    }\n\n    const resizeObserver = new ResizeObserver(throttled);\n    resizeObserver.observe(listElement);\n\n    return () => {\n      listElement.removeEventListener('scroll', throttled);\n      resizeObserver.disconnect();\n      throttled.cancel();\n    };\n  }, [listElement, update]);\n\n  return {\n    floatingDate: state.date,\n    showFloatingDate: state.visible,\n  };\n};\n","import { useMemo } from 'react';\nimport type { Channel, LocalMessage, UserResponse } from 'stream-chat';\n\ntype UseLastReadDataParams = {\n  channel: Channel;\n  messages: LocalMessage[];\n  returnAllReadData: boolean;\n  lastOwnMessage?: LocalMessage;\n};\n\nexport const useLastReadData = (props: UseLastReadDataParams) => {\n  const { channel, lastOwnMessage, messages, returnAllReadData } = props;\n\n  return useMemo(() => {\n    if (returnAllReadData) {\n      return messages.reduce(\n        (acc, msg) => {\n          acc[msg.id] = channel.messageReceiptsTracker.readersForMessage({\n            msgId: msg.id,\n            timestampMs: msg.created_at.getTime(),\n          });\n          return acc;\n        },\n        {} as Record<string, UserResponse[]>,\n      );\n    }\n\n    if (!lastOwnMessage) return {};\n    return {\n      [lastOwnMessage.id]: channel.messageReceiptsTracker.readersForMessage({\n        msgId: lastOwnMessage.id,\n        timestampMs: lastOwnMessage.created_at.getTime(),\n      }),\n    };\n  }, [channel, lastOwnMessage, messages, returnAllReadData]);\n};\n","import { useCallback, useEffect, useState } from 'react';\nimport type { Channel, LocalMessage, UserResponse } from 'stream-chat';\n\ntype UseLastDeliveredDataParams = {\n  channel: Channel;\n  messages: LocalMessage[];\n  returnAllReadData: boolean;\n  lastOwnMessage?: LocalMessage;\n};\n\nexport const useLastDeliveredData = (\n  props: UseLastDeliveredDataParams,\n): Record<string, UserResponse[]> => {\n  const { channel, lastOwnMessage, messages, returnAllReadData } = props;\n\n  const calculateForAll = useCallback(\n    () =>\n      messages.reduce(\n        (acc, msg) => {\n          acc[msg.id] = channel.messageReceiptsTracker.deliveredForMessage({\n            msgId: msg.id,\n            timestampMs: msg.created_at.getTime(),\n          });\n          return acc;\n        },\n        {} as Record<string, UserResponse[]>,\n      ),\n    [channel, messages],\n  );\n\n  const calculateForLastOwn = useCallback(() => {\n    if (!lastOwnMessage) return {};\n    return {\n      [lastOwnMessage.id]: channel.messageReceiptsTracker.deliveredForMessage({\n        msgId: lastOwnMessage.id,\n        timestampMs: lastOwnMessage.created_at.getTime(),\n      }),\n    };\n  }, [channel, lastOwnMessage]);\n\n  const [deliveredTo, setDeliveredTo] = useState<Record<string, UserResponse[]>>(\n    returnAllReadData ? calculateForAll : calculateForLastOwn,\n  );\n\n  useEffect(() => {\n    if (!returnAllReadData) return;\n    setDeliveredTo(calculateForAll);\n    return channel.on('message.delivered', () => setDeliveredTo(calculateForAll))\n      .unsubscribe;\n  }, [channel, calculateForAll, returnAllReadData]);\n\n  useEffect(() => {\n    if (returnAllReadData) return;\n    else setDeliveredTo(calculateForLastOwn);\n    return channel.on('message.delivered', () => setDeliveredTo(calculateForLastOwn))\n      .unsubscribe;\n  }, [channel, calculateForLastOwn, returnAllReadData]);\n\n  return deliveredTo;\n};\n","import type React from 'react';\nimport { useMemo } from 'react';\n\nimport { useLastReadData } from '../useLastReadData';\nimport type { GroupStyle, RenderedMessage } from '../../utils';\nimport { getLastReceived } from '../../utils';\n\nimport { useChatContext } from '../../../../context/ChatContext';\nimport { useComponentContext } from '../../../../context/ComponentContext';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { ChannelUnreadUiState } from '../../../../types/types';\nimport type { MessageRenderer, SharedMessageProps } from '../../renderMessages';\nimport { useChannelStateContext } from '../../../../context';\nimport { useLastDeliveredData } from '../useLastDeliveredData';\n\ntype UseMessageListElementsProps = {\n  messages: LocalMessage[];\n  enrichedMessages: RenderedMessage[];\n  internalMessageProps: SharedMessageProps;\n  messageGroupStyles: Record<string, GroupStyle>;\n  renderMessages: MessageRenderer;\n  returnAllReadData: boolean;\n  threadList: boolean;\n  channelUnreadUiState?: ChannelUnreadUiState;\n  lastOwnMessage?: LocalMessage;\n};\n\nexport const useMessageListElements = (props: UseMessageListElementsProps) => {\n  const {\n    channelUnreadUiState,\n    enrichedMessages,\n    internalMessageProps,\n    lastOwnMessage,\n    messageGroupStyles,\n    messages,\n    renderMessages,\n    returnAllReadData,\n    threadList,\n  } = props;\n\n  const { customClasses } = useChatContext('useMessageListElements');\n  const { channel } = useChannelStateContext();\n  const components = useComponentContext('useMessageListElements');\n\n  // get the readData, but only for messages submitted by the user themselves\n  const readData = useLastReadData({\n    channel,\n    lastOwnMessage,\n    messages,\n    returnAllReadData,\n  });\n\n  const ownMessagesDeliveredToOthers = useLastDeliveredData({\n    channel,\n    lastOwnMessage,\n    messages,\n    returnAllReadData,\n  });\n\n  const lastReceivedMessageId = useMemo(\n    () => getLastReceived(enrichedMessages),\n    [enrichedMessages],\n  );\n\n  const elements: React.ReactNode[] = useMemo(\n    () =>\n      renderMessages({\n        channelUnreadUiState,\n        components,\n        customClasses,\n        lastOwnMessage,\n        lastReceivedMessageId,\n        messageGroupStyles,\n        messages: enrichedMessages,\n        ownMessagesDeliveredToOthers,\n        readData,\n        sharedMessageProps: { ...internalMessageProps, returnAllReadData, threadList },\n      }),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      enrichedMessages,\n      internalMessageProps,\n      lastOwnMessage,\n      lastReceivedMessageId,\n      messageGroupStyles,\n      channelUnreadUiState,\n      readData,\n      renderMessages,\n      returnAllReadData,\n      threadList,\n    ],\n  );\n\n  return elements;\n};\n","import { useLayoutEffect, useRef } from 'react';\n\nimport { useChatContext } from '../../../../context/ChatContext';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type ContainerMeasures = {\n  offsetHeight: number;\n  scrollHeight: number;\n  scrollTop: number;\n};\n\nexport type UseMessageListScrollManagerParams = {\n  captureAnchor: () => { id: string; offsetTop: number } | null;\n  disableScrollManagement?: boolean;\n  justReachedLatestMessageSet?: boolean;\n  loadMoreScrollThreshold: number;\n  loadingMore?: boolean;\n  messages: LocalMessage[];\n  onScrollBy: (scrollBy: number) => void;\n  onScrollToTop: () => void;\n  restoreAnchor: (anchor: { id: string; offsetTop: number }) => void;\n  scrollContainerMeasures: () => ContainerMeasures;\n  scrolledUpThreshold: number;\n  scrollToBottom: () => void;\n  showNewMessages: () => void;\n};\n\n// Tracks how the current older-page pagination cycle should restore the viewport\n// once messages are prepended. The mode is chosen when loading starts and cleared\n// after the prepend has been handled.\n//\n// Modes:\n// - `idle`: there is no active older-page restoration strategy\n// - `stick-to-top`: pagination started from the absolute top, so keep the newly\n//   loaded page pinned to the top of the container\n// - `preserve-anchor`: pagination started near the top but not at the absolute\n//   top, so restore the captured anchor message to its previous viewport offset\ntype OlderPaginationState =\n  | { anchor: null; mode: 'idle' }\n  | { anchor: null; mode: 'stick-to-top' }\n  | { anchor: { id: string; offsetTop: number }; mode: 'preserve-anchor' };\n\n// An \"anchor\" is the currently visible message row we want to keep visually pinned\n// to the same spot in the viewport while older messages are inserted above it.\n// It stores:\n// - `id`: which rendered message row should stay stable\n// - `offsetTop`: how far that row sits from the top edge of the scroll container\n//\n// After a prepend, the DOM shifts downward. Restoring the anchor means finding the\n// same message row again and correcting scrollTop until it returns to that offset.\n\n// When all previous messages appear at the start of the new array, the growth\n// happened at the bottom of the list.\nconst messageIdsMatchAsPrefix = (\n  prevMessages: LocalMessage[],\n  newMessages: LocalMessage[],\n) => prevMessages.every((message, index) => message.id === newMessages[index]?.id);\n\n// When all previous messages appear at the end of the new array, the growth\n// happened at the top of the list.\nconst messageIdsMatchAsSuffix = (\n  prevMessages: LocalMessage[],\n  newMessages: LocalMessage[],\n) =>\n  prevMessages.every(\n    (message, index) =>\n      message.id === newMessages[newMessages.length - prevMessages.length + index]?.id,\n  );\n\n/**\n * Coordinates scroll-position preservation when the rendered message array changes.\n *\n * The hook distinguishes three broad cases:\n * 1. Older-page pagination prepends messages at the top of the list.\n *    This path either sticks to the top of the new page or restores a captured\n *    message anchor, depending on where the user was when pagination started.\n * 2. Newer messages append to the bottom of the list.\n *    This path preserves normal chat behavior by auto-scrolling only when the\n *    user was already near the bottom or the appended message is the user's own.\n * 3. Disjunct/overlapping page switches.\n *    These intentionally bypass prepend heuristics because the old and new arrays\n *    are not comparable as a single contiguous list.\n */\nexport function useMessageListScrollManager(params: UseMessageListScrollManagerParams) {\n  const {\n    captureAnchor,\n    disableScrollManagement = false,\n    justReachedLatestMessageSet = false,\n    loadingMore = false,\n    loadMoreScrollThreshold,\n    onScrollBy,\n    onScrollToTop,\n    restoreAnchor,\n    scrollContainerMeasures,\n    scrolledUpThreshold,\n    scrollToBottom,\n    showNewMessages,\n  } = params;\n\n  const { client } = useChatContext('useMessageListScrollManager');\n\n  const measures = useRef<ContainerMeasures>({\n    offsetHeight: 0,\n    scrollHeight: 0,\n    scrollTop: 0,\n  });\n  const messages = useRef<LocalMessage[]>(undefined);\n  const olderPaginationState = useRef<OlderPaginationState>({\n    anchor: null,\n    mode: 'idle',\n  });\n  const previousLoadingMoreRef = useRef(loadingMore);\n  const scrollTop = useRef(0);\n\n  useLayoutEffect(() => {\n    if (disableScrollManagement) {\n      // Even while management is disabled we still refresh the cached list shape,\n      // so the next enabled render compares against the most recent DOM state.\n      messages.current = params.messages;\n      measures.current = scrollContainerMeasures();\n      previousLoadingMoreRef.current = loadingMore;\n      return;\n    }\n\n    const prevMeasures = measures.current;\n    const prevMessages = messages.current;\n    const newMessages = params.messages;\n    const lastNewMessage = newMessages[newMessages.length - 1] || {};\n    const lastPrevMessage = prevMessages?.[prevMessages.length - 1];\n    const newMeasures = scrollContainerMeasures();\n    const startedLoadingOlder = loadingMore && !previousLoadingMoreRef.current;\n    const finishedLoadingOlder = !loadingMore && previousLoadingMoreRef.current;\n\n    if (startedLoadingOlder) {\n      // Read the live DOM scroll position instead of the cached ref so we get\n      // the correct value even when scrollToBottom() has been called but the\n      // async scroll event hasn't updated the ref yet (common on initial mount).\n      const liveMeasures = scrollContainerMeasures();\n      const hasOverflow = liveMeasures.scrollHeight > liveMeasures.offsetHeight;\n      const liveScrollTop = liveMeasures.scrollTop;\n\n      // Older-page pagination uses one of three modes:\n      // - `stick-to-top`: user hit the absolute top and wants to keep reading upward\n      // - `preserve-anchor`: user was only near the top, so keep the same message in view\n      // - `idle`: no restoration needed for this load cycle\n      //\n      // When the container doesn't overflow yet (e.g. content hasn't reached its\n      // final height due to font loading) the scroll position is meaningless, so\n      // default to idle to avoid a false stick-to-top that would jump the list.\n      if (!hasOverflow) {\n        olderPaginationState.current = {\n          anchor: null,\n          mode: 'idle',\n        };\n      } else if (liveScrollTop <= 1) {\n        olderPaginationState.current = {\n          anchor: null,\n          mode: 'stick-to-top',\n        };\n      } else if (liveScrollTop < loadMoreScrollThreshold) {\n        const capturedAnchor = captureAnchor();\n        if (capturedAnchor) {\n          olderPaginationState.current = {\n            anchor: capturedAnchor,\n            mode: 'preserve-anchor',\n          };\n        } else {\n          olderPaginationState.current = {\n            anchor: null,\n            mode: 'idle',\n          };\n        }\n      } else {\n        olderPaginationState.current = {\n          anchor: null,\n          mode: 'idle',\n        };\n      }\n    }\n\n    // Evaluate bottom proximity from the previous render, before any new content\n    // changes the list height and invalidates the prior bottom distance.\n    const wasAtBottom =\n      prevMeasures.scrollHeight - prevMeasures.offsetHeight - scrollTop.current <\n      scrolledUpThreshold;\n\n    if (typeof prevMessages !== 'undefined') {\n      if (prevMessages.length < newMessages.length) {\n        const messagesAddedToTop = messageIdsMatchAsSuffix(prevMessages, newMessages);\n        const messagesAddedToBottom = messageIdsMatchAsPrefix(prevMessages, newMessages);\n\n        // A clean prepend means older messages were inserted ahead of the current\n        // viewport. Restore the viewport according to the mode chosen when loading\n        // started, then clear the mode for the next pagination cycle.\n        if (messagesAddedToTop) {\n          const preservedAnchor =\n            olderPaginationState.current.mode === 'preserve-anchor' &&\n            olderPaginationState.current.anchor &&\n            (finishedLoadingOlder || loadingMore)\n              ? olderPaginationState.current.anchor\n              : null;\n\n          // When pagination was triggered from absolute top, keep the newly\n          // loaded page pinned to top instead of restoring the old viewport.\n          if (olderPaginationState.current.mode === 'stick-to-top') {\n            onScrollToTop();\n          } else if (preservedAnchor) {\n            restoreAnchor(preservedAnchor);\n          } else if (scrollTop.current < loadMoreScrollThreshold) {\n            // Fallback for prepends when there is no stable DOM anchor to restore.\n            // This is less accurate than anchor restoration, but still avoids a full\n            // jump by compensating for the inserted page height.\n            const listHeightDelta = newMeasures.scrollHeight - prevMeasures.scrollHeight;\n            onScrollBy(listHeightDelta);\n          }\n\n          olderPaginationState.current = {\n            anchor: null,\n            mode: 'idle',\n          };\n        }\n        // A clean append means the list grew downward. Preserve the usual chat\n        // semantics: auto-scroll only for self-sent messages or when the user was\n        // already close enough to bottom.\n        else if (messagesAddedToBottom) {\n          if (justReachedLatestMessageSet) {\n            // Merging into the latest page is handled by dedicated logic higher up.\n            // Returning here avoids undoing that behavior with a normal append scroll.\n            messages.current = newMessages;\n            measures.current = newMeasures;\n            previousLoadingMoreRef.current = loadingMore;\n            return;\n          }\n\n          const lastMessageIsFromCurrentUser = lastNewMessage.user?.id === client.userID;\n\n          if (lastMessageIsFromCurrentUser || wasAtBottom) {\n            scrollToBottom();\n          } else {\n            showNewMessages();\n          }\n        } else {\n          // If the new page is neither a pure prepend nor a pure append, treat it as\n          // a disjunct/overlapping page switch and avoid applying prepend heuristics.\n          olderPaginationState.current = {\n            anchor: null,\n            mode: 'idle',\n          };\n        }\n      }\n      // message list length didn't change, but check if last message had reaction/reply update\n      else {\n        const hasNewReactions =\n          lastPrevMessage?.latest_reactions?.length !==\n          lastNewMessage.latest_reactions?.length;\n        const hasNewReplies = lastPrevMessage?.reply_count !== lastNewMessage.reply_count;\n\n        if ((hasNewReactions || hasNewReplies) && wasAtBottom) {\n          scrollToBottom();\n        }\n\n        if (finishedLoadingOlder) {\n          // Clear any older-page mode when the request ends without increasing the\n          // rendered list size, so the next pagination cycle starts from a clean slate.\n          olderPaginationState.current = {\n            anchor: null,\n            mode: 'idle',\n          };\n        }\n      }\n    }\n\n    messages.current = newMessages;\n    measures.current = newMeasures;\n    previousLoadingMoreRef.current = loadingMore;\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [\n    captureAnchor,\n    disableScrollManagement,\n    justReachedLatestMessageSet,\n    loadingMore,\n    measures,\n    messages,\n    params.messages,\n    restoreAnchor,\n    scrollContainerMeasures,\n  ]);\n\n  return (\n    scrollTopValue: number,\n    getLatestAnchor: (() => { id: string; offsetTop: number } | null) | null = null,\n  ) => {\n    scrollTop.current = scrollTopValue;\n\n    if (\n      loadingMore &&\n      getLatestAnchor &&\n      olderPaginationState.current.mode === 'preserve-anchor'\n    ) {\n      // Keep the anchor fresh while the request is in flight so restoration matches\n      // the latest viewport position if the user keeps scrolling before data arrives.\n      // The getter keeps normal scroll events cheap by avoiding DOM anchor capture\n      // unless anchor preservation is actually active.\n      const latestAnchor = getLatestAnchor();\n      if (!latestAnchor) return;\n\n      olderPaginationState.current = {\n        anchor: latestAnchor,\n        mode: 'preserve-anchor',\n      };\n    }\n  };\n}\n","import type React from 'react';\nimport { useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport { useMessageListScrollManager } from './useMessageListScrollManager';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type UseScrollLocationLogicParams = {\n  /** Disables automatic scroll-to-bottom updates after message changes. */\n  disableAutoScrollToBottom?: boolean;\n  /** Disables scroll-management adjustments (anchor restore, append/prepend handling). */\n  disableScrollManagement?: boolean;\n  /** True when there are newer messages to load beyond the currently rendered page. */\n  hasMoreNewer: boolean;\n  /** Scrollable message-list container element. */\n  listElement: HTMLDivElement | null;\n  /** Threshold used to detect older-page pagination proximity near the top. */\n  loadMoreScrollThreshold: number;\n  /** Indicates whether older-page pagination is currently in progress. */\n  loadingMore?: boolean;\n  /** Hard-disable all autoscroll behavior. */\n  suppressAutoscroll: boolean;\n  /** Current rendered message set used for scroll reconciliation. */\n  messages?: LocalMessage[];\n  /** Distance from bottom (px) considered as \"near bottom\". */\n  scrolledUpThreshold?: number;\n};\n\n/**\n * Centralized scroll-position logic for MessageList.\n *\n * Responsibilities:\n * - Keep viewport stable during prepend/append pagination updates.\n * - Track whether the list is near bottom and expose that state to UI.\n * - Auto-scroll to bottom when appropriate while respecting suppression flags.\n * - Perform a short hydration settle pass so freshly loaded lists land at bottom.\n */\nexport const useScrollLocationLogic = (params: UseScrollLocationLogicParams) => {\n  const {\n    disableAutoScrollToBottom = false,\n    disableScrollManagement = false,\n    hasMoreNewer,\n    listElement,\n    loadingMore = false,\n    loadMoreScrollThreshold,\n    messages = [],\n    scrolledUpThreshold = 200,\n    suppressAutoscroll,\n  } = params;\n\n  const [hasNewMessages, setHasNewMessages] = useState(false);\n  const [wrapperRect, setWrapperRect] = useState<DOMRect>();\n  const previousHasMoreNewerRef = useRef(hasMoreNewer);\n  const justReachedLatestMessageSet = previousHasMoreNewerRef.current && !hasMoreNewer;\n  const skipNextAutoScrollRef = useRef(false);\n  const isRestoringOlderAnchorRef = useRef(false);\n\n  const [isMessageListScrolledToBottom, setIsMessageListScrolledToBottom] =\n    useState(true);\n  const closeToBottom = useRef(false);\n  const closeToTop = useRef(false);\n  const previousScrollTopRef = useRef(0);\n  const previousMessagesLengthRef = useRef(messages.length);\n  const previousDisableAutoScrollToBottomRef = useRef(disableAutoScrollToBottom);\n  const previousDisableAutoScrollSettleRef = useRef(disableAutoScrollToBottom);\n  const anchorRestoreCleanupRef = useRef<(() => void) | null>(null);\n\n  const captureAnchor = useCallback(() => {\n    if (!listElement) return null;\n\n    const listRect = listElement.getBoundingClientRect();\n    const listTop = listRect.top;\n    const listBottom = listRect.bottom;\n    const listCenter = listTop + listRect.height / 2;\n    // Older-page pagination should track the top edge, while the generic\n    // “keep this viewport stable” case works better from the center.\n    const preferTopEdgeAnchor =\n      loadingMore || listElement.scrollTop < loadMoreScrollThreshold;\n    const messageElements = Array.from(\n      listElement.querySelectorAll<HTMLElement>('[data-message-id]'),\n    );\n    const messageAnchors = messageElements.map((element) => {\n      const rect = element.getBoundingClientRect();\n      return {\n        center: rect.top + rect.height / 2,\n        element,\n        offsetTop: rect.top - listTop,\n        rect,\n      };\n    });\n\n    const visibleMessageAnchors = messageAnchors.filter(\n      ({ rect }) => rect.bottom > listTop && rect.top < listBottom,\n    );\n\n    const topEdgeAnchor = visibleMessageAnchors.reduce<\n      (typeof visibleMessageAnchors)[number] | null\n    >((closest, candidate) => {\n      if (!closest || candidate.rect.top < closest.rect.top) {\n        return candidate;\n      }\n\n      return closest;\n    }, null);\n\n    const centerAnchor =\n      visibleMessageAnchors.find(\n        ({ rect }) => rect.top <= listCenter && rect.bottom >= listCenter,\n      ) ??\n      visibleMessageAnchors.reduce<(typeof visibleMessageAnchors)[number] | null>(\n        (closest, candidate) => {\n          if (!closest) return candidate;\n\n          const distance = Math.abs(candidate.center - listCenter);\n          const closestDistance = Math.abs(closest.center - listCenter);\n\n          return distance < closestDistance ? candidate : closest;\n        },\n        null,\n      );\n\n    const anchor =\n      (preferTopEdgeAnchor ? topEdgeAnchor : centerAnchor) ?? messageAnchors[0];\n\n    if (!anchor?.element.dataset.messageId) return null;\n\n    return {\n      id: anchor.element.dataset.messageId,\n      offsetTop: anchor.offsetTop,\n    };\n  }, [listElement, loadMoreScrollThreshold, loadingMore]);\n\n  const restoreAnchor = useCallback(\n    (anchor: { id: string; offsetTop: number }) => {\n      if (!listElement) return;\n\n      anchorRestoreCleanupRef.current?.();\n\n      let cancelled = false;\n      let stableFrameCount = 0;\n      let frameQueued = false;\n      let resizeObserver: ResizeObserver | undefined;\n      // eslint-disable-next-line prefer-const\n      let settleTimeoutId: ReturnType<typeof setTimeout> | undefined;\n      let animationFrameId: number | undefined;\n\n      isRestoringOlderAnchorRef.current = true;\n\n      const applyAnchor = () => {\n        if (cancelled) return true;\n\n        const anchorElement = listElement.querySelector<HTMLElement>(\n          `[data-message-id='${anchor.id}']`,\n        );\n        if (!anchorElement) return true;\n\n        const listTop = listElement.getBoundingClientRect().top;\n        const nextOffsetTop = anchorElement.getBoundingClientRect().top - listTop;\n        const offsetDelta = nextOffsetTop - anchor.offsetTop;\n\n        if (Math.abs(offsetDelta) > 1) {\n          listElement.scrollBy({ top: offsetDelta });\n          return false;\n        }\n\n        return true;\n      };\n\n      const cleanup = () => {\n        cancelled = true;\n        frameQueued = false;\n        isRestoringOlderAnchorRef.current = false;\n        if (typeof animationFrameId !== 'undefined') {\n          window.cancelAnimationFrame(animationFrameId);\n        }\n        if (settleTimeoutId) {\n          clearTimeout(settleTimeoutId);\n        }\n        resizeObserver?.disconnect();\n      };\n\n      // Keep correcting against the same anchor until the DOM stops shifting.\n      const queueNextFrame = () => {\n        if (cancelled || frameQueued) return;\n        frameQueued = true;\n        animationFrameId = window.requestAnimationFrame(() => {\n          frameQueued = false;\n          const isStable = applyAnchor();\n          stableFrameCount = isStable ? stableFrameCount + 1 : 0;\n\n          if (stableFrameCount >= 2) {\n            cleanup();\n            return;\n          }\n\n          queueNextFrame();\n        });\n      };\n\n      stableFrameCount = applyAnchor() ? 1 : 0;\n      queueNextFrame();\n\n      // Late media/layout updates can still move the anchor after the first\n      // correction, so restart the settle check when the list resizes.\n      if (typeof ResizeObserver !== 'undefined') {\n        resizeObserver = new ResizeObserver(() => {\n          stableFrameCount = 0;\n          queueNextFrame();\n        });\n        resizeObserver.observe(listElement);\n      }\n\n      settleTimeoutId = setTimeout(() => {\n        cleanup();\n      }, 1200);\n\n      anchorRestoreCleanupRef.current = cleanup;\n    },\n    [listElement],\n  );\n\n  useLayoutEffect(\n    () => () => {\n      anchorRestoreCleanupRef.current?.();\n    },\n    [],\n  );\n\n  const scrollToBottom = useCallback(\n    (options?: ScrollToOptions) => {\n      if (\n        !listElement?.scrollTo ||\n        hasMoreNewer ||\n        isRestoringOlderAnchorRef.current ||\n        justReachedLatestMessageSet ||\n        suppressAutoscroll\n      ) {\n        return;\n      }\n\n      listElement.scrollTo({\n        behavior: options?.behavior,\n        top: listElement.scrollHeight,\n      });\n      setHasNewMessages(false);\n    },\n    [hasMoreNewer, justReachedLatestMessageSet, listElement, suppressAutoscroll],\n  );\n\n  /**\n   * Keeps wrapper geometry up to date and handles the \"reached latest merged set\"\n   * path where existing viewport position must be preserved.\n   */\n  useLayoutEffect(() => {\n    const disableAutoScrollJustReleased =\n      previousDisableAutoScrollToBottomRef.current && !disableAutoScrollToBottom;\n    previousDisableAutoScrollToBottomRef.current = disableAutoScrollToBottom;\n\n    // Re-enabling auto-scroll should not immediately force a jump to bottom.\n    // This avoids snap-back after temporary suppression (e.g. jump-to-message).\n    if (disableAutoScrollJustReleased) {\n      return;\n    }\n\n    if (listElement) {\n      setWrapperRect(listElement.getBoundingClientRect());\n    }\n\n    if (listElement && justReachedLatestMessageSet) {\n      listElement.scrollTop = previousScrollTopRef.current;\n      skipNextAutoScrollRef.current = true;\n      return;\n    }\n\n    if (skipNextAutoScrollRef.current) {\n      skipNextAutoScrollRef.current = false;\n      return;\n    }\n\n    if (listElement && !disableAutoScrollToBottom && !isRestoringOlderAnchorRef.current) {\n      scrollToBottom();\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [disableAutoScrollToBottom, justReachedLatestMessageSet, listElement, hasMoreNewer]);\n\n  /**\n   * Short post-render bottom settle. This is intentionally small (immediate + 2 retries)\n   * to catch late layout updates without keeping the list in a prolonged lock loop.\n   */\n  useLayoutEffect(() => {\n    const disableAutoScrollJustReleased =\n      previousDisableAutoScrollSettleRef.current && !disableAutoScrollToBottom;\n    previousDisableAutoScrollSettleRef.current = disableAutoScrollToBottom;\n\n    // Skip one settle cycle when auto-scroll suppression is released.\n    // Without this guard, a jump-to-message flow can scroll to the target and then\n    // get pulled back down by the delayed \"keep pinned to bottom\" retries\n    // (80/260/420/900/1700ms), which looks like a snap-back to the latest message.\n    // Letting this transition frame pass preserves the jump destination.\n    if (disableAutoScrollJustReleased) {\n      return;\n    }\n\n    if (\n      !listElement ||\n      disableAutoScrollToBottom ||\n      hasMoreNewer ||\n      suppressAutoscroll ||\n      justReachedLatestMessageSet ||\n      isRestoringOlderAnchorRef.current\n    ) {\n      return;\n    }\n\n    const initialDistanceToBottom =\n      listElement.scrollHeight - (listElement.scrollTop + listElement.clientHeight);\n    const messagesHydrated =\n      previousMessagesLengthRef.current === 0 && messages.length > 0;\n\n    if (initialDistanceToBottom > scrolledUpThreshold && !messagesHydrated) {\n      return;\n    }\n\n    let keepPinnedToBottom = true;\n\n    const maybeScrollToBottom = () => {\n      if (keepPinnedToBottom) {\n        scrollToBottom();\n      }\n    };\n\n    maybeScrollToBottom();\n    const settleDelays = [80, messagesHydrated ? 260 : 420, 900, 1700];\n    const settleTimeoutIds = settleDelays.map((delay) =>\n      setTimeout(maybeScrollToBottom, delay),\n    );\n\n    const stopKeepingPinnedToBottom = () => {\n      keepPinnedToBottom = false;\n    };\n\n    // Any direct user interaction with the scroller disables the temporary\n    // initial-load pin, so manual scrolling is never force-overridden.\n    listElement.addEventListener('pointerdown', stopKeepingPinnedToBottom, {\n      passive: true,\n    });\n    listElement.addEventListener('touchstart', stopKeepingPinnedToBottom, {\n      passive: true,\n    });\n    listElement.addEventListener('wheel', stopKeepingPinnedToBottom, {\n      passive: true,\n    });\n    listElement.addEventListener('keydown', stopKeepingPinnedToBottom);\n\n    const pinWindowTimeoutId = setTimeout(() => {\n      stopKeepingPinnedToBottom();\n    }, 2200);\n\n    return () => {\n      settleTimeoutIds.forEach(clearTimeout);\n      clearTimeout(pinWindowTimeoutId);\n      listElement.removeEventListener('pointerdown', stopKeepingPinnedToBottom);\n      listElement.removeEventListener('touchstart', stopKeepingPinnedToBottom);\n      listElement.removeEventListener('wheel', stopKeepingPinnedToBottom);\n      listElement.removeEventListener('keydown', stopKeepingPinnedToBottom);\n    };\n  }, [\n    disableAutoScrollToBottom,\n    hasMoreNewer,\n    justReachedLatestMessageSet,\n    listElement,\n    messages.length,\n    scrollToBottom,\n    scrolledUpThreshold,\n    suppressAutoscroll,\n  ]);\n\n  const updateScrollTop = useMessageListScrollManager({\n    captureAnchor,\n    disableScrollManagement: disableScrollManagement || isRestoringOlderAnchorRef.current,\n    justReachedLatestMessageSet,\n    loadingMore,\n    loadMoreScrollThreshold,\n    messages,\n    onScrollBy: (scrollBy) => {\n      listElement?.scrollBy({ top: scrollBy });\n    },\n    onScrollToTop: () => {\n      if (!listElement) return;\n      listElement.scrollTop = 0;\n    },\n    restoreAnchor,\n\n    scrollContainerMeasures: () => ({\n      offsetHeight: listElement?.offsetHeight || 0,\n      scrollHeight: listElement?.scrollHeight || 0,\n      scrollTop: listElement?.scrollTop || 0,\n    }),\n    scrolledUpThreshold,\n    scrollToBottom,\n    showNewMessages: () => setHasNewMessages(true),\n  });\n\n  useLayoutEffect(() => {\n    previousHasMoreNewerRef.current = hasMoreNewer;\n  }, [hasMoreNewer]);\n\n  useLayoutEffect(() => {\n    previousMessagesLengthRef.current = messages.length;\n  }, [messages.length]);\n\n  /**\n   * Updates cached scroll metrics and bottom/top proximity state used by\n   * notifications, autoscroll decisions, and paginator behavior.\n   */\n  const onScroll = useCallback(\n    (event: React.UIEvent<HTMLDivElement>) => {\n      const element = event.target as HTMLDivElement;\n      const scrollTop = element.scrollTop;\n      previousScrollTopRef.current = scrollTop;\n\n      updateScrollTop(scrollTop, captureAnchor);\n\n      const offsetHeight = element.offsetHeight;\n      const scrollHeight = element.scrollHeight;\n      const distanceToBottom = scrollHeight - (scrollTop + offsetHeight);\n      const bottomEnterThreshold = Math.max(Math.floor(scrolledUpThreshold * 0.6), 24);\n\n      const prevCloseToBottom = closeToBottom.current;\n      closeToBottom.current = prevCloseToBottom\n        ? distanceToBottom < scrolledUpThreshold\n        : distanceToBottom < bottomEnterThreshold;\n      closeToTop.current = scrollTop < scrolledUpThreshold;\n\n      if (closeToBottom.current) {\n        setHasNewMessages(false);\n      }\n      if (prevCloseToBottom && !closeToBottom.current) {\n        setIsMessageListScrolledToBottom(false);\n      } else if (!prevCloseToBottom && closeToBottom.current) {\n        setIsMessageListScrolledToBottom(true);\n      }\n    },\n    [captureAnchor, updateScrollTop, closeToTop, closeToBottom, scrolledUpThreshold],\n  );\n\n  return {\n    hasNewMessages,\n    isMessageListScrolledToBottom,\n    onScroll,\n    scrollToBottom,\n    wrapperRect,\n  };\n};\n","import React from 'react';\nimport type { PropsWithChildrenOnly } from '../../types/types';\n\nexport const MESSAGE_LIST_MAIN_PANEL_CLASS =\n  'str-chat__main-panel-inner str-chat__message-list-main-panel' as const;\n\nexport const MessageListMainPanel = ({ children }: PropsWithChildrenOnly) => (\n  <div className={MESSAGE_LIST_MAIN_PANEL_CLASS}>{children}</div>\n);\n","import React from 'react';\nimport { useChannelActionContext, useTranslationContext } from '../../context';\nimport { Button } from '../Button';\nimport { IconXmark } from '../Icons';\n\nexport const UNREAD_MESSAGE_SEPARATOR_CLASS = 'str-chat__unread-messages-separator';\n\nexport type UnreadMessagesSeparatorProps = {\n  /**\n   * Configuration parameter to determine, whether the unread count is to be shown on the component. Enabled by default.\n   */\n  showCount?: boolean;\n  /**\n   * The count of unread messages to be displayed if enabled.\n   */\n  unreadCount?: number;\n};\n\nexport const UnreadMessagesSeparator = ({\n  showCount = true,\n  unreadCount,\n}: UnreadMessagesSeparatorProps) => {\n  const { t } = useTranslationContext('UnreadMessagesSeparator');\n  const { markRead } = useChannelActionContext();\n  return (\n    <div\n      className={UNREAD_MESSAGE_SEPARATOR_CLASS}\n      data-testid='unread-messages-separator'\n    >\n      <div className={'str-chat__unread-messages-separator__text'}>\n        {unreadCount && showCount\n          ? t('{{count}} unread', { count: unreadCount })\n          : t('Unread messages')}\n      </div>\n      <Button\n        appearance='ghost'\n        aria-label={t('aria/Mark messages as read')}\n        circular\n        onClick={() => markRead()}\n        size='sm'\n        variant='secondary'\n      >\n        <IconXmark />\n      </Button>\n    </div>\n  );\n};\n","import { useChannelStateContext } from '../../../../context';\nimport { useEffect, useRef, useState } from 'react';\nimport { MESSAGE_LIST_MAIN_PANEL_CLASS } from '../../MessageListMainPanel';\nimport { UNREAD_MESSAGE_SEPARATOR_CLASS } from '../../UnreadMessagesSeparator';\n\nconst targetScrolledAboveVisibleContainerArea = (\n  element: Element,\n  container?: Element,\n) => {\n  const { bottom: targetBottom } = element.getBoundingClientRect();\n  const containerTop = container?.getBoundingClientRect().top ?? 0;\n  return targetBottom < containerTop;\n};\n\nconst targetScrolledBelowVisibleContainerArea = (\n  element: Element,\n  container: Element,\n) => {\n  const { top: targetTop } = element.getBoundingClientRect();\n  const { bottom: containerBottom } = container.getBoundingClientRect();\n  return targetTop > containerBottom;\n};\n\nexport type UseUnreadMessagesNotificationParams = {\n  /** Scroll container (the element with overflow that actually scrolls). When provided, used as IntersectionObserver root and for initial visibility. */\n  listElement: HTMLDivElement | null;\n  isMessageListScrolledToBottom: boolean;\n  showAlways: boolean;\n  unreadCount?: number;\n};\n\nexport const useUnreadMessagesNotification = ({\n  isMessageListScrolledToBottom,\n  listElement,\n  showAlways,\n  unreadCount,\n}: UseUnreadMessagesNotificationParams) => {\n  const { messages } = useChannelStateContext('UnreadMessagesNotification');\n  const [show, setShow] = useState(false);\n  const isScrolledAboveTargetTop = useRef(false);\n  const intersectionObserverIsSupported = typeof IntersectionObserver !== 'undefined';\n\n  useEffect(() => {\n    if (!(unreadCount && intersectionObserverIsSupported)) {\n      setShow(false);\n      return;\n    }\n\n    const scrollRoot = listElement ?? null;\n    if (!scrollRoot) {\n      const [msgListPanel] = document.getElementsByClassName(\n        MESSAGE_LIST_MAIN_PANEL_CLASS,\n      );\n      if (!msgListPanel) return;\n      const [observedTarget] = document.getElementsByClassName(\n        UNREAD_MESSAGE_SEPARATOR_CLASS,\n      );\n      if (!observedTarget) {\n        setShow(true);\n      }\n      return;\n    }\n\n    const [observedTarget] = document.getElementsByClassName(\n      UNREAD_MESSAGE_SEPARATOR_CLASS,\n    );\n    if (!observedTarget) {\n      setShow(true);\n      return;\n    }\n\n    const scrolledBelowSeparator = targetScrolledAboveVisibleContainerArea(\n      observedTarget,\n      scrollRoot,\n    );\n    const scrolledAboveSeparator = targetScrolledBelowVisibleContainerArea(\n      observedTarget,\n      scrollRoot,\n    );\n\n    setShow(\n      showAlways\n        ? scrolledBelowSeparator || scrolledAboveSeparator\n        : scrolledBelowSeparator,\n    );\n\n    const observer = new IntersectionObserver(\n      (elements) => {\n        if (!elements.length) return;\n        const entry = elements[0];\n        const { boundingClientRect, isIntersecting, rootBounds } = entry;\n        if (isIntersecting) {\n          setShow(false);\n          return;\n        }\n        const rootTop = rootBounds?.top ?? 0;\n        const separatorIsAboveContainerTop = boundingClientRect.bottom < rootTop;\n        setShow(showAlways || separatorIsAboveContainerTop);\n        isScrolledAboveTargetTop.current = separatorIsAboveContainerTop;\n      },\n      { root: scrollRoot },\n    );\n    observer.observe(observedTarget);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [\n    intersectionObserverIsSupported,\n    listElement,\n    isMessageListScrolledToBottom,\n    messages,\n    showAlways,\n    unreadCount,\n  ]);\n\n  useEffect(() => {\n    /**\n     * Handle situation when scrollToBottom is called from another component when the msg list is scrolled above the observed target (unread separator).\n     * The intersection observer is not triggered when Element.scrollTo() is called. So we end up in a situation when we are scrolled to the bottom\n     * and at the same time scrolled above the observed target.\n     */\n\n    if (\n      unreadCount &&\n      isMessageListScrolledToBottom &&\n      isScrolledAboveTargetTop.current\n    ) {\n      setShow(true);\n      isScrolledAboveTargetTop.current = false;\n    }\n  }, [isMessageListScrolledToBottom, unreadCount]);\n\n  return { show: show && intersectionObserverIsSupported };\n};\n","import { useEffect } from 'react';\nimport {\n  useChannelActionContext,\n  useChannelStateContext,\n  useChatContext,\n} from '../../../context';\nimport type { Channel, Event, LocalMessage, MessageResponse } from 'stream-chat';\n\nconst hasReadLastMessage = (channel: Channel, userId: string) => {\n  const latestMessageIdInChannel = channel.state.latestMessages.slice(-1)[0]?.id;\n  const lastReadMessageIdServer = channel.state.read[userId]?.last_read_message_id;\n  return latestMessageIdInChannel === lastReadMessageIdServer;\n};\n\ntype UseMarkReadParams = {\n  isMessageListScrolledToBottom: boolean;\n  messageListIsThread: boolean;\n  wasMarkedUnread?: boolean;\n};\n\n/**\n * Takes care of marking a channel read. The channel is read only if all the following applies:\n * 1. the message list is not rendered in a thread\n * 2. the message list is scrolled to the bottom\n * 3. the channel was not marked unread by the user\n * @param isMessageListScrolledToBottom\n * @param messageListIsThread\n * @param wasChannelMarkedUnread\n */\nexport const useMarkRead = ({\n  isMessageListScrolledToBottom,\n  messageListIsThread,\n  wasMarkedUnread,\n}: UseMarkReadParams) => {\n  const { client } = useChatContext('useMarkRead');\n  const { markRead, setChannelUnreadUiState } = useChannelActionContext('useMarkRead');\n  const { channel } = useChannelStateContext('useMarkRead');\n\n  useEffect(() => {\n    if (!channel.getConfig()?.read_events) return;\n    const shouldMarkRead = () =>\n      !document.hidden &&\n      !wasMarkedUnread &&\n      !messageListIsThread &&\n      isMessageListScrolledToBottom &&\n      client.user?.id &&\n      !hasReadLastMessage(channel, client.user.id);\n\n    const onVisibilityChange = () => {\n      if (shouldMarkRead()) markRead();\n    };\n\n    const handleMessageNew = (event: Event) => {\n      const mainChannelUpdated =\n        !event.message?.parent_id || event.message?.show_in_channel;\n\n      if (!isMessageListScrolledToBottom || wasMarkedUnread || document.hidden) {\n        setChannelUnreadUiState((prev) => {\n          const previousUnreadCount = prev?.unread_messages ?? 0;\n          const previousLastMessage = getPreviousLastMessage(\n            channel.state.messages,\n            event.message,\n          );\n          return {\n            ...(prev || {}),\n            last_read:\n              prev?.last_read ??\n              (previousUnreadCount === 0 && previousLastMessage?.created_at\n                ? new Date(previousLastMessage.created_at)\n                : new Date(0)), // not having information about the last read message means the whole channel is unread,\n            unread_messages: previousUnreadCount + 1,\n          };\n        });\n      } else if (mainChannelUpdated && shouldMarkRead()) {\n        markRead();\n      }\n    };\n\n    channel.on('message.new', handleMessageNew);\n    document.addEventListener('visibilitychange', onVisibilityChange);\n\n    if (shouldMarkRead()) {\n      markRead();\n    }\n\n    return () => {\n      channel.off('message.new', handleMessageNew);\n      document.removeEventListener('visibilitychange', onVisibilityChange);\n    };\n  }, [\n    channel,\n    client,\n    isMessageListScrolledToBottom,\n    markRead,\n    messageListIsThread,\n    setChannelUnreadUiState,\n    wasMarkedUnread,\n  ]);\n};\n\nfunction getPreviousLastMessage(messages: LocalMessage[], newMessage?: MessageResponse) {\n  if (!newMessage) return;\n  let previousLastMessage;\n  for (let i = messages.length - 1; i >= 0; i--) {\n    const msg = messages[i];\n    if (!msg?.id) break;\n    if (msg.id !== newMessage.id) {\n      previousLastMessage = msg;\n      break;\n    }\n  }\n  return previousLastMessage;\n}\n","import React from 'react';\n\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\n\nexport type NewMessageNotificationProps = {\n  /** Pre-computed label text (passed to custom override) */\n  label?: string;\n  /** Controls the notification display */\n  showNotification?: boolean;\n  /** Number of new messages since user scrolled up (optional; when provided shows \"{{count}} new messages\") */\n  newMessageCount?: number;\n};\n\nconst UnMemoizedNewMessageNotification = (props: NewMessageNotificationProps) => {\n  const { newMessageCount = 0, showNotification } = props;\n\n  const { t } = useTranslationContext();\n\n  const { NewMessageNotification: CustomNewMessageNotification } = useComponentContext();\n\n  if (!showNotification) return null;\n\n  const label =\n    newMessageCount > 0\n      ? t('{{count}} new messages', { count: newMessageCount })\n      : t('New Messages!');\n\n  if (CustomNewMessageNotification) {\n    return <CustomNewMessageNotification {...props} label={label} />;\n  }\n\n  return (\n    <div className='str-chat__new-message-notification'>\n      <div\n        aria-atomic='true'\n        aria-live='polite'\n        className='str-chat__message-notification__label'\n        data-testid='message-notification'\n        role='status'\n      >\n        {label}\n      </div>\n    </div>\n  );\n};\n\nexport const NewMessageNotification = React.memo(\n  UnMemoizedNewMessageNotification,\n) as typeof UnMemoizedNewMessageNotification;\n","import React from 'react';\nimport { useChannelActionContext, useTranslationContext } from '../../context';\nimport { Button } from '../Button';\nimport { IconArrowUp, IconXmark } from '../Icons';\nimport clsx from 'clsx';\n\nexport type UnreadMessagesNotificationProps = {\n  /**\n   * Configuration parameter to determine the message page size, when jumping to the first unread message.\n   */\n  queryMessageLimit?: number;\n  /**\n   * Configuration parameter to determine, whether the unread count is to be shown on the component. Enabled by default.\n   */\n  showCount?: boolean;\n  /**\n   * The count of unread messages to be displayed if enabled.\n   */\n  unreadCount?: number;\n};\n\nexport const UnreadMessagesNotification = ({\n  queryMessageLimit,\n  showCount = true,\n  unreadCount,\n}: UnreadMessagesNotificationProps) => {\n  const { jumpToFirstUnreadMessage, markRead } = useChannelActionContext();\n  const { t } = useTranslationContext('UnreadMessagesNotification');\n\n  return (\n    <div\n      className={clsx('str-chat__unread-messages-notification', {\n        'str-chat__unread-messages-notification--with-count': unreadCount && showCount,\n      })}\n      data-testid='unread-messages-notification'\n    >\n      <Button\n        appearance='outline'\n        onClick={() => jumpToFirstUnreadMessage(queryMessageLimit)}\n        variant='secondary'\n      >\n        <IconArrowUp />\n        {unreadCount && showCount\n          ? t('{{count}} unread', { count: unreadCount })\n          : t('Unread messages')}\n      </Button>\n      <Button\n        appearance='outline'\n        aria-label={t('aria/Mark messages as read')}\n        onClick={() => markRead()}\n        variant='secondary'\n      >\n        <IconXmark />\n      </Button>\n    </div>\n  );\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport type { PaginatorProps } from '../../types/types';\nimport { DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD } from '../../constants/limits';\n\n/**\n * Prevents Chrome hangups\n * See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257\n */\nconst mousewheelListener = (event: Event) => {\n  if (event instanceof WheelEvent && event.deltaY === 1) {\n    event.preventDefault();\n  }\n};\n\nexport type InfiniteScrollProps = PaginatorProps & {\n  className?: string;\n  element?: React.ElementType;\n  /** Element to be rendered at the top of the thread message list. By default, Message and ThreadStart components */\n  head?: React.ReactNode;\n  initialLoad?: boolean;\n  isLoading?: boolean;\n  listenToScroll?: (offset: number, reverseOffset: number, threshold: number) => void;\n  loader?: React.ReactNode;\n  useCapture?: boolean;\n};\n\n/**\n * This component serves a single purpose - load more items on scroll inside the MessageList component\n * It is not a general purpose infinite scroll controller, because:\n * 1. It is re-rendered whenever queryInProgress, hasNext, hasPrev changes. This can lead to scrollListener to have stale data.\n * 2. It pretends to invoke scrollListener on resize event even though this event is emitted only on window resize. It should\n * rather use ResizeObserver. But then again, it ResizeObserver would invoke a stale version of scrollListener.\n *\n * In general, the infinite scroll controller should not aim for checking the loading state and whether there is more data to load.\n * That should be controlled by the loading function.\n */\nexport const InfiniteScroll = (props: PropsWithChildren<InfiniteScrollProps>) => {\n  const {\n    children,\n    element: Component = 'div',\n    hasNextPage,\n    hasPreviousPage,\n    head,\n    initialLoad = true,\n    isLoading,\n    listenToScroll,\n    loader,\n    loadNextPage,\n    loadPreviousPage,\n    threshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,\n    useCapture = false,\n    ...elementProps\n  } = props;\n\n  const [scrollComponent, setScrollComponent] = useState<HTMLElement | null>(null);\n  const previousOffset = useRef<number | undefined>(undefined);\n  const previousReverseOffset = useRef<number | undefined>(undefined);\n\n  const scrollListenerRef = useRef<() => void>(undefined);\n  scrollListenerRef.current = () => {\n    const element = scrollComponent;\n\n    if (!element || element.offsetParent === null) {\n      return;\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const parentElement = element.parentElement!;\n\n    const offset =\n      element.scrollHeight - parentElement.scrollTop - parentElement.clientHeight;\n    const reverseOffset = parentElement.scrollTop;\n\n    if (listenToScroll) {\n      listenToScroll(offset, reverseOffset, threshold);\n    }\n\n    if (isLoading) return;\n\n    if (\n      previousOffset.current === offset &&\n      previousReverseOffset.current === reverseOffset\n    )\n      return;\n    previousOffset.current = offset;\n    previousReverseOffset.current = reverseOffset;\n\n    // FIXME: this triggers loadMore call when a user types messages in thread and the scroll container expands\n    if (\n      reverseOffset < Number(threshold) &&\n      typeof loadPreviousPage === 'function' &&\n      hasPreviousPage\n    ) {\n      loadPreviousPage();\n    }\n\n    if (offset < Number(threshold) && typeof loadNextPage === 'function' && hasNextPage) {\n      loadNextPage();\n    }\n  };\n\n  useEffect(() => {\n    const scrollElement = scrollComponent?.parentNode;\n\n    if (!scrollElement) return;\n\n    const scrollListener = () => scrollListenerRef.current?.();\n\n    scrollElement.addEventListener('scroll', scrollListener, useCapture);\n    scrollElement.addEventListener('resize', scrollListener, useCapture);\n\n    // Defer the initial proximity check so that any pending scroll-to-bottom\n    // from useLayoutEffect (e.g. the MessageList settle pass) has been applied\n    // to the DOM before we evaluate whether more pages should be loaded.\n    // Without this, scrollTop is still 0 on mount which falsely triggers\n    // loadPreviousPage and breaks the initial scroll position.\n    const rafId = requestAnimationFrame(() => {\n      scrollListener();\n    });\n\n    return () => {\n      cancelAnimationFrame(rafId);\n      scrollElement.removeEventListener('scroll', scrollListener, useCapture);\n      scrollElement.removeEventListener('resize', scrollListener, useCapture);\n    };\n  }, [initialLoad, scrollComponent, useCapture]);\n\n  useEffect(() => {\n    const scrollElement = scrollComponent?.parentNode;\n\n    if (!scrollElement) return;\n\n    scrollElement.addEventListener('wheel', mousewheelListener, { passive: false });\n\n    return () => {\n      scrollElement.removeEventListener('wheel', mousewheelListener, useCapture);\n    };\n  }, [scrollComponent, useCapture]);\n\n  return (\n    <Component {...elementProps} ref={setScrollComponent}>\n      {head}\n      {loader}\n      {children}\n    </Component>\n  );\n};\n","import React, { useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { AvatarStack } from '../Avatar';\nimport { TypingIndicatorDots } from './TypingIndicatorDots';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useTypingContext } from '../../context/TypingContext';\nimport { useThreadContext } from '../Threads';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport { useDebouncedTypingActive } from './hooks/useDebouncedTypingActive';\nimport { getTypingStatusMessage } from './utils/getTypingStatusMessage';\n\nexport type TypingIndicatorProps = {\n  /** When false, the indicator is not rendered (e.g. when list is not scrolled to bottom). Omit or true to show when typing. */\n  isMessageListScrolledToBottom?: boolean;\n  scrollToBottom: () => void;\n  /** Whether the typing indicator is in a thread */\n  threadList?: boolean;\n};\n\n/**\n * TypingIndicator shows avatars of users currently typing and a bubble with animated dots.\n * Renders only for other participants (never the current user), only when scrolled to latest message if isMessageListScrolledToBottom is provided.\n * It must be a child of Channel component.\n */\nconst UnMemoizedTypingIndicator = (props: TypingIndicatorProps) => {\n  const { isMessageListScrolledToBottom = true, scrollToBottom, threadList } = props;\n\n  const { channelConfig, thread } = useChannelStateContext('TypingIndicator');\n  const threadInstance = useThreadContext();\n  const parentId = threadInstance?.id ?? thread?.id;\n  const { client } = useChatContext('TypingIndicator');\n  const { t } = useTranslationContext();\n  const { typing = {} } = useTypingContext('TypingIndicator');\n\n  const typingInChannel = !threadList\n    ? Object.values(typing).filter(\n        ({ parent_id, user }) => user?.id !== client.user?.id && !parent_id,\n      )\n    : [];\n\n  const typingInThread = threadList\n    ? Object.values(typing).filter(\n        ({ parent_id, user }) => user?.id !== client.user?.id && parent_id === parentId,\n      )\n    : [];\n\n  const typingUsers = threadList ? typingInThread : typingInChannel;\n  const { displayUsers } = useDebouncedTypingActive(typingUsers);\n  const showIndicator = displayUsers.length > 0;\n  const typingAnnouncement = useMemo(\n    () => getTypingStatusMessage(displayUsers, t),\n    [displayUsers, t],\n  );\n\n  const displayInfo = useMemo(\n    () =>\n      displayUsers.map(\n        ({ user }) =>\n          ({\n            id: user?.id,\n            imageUrl: user?.image,\n            userName: user?.name,\n          }) as const,\n      ),\n    [displayUsers],\n  );\n\n  useEffect(() => {\n    if (showIndicator && isMessageListScrolledToBottom) scrollToBottom();\n  }, [scrollToBottom, isMessageListScrolledToBottom, showIndicator]);\n\n  if (channelConfig?.typing_events === false) {\n    return null;\n  }\n\n  if (!showIndicator || !isMessageListScrolledToBottom) {\n    return null;\n  }\n\n  return (\n    <div\n      className={clsx(\n        'str-chat__typing-indicator',\n        'str-chat__typing-indicator--with-transition',\n        {\n          'str-chat__typing-indicator--typing': showIndicator,\n        },\n      )}\n      data-testid='typing-indicator'\n    >\n      {displayInfo.length > 0 && (\n        <div aria-hidden='true'>\n          <AvatarStack badgeSize='md' displayInfo={displayInfo} size='md' />\n        </div>\n      )}\n      <div aria-hidden='true' className='str-chat__typing-indicator__bubble'>\n        <div className='str-chat__typing-indicator__dots'>\n          <TypingIndicatorDots />\n        </div>\n      </div>\n      <VisuallyHidden>\n        <span\n          aria-atomic='true'\n          aria-live='polite'\n          data-testid='typing-indicator-status'\n          role='status'\n        >\n          {typingAnnouncement}\n        </span>\n      </VisuallyHidden>\n    </div>\n  );\n};\n\nexport const TypingIndicator = React.memo(\n  UnMemoizedTypingIndicator,\n) as typeof UnMemoizedTypingIndicator;\n","import { useCallback, useState } from 'react';\n\nimport type { RenderedMessage } from '../../utils';\nimport { isDateSeparatorMessage, isIntroMessage } from '../../utils';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type UseFloatingDateSeparatorParams = {\n  disableDateSeparator: boolean;\n  processedMessages: RenderedMessage[];\n};\n\nexport type UseFloatingDateSeparatorResult = {\n  floatingDate: Date | null;\n  onItemsRendered: (rendered: RenderedMessage[]) => void;\n  showFloatingDate: boolean;\n};\n\n/**\n * Returns the date to show in the floating date separator based on currently visible messages.\n * When the first visible item is a message (not a date separator), we've scrolled past its\n * date separator — find that separator's date.\n */\nfunction getFloatingDateForFirstMessage(\n  firstMessage: RenderedMessage,\n  processedMessages: RenderedMessage[],\n  firstMessageIndex: number,\n): Date | null {\n  if (isIntroMessage(firstMessage)) return null;\n\n  // Walk backwards to find the last date separator before this message\n  for (let i = firstMessageIndex - 1; i >= 0; i -= 1) {\n    const item = processedMessages[i];\n    if (isDateSeparatorMessage(item)) {\n      return item.date;\n    }\n  }\n\n  // No preceding date separator; use message's created_at\n  const msg = firstMessage as LocalMessage;\n  const created = msg.created_at;\n  if (created) {\n    const d = new Date(created);\n    return isNaN(d.getTime()) ? null : d;\n  }\n  return null;\n}\n\nfunction getFloatingDateForFirstItem(\n  firstItem: RenderedMessage,\n  processedMessages: RenderedMessage[],\n  firstItemIndex: number,\n): Date | null {\n  if (isDateSeparatorMessage(firstItem)) return firstItem.date;\n\n  return getFloatingDateForFirstMessage(firstItem, processedMessages, firstItemIndex);\n}\n\n/**\n * Controls the floating date separator as a sticky \"current section\" label.\n * It follows the date separator represented by the first visible item.\n */\nconst HIDDEN_STATE = { date: null, visible: false } as const;\n\nexport const useFloatingDateSeparator = ({\n  disableDateSeparator,\n  processedMessages,\n}: UseFloatingDateSeparatorParams): UseFloatingDateSeparatorResult => {\n  const [state, setState] = useState<{\n    date: Date | null;\n    visible: boolean;\n  }>(HIDDEN_STATE);\n\n  const onItemsRendered = useCallback(\n    (rendered: RenderedMessage[]) => {\n      if (disableDateSeparator || processedMessages.length === 0) {\n        setState(HIDDEN_STATE);\n        return;\n      }\n\n      const valid = rendered.filter((m): m is RenderedMessage => m != null);\n      if (valid.length === 0) {\n        setState(HIDDEN_STATE);\n        return;\n      }\n\n      const first = valid[0];\n      const firstIndex = processedMessages.findIndex((m) => m.id === first.id);\n      const date =\n        firstIndex >= 0\n          ? getFloatingDateForFirstItem(first, processedMessages, firstIndex)\n          : null;\n\n      const visible = date !== null;\n      setState((prev) => {\n        const prevTime = prev.date?.getTime() ?? null;\n        const nextTime = date?.getTime() ?? null;\n        if (prev.visible === visible && prevTime === nextTime) return prev;\n        return { date, visible };\n      });\n    },\n    [disableDateSeparator, processedMessages],\n  );\n\n  return {\n    floatingDate: state.date,\n    onItemsRendered,\n    showFloatingDate: !!state.date && state.visible,\n  };\n};\n","import { useEffect, useState } from 'react';\n\nimport { useChatContext } from '../../../../context/ChatContext';\n\nimport type { EventHandler, LocalMessage } from 'stream-chat';\n\nexport const useGiphyPreview = (separateGiphyPreview: boolean) => {\n  const [giphyPreviewMessage, setGiphyPreviewMessage] = useState<LocalMessage>();\n\n  const { client } = useChatContext('useGiphyPreview');\n\n  useEffect(() => {\n    if (!separateGiphyPreview) return;\n    const handleEvent: EventHandler = (event) => {\n      const { message, user } = event;\n\n      if (message?.command === 'giphy' && user?.id === client.userID) {\n        setGiphyPreviewMessage(undefined);\n      }\n    };\n\n    client.on('message.new', handleEvent);\n    return () => client.off('message.new', handleEvent);\n  }, [client, separateGiphyPreview]);\n\n  return {\n    giphyPreviewMessage,\n    setGiphyPreviewMessage: separateGiphyPreview ? setGiphyPreviewMessage : undefined,\n  };\n};\n","import { useEffect, useRef, useState } from 'react';\nimport type { LocalMessage } from 'stream-chat';\n\ntype UseMessageSetKeyParams = {\n  messages?: LocalMessage[];\n};\n\nexport const useMessageSetKey = ({ messages }: UseMessageSetKeyParams) => {\n  /**\n   * Logic to update the key of the virtuoso component when the list jumps to a new location.\n   */\n  const [messageSetKey, setMessageSetKey] = useState(+new Date());\n  const firstMessageId = useRef<string | undefined>(undefined);\n\n  useEffect(() => {\n    const continuousSet = messages?.find(\n      (message) => message.id === firstMessageId.current,\n    );\n    if (!continuousSet) {\n      setMessageSetKey(+new Date());\n    }\n    firstMessageId.current = messages?.[0]?.id;\n  }, [messages]);\n\n  return {\n    messageSetKey,\n  };\n};\n","import { useEffect, useRef, useState } from 'react';\nimport type { LocalMessage } from 'stream-chat';\nimport type { RenderedMessage } from '../../utils';\n\nexport function useNewMessageNotification(\n  messages: RenderedMessage[],\n  currentUserId: string | undefined,\n  hasMoreNewer?: boolean,\n) {\n  const [newMessagesNotification, setNewMessagesNotification] = useState(false);\n  const [isMessageListScrolledToBottom, setIsMessageListScrolledToBottom] =\n    useState(true);\n  /**\n   * use the flag to avoid the initial \"new messages\" quick blink\n   */\n  const didMount = useRef(false);\n\n  const lastMessageId = useRef('');\n  const atBottom = useRef(false);\n\n  useEffect(() => {\n    if (hasMoreNewer) {\n      setNewMessagesNotification(true);\n      return;\n    }\n    /* handle scrolling behavior for new messages */\n    if (!messages?.length) return;\n\n    const lastMessage = messages[messages.length - 1];\n    const prevMessageId = lastMessageId.current;\n    lastMessageId.current = lastMessage.id || ''; // update last message id\n\n    /* do nothing if new messages are loaded from top(loadMore)  */\n    if (lastMessage.id === prevMessageId) return;\n\n    /* if list is already at the bottom return, followOutput will do the job */\n    if (atBottom.current) return;\n\n    /* if the new message belongs to current user scroll to bottom */\n    if ((lastMessage as LocalMessage).user?.id !== currentUserId && didMount.current) {\n      /* otherwise just show newMessage notification  */\n      setNewMessagesNotification(true);\n    }\n    didMount.current = true;\n  }, [currentUserId, messages, hasMoreNewer]);\n\n  return {\n    atBottom,\n    isMessageListScrolledToBottom,\n    newMessagesNotification,\n    setIsMessageListScrolledToBottom,\n    setNewMessagesNotification,\n  };\n}\n","import { useMemo, useRef } from 'react';\nimport type { RenderedMessage } from '../../utils';\nimport { isLocalMessage } from '../../utils';\n\nconst STATUSES_EXCLUDED_FROM_PREPEND = {\n  failed: true,\n  sending: true,\n} as const as Record<string, boolean>;\n\nexport function usePrependedMessagesCount(\n  messages: RenderedMessage[],\n  hasDateSeparator: boolean,\n) {\n  const firstRealMessageIndex = hasDateSeparator ? 1 : 0;\n  const firstMessageOnFirstLoadedPage = useRef<RenderedMessage>(undefined);\n  const previousFirstMessageOnFirstLoadedPage = useRef<RenderedMessage>(undefined);\n  const previousNumItemsPrepended = useRef(0);\n\n  const numItemsPrepended = useMemo(() => {\n    if (!messages || !messages.length) {\n      previousNumItemsPrepended.current = 0;\n      return 0;\n    }\n\n    const currentFirstMessage = messages?.[firstRealMessageIndex];\n\n    const noNewMessages =\n      currentFirstMessage?.id === previousFirstMessageOnFirstLoadedPage.current?.id;\n\n    // This is possible only, when sending messages very quickly (basically single char messages submitted like a crazy) in empty channel (first page)\n    // Optimistic UI update, when sending messages, can lead to a situation, when\n    // the order of the messages changes for a moment. This can happen, when a user\n    // sends multiple messages withing few milliseconds. E.g. we send a message A\n    // then message B. At first we have message array with both messages of status \"sending\"\n    // then response for message A is received with a new - later - created_at timestamp\n    // this leads to rearrangement of 1.B (\"sending\"), 2.A (\"received\"). Still firstMessageOnFirstLoadedPage.current\n    // points to message A, but now this message has index 1 => previousNumItemsPrepended.current === 1\n    // That in turn leads to incorrect index calculation in VirtualizedMessageList trying to access a message\n    // at non-existent index. Therefore, we ignore messages of status \"sending\" / \"failed\" in order they are\n    // not considered as prepended messages.\n    const currentFirstMessageStatus = isLocalMessage(currentFirstMessage)\n      ? currentFirstMessage.status\n      : undefined;\n    const firstMsgMovedAfterMessagesInExcludedStatus = !!(\n      currentFirstMessageStatus &&\n      STATUSES_EXCLUDED_FROM_PREPEND[currentFirstMessageStatus]\n    );\n\n    if (noNewMessages || firstMsgMovedAfterMessagesInExcludedStatus) {\n      return previousNumItemsPrepended.current;\n    }\n\n    if (!firstMessageOnFirstLoadedPage.current) {\n      firstMessageOnFirstLoadedPage.current = currentFirstMessage;\n    }\n    previousFirstMessageOnFirstLoadedPage.current = currentFirstMessage;\n    // if new messages were prepended, find out how many\n    // start with this number because there cannot be fewer prepended items than before\n    for (\n      let prependedMessageCount = previousNumItemsPrepended.current;\n      prependedMessageCount < messages.length;\n      prependedMessageCount += 1\n    ) {\n      const messageIsFirstOnFirstLoadedPage =\n        messages[prependedMessageCount].id === firstMessageOnFirstLoadedPage.current?.id;\n\n      if (messageIsFirstOnFirstLoadedPage) {\n        previousNumItemsPrepended.current = prependedMessageCount - firstRealMessageIndex;\n        return previousNumItemsPrepended.current;\n      }\n    }\n\n    // if no match has found, we have jumped - reset the prepended item count.\n    firstMessageOnFirstLoadedPage.current = currentFirstMessage;\n    previousNumItemsPrepended.current = 0;\n    return 0;\n    // TODO: there's a bug here, the messages prop is the same array instance (something mutates it)\n    // that's why the second dependency is necessary\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [firstRealMessageIndex, messages, messages?.length]);\n\n  return numItemsPrepended;\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { RenderedMessage } from '../../utils';\n\ntype UseScrollToBottomOnNewMessageParams = {\n  scrollToBottom: () => void;\n  messages?: RenderedMessage[];\n  /** When `true`, the list will scroll to the latest message when the window regains focus */\n  scrollToLatestMessageOnFocus?: boolean;\n};\n\nexport const useScrollToBottomOnNewMessage = ({\n  messages,\n  scrollToBottom,\n  scrollToLatestMessageOnFocus,\n}: UseScrollToBottomOnNewMessageParams) => {\n  const [newMessagesReceivedInBackground, setNewMessagesReceivedInBackground] =\n    useState(false);\n\n  const scrollToBottomIfConfigured = useRef<(e: Event) => void>(undefined);\n\n  scrollToBottomIfConfigured.current = (event: Event) => {\n    if (\n      !scrollToLatestMessageOnFocus ||\n      !newMessagesReceivedInBackground ||\n      event.target !== window\n    ) {\n      return;\n    }\n\n    setTimeout(scrollToBottom, 100);\n  };\n\n  useEffect(() => {\n    setNewMessagesReceivedInBackground(true);\n  }, [messages]);\n\n  useEffect(() => {\n    const handleFocus = (event: Event) => {\n      scrollToBottomIfConfigured.current?.(event);\n    };\n\n    const handleBlur = () => {\n      setNewMessagesReceivedInBackground(false);\n    };\n\n    if (typeof window !== 'undefined') {\n      window.addEventListener('focus', handleFocus);\n      window.addEventListener('blur', handleBlur);\n    }\n\n    return () => {\n      window.removeEventListener('focus', handleFocus);\n      window.removeEventListener('blur', handleBlur);\n    };\n  }, []);\n};\n","import { useEffect, useRef } from 'react';\nimport type { RenderedMessage } from '../../utils';\nimport type { LocalMessage } from 'stream-chat';\n\nexport function useShouldForceScrollToBottom(\n  messages: RenderedMessage[],\n  currentUserId?: string,\n) {\n  const lastFocusedOwnMessage = useRef('');\n  const initialFocusRegistered = useRef(false);\n\n  function recheckForNewOwnMessage() {\n    if (messages && messages.length > 0) {\n      const lastMessage = messages[messages.length - 1];\n\n      if (\n        (lastMessage as LocalMessage).user?.id === currentUserId &&\n        lastFocusedOwnMessage.current !== lastMessage.id\n      ) {\n        lastFocusedOwnMessage.current = lastMessage.id;\n        return true;\n      }\n    }\n    return false;\n  }\n\n  useEffect(() => {\n    if (messages && messages.length && !initialFocusRegistered.current) {\n      initialFocusRegistered.current = true;\n      recheckForNewOwnMessage();\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [messages, messages?.length]);\n\n  return recheckForNewOwnMessage;\n}\n","import { useCallback, useEffect, useState } from 'react';\nimport type { RenderedMessage } from '../../utils';\nimport type { LocalMessage } from 'stream-chat';\n\nexport type UseUnreadMessagesNotificationParams = {\n  showAlways: boolean;\n  unreadCount: number;\n  lastRead?: Date | null;\n};\n\n/**\n * Controls the logic when an `UnreadMessagesNotification` component should be shown.\n * In virtualized message list there is no notion of being scrolled below or above `UnreadMessagesSeparator`.\n * Therefore, the `UnreadMessagesNotification` component is rendered based on timestamps.\n * If the there are unread messages in the channel and the `VirtualizedMessageList` renders\n * messages created later than the last read message in the channel, then the\n * `UnreadMessagesNotification` component is rendered. This is an approximate equivalent to being\n * scrolled below the `UnreadMessagesNotification` component.\n * @param lastRead\n * @param showAlways\n * @param unreadCount\n */\nexport const useUnreadMessagesNotificationVirtualized = ({\n  lastRead,\n  showAlways,\n  unreadCount,\n}: UseUnreadMessagesNotificationParams) => {\n  const [show, setShow] = useState(false);\n\n  const toggleShowUnreadMessagesNotification = useCallback(\n    (renderedMessages: RenderedMessage[]) => {\n      if (!unreadCount) return;\n      const firstRenderedMessage = renderedMessages[0];\n      const lastRenderedMessage = renderedMessages.slice(-1)[0];\n      if (!(firstRenderedMessage && lastRenderedMessage)) return;\n\n      const firstRenderedMessageTime = new Date(\n        (firstRenderedMessage as LocalMessage).created_at ?? 0,\n      ).getTime();\n      const lastRenderedMessageTime = new Date(\n        (lastRenderedMessage as LocalMessage).created_at ?? 0,\n      ).getTime();\n      const lastReadTime = new Date(lastRead ?? 0).getTime();\n\n      const scrolledBelowSeparator =\n        !!lastReadTime && firstRenderedMessageTime > lastReadTime;\n      const scrolledAboveSeparator =\n        !!lastReadTime && lastRenderedMessageTime < lastReadTime;\n\n      setShow(\n        showAlways\n          ? scrolledBelowSeparator || scrolledAboveSeparator\n          : scrolledBelowSeparator,\n      );\n    },\n    [lastRead, showAlways, unreadCount],\n  );\n\n  useEffect(() => {\n    if (!unreadCount) setShow(false);\n  }, [unreadCount]);\n\n  return { show, toggleShowUnreadMessagesNotification };\n};\n","import React, { useLayoutEffect } from 'react';\nimport type { RefObject } from 'react';\n\nimport { DateSeparator as DefaultDateSeparator } from '../DateSeparator';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useFloatingDateSeparatorMessageList } from './hooks/MessageList';\nimport { useFloatingDateSeparator } from './hooks/VirtualizedMessageList';\nimport type { RenderedMessage } from './utils';\n\ntype BaseProps = {\n  disableDateSeparator: boolean;\n  processedMessages: RenderedMessage[];\n};\n\nexport type FloatingDateSeparatorProps = BaseProps &\n  (\n    | {\n        /** For VirtualizedMessageList: ref the parent calls with visible items */\n        itemsRenderedRef: RefObject<((rendered: RenderedMessage[]) => void) | null>;\n      }\n    | {\n        /** For MessageList: scroll container to query DOM for date separators */\n        listElement: HTMLDivElement | null;\n      }\n  );\n\n/**\n * Renders a floating date separator when the user has scrolled past the in-flow date.\n * State is internal so MessageList/VirtualizedMessageList do not re-render when it changes.\n * Use itemsRenderedRef for Virtuoso, listElement for non-virtualized MessageList.\n */\nexport const FloatingDateSeparator = (props: FloatingDateSeparatorProps) => {\n  const { DateSeparator = DefaultDateSeparator } = useComponentContext(\n    'FloatingDateSeparator',\n  );\n  const { disableDateSeparator, processedMessages } = props;\n\n  const listElement = 'listElement' in props ? props.listElement : null;\n  const useDomMode = listElement != null;\n\n  const virtuosoResult = useFloatingDateSeparator({\n    disableDateSeparator,\n    processedMessages,\n  });\n  const domResult = useFloatingDateSeparatorMessageList({\n    disableDateSeparator,\n    listElement,\n    processedMessages,\n  });\n\n  const floatingDate = useDomMode ? domResult.floatingDate : virtuosoResult.floatingDate;\n  const showFloatingDate = useDomMode\n    ? domResult.showFloatingDate\n    : virtuosoResult.showFloatingDate;\n\n  const itemsRenderedRef = 'itemsRenderedRef' in props ? props.itemsRenderedRef : null;\n  useLayoutEffect(() => {\n    if (!itemsRenderedRef) return;\n    itemsRenderedRef.current = virtuosoResult.onItemsRendered;\n    return () => {\n      itemsRenderedRef.current = null;\n    };\n  }, [itemsRenderedRef, virtuosoResult.onItemsRendered]);\n\n  if (!showFloatingDate || !floatingDate || !DateSeparator) return null;\n\n  return <DateSeparator date={floatingDate} floating />;\n};\n","import React from 'react';\n\nimport type { Event, LocalMessage } from 'stream-chat';\nimport type { TimestampFormatterOptions } from '../../i18n/types';\n\nexport type EventComponentProps = TimestampFormatterOptions & {\n  message: LocalMessage & {\n    event?: Event;\n  };\n  unsafeHTML?: boolean;\n};\n\n/**\n * Component to display system and channel event messages\n */\nconst UnMemoizedEventComponent = (props: EventComponentProps) => {\n  const { message, unsafeHTML = false } = props;\n  const { type } = message;\n\n  if (type !== 'system') return null;\n\n  return (\n    <div className='str-chat__message--system' data-testid='message-system'>\n      <div className='str-chat__message--system__text'>\n        {unsafeHTML ? (\n          <div\n            dangerouslySetInnerHTML={{ __html: message.html || '' }}\n            data-unsafe-inner-html\n          />\n        ) : (\n          <span>{message.text}</span>\n        )}\n      </div>\n    </div>\n  );\n};\n\nexport const EventComponent = React.memo(\n  UnMemoizedEventComponent,\n) as typeof UnMemoizedEventComponent;\n","import type { ReactNode } from 'react';\nimport React, { Fragment } from 'react';\nimport type { GroupStyle, RenderedMessage } from './utils';\nimport { getIsFirstUnreadMessage, isDateSeparatorMessage, isIntroMessage } from './utils';\nimport type { MessageProps } from '../Message';\nimport { Message } from '../Message';\nimport { DateSeparator as DefaultDateSeparator } from '../DateSeparator';\nimport { EventComponent as DefaultMessageSystem } from '../EventComponent';\nimport { UnreadMessagesSeparator as DefaultUnreadMessagesSeparator } from './UnreadMessagesSeparator';\nimport type { LocalMessage, UserResponse } from 'stream-chat';\nimport type { ComponentContextValue, CustomClasses } from '../../context';\nimport type { ChannelUnreadUiState } from '../../types';\n\nexport interface RenderMessagesOptions {\n  components: ComponentContextValue;\n  lastReceivedMessageId: string | null;\n  messageGroupStyles: Record<string, GroupStyle>;\n  messages: Array<RenderedMessage>;\n  ownMessagesDeliveredToOthers: Record<string, UserResponse[]>;\n  /**\n   * Object mapping message IDs of own messages to the users who read those messages.\n   */\n  readData: Record<string, Array<UserResponse>>;\n  /**\n   * Props forwarded to the Message component.\n   */\n  sharedMessageProps: SharedMessageProps;\n  /** Latest own message in currently displayed message set. */\n  lastOwnMessage?: LocalMessage;\n  /**\n   * Current user's channel read state used to render components reflecting unread state.\n   * It does not reflect the back-end state if a channel is marked read on mount.\n   * This is in order to keep the unread UI when an unread channel is open.\n   */\n  channelUnreadUiState?: ChannelUnreadUiState;\n  customClasses?: CustomClasses;\n}\n\nexport type SharedMessageProps = Omit<MessageProps, MessagePropsToOmit>;\n\nexport type MessageRenderer = (options: RenderMessagesOptions) => Array<ReactNode>;\n\ntype MessagePropsToOmit =\n  | 'channel'\n  | 'deliveredTo'\n  | 'groupStyles'\n  | 'initialMessage'\n  | 'lastReceivedId'\n  | 'message'\n  | 'readBy';\n\nexport function defaultRenderMessages({\n  channelUnreadUiState,\n  components,\n  customClasses,\n  lastOwnMessage,\n  lastReceivedMessageId: lastReceivedId,\n  messageGroupStyles,\n  messages,\n  ownMessagesDeliveredToOthers,\n  readData,\n  sharedMessageProps: messageProps,\n}: RenderMessagesOptions) {\n  const {\n    DateSeparator = DefaultDateSeparator,\n    HeaderComponent,\n    MessageListItem = 'li',\n    MessageSystem = DefaultMessageSystem,\n    UnreadMessagesSeparator = DefaultUnreadMessagesSeparator,\n  } = components;\n\n  const renderedMessages = [];\n  let firstMessage;\n  let previousMessage = undefined;\n  for (let index = 0; index < messages.length; index++) {\n    const message = messages[index];\n    if (isDateSeparatorMessage(message)) {\n      renderedMessages.push(\n        <MessageListItem data-index={index} key={`${message.date.toISOString()}-i`}>\n          <DateSeparator\n            date={message.date}\n            formatDate={messageProps.formatDate}\n            unread={message.unread}\n          />\n        </MessageListItem>,\n      );\n    } else if (isIntroMessage(message)) {\n      if (HeaderComponent) {\n        renderedMessages.push(\n          <MessageListItem data-index={index} key='intro'>\n            <HeaderComponent />\n          </MessageListItem>,\n        );\n      }\n    } else if (message.type === 'system') {\n      renderedMessages.push(\n        <MessageListItem\n          data-index={index}\n          data-message-id={message.id}\n          key={message.id || message.created_at.toISOString()}\n        >\n          <MessageSystem message={message} unsafeHTML={messageProps.unsafeHTML} />\n        </MessageListItem>,\n      );\n    } else {\n      if (!firstMessage) {\n        firstMessage = message;\n      }\n      const groupStyles: GroupStyle = messageGroupStyles[message.id] || '';\n      const messageClass =\n        customClasses?.message || `str-chat__li str-chat__li--${groupStyles}`;\n\n      const isFirstUnreadMessage = getIsFirstUnreadMessage({\n        firstUnreadMessageId: channelUnreadUiState?.first_unread_message_id,\n        isFirstMessage: !!firstMessage?.id && firstMessage.id === message.id,\n        lastReadDate: channelUnreadUiState?.last_read,\n        lastReadMessageId: channelUnreadUiState?.last_read_message_id,\n        message,\n        previousMessage,\n        unreadMessageCount: channelUnreadUiState?.unread_messages,\n      });\n\n      renderedMessages.push(\n        <Fragment key={message.id || message.created_at.toISOString()}>\n          {isFirstUnreadMessage && UnreadMessagesSeparator && (\n            <MessageListItem className='str-chat__li str-chat__unread-messages-separator-wrapper'>\n              <UnreadMessagesSeparator\n                unreadCount={channelUnreadUiState?.unread_messages}\n              />\n            </MessageListItem>\n          )}\n          <MessageListItem\n            className={messageClass}\n            data-index={index}\n            data-message-id={message.id}\n            data-testid={messageClass}\n          >\n            <Message\n              deliveredTo={ownMessagesDeliveredToOthers[message.id] || []}\n              groupStyles={[groupStyles]} /* TODO: convert to simple string */\n              lastOwnMessage={lastOwnMessage}\n              lastReceivedId={lastReceivedId}\n              message={message}\n              readBy={readData[message.id] || []}\n              {...messageProps}\n            />\n          </MessageListItem>\n        </Fragment>,\n      );\n      previousMessage = message;\n    }\n  }\n  return renderedMessages;\n}\n","// last own message should be tracked in the low-level client\nexport const findReverse = <T>(\n  items: T[],\n  matches: (items: T) => boolean,\n): T | undefined => {\n  for (let i = items.length - 1; i >= 0; i -= 1) {\n    if (matches(items[i])) {\n      return items[i];\n    }\n  }\n\n  return undefined;\n};\n","import { useMemo } from 'react';\nimport { findReverse } from '../../../utils/findReverse';\nimport type { LocalMessage } from 'stream-chat';\n\n// fixme: we should be able to retrieve last own message quickly from the LLC. Should be done when refactoring the LLC Channel state to reactive.\nexport const useLastOwnMessage = ({\n  messages,\n  ownUserId,\n}: {\n  messages?: LocalMessage[];\n  ownUserId?: string;\n}) =>\n  useMemo(\n    () =>\n      messages && findReverse(messages, (msg) => (msg.user && msg.user.id) === ownUserId),\n    [messages, ownUserId],\n  );\n","import { useSyncExternalStore } from 'react';\n\nconst REDUCED_MOTION_MEDIA_QUERY = '(prefers-reduced-motion: reduce)';\n\nconst getReducedMotionSnapshot = () => {\n  if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n    return false;\n  }\n\n  return window.matchMedia(REDUCED_MOTION_MEDIA_QUERY).matches;\n};\n\nconst subscribeToReducedMotion = (onStoreChange: () => void) => {\n  if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n    return () => undefined;\n  }\n\n  const mediaQueryList = window.matchMedia(REDUCED_MOTION_MEDIA_QUERY);\n  const handleChange = () => onStoreChange();\n\n  if (typeof mediaQueryList.addEventListener === 'function') {\n    mediaQueryList.addEventListener('change', handleChange);\n    return () => mediaQueryList.removeEventListener('change', handleChange);\n  }\n\n  mediaQueryList.addListener(handleChange);\n  return () => mediaQueryList.removeListener(handleChange);\n};\n\nexport const useReducedMotionPreference = () =>\n  useSyncExternalStore(subscribeToReducedMotion, getReducedMotionSnapshot, () => false);\n","import React, { useEffect, useState } from 'react';\n\nimport {\n  useChannelStateContext,\n  useChatContext,\n  useTranslationContext,\n} from '../../context';\n\nimport type { Event } from 'stream-chat';\nimport { Badge } from '../Badge';\nimport { Button } from '../Button';\nimport { IconArrowDown } from '../Icons';\n\nexport type ScrollToLatestMessageButtonProps = {\n  /** When true, user has jumped to an older message set and newer messages can be loaded */\n  isNotAtLatestMessageSet?: boolean;\n  isMessageListScrolledToBottom?: boolean;\n  onClick: React.MouseEventHandler;\n  threadList?: boolean;\n};\n\nconst UnMemoizedScrollToLatestMessageButton = (\n  props: ScrollToLatestMessageButtonProps,\n) => {\n  const {\n    isMessageListScrolledToBottom,\n    isNotAtLatestMessageSet = false,\n    onClick,\n    threadList,\n  } = props;\n\n  const { channel: activeChannel, client } = useChatContext();\n  const { thread } = useChannelStateContext();\n  const { t } = useTranslationContext();\n  const [countUnread, setCountUnread] = useState(activeChannel?.countUnread() || 0);\n  const [replyCount, setReplyCount] = useState(thread?.reply_count || 0);\n  const observedEvent = threadList ? 'message.updated' : 'message.new';\n\n  useEffect(() => {\n    const handleEvent = (event: Event) => {\n      const newMessageInAnotherChannel = event.cid !== activeChannel?.cid;\n      const newMessageIsMine = event.user?.id === client.user?.id;\n\n      const isThreadOpen = !!thread;\n      const newMessageIsReply = !!event.message?.parent_id;\n      const dontIncreaseMainListCounterOnNewReply =\n        isThreadOpen && !threadList && newMessageIsReply;\n\n      if (\n        isMessageListScrolledToBottom ||\n        newMessageInAnotherChannel ||\n        newMessageIsMine ||\n        dontIncreaseMainListCounterOnNewReply\n      ) {\n        return;\n      }\n\n      if (event.type === 'message.new') {\n        // cannot rely on channel.countUnread because active channel is automatically marked read\n        setCountUnread((prev) => prev + 1);\n      } else if (event.message?.id === thread?.id) {\n        const newReplyCount = event.message?.reply_count || 0;\n        setCountUnread(() => newReplyCount - replyCount);\n      }\n    };\n    client.on(observedEvent, handleEvent);\n\n    return () => {\n      client.off(observedEvent, handleEvent);\n    };\n  }, [\n    activeChannel,\n    client,\n    isMessageListScrolledToBottom,\n    observedEvent,\n    replyCount,\n    thread,\n    threadList,\n  ]);\n\n  useEffect(() => {\n    if (isMessageListScrolledToBottom) {\n      setCountUnread(0);\n      setReplyCount(thread?.reply_count || 0);\n    }\n  }, [isMessageListScrolledToBottom, thread]);\n\n  if (isMessageListScrolledToBottom && !isNotAtLatestMessageSet) return null;\n\n  return (\n    <div className='str-chat__jump-to-latest-message'>\n      <Button\n        appearance='ghost'\n        aria-label={t('aria/Jump to latest message')}\n        aria-live='polite'\n        circular\n        className='str-chat__jump-to-latest-message__button'\n        data-testid='scroll-to-latest-message-button'\n        onClick={onClick}\n        size='md'\n        variant='secondary'\n      >\n        <IconArrowDown />\n      </Button>\n      {countUnread > 0 && (\n        <Badge\n          className='str-chat__jump-to-latest__unread-count'\n          data-testid='unread-message-notification-counter'\n          size='md'\n          variant='primary'\n        >\n          {countUnread}\n        </Badge>\n      )}\n    </div>\n  );\n};\n\nexport const ScrollToLatestMessageButton = React.memo(\n  UnMemoizedScrollToLatestMessageButton,\n) as typeof UnMemoizedScrollToLatestMessageButton;\n","import clsx from 'clsx';\nimport React from 'react';\n\nimport {\n  useEnrichedMessages,\n  useMessageListElements,\n  useScrollLocationLogic,\n  useUnreadMessagesNotification,\n} from './hooks/MessageList';\nimport { useMarkRead } from './hooks/useMarkRead';\nimport { NewMessageNotification as DefaultNewMessageNotification } from './NewMessageNotification';\nimport { UnreadMessagesNotification as DefaultUnreadMessagesNotification } from './UnreadMessagesNotification';\n\nimport type { ChannelActionContextValue } from '../../context/ChannelActionContext';\nimport { useChannelActionContext } from '../../context/ChannelActionContext';\nimport type { ChannelStateContextValue } from '../../context/ChannelStateContext';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { DialogManagerProvider } from '../../context';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { MessageListContextProvider } from '../../context/MessageListContext';\nimport { MessageTranslationViewProvider } from '../../context/MessageTranslationViewContext';\nimport { EmptyStateIndicator as DefaultEmptyStateIndicator } from '../EmptyStateIndicator';\nimport type { InfiniteScrollProps } from '../InfiniteScrollPaginator/InfiniteScroll';\nimport { InfiniteScroll } from '../InfiniteScrollPaginator/InfiniteScroll';\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../Loading';\nimport { MESSAGE_ACTIONS } from '../Message/utils';\nimport { TypingIndicator as DefaultTypingIndicator } from '../TypingIndicator';\nimport { MessageListMainPanel as DefaultMessageListMainPanel } from './MessageListMainPanel';\n\nimport { FloatingDateSeparator } from './FloatingDateSeparator';\nimport type { MessageRenderer } from './renderMessages';\nimport { defaultRenderMessages } from './renderMessages';\nimport { useStableId } from '../UtilityComponents/useStableId';\n\nimport type { LocalMessage } from 'stream-chat';\nimport type { GroupStyle, ProcessMessagesParams, RenderedMessage } from './utils';\nimport type { MessageProps } from '../Message/types';\n\nimport {\n  DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,\n  DEFAULT_NEXT_CHANNEL_PAGE_SIZE,\n} from '../../constants/limits';\nimport { useLastOwnMessage } from './hooks/useLastOwnMessage';\nimport { useReducedMotionPreference } from './hooks/useReducedMotionPreference';\nimport { ScrollToLatestMessageButton as DefaultScrollToLatestMessageButton } from './ScrollToLatestMessageButton';\nimport {\n  NotificationList as DefaultNotificationList,\n  useNotificationTarget,\n} from '../Notifications';\nimport { AriaLiveRegion, useIncomingMessageAnnouncements } from '../Accessibility';\n\ntype MessageListWithContextProps = Omit<\n  ChannelStateContextValue,\n  'members' | 'mutes' | 'watchers'\n> &\n  MessageListProps;\n\ntype JumpToLatestPhase = 'idle' | 'waiting-for-render' | 'animating';\ntype HighlightedJumpPhase = 'idle' | 'waiting-for-render' | 'animating';\n\nconst getMessageSetSignature = (messages: LocalMessage[]) =>\n  `${messages.length}:${messages[0]?.id || ''}:${messages[messages.length - 1]?.id || ''}`;\n\nconst getMessageTimestamp = (message?: LocalMessage) =>\n  message?.created_at?.getTime?.() ?? null;\n\nconst MessageListWithContext = (props: MessageListWithContextProps) => {\n  const {\n    channel,\n    channelUnreadUiState,\n    disableDateSeparator = false,\n    groupStyles,\n    hasMoreNewer = false,\n    headerPosition,\n    hideDeletedMessages = false,\n    hideNewMessageSeparator = false,\n    highlightedMessageId,\n    internalInfiniteScrollProps: {\n      threshold: loadMoreScrollThreshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,\n      ...restInternalInfiniteScrollProps\n    } = {},\n    jumpToLatestMessage = () => Promise.resolve(),\n    loadMore: loadMoreCallback,\n    loadMoreNewer: loadMoreNewerCallback,\n    maxTimeBetweenGroupedMessages,\n    messageActions = Object.keys(MESSAGE_ACTIONS),\n    messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE,\n    messages = [],\n    noGroupByUser = false,\n    reactionDetailsSort,\n    renderMessages = defaultRenderMessages,\n    returnAllReadData = false,\n    reviewProcessedMessage,\n    showUnreadNotificationAlways,\n    sortReactions,\n    suppressAutoscroll,\n    thread,\n    threadList = false,\n    unsafeHTML = false,\n  } = props;\n\n  const [listElement, setListElement] = React.useState<HTMLDivElement | null>(null);\n  const [jumpToLatestPhase, setJumpToLatestPhase] =\n    React.useState<JumpToLatestPhase>('idle');\n  const [highlightedJumpPhase, setHighlightedJumpPhase] =\n    React.useState<HighlightedJumpPhase>('idle');\n  const [jumpSourceMessageSetSignature, setJumpSourceMessageSetSignature] =\n    React.useState<string | null>(null);\n  const previousHasMoreNewerRef = React.useRef(hasMoreNewer);\n  const previousMessageSetSignatureRef = React.useRef('');\n  const previousMessageSetBoundsRef = React.useRef<{\n    firstTimestamp: number | null;\n    lastTimestamp: number | null;\n  }>({\n    firstTimestamp: null,\n    lastTimestamp: null,\n  });\n\n  const { customClasses } = useChatContext('MessageList');\n  const prefersReducedMotion = useReducedMotionPreference();\n  const scrollBehavior = prefersReducedMotion ? 'auto' : 'smooth';\n\n  const {\n    EmptyStateIndicator = DefaultEmptyStateIndicator,\n    LoadingIndicator = DefaultLoadingIndicator,\n    MessageListMainPanel = DefaultMessageListMainPanel,\n    MessageListWrapper = 'ul',\n    NewMessageNotification = DefaultNewMessageNotification,\n    NotificationList = DefaultNotificationList,\n    ScrollToLatestMessageButton = DefaultScrollToLatestMessageButton,\n    TypingIndicator = DefaultTypingIndicator,\n    UnreadMessagesNotification = DefaultUnreadMessagesNotification,\n  } = useComponentContext();\n\n  const notificationTarget = useNotificationTarget();\n  const messageSetSignature = React.useMemo(\n    () => getMessageSetSignature(messages),\n    [messages],\n  );\n  const messageSetBounds = React.useMemo(\n    () => ({\n      firstTimestamp: getMessageTimestamp(messages[0]),\n      lastTimestamp: getMessageTimestamp(messages[messages.length - 1]),\n    }),\n    [messages],\n  );\n  const isJumpingToLatest = jumpToLatestPhase !== 'idle';\n  const isHighlightedJumpRequested = !!highlightedMessageId;\n  // Highlighted jumps temporarily disable prepend pagination so a target\n  // message rendered near the top does not immediately load the previous page.\n  const isJumpingToHighlightedMessage = highlightedJumpPhase !== 'idle';\n  const justReachedLatestMergedSet = previousHasMoreNewerRef.current && !hasMoreNewer;\n\n  const {\n    hasNewMessages,\n    isMessageListScrolledToBottom,\n    onScroll,\n    scrollToBottom,\n    wrapperRect,\n  } = useScrollLocationLogic({\n    disableAutoScrollToBottom:\n      isJumpingToLatest || isHighlightedJumpRequested || justReachedLatestMergedSet,\n    disableScrollManagement: isJumpingToLatest || isJumpingToHighlightedMessage,\n    hasMoreNewer,\n    listElement,\n    loadingMore: props.loadingMore,\n    loadMoreScrollThreshold,\n    messages, // todo: is it correct to base the scroll logic on an array that does not contain date separators or intro?\n    scrolledUpThreshold: props.scrolledUpThreshold,\n    suppressAutoscroll,\n  });\n  const isTypingIndicatorScrolledToBottom =\n    isMessageListScrolledToBottom &&\n    !isJumpingToLatest &&\n    !isJumpingToHighlightedMessage &&\n    !justReachedLatestMergedSet;\n\n  const { show: showUnreadMessagesNotification } = useUnreadMessagesNotification({\n    isMessageListScrolledToBottom,\n    listElement,\n    showAlways: !!showUnreadNotificationAlways,\n    unreadCount: channelUnreadUiState?.unread_messages,\n  });\n\n  useMarkRead({\n    isMessageListScrolledToBottom: isTypingIndicatorScrolledToBottom,\n    messageListIsThread: threadList,\n    wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id,\n  });\n\n  const { messageGroupStyles, messages: enrichedMessages } = useEnrichedMessages({\n    channel,\n    disableDateSeparator,\n    groupStyles,\n    headerPosition,\n    hideDeletedMessages,\n    hideNewMessageSeparator,\n    maxTimeBetweenGroupedMessages,\n    messages,\n    noGroupByUser,\n    reviewProcessedMessage,\n  });\n\n  const lastOwnMessage = useLastOwnMessage({\n    messages,\n    ownUserId: channel.getClient().user?.id,\n  });\n\n  const elements = useMessageListElements({\n    channelUnreadUiState,\n    enrichedMessages,\n    internalMessageProps: {\n      additionalMessageComposerProps: props.additionalMessageComposerProps,\n      closeReactionSelectorOnClick: props.closeReactionSelectorOnClick,\n      disableQuotedMessages: props.disableQuotedMessages,\n      formatDate: props.formatDate,\n      Message: props.Message,\n      messageActions,\n      messageListRect: wrapperRect,\n      onMentionsClick: props.onMentionsClick,\n      onMentionsHover: props.onMentionsHover,\n      onUserClick: props.onUserClick,\n      onUserHover: props.onUserHover,\n      openThread: props.openThread,\n      reactionDetailsSort,\n      renderText: props.renderText,\n      retrySendMessage: props.retrySendMessage,\n      showAvatar: props.showAvatar,\n      sortReactions,\n      unsafeHTML,\n    },\n    lastOwnMessage,\n    messageGroupStyles,\n    messages,\n    renderMessages,\n    returnAllReadData,\n    threadList,\n  });\n\n  useIncomingMessageAnnouncements({\n    activeThreadId: thread?.id,\n    channel,\n    ownUserId: channel.getClient().user?.id,\n    threadList,\n  });\n\n  const messageListClass = customClasses?.messageList || 'str-chat__message-list';\n\n  const loadMore = React.useCallback(() => {\n    if (loadMoreCallback) {\n      loadMoreCallback(messageLimit);\n    }\n  }, [loadMoreCallback, messageLimit]);\n\n  const loadMoreNewer = React.useCallback(() => {\n    if (loadMoreNewerCallback) {\n      loadMoreNewerCallback(messageLimit);\n    }\n  }, [loadMoreNewerCallback, messageLimit]);\n\n  const scrollToBottomFromNotification = React.useCallback(async () => {\n    if (hasMoreNewer) {\n      setJumpSourceMessageSetSignature(messageSetSignature);\n      setJumpToLatestPhase('waiting-for-render');\n      try {\n        await jumpToLatestMessage();\n      } catch (error) {\n        setJumpSourceMessageSetSignature(null);\n        setJumpToLatestPhase('idle');\n        throw error;\n      }\n      return;\n    }\n\n    scrollToBottom({ behavior: scrollBehavior });\n  }, [\n    scrollBehavior,\n    hasMoreNewer,\n    jumpToLatestMessage,\n    messageSetSignature,\n    scrollToBottom,\n  ]);\n\n  React.useLayoutEffect(() => {\n    if (\n      jumpToLatestPhase !== 'waiting-for-render' ||\n      hasMoreNewer ||\n      !listElement?.scrollTo ||\n      messageSetSignature === jumpSourceMessageSetSignature\n    ) {\n      return;\n    }\n\n    listElement.scrollTo({ top: 0 });\n\n    const animationFrameId = requestAnimationFrame(() => {\n      setJumpToLatestPhase('animating');\n      listElement.scrollTo({\n        behavior: scrollBehavior,\n        top: listElement.scrollHeight,\n      });\n    });\n\n    return () => cancelAnimationFrame(animationFrameId);\n  }, [\n    scrollBehavior,\n    hasMoreNewer,\n    jumpSourceMessageSetSignature,\n    jumpToLatestPhase,\n    listElement,\n    messageSetSignature,\n  ]);\n\n  React.useLayoutEffect(() => {\n    if (jumpToLatestPhase !== 'animating' || !listElement?.scrollTo) {\n      return;\n    }\n\n    const finalize = () => {\n      listElement.scrollTo({ top: listElement.scrollHeight });\n      setJumpSourceMessageSetSignature(null);\n      setJumpToLatestPhase('idle');\n    };\n\n    const settleTimeoutId = setTimeout(finalize, 500);\n\n    return () => {\n      clearTimeout(settleTimeoutId);\n    };\n  }, [jumpToLatestPhase, listElement]);\n\n  React.useLayoutEffect(() => {\n    if (!highlightedMessageId) {\n      setHighlightedJumpPhase('idle');\n      return;\n    }\n\n    const element = listElement?.querySelector(\n      `[data-message-id='${highlightedMessageId}']`,\n    );\n    if (!element) {\n      setHighlightedJumpPhase('waiting-for-render');\n      return;\n    }\n\n    const messageSetChanged =\n      previousMessageSetSignatureRef.current !== messageSetSignature;\n    setHighlightedJumpPhase(messageSetChanged ? 'animating' : 'idle');\n    let settleTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n    const animationFrameId = requestAnimationFrame(() => {\n      element.scrollIntoView({\n        behavior: scrollBehavior,\n        block: 'center',\n      });\n\n      if (!messageSetChanged || !listElement?.scrollTo) {\n        setHighlightedJumpPhase('idle');\n        return;\n      }\n\n      settleTimeoutId = setTimeout(() => {\n        const elementRect = element.getBoundingClientRect();\n        const listRect = listElement.getBoundingClientRect();\n        const targetTop =\n          listElement.scrollTop +\n          (elementRect.top - listRect.top) -\n          (listElement.clientHeight - elementRect.height) / 2;\n\n        listElement.scrollTo({ top: Math.max(targetTop, 0) });\n        setHighlightedJumpPhase('idle');\n      }, 500);\n    });\n\n    return () => {\n      cancelAnimationFrame(animationFrameId);\n      if (settleTimeoutId) {\n        clearTimeout(settleTimeoutId);\n      }\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [scrollBehavior, highlightedMessageId, messageSetSignature]);\n\n  React.useEffect(() => {\n    previousHasMoreNewerRef.current = hasMoreNewer;\n  }, [hasMoreNewer]);\n\n  React.useEffect(() => {\n    previousMessageSetSignatureRef.current = messageSetSignature;\n    previousMessageSetBoundsRef.current = messageSetBounds;\n  }, [messageSetBounds, messageSetSignature]);\n\n  const id = useStableId();\n\n  const showEmptyStateIndicator = elements.length === 0 && !threadList;\n  const dialogManagerId = threadList\n    ? `message-list-dialog-manager-thread-${id}`\n    : `message-list-dialog-manager-${id}`;\n\n  return (\n    <MessageListContextProvider\n      value={{\n        listElement,\n        processedMessages: enrichedMessages,\n        scrollToBottom,\n      }}\n    >\n      <MessageTranslationViewProvider>\n        <MessageListMainPanel>\n          <DialogManagerProvider id={dialogManagerId}>\n            {!threadList && showUnreadMessagesNotification && (\n              <UnreadMessagesNotification\n                unreadCount={channelUnreadUiState?.unread_messages}\n              />\n            )}\n            <FloatingDateSeparator\n              disableDateSeparator={disableDateSeparator}\n              listElement={listElement}\n              processedMessages={enrichedMessages}\n            />\n            <div\n              className={clsx(messageListClass, customClasses?.threadList)}\n              onScroll={onScroll}\n              ref={setListElement}\n              tabIndex={0}\n            >\n              {showEmptyStateIndicator ? (\n                <EmptyStateIndicator listType={threadList ? 'thread' : 'message'} />\n              ) : (\n                <InfiniteScroll\n                  className='str-chat__message-list-scroll'\n                  data-testid='reverse-infinite-scroll'\n                  hasNextPage={props.hasMoreNewer}\n                  hasPreviousPage={isJumpingToHighlightedMessage ? false : props.hasMore}\n                  head={props.head}\n                  isLoading={Boolean(\n                    props.loadingMore || props.loadingMoreForJumpToChannelMessage,\n                  )}\n                  loader={\n                    <div className='str-chat__list__loading' key='loading-indicator'>\n                      {(props.loadingMore ||\n                        props.loadingMoreForJumpToChannelMessage) && <LoadingIndicator />}\n                    </div>\n                  }\n                  loadNextPage={loadMoreNewer}\n                  loadPreviousPage={\n                    isJumpingToHighlightedMessage ? () => undefined : loadMore\n                  }\n                  threshold={loadMoreScrollThreshold}\n                  {...restInternalInfiniteScrollProps}\n                >\n                  <MessageListWrapper className='str-chat__ul'>\n                    {elements}\n                  </MessageListWrapper>\n                  <TypingIndicator\n                    isMessageListScrolledToBottom={isTypingIndicatorScrolledToBottom}\n                    scrollToBottom={scrollToBottom}\n                    threadList={threadList}\n                  />\n\n                  <div key='bottom' />\n                </InfiniteScroll>\n              )}\n            </div>\n            <NewMessageNotification\n              newMessageCount={channelUnreadUiState?.unread_messages}\n              showNotification={hasNewMessages || hasMoreNewer}\n            />\n            <ScrollToLatestMessageButton\n              isMessageListScrolledToBottom={isMessageListScrolledToBottom}\n              isNotAtLatestMessageSet={hasMoreNewer}\n              onClick={scrollToBottomFromNotification}\n              threadList={threadList}\n            />\n          </DialogManagerProvider>\n          <NotificationList panel={notificationTarget} />\n        </MessageListMainPanel>\n      </MessageTranslationViewProvider>\n    </MessageListContextProvider>\n  );\n};\n\ntype PropsDrilledToMessage =\n  | 'additionalMessageComposerProps'\n  | 'closeReactionSelectorOnClick'\n  | 'disableQuotedMessages'\n  | 'formatDate'\n  | 'Message'\n  | 'messageActions'\n  | 'onMentionsClick'\n  | 'onMentionsHover'\n  | 'onUserClick'\n  | 'onUserHover'\n  | 'openThread'\n  | 'reactionDetailsSort'\n  | 'renderText'\n  | 'retrySendMessage'\n  | 'showAvatar'\n  | 'sortReactions'\n  | 'unsafeHTML';\n\nexport type MessageListProps = Partial<Pick<MessageProps, PropsDrilledToMessage>> & {\n  /** Disables the injection of date separator components in MessageList, defaults to `false` */\n  disableDateSeparator?: boolean;\n  /** Callback function to set group styles for each message */\n  groupStyles?: (\n    message: RenderedMessage,\n    previousMessage: RenderedMessage,\n    nextMessage: RenderedMessage,\n    noGroupByUser: boolean,\n    maxTimeBetweenGroupedMessages?: number,\n  ) => GroupStyle;\n  /** Whether the list has more items to load */\n  hasMore?: boolean;\n  /** Element to be rendered at the top of the thread message list. By default, these are the Message and ThreadStart components */\n  head?: React.ReactElement;\n  /** Position to render HeaderComponent */\n  headerPosition?: number;\n  /** Hides the MessageDeleted components from the list, defaults to `false` */\n  hideDeletedMessages?: boolean;\n  /** Hides the DateSeparator component when new messages are received in a channel that's watched but not active, defaults to false */\n  hideNewMessageSeparator?: boolean;\n  /** Overrides the default props passed to [InfiniteScroll](https://github.com/GetStream/stream-chat-react/blob/master/src/components/InfiniteScrollPaginator/InfiniteScroll.tsx) */\n  internalInfiniteScrollProps?: Partial<InfiniteScrollProps>;\n  /** Function called when latest messages should be loaded, after the list has jumped at an earlier message set */\n  jumpToLatestMessage?: () => Promise<void>;\n  /** Whether or not the list is currently loading more items */\n  loadingMore?: boolean;\n  /** Whether or not the list is currently jumping to a highlighted message */\n  loadingMoreForJumpToChannelMessage?: boolean;\n  /** Whether or not the list is currently loading newer items */\n  loadingMoreNewer?: boolean;\n  /** Function called when more messages are to be loaded, defaults to function stored in [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/) */\n  loadMore?: ChannelActionContextValue['loadMore'] | (() => Promise<void>);\n  /** Function called when newer messages are to be loaded, defaults to function stored in [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/) */\n  loadMoreNewer?: ChannelActionContextValue['loadMoreNewer'] | (() => Promise<void>);\n  /** Maximum time in milliseconds that should occur between messages to still consider them grouped together */\n  maxTimeBetweenGroupedMessages?: number;\n  /** The limit to use when paginating messages */\n  messageLimit?: number;\n  /** The messages to render in the list, defaults to messages stored in [ChannelStateContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_state_context/) */\n  messages?: LocalMessage[];\n  /** If true, turns off message UI grouping by user */\n  noGroupByUser?: boolean;\n  /** Overrides the way MessageList renders messages */\n  renderMessages?: MessageRenderer;\n  /** If true, `readBy` data supplied to the `Message` components will include all user read states per sent message */\n  returnAllReadData?: boolean;\n  /**\n   * Allows to review changes introduced to messages array on per message basis (e.g. date separator injection before a message).\n   * The array returned from the function is appended to the array of messages that are later rendered into React elements in the `MessageList`.\n   */\n  reviewProcessedMessage?: ProcessMessagesParams['reviewProcessedMessage'];\n  /**\n   * The pixel threshold under which the message list is considered to be so near to the bottom,\n   * so that if a new message is delivered, the list will be scrolled to the absolute bottom.\n   * Defaults to 200px\n   */\n  scrolledUpThreshold?: number;\n  /**\n   * The floating notification informing about unread messages will be shown when the\n   * UnreadMessagesSeparator is not visible. The default is false, that means the notification\n   * is shown only when viewing unread messages.\n   */\n  showUnreadNotificationAlways?: boolean;\n  /** If true, indicates the message list is a thread  */\n  threadList?: boolean; // todo: refactor needed - message list should have a state in which among others it would be optionally flagged as thread\n};\n\n/**\n * The MessageList component renders a list of Messages.\n * It is a consumer of the following contexts:\n * - [ChannelStateContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_state_context/)\n * - [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/)\n * - [ComponentContext](https://getstream.io/chat/docs/sdk/react/contexts/component_context/)\n * - [TypingContext](https://getstream.io/chat/docs/sdk/react/contexts/typing_context/)\n */\nexport const MessageList = (props: MessageListProps) => {\n  const { jumpToLatestMessage, loadMore, loadMoreNewer } =\n    useChannelActionContext('MessageList');\n\n  const {\n    members: membersPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    mutes: mutesPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    watchers: watchersPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars\n    ...restChannelStateContext\n  } = useChannelStateContext('MessageList');\n\n  return (\n    <AriaLiveRegion>\n      <MessageListWithContext\n        jumpToLatestMessage={jumpToLatestMessage}\n        loadMore={loadMore}\n        loadMoreNewer={loadMoreNewer}\n        {...restChannelStateContext}\n        {...props}\n      />\n    </AriaLiveRegion>\n  );\n};\n","import clsx from 'clsx';\nimport throttle from 'lodash.throttle';\nimport React from 'react';\nimport type { ItemProps, ListItem } from 'react-virtuoso';\n\nimport { EmptyStateIndicator as DefaultEmptyStateIndicator } from '../EmptyStateIndicator';\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../Loading';\nimport { Message } from '../Message';\n\nimport { useComponentContext } from '../../context';\nimport type { GroupStyle, RenderedMessage } from './utils';\nimport { getIsFirstUnreadMessage, isDateSeparatorMessage, isIntroMessage } from './utils';\nimport type { VirtuosoContext } from './VirtualizedMessageList';\nimport type { UnknownType } from '../../types/types';\n\nconst PREPEND_OFFSET = 10 ** 7;\n\nexport function calculateItemIndex(virtuosoIndex: number, numItemsPrepended: number) {\n  return virtuosoIndex + numItemsPrepended - PREPEND_OFFSET;\n}\n\nexport function calculateFirstItemIndex(numItemsPrepended: number) {\n  return PREPEND_OFFSET - numItemsPrepended;\n}\n\nexport const makeItemsRenderedHandler = (\n  renderedItemsActions: Array<(msg: RenderedMessage[]) => void>,\n  processedMessages: RenderedMessage[],\n) =>\n  throttle((items: ListItem<UnknownType>[]) => {\n    const renderedMessages = items\n      .map((item) => {\n        if (!item.originalIndex) return undefined;\n        return processedMessages[calculateItemIndex(item.originalIndex, PREPEND_OFFSET)];\n      })\n      .filter((msg) => !!msg);\n    renderedItemsActions.forEach((action) =>\n      action(renderedMessages as RenderedMessage[]),\n    );\n  }, 200);\n\ntype CommonVirtuosoComponentProps = {\n  context?: VirtuosoContext;\n};\n// using 'display: inline-block'\n// traps CSS margins of the item elements, preventing incorrect item measurements\nexport const Item = ({ context, ...props }: ItemProps & CommonVirtuosoComponentProps) => {\n  if (!context) return <></>;\n\n  const message =\n    context.processedMessages[\n      calculateItemIndex(props['data-item-index'], context.numItemsPrepended)\n    ];\n  const groupStyles: GroupStyle = context.messageGroupStyles[message.id];\n\n  return (\n    <div\n      {...props}\n      className={\n        context?.customClasses?.virtualMessage ||\n        clsx('str-chat__virtual-list-message-wrapper str-chat__li', {\n          [`str-chat__li--${groupStyles}`]: groupStyles,\n        })\n      }\n    />\n  );\n};\nexport const Header = ({ context }: CommonVirtuosoComponentProps) => {\n  const { LoadingIndicator = DefaultLoadingIndicator } = useComponentContext(\n    'VirtualizedMessageListHeader',\n  );\n\n  return (\n    <>\n      {context?.head}\n      {context?.loadingMore && LoadingIndicator && (\n        <div className='str-chat__virtual-list__loading'>\n          <LoadingIndicator />\n        </div>\n      )}\n    </>\n  );\n};\nexport const EmptyPlaceholder = ({ context }: CommonVirtuosoComponentProps) => {\n  const { EmptyStateIndicator = DefaultEmptyStateIndicator } = useComponentContext(\n    'VirtualizedMessageList',\n  );\n  // prevent showing that there are no messages if there actually are messages (for some reason virtuoso decides to render empty placeholder first, even though it has the totalCount prop > 0)\n  if (\n    typeof context?.processedMessages !== 'undefined' &&\n    context.processedMessages.length > 0\n  )\n    return null;\n\n  return (\n    <>\n      {EmptyStateIndicator && (\n        <EmptyStateIndicator listType={context?.threadList ? 'thread' : 'message'} />\n      )}\n    </>\n  );\n};\n\nexport const messageRenderer = (\n  virtuosoIndex: number,\n  _data: UnknownType,\n  virtuosoContext: VirtuosoContext,\n) => {\n  const {\n    additionalMessageComposerProps,\n    closeReactionSelectorOnClick,\n    customMessageRenderer,\n    DateSeparator,\n    firstUnreadMessageId,\n    formatDate,\n    lastOwnMessage,\n    lastReadDate,\n    lastReadMessageId,\n    lastReceivedMessageId,\n    Message: MessageUIComponent,\n    messageActions,\n    messageGroupStyles,\n    MessageSystem,\n    numItemsPrepended,\n    openThread,\n    ownMessagesDeliveredToOthers,\n    ownMessagesReadByOthers,\n    processedMessages: messageList,\n    reactionDetailsSort,\n    renderText,\n    returnAllReadData,\n    showAvatar,\n    sortReactions,\n    threadList,\n    unreadMessageCount = 0,\n    UnreadMessagesSeparator,\n    virtuosoRef,\n  } = virtuosoContext;\n\n  const streamMessageIndex = calculateItemIndex(virtuosoIndex, numItemsPrepended);\n\n  if (customMessageRenderer) {\n    return customMessageRenderer(messageList, streamMessageIndex);\n  }\n\n  const message = messageList[streamMessageIndex];\n\n  if (!message || isIntroMessage(message)) return <div style={{ height: '1px' }}></div>; // returning null or zero height breaks the virtuoso\n\n  if (isDateSeparatorMessage(message)) {\n    return DateSeparator ? (\n      <DateSeparator date={message.date} unread={message.unread} />\n    ) : null;\n  }\n\n  if (message.type === 'system') {\n    return MessageSystem ? <MessageSystem message={message} /> : null;\n  }\n\n  const isFirstUnreadMessage = getIsFirstUnreadMessage({\n    firstUnreadMessageId,\n    isFirstMessage: streamMessageIndex === 0,\n    lastReadDate,\n    lastReadMessageId,\n    message,\n    previousMessage: streamMessageIndex ? messageList[streamMessageIndex - 1] : undefined,\n    unreadMessageCount,\n  });\n\n  return (\n    <>\n      {isFirstUnreadMessage && (\n        <div className='str-chat__unread-messages-separator-wrapper'>\n          <UnreadMessagesSeparator unreadCount={unreadMessageCount} />\n        </div>\n      )}\n      <Message\n        additionalMessageComposerProps={additionalMessageComposerProps}\n        autoscrollToBottom={virtuosoRef.current?.autoscrollToBottom}\n        closeReactionSelectorOnClick={closeReactionSelectorOnClick}\n        deliveredTo={ownMessagesDeliveredToOthers[message.id] || []}\n        formatDate={formatDate}\n        groupStyles={[messageGroupStyles[message.id] ?? '']}\n        lastOwnMessage={lastOwnMessage}\n        lastReceivedId={lastReceivedMessageId}\n        message={message}\n        Message={MessageUIComponent}\n        messageActions={messageActions}\n        openThread={openThread}\n        reactionDetailsSort={reactionDetailsSort}\n        readBy={ownMessagesReadByOthers[message.id] || []}\n        renderText={renderText}\n        returnAllReadData={returnAllReadData}\n        showAvatar={showAvatar}\n        sortReactions={sortReactions}\n        threadList={threadList}\n      />\n    </>\n  );\n};\n","import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nexport type VirtualizedMessageListContextValue = {\n  /** Function that scrolls the list to the bottom. */\n  scrollToBottom: () => void;\n};\n\nexport const VirtualizedMessageListContext = createContext<\n  VirtualizedMessageListContextValue | undefined\n>(undefined);\n\n/**\n * Context provider for components rendered within the `VirtualizedMessageList`\n */\nexport const VirtualizedMessageListContextProvider = ({\n  children,\n  value,\n}: PropsWithChildren<{\n  value: VirtualizedMessageListContextValue;\n}>) => (\n  <VirtualizedMessageListContext.Provider\n    value={value as VirtualizedMessageListContextValue}\n  >\n    {children}\n  </VirtualizedMessageListContext.Provider>\n);\n\nexport const useVirtualizedMessageListContext = () =>\n  useContext(VirtualizedMessageListContext) as VirtualizedMessageListContextValue;\n","import type { RefObject } from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { FloatingDateSeparator } from './FloatingDateSeparator';\nimport type {\n  ComputeItemKey,\n  ScrollSeekConfiguration,\n  ScrollSeekPlaceholderProps,\n  VirtuosoHandle,\n  VirtuosoProps,\n} from 'react-virtuoso';\nimport { Virtuoso } from 'react-virtuoso';\n\nimport { GiphyPreviewMessage as DefaultGiphyPreviewMessage } from './GiphyPreviewMessage';\nimport { useLastReadData } from './hooks';\nimport {\n  useGiphyPreview,\n  useMessageSetKey,\n  useNewMessageNotification,\n  usePrependedMessagesCount,\n  useScrollToBottomOnNewMessage,\n  useShouldForceScrollToBottom,\n  useUnreadMessagesNotificationVirtualized,\n} from './hooks/VirtualizedMessageList';\nimport { useMarkRead } from './hooks/useMarkRead';\nimport { NewMessageNotification as DefaultNewMessageNotification } from './NewMessageNotification';\nimport { MessageListMainPanel as DefaultMessageListMainPanel } from './MessageListMainPanel';\nimport type { GroupStyle, ProcessMessagesParams, RenderedMessage } from './utils';\nimport { getGroupStyles, getLastReceived, processMessages } from './utils';\nimport type { MessageProps, MessageUIComponentProps } from '../Message';\nimport { MessageUI } from '../Message';\nimport { UnreadMessagesNotification as DefaultUnreadMessagesNotification } from './UnreadMessagesNotification';\nimport {\n  calculateFirstItemIndex,\n  calculateItemIndex,\n  EmptyPlaceholder,\n  Header,\n  Item,\n  makeItemsRenderedHandler,\n  messageRenderer,\n} from './VirtualizedMessageListComponents';\n\nimport {\n  ScrollToLatestMessageButton as DefaultScrollToLatestMessageButton,\n  UnreadMessagesSeparator as DefaultUnreadMessagesSeparator,\n} from '../MessageList';\nimport { DateSeparator as DefaultDateSeparator } from '../DateSeparator';\nimport { EventComponent as DefaultMessageSystem } from '../EventComponent';\nimport {\n  NotificationList as DefaultNotificationList,\n  useNotificationTarget,\n} from '../Notifications';\n\nimport { DialogManagerProvider } from '../../context';\nimport type { ChannelActionContextValue } from '../../context/ChannelActionContext';\nimport { useChannelActionContext } from '../../context/ChannelActionContext';\nimport type {\n  ChannelNotifications,\n  ChannelStateContextValue,\n} from '../../context/ChannelStateContext';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport type { ChatContextValue } from '../../context/ChatContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport type { ComponentContextValue } from '../../context/ComponentContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { MessageTranslationViewProvider } from '../../context/MessageTranslationViewContext';\nimport { VirtualizedMessageListContextProvider } from '../../context/VirtualizedMessageListContext';\n\nimport type {\n  Channel,\n  LocalMessage,\n  ChannelState as StreamChannelState,\n  UserResponse,\n} from 'stream-chat';\nimport type { UnknownType } from '../../types/types';\nimport { DEFAULT_NEXT_CHANNEL_PAGE_SIZE } from '../../constants/limits';\nimport { useStableId } from '../UtilityComponents/useStableId';\nimport { useLastDeliveredData } from './hooks/useLastDeliveredData';\nimport { useLastOwnMessage } from './hooks/useLastOwnMessage';\nimport { useReducedMotionPreference } from './hooks/useReducedMotionPreference';\nimport { AriaLiveRegion, useIncomingMessageAnnouncements } from '../Accessibility';\n\ntype PropsDrilledToMessage =\n  | 'additionalMessageComposerProps'\n  | 'formatDate'\n  | 'messageActions'\n  | 'openThread'\n  | 'reactionDetailsSort'\n  | 'renderText'\n  | 'showAvatar'\n  | 'sortReactions';\n\ntype VirtualizedMessageListPropsForContext =\n  | PropsDrilledToMessage\n  | 'closeReactionSelectorOnClick'\n  | 'customMessageRenderer'\n  | 'head'\n  | 'loadingMore'\n  | 'Message'\n  | 'returnAllReadData'\n  | 'shouldGroupByUser'\n  | 'threadList';\n\n/**\n * Context object provided to some Virtuoso props that are functions (components rendered by Virtuoso and other functions)\n */\nexport type VirtuosoContext = Required<\n  Pick<\n    ComponentContextValue,\n    'DateSeparator' | 'MessageSystem' | 'UnreadMessagesSeparator'\n  >\n> &\n  Pick<VirtualizedMessageListProps, VirtualizedMessageListPropsForContext> &\n  Pick<ChatContextValue, 'customClasses'> & {\n    /** Latest received message id in the current channel */\n    lastReceivedMessageId: string | null | undefined;\n    /** Object mapping between the message ID and a string representing the position in the group of a sequence of messages posted by the same user. */\n    messageGroupStyles: Record<string, GroupStyle>;\n    /** Number of messages prepended before the first page of messages. This is needed to calculate the virtual position in the virtual list. */\n    numItemsPrepended: number;\n    /** Mapping of message ID of own messages to the array of users, who were delivered the given message */\n    ownMessagesDeliveredToOthers: Record<string, UserResponse[]>;\n    /** Mapping of message ID of own messages to the array of users, who read the given message */\n    ownMessagesReadByOthers: Record<string, UserResponse[]>;\n    /** The original message list enriched with date separators, omitted deleted messages or giphy previews. */\n    processedMessages: RenderedMessage[];\n    /** Instance of VirtuosoHandle object providing the API to navigate in the virtualized list by various scroll actions. */\n    virtuosoRef: RefObject<VirtuosoHandle | null>;\n    /** Latest own message in currently displayed message set. */\n    lastOwnMessage?: LocalMessage;\n    /** Message id which was marked as unread. ALl the messages following this message are considered unrea.  */\n    firstUnreadMessageId?: string;\n    lastReadDate?: Date;\n    /**\n     * The ID of the last message considered read by the current user in the current channel.\n     * All the messages following this message are considered unread.\n     */\n    lastReadMessageId?: string;\n    /** The number of unread messages in the current channel. */\n    unreadMessageCount?: number;\n  };\n\ntype VirtualizedMessageListWithContextProps = VirtualizedMessageListProps & {\n  channel: Channel;\n  hasMore: boolean;\n  hasMoreNewer: boolean;\n  jumpToLatestMessage: () => Promise<void>;\n  loadingMore: boolean;\n  loadingMoreNewer: boolean;\n  notifications: ChannelNotifications;\n  read?: StreamChannelState['read'];\n  thread?: ChannelStateContextValue['thread'];\n};\n\nfunction captureResizeObserverExceededError(e: ErrorEvent) {\n  if (\n    e.message === 'ResizeObserver loop completed with undelivered notifications.' ||\n    e.message === 'ResizeObserver loop limit exceeded'\n  ) {\n    e.stopImmediatePropagation();\n  }\n}\n\nfunction useCaptureResizeObserverExceededError() {\n  useEffect(() => {\n    window.addEventListener('error', captureResizeObserverExceededError);\n    return () => {\n      window.removeEventListener('error', captureResizeObserverExceededError);\n    };\n  }, []);\n}\n\nfunction fractionalItemSize(element: HTMLElement) {\n  return element.getBoundingClientRect().height;\n}\n\nfunction findMessageIndex(messages: RenderedMessage[], id: string) {\n  return messages.findIndex((message) => message.id === id);\n}\n\nfunction calculateInitialTopMostItemIndex(\n  messages: RenderedMessage[],\n  highlightedMessageId: string | undefined,\n) {\n  if (highlightedMessageId) {\n    const index = findMessageIndex(messages, highlightedMessageId);\n    if (index !== -1) {\n      return { align: 'center', index } as const;\n    }\n  }\n  return messages.length - 1;\n}\n\nconst VirtualizedMessageListWithContext = (\n  props: VirtualizedMessageListWithContextProps,\n) => {\n  const {\n    additionalMessageComposerProps,\n    additionalVirtuosoProps = {},\n    channel,\n    channelUnreadUiState,\n    closeReactionSelectorOnClick,\n    customMessageRenderer,\n    defaultItemHeight,\n    disableDateSeparator = true,\n    formatDate,\n    groupStyles,\n    hasMoreNewer,\n    head,\n    hideDeletedMessages = false,\n    hideNewMessageSeparator = false,\n    highlightedMessageId,\n    jumpToLatestMessage,\n    loadingMore,\n    loadMore,\n    loadMoreNewer,\n    maxTimeBetweenGroupedMessages,\n    Message: MessageUIComponentFromProps,\n    messageActions,\n    messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE,\n    messages,\n    openThread,\n    // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component\n    overscan = 0,\n    reactionDetailsSort,\n    renderText,\n    returnAllReadData = false,\n    reviewProcessedMessage,\n    scrollSeekPlaceHolder,\n    scrollToLatestMessageOnFocus = false,\n    separateGiphyPreview = false,\n    shouldGroupByUser = false,\n    showAvatar,\n    showUnreadNotificationAlways,\n    sortReactions,\n    stickToBottomScrollBehavior = 'smooth',\n    suppressAutoscroll,\n    thread,\n    threadList,\n  } = props;\n\n  const { components: virtuosoComponentsFromProps, ...overridingVirtuosoProps } =\n    additionalVirtuosoProps;\n\n  // Stops errors generated from react-virtuoso to bubble up\n  // to Sentry or other tracking tools.\n  useCaptureResizeObserverExceededError();\n\n  const {\n    DateSeparator = DefaultDateSeparator,\n    GiphyPreviewMessage = DefaultGiphyPreviewMessage,\n    MessageListMainPanel = DefaultMessageListMainPanel,\n    MessageSystem = DefaultMessageSystem,\n    NewMessageNotification = DefaultNewMessageNotification,\n    NotificationList = DefaultNotificationList,\n    ScrollToLatestMessageButton = DefaultScrollToLatestMessageButton,\n    TypingIndicator,\n    UnreadMessagesNotification = DefaultUnreadMessagesNotification,\n    UnreadMessagesSeparator = DefaultUnreadMessagesSeparator,\n    VirtualMessage: MessageUIComponentFromContext = MessageUI,\n  } = useComponentContext('VirtualizedMessageList');\n  const MessageUIComponent = MessageUIComponentFromProps || MessageUIComponentFromContext;\n\n  const { client, customClasses } = useChatContext('VirtualizedMessageList');\n  const prefersReducedMotion = useReducedMotionPreference();\n  const effectiveStickToBottomScrollBehavior = prefersReducedMotion\n    ? 'auto'\n    : stickToBottomScrollBehavior;\n  const notificationTarget = useNotificationTarget();\n\n  const virtuoso = useRef<VirtuosoHandle>(null);\n\n  const lastRead = useMemo(() => channel.lastRead?.(), [channel]);\n\n  const { show: showUnreadMessagesNotification, toggleShowUnreadMessagesNotification } =\n    useUnreadMessagesNotificationVirtualized({\n      lastRead: channelUnreadUiState?.last_read,\n      showAlways: !!showUnreadNotificationAlways,\n      unreadCount: channelUnreadUiState?.unread_messages ?? 0,\n    });\n\n  const { giphyPreviewMessage, setGiphyPreviewMessage } =\n    useGiphyPreview(separateGiphyPreview);\n\n  const processedMessages = useMemo(() => {\n    if (typeof messages === 'undefined') {\n      return [];\n    }\n\n    if (\n      disableDateSeparator &&\n      !hideDeletedMessages &&\n      hideNewMessageSeparator &&\n      !separateGiphyPreview\n    ) {\n      return messages;\n    }\n\n    return processMessages({\n      enableDateSeparator: !disableDateSeparator,\n      hideDeletedMessages,\n      hideNewMessageSeparator,\n      lastRead,\n      messages,\n      reviewProcessedMessage,\n      setGiphyPreviewMessage,\n      userId: client.userID || '',\n    });\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [\n    disableDateSeparator,\n    hideDeletedMessages,\n    hideNewMessageSeparator,\n    lastRead,\n    messages,\n    messages?.length,\n    client.userID,\n  ]);\n\n  /**\n   * This indirection via a ref is needed because Virtuoso’s itemsRendered is set at render time,\n   * while FloatingDateSeparator lives in a child component that may run its hooks in a different order.\n   * Using a ref lets the parent provide the callback to Virtuoso while the child keeps ownership\n   * of the actual handler implementation.\n   */\n  const floatingDateItemsRenderedRef = useRef<\n    ((rendered: RenderedMessage[]) => void) | null\n  >(null);\n\n  const lastOwnMessage = useLastOwnMessage({ messages, ownUserId: client.user?.id });\n\n  // get the mapping of own messages to array of users who read them\n  const ownMessagesReadByOthers = useLastReadData({\n    channel,\n    lastOwnMessage,\n    messages: messages || [],\n    returnAllReadData,\n  });\n\n  const ownMessagesDeliveredToOthers = useLastDeliveredData({\n    channel,\n    lastOwnMessage,\n    messages: messages || [],\n    returnAllReadData,\n  });\n\n  const lastReceivedMessageId = useMemo(\n    () => getLastReceived(processedMessages),\n    [processedMessages],\n  );\n\n  const groupStylesFn = groupStyles || getGroupStyles;\n  const messageGroupStyles = useMemo(\n    () =>\n      processedMessages.reduce<Record<string, GroupStyle>>((acc, message, i) => {\n        const style = groupStylesFn(\n          message,\n          processedMessages[i - 1],\n          processedMessages[i + 1],\n          !shouldGroupByUser,\n          maxTimeBetweenGroupedMessages,\n        );\n        if (style && message.id) acc[message.id] = style;\n        return acc;\n      }, {}),\n    // processedMessages were incorrectly rebuilt with a new object identity at some point, hence the .length usage\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      maxTimeBetweenGroupedMessages,\n      processedMessages.length,\n      shouldGroupByUser,\n      groupStylesFn,\n    ],\n  );\n\n  const {\n    atBottom,\n    isMessageListScrolledToBottom,\n    newMessagesNotification,\n    setIsMessageListScrolledToBottom,\n    setNewMessagesNotification,\n  } = useNewMessageNotification(processedMessages, client.userID, hasMoreNewer);\n\n  useMarkRead({\n    isMessageListScrolledToBottom,\n    messageListIsThread: !!threadList,\n    wasMarkedUnread: !!channelUnreadUiState?.first_unread_message_id,\n  });\n\n  const scrollToBottom = useCallback(async () => {\n    if (hasMoreNewer) {\n      await jumpToLatestMessage();\n      return;\n    }\n\n    if (virtuoso.current) {\n      virtuoso.current.scrollToIndex(processedMessages.length - 1);\n    }\n\n    setNewMessagesNotification(false);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [\n    virtuoso,\n    processedMessages,\n    setNewMessagesNotification,\n    // processedMessages were incorrectly rebuilt with a new object identity at some point, hence the .length usage\n    processedMessages.length,\n    hasMoreNewer,\n    jumpToLatestMessage,\n  ]);\n\n  useScrollToBottomOnNewMessage({\n    messages,\n    scrollToBottom,\n    scrollToLatestMessageOnFocus,\n  });\n\n  const numItemsPrepended = usePrependedMessagesCount(\n    processedMessages,\n    !disableDateSeparator,\n  );\n\n  const { messageSetKey } = useMessageSetKey({ messages });\n\n  const shouldForceScrollToBottom = useShouldForceScrollToBottom(\n    processedMessages,\n    client.userID,\n  );\n\n  useIncomingMessageAnnouncements({\n    activeThreadId: thread?.id,\n    channel,\n    ownUserId: client.userID,\n    threadList,\n  });\n\n  const handleItemsRendered = useMemo(\n    () =>\n      makeItemsRenderedHandler(\n        [\n          toggleShowUnreadMessagesNotification,\n          (rendered) => floatingDateItemsRenderedRef.current?.(rendered),\n        ],\n        processedMessages,\n      ),\n    [processedMessages, toggleShowUnreadMessagesNotification],\n  );\n  const followOutput = (isAtBottom: boolean) => {\n    if (hasMoreNewer || suppressAutoscroll) {\n      return false;\n    }\n\n    if (shouldForceScrollToBottom()) {\n      return isAtBottom ? effectiveStickToBottomScrollBehavior : 'auto';\n    }\n    // a message from another user has been received - don't scroll to bottom unless already there\n    return isAtBottom ? effectiveStickToBottomScrollBehavior : false;\n  };\n\n  const computeItemKey = useCallback<ComputeItemKey<UnknownType, VirtuosoContext>>(\n    (index, _, { numItemsPrepended, processedMessages }) =>\n      processedMessages[calculateItemIndex(index, numItemsPrepended)].id,\n    [],\n  );\n\n  const atBottomStateChange = (isAtBottom: boolean) => {\n    atBottom.current = isAtBottom;\n    setIsMessageListScrolledToBottom(isAtBottom);\n\n    if (isAtBottom) {\n      loadMoreNewer?.(messageLimit);\n      setNewMessagesNotification?.(false);\n    }\n  };\n  const atTopStateChange = (isAtTop: boolean) => {\n    if (isAtTop) {\n      loadMore?.(messageLimit);\n    }\n  };\n\n  useEffect(() => {\n    let scrollTimeout: ReturnType<typeof setTimeout>;\n    if (highlightedMessageId) {\n      const index = findMessageIndex(processedMessages, highlightedMessageId);\n      if (index !== -1) {\n        scrollTimeout = setTimeout(() => {\n          virtuoso.current?.scrollToIndex({ align: 'center', index });\n        }, 0);\n      }\n    }\n    return () => {\n      clearTimeout(scrollTimeout);\n    };\n  }, [highlightedMessageId, processedMessages]);\n\n  const id = useStableId();\n\n  if (!processedMessages) return null;\n\n  const dialogManagerId = threadList\n    ? `virtualized-message-list-dialog-manager-thread-${id}`\n    : `virtualized-message-list-dialog-manager-${id}`;\n\n  return (\n    <VirtualizedMessageListContextProvider value={{ scrollToBottom }}>\n      <MessageTranslationViewProvider>\n        <MessageListMainPanel>\n          <DialogManagerProvider id={dialogManagerId}>\n            {!threadList && showUnreadMessagesNotification && (\n              <UnreadMessagesNotification\n                unreadCount={channelUnreadUiState?.unread_messages}\n              />\n            )}\n            <div\n              className={\n                customClasses?.virtualizedMessageList || 'str-chat__virtual-list'\n              }\n            >\n              <FloatingDateSeparator\n                disableDateSeparator={disableDateSeparator}\n                itemsRenderedRef={floatingDateItemsRenderedRef}\n                processedMessages={processedMessages}\n              />\n              <Virtuoso<UnknownType, VirtuosoContext>\n                atBottomStateChange={atBottomStateChange}\n                atBottomThreshold={100}\n                atTopStateChange={atTopStateChange}\n                atTopThreshold={100}\n                className='str-chat__message-list-scroll'\n                components={{\n                  EmptyPlaceholder,\n                  Header,\n                  Item,\n                  ...(TypingIndicator && {\n                    Footer: () =>\n                      isMessageListScrolledToBottom ? (\n                        <TypingIndicator\n                          isMessageListScrolledToBottom={isMessageListScrolledToBottom}\n                          scrollToBottom={scrollToBottom}\n                          threadList={threadList}\n                        />\n                      ) : null,\n                  }),\n                  ...virtuosoComponentsFromProps,\n                }}\n                computeItemKey={computeItemKey}\n                context={{\n                  additionalMessageComposerProps,\n                  closeReactionSelectorOnClick,\n                  customClasses,\n                  customMessageRenderer,\n                  DateSeparator,\n                  firstUnreadMessageId: channelUnreadUiState?.first_unread_message_id,\n                  formatDate,\n                  head,\n                  lastOwnMessage,\n                  lastReadDate: channelUnreadUiState?.last_read,\n                  lastReadMessageId: channelUnreadUiState?.last_read_message_id,\n                  lastReceivedMessageId,\n                  loadingMore,\n                  Message: MessageUIComponent,\n                  messageActions,\n                  messageGroupStyles,\n                  MessageSystem,\n                  numItemsPrepended,\n                  openThread,\n                  ownMessagesDeliveredToOthers,\n                  ownMessagesReadByOthers,\n                  processedMessages,\n                  reactionDetailsSort,\n                  renderText,\n                  returnAllReadData,\n                  shouldGroupByUser,\n                  showAvatar,\n                  sortReactions,\n                  threadList,\n                  unreadMessageCount: channelUnreadUiState?.unread_messages,\n                  UnreadMessagesSeparator,\n                  virtuosoRef: virtuoso,\n                }}\n                firstItemIndex={calculateFirstItemIndex(numItemsPrepended)}\n                followOutput={followOutput}\n                increaseViewportBy={{ bottom: 200, top: 0 }}\n                initialTopMostItemIndex={calculateInitialTopMostItemIndex(\n                  processedMessages,\n                  highlightedMessageId,\n                )}\n                itemContent={messageRenderer}\n                itemSize={fractionalItemSize}\n                itemsRendered={handleItemsRendered}\n                key={messageSetKey}\n                overscan={overscan}\n                ref={virtuoso}\n                style={{ overflowX: 'hidden' }}\n                totalCount={processedMessages.length}\n                {...overridingVirtuosoProps}\n                {...(scrollSeekPlaceHolder ? { scrollSeek: scrollSeekPlaceHolder } : {})}\n                {...(defaultItemHeight ? { defaultItemHeight } : {})}\n              />\n              <NewMessageNotification\n                newMessageCount={channelUnreadUiState?.unread_messages}\n                showNotification={newMessagesNotification || hasMoreNewer}\n              />\n              <ScrollToLatestMessageButton\n                isMessageListScrolledToBottom={isMessageListScrolledToBottom}\n                isNotAtLatestMessageSet={hasMoreNewer}\n                onClick={scrollToBottom}\n                threadList={threadList}\n              />\n            </div>\n          </DialogManagerProvider>\n          <NotificationList panel={notificationTarget} />\n        </MessageListMainPanel>\n        {giphyPreviewMessage && <GiphyPreviewMessage message={giphyPreviewMessage} />}\n      </MessageTranslationViewProvider>\n    </VirtualizedMessageListContextProvider>\n  );\n};\n\nexport type VirtualizedMessageListProps = Partial<\n  Pick<MessageProps, PropsDrilledToMessage>\n> & {\n  /** Additional props to be passed the underlying [`react-virtuoso` virtualized list dependency](https://virtuoso.dev/virtuoso-api-reference/) */\n  additionalVirtuosoProps?: VirtuosoProps<UnknownType, VirtuosoContext>;\n  channelUnreadUiState?: ChannelStateContextValue['channelUnreadUiState'];\n  /** If true, picking a reaction from the `ReactionSelector` component will close the selector */\n  closeReactionSelectorOnClick?: boolean;\n  /** Custom render function, if passed, certain UI props are ignored */\n  customMessageRenderer?: (\n    messageList: RenderedMessage[],\n    index: number,\n  ) => React.ReactElement;\n  /** @deprecated Use additionalVirtuosoProps.defaultItemHeight instead. Will be removed with next major release - `v11.0.0`.\n   * If set, the default item height is used for the calculation of the total list height. Use if you expect messages with a lot of height variance\n   * */\n  defaultItemHeight?: number;\n  /** Disables the injection of date separator components in MessageList, defaults to `true` */\n  disableDateSeparator?: boolean;\n  /** Callback function to set group styles for each message */\n  groupStyles?: (\n    message: RenderedMessage,\n    previousMessage: RenderedMessage,\n    nextMessage: RenderedMessage,\n    noGroupByUser: boolean,\n    maxTimeBetweenGroupedMessages?: number,\n  ) => GroupStyle;\n  /** Whether or not the list has more items to load */\n  hasMore?: boolean;\n  /** Whether or not the list has newer items to load */\n  hasMoreNewer?: boolean;\n  /**\n   * @deprecated Use additionalVirtuosoProps.components.Header to override default component rendered above the list ove messages.\n   * Element to be rendered at the top of the thread message list. By default, these are the Message and ThreadStart components\n   */\n  head?: React.ReactElement;\n  /** Hides the `MessageDeleted` components from the list, defaults to `false` */\n  hideDeletedMessages?: boolean;\n  /** Hides the `DateSeparator` component when new messages are received in a channel that's watched but not active, defaults to false */\n  hideNewMessageSeparator?: boolean;\n  /** The id of the message to highlight and center */\n  highlightedMessageId?: string;\n  /** Whether or not the list is currently loading more items */\n  loadingMore?: boolean;\n  /** Whether or not the list is currently loading newer items */\n  loadingMoreNewer?: boolean;\n  /** Function called when more messages are to be loaded, defaults to function stored in [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/) */\n  loadMore?: ChannelActionContextValue['loadMore'] | (() => Promise<void>);\n  /** Function called when new messages are to be loaded, defaults to function stored in [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/) */\n  loadMoreNewer?: ChannelActionContextValue['loadMore'] | (() => Promise<void>);\n  /** Maximum time in milliseconds that should occur between messages to still consider them grouped together */\n  maxTimeBetweenGroupedMessages?: number;\n  /** Custom UI component to display a message, defaults to and accepts same props as [MessageUI](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageUI.tsx) */\n  Message?: React.ComponentType<MessageUIComponentProps>;\n  /** The limit to use when paginating messages */\n  messageLimit?: number;\n  /** Optional prop to override the messages available from [ChannelStateContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_state_context/) */\n  messages?: LocalMessage[];\n  /**\n   * @deprecated Use additionalVirtuosoProps.overscan instead. Will be removed with next major release - `v11.0.0`.\n   * The amount of extra content the list should render in addition to what's necessary to fill in the viewport\n   */\n  overscan?: number;\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  /**\n   * Allows to review changes introduced to messages array on per message basis (e.g. date separator injected before a message).\n   * The array returned from the function is appended to the array of messages that are later rendered into React elements in the `VirtualizedMessageList`.\n   */\n  reviewProcessedMessage?: ProcessMessagesParams['reviewProcessedMessage'];\n  /**\n   * @deprecated Pass additionalVirtuosoProps.scrollSeekConfiguration and specify the placeholder in additionalVirtuosoProps.components.ScrollSeekPlaceholder instead.  Will be removed with next major release - `v11.0.0`.\n   * Performance improvement by showing placeholders if user scrolls fast through list.\n   * it can be used like this:\n   * ```\n   *  {\n   *    enter: (velocity) => Math.abs(velocity) > 120,\n   *    exit: (velocity) => Math.abs(velocity) < 40,\n   *    change: () => null,\n   *    placeholder: ({index, height})=> <div style={{height: height + \"px\"}}>{index}</div>,\n   *  }\n   *  ```\n   */\n  scrollSeekPlaceHolder?: ScrollSeekConfiguration & {\n    placeholder: React.ComponentType<ScrollSeekPlaceholderProps>;\n  };\n  /** When `true`, the list will scroll to the latest message when the window regains focus */\n  scrollToLatestMessageOnFocus?: boolean;\n  /** If true, the Giphy preview will render as a separate component above the `MessageComposer`, rather than inline with the other messages in the list */\n  separateGiphyPreview?: boolean;\n  /** If true, group messages belonging to the same user, otherwise show each message individually */\n  shouldGroupByUser?: boolean;\n  /**\n   * The floating notification informing about unread messages will be shown when the\n   * UnreadMessagesSeparator is not visible. The default is false, that means the notification\n   * is shown only when viewing unread messages.\n   */\n  showUnreadNotificationAlways?: boolean;\n  /** The scrollTo behavior when new messages appear. Use `\"smooth\"` for regular chat channels, and `\"auto\"` (which results in instant scroll to bottom) if you expect high throughput. Reduced-motion users are always treated as `\"auto\"`. */\n  stickToBottomScrollBehavior?: 'smooth' | 'auto';\n  /** stops the list from autoscrolling when new messages are loaded */\n  suppressAutoscroll?: boolean;\n  /** If true, indicates the message list is a thread  */\n  threadList?: boolean;\n};\n\n/**\n * The VirtualizedMessageList component renders a list of messages in a virtualized list.\n * It is a consumer of the React contexts set in [Channel](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Channel/Channel.tsx).\n */\nexport function VirtualizedMessageList(props: VirtualizedMessageListProps) {\n  const { jumpToLatestMessage, loadMore, loadMoreNewer } = useChannelActionContext(\n    'VirtualizedMessageList',\n  );\n  const {\n    channel,\n    channelUnreadUiState,\n    hasMore,\n    hasMoreNewer,\n    highlightedMessageId,\n    loadingMore,\n    loadingMoreNewer,\n    messages: contextMessages,\n    notifications,\n    read,\n    suppressAutoscroll,\n    thread,\n  } = useChannelStateContext('VirtualizedMessageList');\n\n  const messages = props.messages || contextMessages;\n\n  return (\n    <AriaLiveRegion>\n      <VirtualizedMessageListWithContext\n        channel={channel}\n        channelUnreadUiState={props.channelUnreadUiState ?? channelUnreadUiState}\n        hasMore={!!hasMore}\n        hasMoreNewer={!!hasMoreNewer}\n        highlightedMessageId={highlightedMessageId}\n        jumpToLatestMessage={jumpToLatestMessage}\n        loadingMore={!!loadingMore}\n        loadingMoreNewer={!!loadingMoreNewer}\n        loadMore={loadMore}\n        loadMoreNewer={loadMoreNewer}\n        messages={messages}\n        notifications={notifications}\n        read={read}\n        suppressAutoscroll={suppressAutoscroll}\n        thread={thread}\n        {...props}\n      />\n    </AriaLiveRegion>\n  );\n}\n","// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt#getting_whole_characters\nexport const getWholeChar = (str: string, i: number) => {\n  const code = str.charCodeAt(i);\n\n  if (Number.isNaN(code)) return '';\n\n  if (code < 0xd800 || code > 0xdfff) return str.charAt(i);\n\n  if (0xd800 <= code && code <= 0xdbff) {\n    if (str.length <= i + 1) {\n      throw 'High surrogate without following low surrogate';\n    }\n\n    const next = str.charCodeAt(i + 1);\n\n    if (0xdc00 > next || next > 0xdfff) {\n      throw 'High surrogate without following low surrogate';\n    }\n\n    return str.charAt(i) + str.charAt(i + 1);\n  }\n\n  if (i === 0) {\n    throw 'Low surrogate without preceding high surrogate';\n  }\n\n  const prev = str.charCodeAt(i - 1);\n\n  if (0xd800 > prev || prev > 0xdbff) {\n    throw 'Low surrogate without preceding high surrogate';\n  }\n\n  return '';\n};\n","import { useEffect, useState } from 'react';\nimport type { SearchController, SearchControllerState, SearchSource } from 'stream-chat';\n\nimport { useStateStore } from '../../../store';\n\nconst searchControllerStateSelector = (value: SearchControllerState) => ({\n  sources: value.sources,\n});\n\nexport type UseSearchQueriesInProgressParams = {\n  searchController: SearchController;\n};\n\nexport const useSearchQueriesInProgress = (searchController: SearchController) => {\n  const [queriesInProgress, setQueriesInProgress] = useState<string[]>([]);\n  const { sources } = useStateStore(\n    searchController.state,\n    searchControllerStateSelector,\n  );\n\n  useEffect(() => {\n    const subscriptions = sources.map((source: SearchSource) =>\n      source.state.subscribeWithSelector(\n        (value) => ({ isLoading: value.isLoading }),\n        ({ isLoading }) => {\n          setQueriesInProgress((prev) => {\n            if (isLoading) return prev.concat(source.type);\n            return prev.filter((type) => type !== source.type);\n          });\n        },\n      ),\n    );\n\n    return () => {\n      subscriptions.forEach((unsubscribe) => unsubscribe());\n    };\n  }, [sources]);\n  return queriesInProgress;\n};\n","import { useEffect } from 'react';\n\nimport { useChatContext } from '../../../context/ChatContext';\n\nexport const useConnectionRecoveredListener = (forceUpdate?: () => void) => {\n  const { client } = useChatContext('useConnectionRecoveredListener');\n\n  useEffect(() => {\n    const handleEvent = () => {\n      if (forceUpdate) {\n        forceUpdate();\n      }\n    };\n\n    client.on('connection.recovered', handleEvent);\n\n    return () => {\n      client.off('connection.recovered', handleEvent);\n    };\n  }, [client, forceUpdate]);\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport uniqBy from 'lodash.uniqby';\n\nimport type {\n  APIErrorResponse,\n  Channel,\n  ChannelFilters,\n  ChannelOptions,\n  ChannelSort,\n  ErrorFromResponse,\n  StreamChat,\n} from 'stream-chat';\n\nimport { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { useNotificationApi } from '../../Notifications';\n\nimport type { ChannelsQueryState } from '../../Chat/hooks/useChannelsQueryState';\n\nconst RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS = 5000;\nconst MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS = 2000;\n\ntype AllowedQueryType = Extract<\n  ChannelsQueryState['queryInProgress'],\n  'reload' | 'load-more'\n>;\n\nexport type CustomQueryChannelParams = {\n  currentChannels: Array<Channel>;\n  queryType: AllowedQueryType;\n  setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>;\n  setHasNextPage: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nexport type CustomQueryChannelsFn = (params: CustomQueryChannelParams) => Promise<void>;\n\nexport const usePaginatedChannels = (\n  client: StreamChat,\n  filters: ChannelFilters,\n  sort: ChannelSort,\n  options: ChannelOptions,\n  activeChannelHandler: (\n    channels: Array<Channel>,\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n  ) => void,\n  recoveryThrottleIntervalMs: number = RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS,\n  customQueryChannels?: CustomQueryChannelsFn,\n) => {\n  const { addNotification } = useNotificationApi();\n  const {\n    channelsQueryState: { error, setError, setQueryInProgress },\n  } = useChatContext('usePaginatedChannels');\n  const { t } = useTranslationContext();\n  const [channels, setChannels] = useState<Array<Channel>>([]);\n  const [hasNextPage, setHasNextPage] = useState(true);\n  const lastRecoveryTimestamp = useRef<number | undefined>(undefined);\n\n  const recoveryThrottleInterval =\n    recoveryThrottleIntervalMs < MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS\n      ? MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS\n      : (recoveryThrottleIntervalMs ?? RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS);\n  // memoize props\n  const filterString = useMemo(() => JSON.stringify(filters), [filters]);\n  const sortString = useMemo(() => JSON.stringify(sort), [sort]);\n\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  const queryChannels = async (queryType = 'load-more') => {\n    setError(null);\n    const offset = queryType === 'reload' ? 0 : channels.length;\n    const isFirstPage = offset === 0;\n\n    if (queryType === 'reload') {\n      setChannels([]);\n    }\n    setQueryInProgress(queryType as AllowedQueryType);\n\n    try {\n      if (customQueryChannels) {\n        await customQueryChannels({\n          currentChannels: channels,\n          queryType: queryType as AllowedQueryType,\n          setChannels,\n          setHasNextPage,\n        });\n      } else {\n        const newOptions = {\n          offset,\n          ...options,\n        };\n\n        const channelQueryResponse = await client.queryChannels(\n          filters,\n          sort || {},\n          newOptions,\n        );\n\n        const newChannels =\n          queryType === 'reload'\n            ? channelQueryResponse\n            : uniqBy([...channels, ...channelQueryResponse], 'cid');\n\n        setChannels(newChannels);\n        setHasNextPage(channelQueryResponse.length >= (newOptions.limit ?? 1));\n\n        // Set active channel only on load of first page\n        if (!offset && activeChannelHandler) {\n          activeChannelHandler(newChannels, setChannels);\n        }\n      }\n    } catch (error) {\n      console.warn(error);\n      addNotification({\n        emitter: 'ChannelList',\n        error: error instanceof Error ? error : undefined,\n        message: isFirstPage\n          ? t('Failed to load channels')\n          : t('Failed to load more channels'),\n        severity: 'error',\n        targetPanels: ['channel-list'],\n        type: isFirstPage\n          ? 'api:channel-list:load:failed'\n          : 'api:channel-list:load-more:failed',\n      });\n\n      if (isFirstPage) {\n        setError(error as ErrorFromResponse<APIErrorResponse>);\n      }\n    }\n\n    setQueryInProgress(null);\n  };\n\n  const throttleRecover = useCallback(() => {\n    const now = Date.now();\n    const isFirstRecovery = !lastRecoveryTimestamp.current;\n    const timeElapsedSinceLastRecoveryMs = lastRecoveryTimestamp.current\n      ? now - lastRecoveryTimestamp.current\n      : 0;\n\n    if (\n      !isFirstRecovery &&\n      timeElapsedSinceLastRecoveryMs < recoveryThrottleInterval &&\n      !error\n    ) {\n      return;\n    }\n\n    lastRecoveryTimestamp.current = now;\n    queryChannels('reload');\n  }, [error, queryChannels, recoveryThrottleInterval]);\n\n  const loadNextPage = () => queryChannels();\n\n  useEffect(() => {\n    if (client.recoverStateOnReconnect) return;\n    const { unsubscribe } = client.on('connection.recovered', throttleRecover);\n\n    return () => {\n      unsubscribe();\n    };\n  }, [client, throttleRecover]);\n\n  useEffect(() => {\n    queryChannels('reload');\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [filterString, sortString]);\n\n  return {\n    channels,\n    hasNextPage,\n    loadNextPage,\n    setChannels,\n  };\n};\n","import type { Channel, ChannelSort, ChannelSortBase } from 'stream-chat';\n\nimport type { ChannelListProps } from './ChannelList';\n\n/**\n * Expects channel array sorted by `{ pinned_at: -1 }`.\n *\n * TODO: add support for the `{ pinned_at: 1 }`\n */\nexport function findLastPinnedChannelIndex({ channels }: { channels: Channel[] }) {\n  let lastPinnedChannelIndex: number | null = null;\n\n  for (const channel of channels) {\n    if (!isChannelPinned(channel)) break;\n\n    if (typeof lastPinnedChannelIndex === 'number') {\n      lastPinnedChannelIndex++;\n    } else {\n      lastPinnedChannelIndex = 0;\n    }\n  }\n\n  return lastPinnedChannelIndex;\n}\n\ntype MoveChannelUpwardsParams = {\n  channels: Array<Channel>;\n  channelToMove: Channel;\n  sort: ChannelSort;\n  /**\n   * If the index of the channel within `channels` list which is being moved upwards\n   * (`channelToMove`) is known, you can supply it to skip extra calculation.\n   */\n  channelToMoveIndexWithinChannels?: number;\n};\n\nexport const moveChannelUpwards = ({\n  channels,\n  channelToMove,\n  channelToMoveIndexWithinChannels,\n  sort,\n}: MoveChannelUpwardsParams) => {\n  // get index of channel to move up\n  const targetChannelIndex =\n    channelToMoveIndexWithinChannels ??\n    channels.findIndex((channel) => channel.cid === channelToMove.cid);\n\n  const targetChannelExistsWithinList = targetChannelIndex >= 0;\n  const targetChannelAlreadyAtTheTop = targetChannelIndex === 0;\n\n  // pinned channels should not move within the list based on recent activity, channels which\n  // receive messages and are not pinned should move upwards but only under the last pinned channel\n  // in the list\n  const considerPinnedChannels = shouldConsiderPinnedChannels(sort);\n  const isTargetChannelPinned = isChannelPinned(channelToMove);\n\n  if (targetChannelAlreadyAtTheTop || (considerPinnedChannels && isTargetChannelPinned)) {\n    return channels;\n  }\n\n  const newChannels = [...channels];\n\n  // target channel index is known, remove it from the list\n  if (targetChannelExistsWithinList) {\n    newChannels.splice(targetChannelIndex, 1);\n  }\n\n  // as position of pinned channels has to stay unchanged, we need to\n  // find last pinned channel in the list to move the target channel after\n  let lastPinnedChannelIndex: number | null = null;\n  if (considerPinnedChannels) {\n    lastPinnedChannelIndex = findLastPinnedChannelIndex({ channels: newChannels });\n  }\n\n  // re-insert it at the new place (to specific index if pinned channels are considered)\n  newChannels.splice(\n    typeof lastPinnedChannelIndex === 'number' ? lastPinnedChannelIndex + 1 : 0,\n    0,\n    channelToMove,\n  );\n\n  return newChannels;\n};\n\n/**\n * Returns `true` only if object with `pinned_at` property is first within the `sort` array\n * or if `pinned_at` key of the `sort` object gets picked first when using `for...in` looping mechanism\n * and value of the `pinned_at` is either `1` or `-1`.\n */\nexport const shouldConsiderPinnedChannels = (sort: ChannelListProps['sort']) => {\n  const value = extractSortValue({ atIndex: 0, sort, targetKey: 'pinned_at' });\n\n  if (typeof value !== 'number') return false;\n\n  return Math.abs(value) === 1;\n};\n\nexport const extractSortValue = ({\n  atIndex,\n  sort,\n  targetKey,\n}: {\n  atIndex: number;\n  targetKey: keyof ChannelSortBase;\n  sort?: ChannelListProps['sort'];\n}) => {\n  if (!sort) return null;\n  let option: null | ChannelSortBase = null;\n\n  if (Array.isArray(sort)) {\n    option = sort[atIndex] ?? null;\n  } else {\n    let index = 0;\n    for (const key in sort) {\n      if (index !== atIndex) {\n        index++;\n        continue;\n      }\n\n      if (key !== targetKey) {\n        return null;\n      }\n\n      option = sort;\n\n      break;\n    }\n  }\n\n  return option?.[targetKey] ?? null;\n};\n\n/**\n * Returns `true` only if `archived` property is of type `boolean` within `filters` object.\n */\nexport const shouldConsiderArchivedChannels = (filters: ChannelListProps['filters']) => {\n  if (!filters) return false;\n\n  return typeof filters.archived === 'boolean';\n};\n\n/**\n * Returns `true` only if `pinned_at` property is of type `string` within `membership` object.\n */\nexport const isChannelPinned = (channel: Channel) => {\n  if (!channel) return false;\n\n  const membership = channel.state.membership;\n\n  return typeof membership.pinned_at === 'string';\n};\n\n/**\n * Returns `true` only if `archived_at` property is of type `string` within `membership` object.\n */\nexport const isChannelArchived = (channel: Channel) => {\n  if (!channel) return false;\n\n  const membership = channel.state.membership;\n\n  return typeof membership.archived_at === 'string';\n};\n","import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport type { Channel, Event } from 'stream-chat';\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport {\n  extractSortValue,\n  findLastPinnedChannelIndex,\n  isChannelArchived,\n  isChannelPinned,\n  moveChannelUpwards,\n  shouldConsiderArchivedChannels,\n  shouldConsiderPinnedChannels,\n} from '../utils';\nimport { useChatContext } from '../../../context';\nimport { getChannel } from '../../../utils';\nimport type { ChannelListProps } from '../ChannelList';\n\ntype SetChannels = Dispatch<SetStateAction<Channel[]>>;\n\ntype BaseParameters = {\n  event: Event;\n  setChannels: SetChannels;\n};\n\ntype RepeatedParameters = {\n  customHandler?: (\n    setChannels: BaseParameters['setChannels'],\n    event: BaseParameters['event'],\n  ) => void;\n};\n\ntype HandleMessageNewParameters = BaseParameters &\n  RepeatedParameters & {\n    allowNewMessagesFromUnfilteredChannels: boolean;\n    lockChannelOrder: boolean;\n  } & Required<Pick<ChannelListProps, 'filters' | 'sort'>>;\n\ntype HandleNotificationMessageNewParameters = BaseParameters &\n  RepeatedParameters & {\n    allowNewMessagesFromUnfilteredChannels: boolean;\n    lockChannelOrder: boolean;\n  } & Required<Pick<ChannelListProps, 'filters' | 'sort'>>;\n\ntype HandleNotificationRemovedFromChannelParameters = BaseParameters & RepeatedParameters;\n\ntype HandleNotificationAddedToChannelParameters = BaseParameters &\n  RepeatedParameters & {\n    allowNewMessagesFromUnfilteredChannels: boolean;\n    lockChannelOrder: boolean;\n  } & Required<Pick<ChannelListProps, 'sort'>>;\n\ntype HandleChannelVisibleParameters = BaseParameters &\n  RepeatedParameters &\n  Required<Pick<ChannelListProps, 'sort' | 'filters'>>;\n\ntype HandleMemberUpdatedParameters = BaseParameters & {\n  lockChannelOrder: boolean;\n} & Required<Pick<ChannelListProps, 'sort' | 'filters'>>;\n\ntype HandleChannelDeletedParameters = BaseParameters & RepeatedParameters;\n\ntype HandleChannelHiddenParameters = BaseParameters & RepeatedParameters;\n\ntype HandleChannelTruncatedParameters = BaseParameters & RepeatedParameters;\n\ntype HandleChannelUpdatedParameters = BaseParameters & RepeatedParameters;\n\ntype HandleUserPresenceChangedParameters = BaseParameters;\n\nconst shared = ({\n  customHandler,\n  event,\n  setChannels,\n}: BaseParameters & RepeatedParameters) => {\n  if (typeof customHandler === 'function') {\n    return customHandler(setChannels, event);\n  }\n\n  setChannels((channels) => {\n    const channelIndex = channels.findIndex((channel) => channel.cid === event.cid);\n\n    if (channelIndex < 0) return channels;\n\n    channels.splice(channelIndex, 1);\n\n    return [...channels];\n  });\n};\n\nexport const useChannelListShapeDefaults = () => {\n  const { client } = useChatContext();\n\n  const handleMessageNew = useCallback(\n    ({\n      allowNewMessagesFromUnfilteredChannels,\n      customHandler,\n      event,\n      filters,\n      lockChannelOrder,\n      setChannels,\n      sort,\n    }: HandleMessageNewParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      const channelType = event.channel_type;\n      const channelId = event.channel_id;\n\n      if (!channelType || !channelId) return;\n\n      setChannels((currentChannels) => {\n        const targetChannel = client.channel(channelType, channelId);\n        const targetChannelIndex = currentChannels.indexOf(targetChannel);\n        const targetChannelExistsWithinList = targetChannelIndex >= 0;\n\n        const isTargetChannelPinned = isChannelPinned(targetChannel);\n        const isTargetChannelArchived = isChannelArchived(targetChannel);\n\n        const considerArchivedChannels = shouldConsiderArchivedChannels(filters);\n        const considerPinnedChannels = shouldConsiderPinnedChannels(sort);\n\n        if (\n          // filter is defined, target channel is archived and filter option is set to false\n          (considerArchivedChannels && isTargetChannelArchived && !filters.archived) ||\n          // filter is defined, target channel isn't archived and filter option is set to true\n          (considerArchivedChannels && !isTargetChannelArchived && filters.archived) ||\n          // sort option is defined, target channel is pinned\n          (considerPinnedChannels && isTargetChannelPinned) ||\n          // list order is locked\n          lockChannelOrder ||\n          // target channel is not within the loaded list and loading from cache is disallowed\n          (!targetChannelExistsWithinList && !allowNewMessagesFromUnfilteredChannels)\n        ) {\n          return currentChannels;\n        }\n\n        return moveChannelUpwards({\n          channels: currentChannels,\n          channelToMove: targetChannel,\n          channelToMoveIndexWithinChannels: targetChannelIndex,\n          sort,\n        });\n      });\n    },\n    [client],\n  );\n\n  const handleNotificationMessageNew = useCallback(\n    async ({\n      allowNewMessagesFromUnfilteredChannels,\n      customHandler,\n      event,\n      filters,\n      setChannels,\n      sort,\n    }: HandleNotificationMessageNewParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      if (!event.channel) {\n        return;\n      }\n\n      const channel = await getChannel({\n        client,\n        id: event.channel.id,\n        type: event.channel.type,\n      });\n\n      const considerArchivedChannels = shouldConsiderArchivedChannels(filters);\n      if (isChannelArchived(channel) && considerArchivedChannels && !filters.archived) {\n        return;\n      }\n\n      if (!allowNewMessagesFromUnfilteredChannels) {\n        return;\n      }\n\n      setChannels((channels) =>\n        moveChannelUpwards({\n          channels,\n          channelToMove: channel,\n          sort,\n        }),\n      );\n    },\n    [client],\n  );\n\n  const handleNotificationAddedToChannel = useCallback(\n    async ({\n      allowNewMessagesFromUnfilteredChannels,\n      customHandler,\n      event,\n      setChannels,\n      sort,\n    }: HandleNotificationAddedToChannelParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      if (!event.channel || !allowNewMessagesFromUnfilteredChannels) {\n        return;\n      }\n\n      const channel = await getChannel({\n        client,\n        id: event.channel.id,\n        members: event.channel.members?.reduce<string[]>(\n          (newMembers, { user, user_id }) => {\n            const userId = user_id || user?.id;\n\n            if (userId) newMembers.push(userId);\n\n            return newMembers;\n          },\n          [],\n        ),\n        type: event.channel.type,\n      });\n\n      // membership has been reset (target channel shouldn't be pinned nor archived)\n      setChannels((channels) =>\n        moveChannelUpwards({\n          channels,\n          channelToMove: channel,\n          sort,\n        }),\n      );\n    },\n    [client],\n  );\n\n  const handleNotificationRemovedFromChannel = useCallback(\n    ({\n      customHandler,\n      event,\n      setChannels,\n    }: HandleNotificationRemovedFromChannelParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      setChannels((channels) =>\n        channels.filter((channel) => channel.cid !== event.channel?.cid),\n      );\n    },\n    [],\n  );\n\n  const handleMemberUpdated = useCallback(\n    ({\n      event,\n      filters,\n      lockChannelOrder,\n      setChannels,\n      sort,\n    }: HandleMemberUpdatedParameters) => {\n      if (\n        !event.member?.user ||\n        event.member.user.id !== client.userID ||\n        !event.channel_type\n      ) {\n        return;\n      }\n\n      const channelType = event.channel_type;\n      const channelId = event.channel_id;\n\n      const considerPinnedChannels = shouldConsiderPinnedChannels(sort);\n      const considerArchivedChannels = shouldConsiderArchivedChannels(filters);\n\n      // `pinned_at` nor `archived` properties are set or channel list order is locked, return early\n      if ((!considerPinnedChannels && !considerArchivedChannels) || lockChannelOrder) {\n        return;\n      }\n\n      const pinnedAtSort = extractSortValue({ atIndex: 0, sort, targetKey: 'pinned_at' });\n\n      setChannels((currentChannels) => {\n        const targetChannel = client.channel(channelType, channelId);\n        // assumes that channel instances are not changing\n        const targetChannelIndex = currentChannels.indexOf(targetChannel);\n        const targetChannelExistsWithinList = targetChannelIndex >= 0;\n\n        const isTargetChannelArchived = isChannelArchived(targetChannel);\n        const isTargetChannelPinned = isChannelPinned(targetChannel);\n\n        const newChannels = [...currentChannels];\n\n        if (targetChannelExistsWithinList) {\n          newChannels.splice(targetChannelIndex, 1);\n        }\n\n        // handle archiving (remove channel)\n        if (\n          (considerArchivedChannels && isTargetChannelArchived && !filters.archived) ||\n          (considerArchivedChannels && !isTargetChannelArchived && filters.archived)\n        ) {\n          return newChannels;\n        }\n\n        let lastPinnedChannelIndex: number | null = null;\n\n        // calculate last pinned channel index only if `pinned_at` sort is set to\n        // ascending order or if it's in descending order while the pin is being removed, otherwise\n        // we move to the top (index 0)\n        if (pinnedAtSort === 1 || (pinnedAtSort === -1 && !isTargetChannelPinned)) {\n          lastPinnedChannelIndex = findLastPinnedChannelIndex({ channels: newChannels });\n        }\n\n        const newTargetChannelIndex =\n          typeof lastPinnedChannelIndex === 'number' ? lastPinnedChannelIndex + 1 : 0;\n\n        newChannels.splice(newTargetChannelIndex, 0, targetChannel);\n\n        return newChannels;\n      });\n    },\n    [client],\n  );\n\n  const handleChannelDeleted = useCallback(\n    (p: HandleChannelDeletedParameters) => shared(p),\n    [],\n  );\n\n  const handleChannelHidden = useCallback(\n    (p: HandleChannelHiddenParameters) => shared(p),\n    [],\n  );\n\n  const handleChannelVisible = useCallback(\n    async ({\n      customHandler,\n      event,\n      filters,\n      setChannels,\n      sort,\n    }: HandleChannelVisibleParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      if (!event.channel_id && !event.channel_type) {\n        return;\n      }\n\n      const channel = await getChannel({\n        client,\n        id: event.channel_id,\n        type: event.channel_type,\n      });\n\n      const considerArchivedChannels = shouldConsiderArchivedChannels(filters);\n      if (isChannelArchived(channel) && considerArchivedChannels && !filters.archived) {\n        return;\n      }\n\n      setChannels((channels) =>\n        moveChannelUpwards({\n          channels,\n          channelToMove: channel,\n          sort,\n        }),\n      );\n    },\n    [client],\n  );\n\n  const handleChannelTruncated = useCallback(\n    ({ customHandler, event, setChannels }: HandleChannelTruncatedParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      // TODO: not sure whether this is needed\n      setChannels((channels) => [...channels]);\n      // if (forceUpdate) {\n      //   forceUpdate();\n      // }\n    },\n    [],\n  );\n\n  const handleChannelUpdated = useCallback(\n    ({ customHandler, event, setChannels }: HandleChannelUpdatedParameters) => {\n      if (typeof customHandler === 'function') {\n        return customHandler(setChannels, event);\n      }\n\n      setChannels((channels) => {\n        const channelIndex = channels.findIndex(\n          (channel) => channel.cid === event.channel?.cid,\n        );\n\n        if (channelIndex > -1 && event.channel) {\n          const newChannels = channels;\n          newChannels[channelIndex].data = {\n            ...event.channel,\n            hidden: event.channel?.hidden ?? newChannels[channelIndex].data?.hidden,\n            own_capabilities:\n              event.channel?.own_capabilities ??\n              newChannels[channelIndex].data?.own_capabilities,\n          };\n\n          return [...newChannels];\n        }\n\n        return channels;\n      });\n\n      // if (forceUpdate) {\n      //   forceUpdate();\n      // }\n    },\n    [],\n  );\n\n  const handleUserPresenceChanged = useCallback(\n    ({ event, setChannels }: HandleUserPresenceChangedParameters) => {\n      setChannels((channels) => {\n        const newChannels = channels.map((channel) => {\n          if (!event.user?.id || !channel.state.members[event.user.id]) {\n            return channel;\n          }\n\n          // FIXME: oh no...\n          const newChannel = channel;\n          newChannel.state.members[event.user.id].user = event.user;\n\n          return newChannel;\n        });\n\n        return newChannels;\n      });\n    },\n    [],\n  );\n\n  return useMemo(\n    () => ({\n      handleChannelDeleted,\n      handleChannelHidden,\n      handleChannelTruncated,\n      handleChannelUpdated,\n      handleChannelVisible,\n      handleMemberUpdated,\n      handleMessageNew,\n      handleNotificationAddedToChannel,\n      handleNotificationMessageNew,\n      handleNotificationRemovedFromChannel,\n      handleUserPresenceChanged,\n    }),\n    [\n      handleChannelDeleted,\n      handleChannelHidden,\n      handleChannelTruncated,\n      handleChannelUpdated,\n      handleChannelVisible,\n      handleMemberUpdated,\n      handleMessageNew,\n      handleNotificationAddedToChannel,\n      handleNotificationMessageNew,\n      handleNotificationRemovedFromChannel,\n      handleUserPresenceChanged,\n    ],\n  );\n};\n\ntype UseDefaultHandleChannelListShapeParameters = Required<\n  Pick<\n    ChannelListProps,\n    'allowNewMessagesFromUnfilteredChannels' | 'lockChannelOrder' | 'filters' | 'sort'\n  >\n> &\n  Pick<\n    ChannelListProps,\n    | 'onAddedToChannel'\n    | 'onChannelDeleted'\n    | 'onChannelHidden'\n    | 'onChannelTruncated'\n    | 'onChannelUpdated'\n    | 'onChannelVisible'\n    | 'onMessageNew'\n    | 'onMessageNewHandler'\n    | 'onRemovedFromChannel'\n  > & {\n    setChannels: SetChannels;\n    customHandleChannelListShape?: (data: {\n      defaults: ReturnType<typeof useChannelListShapeDefaults>;\n      event: Event;\n      setChannels: SetChannels;\n    }) => void;\n  };\n\nexport const usePrepareShapeHandlers = ({\n  allowNewMessagesFromUnfilteredChannels,\n  customHandleChannelListShape,\n  filters,\n  lockChannelOrder,\n  onAddedToChannel,\n  onChannelDeleted,\n  onChannelHidden,\n  onChannelTruncated,\n  onChannelUpdated,\n  onChannelVisible,\n  onMessageNew,\n  onMessageNewHandler,\n  onRemovedFromChannel,\n  setChannels,\n  sort,\n}: UseDefaultHandleChannelListShapeParameters) => {\n  const defaults = useChannelListShapeDefaults();\n\n  const defaultHandleChannelListShapeRef = useRef<(e: Event) => void>(undefined);\n\n  const customHandleChannelListShapeRef = useRef<(e: Event) => void>(undefined);\n\n  customHandleChannelListShapeRef.current = (event: Event) => {\n    customHandleChannelListShape?.({ defaults, event, setChannels });\n  };\n\n  defaultHandleChannelListShapeRef.current = (event: Event) => {\n    switch (event.type) {\n      case 'message.new':\n        defaults.handleMessageNew({\n          allowNewMessagesFromUnfilteredChannels,\n          customHandler: onMessageNewHandler,\n          event,\n          filters,\n          lockChannelOrder,\n          setChannels,\n          sort,\n        });\n        break;\n      case 'notification.message_new':\n        defaults.handleNotificationMessageNew({\n          allowNewMessagesFromUnfilteredChannels,\n          customHandler: onMessageNew,\n          event,\n          filters,\n          lockChannelOrder,\n          setChannels,\n          sort,\n        });\n        break;\n      case 'notification.added_to_channel':\n        defaults.handleNotificationAddedToChannel({\n          allowNewMessagesFromUnfilteredChannels,\n          customHandler: onAddedToChannel,\n          event,\n          lockChannelOrder,\n          setChannels,\n          sort,\n        });\n        break;\n      case 'notification.removed_from_channel':\n        defaults.handleNotificationRemovedFromChannel({\n          customHandler: onRemovedFromChannel,\n          event,\n          setChannels,\n        });\n        break;\n      case 'channel.deleted':\n        defaults.handleChannelDeleted({\n          customHandler: onChannelDeleted,\n          event,\n          setChannels,\n        });\n        break;\n      case 'channel.hidden':\n        defaults.handleChannelHidden({\n          customHandler: onChannelHidden,\n          event,\n          setChannels,\n        });\n        break;\n      case 'channel.visible':\n        defaults.handleChannelVisible({\n          customHandler: onChannelVisible,\n          event,\n          filters,\n          setChannels,\n          sort,\n        });\n        break;\n      case 'channel.truncated':\n        defaults.handleChannelTruncated({\n          customHandler: onChannelTruncated,\n          event,\n          setChannels,\n        });\n        break;\n      case 'channel.updated':\n        defaults.handleChannelUpdated({\n          customHandler: onChannelUpdated,\n          event,\n          setChannels,\n        });\n        break;\n      case 'user.presence.changed':\n        defaults.handleUserPresenceChanged({ event, setChannels });\n        break;\n      case 'member.updated':\n        defaults.handleMemberUpdated({\n          event,\n          filters,\n          lockChannelOrder,\n          setChannels,\n          sort,\n        });\n        break;\n      default:\n        break;\n    }\n  };\n\n  const defaultFn = useCallback((e: Event) => {\n    defaultHandleChannelListShapeRef.current?.(e);\n  }, []);\n\n  const customFn = useMemo(() => {\n    if (!customHandleChannelListShape) return null;\n    return (e: Event) => {\n      customHandleChannelListShapeRef.current?.(e);\n    };\n  }, [customHandleChannelListShape]);\n\n  return {\n    customHandler: customFn,\n    defaultHandler: defaultFn,\n  };\n};\n\nexport const useChannelListShape = (handler: (e: Event) => void) => {\n  const { client } = useChatContext();\n\n  useEffect(() => {\n    const subscription = client.on('all', handler);\n\n    return subscription.unsubscribe;\n  }, [client, handler]);\n};\n","import React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { APIErrorResponse, Channel, ErrorFromResponse } from 'stream-chat';\n\nimport { LoadingChannels } from '../Loading/LoadingChannels';\nimport { NullComponent } from '../UtilityComponents';\nimport { useComponentContext, useTranslationContext } from '../../context';\n\nexport type ChannelListUIProps = {\n  /** Whether the channel query request returned an errored response */\n  error: ErrorFromResponse<APIErrorResponse> | null;\n  /** The channels currently loaded in the list, only defined if `sendChannelsToList` on `ChannelList` is true */\n  loadedChannels?: Channel[];\n  /** Whether the channels are currently loading */\n  loading?: boolean;\n  /** Local state hook that resets the currently loaded channels */\n  setChannels?: React.Dispatch<React.SetStateAction<Channel[]>>;\n};\n\n/**\n * A preview list of channels, allowing you to select the channel you want to open\n */\nexport const ChannelListUI = (props: PropsWithChildren<ChannelListUIProps>) => {\n  const { children, error = null, loading = false } = props;\n  const { LoadingErrorIndicator = NullComponent, LoadingIndicator = LoadingChannels } =\n    useComponentContext('ChannelListUI');\n  const { t } = useTranslationContext('ChannelListUI');\n\n  if (error) {\n    return <LoadingErrorIndicator error={error} />;\n  }\n\n  return (\n    <div className='str-chat__channel-list-inner'>\n      <div\n        aria-label={t('aria/Channel list')}\n        className='str-chat__channel-list-inner__main'\n        role='listbox'\n      >\n        {loading ? <LoadingIndicator /> : children}\n      </div>\n    </div>\n  );\n};\n","import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { SearchController } from 'stream-chat';\nimport type { SearchProps } from './Search';\n\nexport type SearchContextValue = {\n  /** Instance of the search controller that handles the data management */\n  searchController: SearchController;\n  /** Reference to the container element of the search component */\n  containerRef: React.RefObject<HTMLDivElement | null>;\n  /** Reference to the container element of the filter buttons */\n  filterButtonsContainerRef: React.RefObject<HTMLDivElement | null>;\n} & Pick<SearchProps, 'disabled' | 'placeholder'> &\n  Required<Pick<SearchProps, 'exitSearchOnInputBlur' | 'directMessagingChannelType'>>;\n\nexport const SearchContext = createContext<SearchContextValue | undefined>(undefined);\n\n/**\n * Context provider for components rendered within the `Search` component\n */\nexport const SearchContextProvider = ({\n  children,\n  value,\n}: PropsWithChildren<{\n  value: SearchContextValue;\n}>) => (\n  <SearchContext.Provider value={value as unknown as SearchContextValue}>\n    {children}\n  </SearchContext.Provider>\n);\n\nexport const useSearchContext = () => {\n  const contextValue = useContext(SearchContext);\n  return contextValue as unknown as SearchContextValue;\n};\n","import clsx from 'clsx';\nimport React, { useEffect, useState } from 'react';\n\nimport { useSearchContext } from '../SearchContext';\nimport { useSearchQueriesInProgress } from '../hooks';\nimport { useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport { Button, IconSearch, IconXCircle, VisuallyHidden } from '../../../components';\n\nimport type { SearchControllerState } from 'stream-chat';\n\nconst searchControllerStateSelector = (nextValue: SearchControllerState) => ({\n  isActive: nextValue.isActive,\n  searchQuery: nextValue.searchQuery,\n});\n\nexport const SearchBar = () => {\n  const { t } = useTranslationContext();\n  const {\n    disabled,\n    exitSearchOnInputBlur,\n    filterButtonsContainerRef,\n    placeholder,\n    searchController,\n  } = useSearchContext();\n  const queriesInProgress = useSearchQueriesInProgress(searchController);\n  const clearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n  const searchInputId = React.useId();\n\n  const [input, setInput] = useState<HTMLInputElement | null>(null);\n  const { isActive, searchQuery } = useStateStore(\n    searchController.state,\n    searchControllerStateSelector,\n  );\n\n  useEffect(() => {\n    if (!input) return;\n    const handleKeyDown = (event: KeyboardEvent) => {\n      if (event.key === 'Escape') {\n        input.blur();\n        searchController.exit();\n      }\n    };\n\n    document.addEventListener('keydown', handleKeyDown);\n    return () => {\n      document.removeEventListener('keydown', handleKeyDown);\n    };\n  }, [searchController, input]);\n\n  return (\n    <div className='str-chat__search-bar' data-testid='search-bar' role='search'>\n      <div\n        className={clsx('str-chat__search-bar__input-wrapper', {\n          'str-chat__search-bar__input-wrapper--active': isActive,\n        })}\n      >\n        <label htmlFor={searchInputId}>\n          <VisuallyHidden>{t('Search')}</VisuallyHidden>\n        </label>\n        <IconSearch />\n        <input\n          className='str-chat__search-bar__input'\n          data-testid='search-input'\n          disabled={disabled}\n          id={searchInputId}\n          onBlur={({ currentTarget, relatedTarget }) => {\n            if (\n              exitSearchOnInputBlur &&\n              // input is empty\n              !currentTarget.value &&\n              // clicking on filter buttons or clear button shouldn't trigger exit search on blur\n              !filterButtonsContainerRef.current?.contains(relatedTarget) &&\n              // clicking clear button shouldn't trigger exit search on blur\n              (!clearButtonRef.current || relatedTarget !== clearButtonRef.current)\n            ) {\n              searchController.exit();\n            }\n          }}\n          onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n            if (event.target.value) {\n              searchController.search(event.target.value);\n            } else if (!event.target.value) {\n              searchController.clear();\n            }\n          }}\n          onFocus={searchController.activate}\n          placeholder={placeholder ?? t('Search')}\n          ref={setInput}\n          type='text'\n          value={searchQuery}\n        />\n        {searchQuery && (\n          <Button\n            appearance='ghost'\n            aria-label={t('aria/Clear search')}\n            circular\n            className='str-chat__search-bar__clear-button'\n            data-testid='clear-input-button'\n            disabled={queriesInProgress.length > 0} // prevent user from clearing the input while query is in progress and avoid out-of-sync UX\n            onClick={() => {\n              searchController.clear();\n              input?.focus();\n            }}\n            ref={clearButtonRef}\n            size='xs'\n            variant='secondary'\n          >\n            <IconXCircle />\n          </Button>\n        )}\n      </div>\n      {isActive && (\n        <Button\n          appearance='ghost'\n          aria-label={t('aria/Exit search')}\n          className='str-chat__search-bar__exit-search-button'\n          data-testid='search-bar-button'\n          onClick={() => {\n            input?.blur();\n            searchController.exit();\n          }}\n          size='sm'\n          variant='secondary'\n        >\n          {t('Cancel')}\n        </Button>\n      )}\n    </div>\n  );\n};\n","import React, { useCallback, useMemo } from 'react';\nimport uniqBy from 'lodash.uniqby';\nimport type { ComponentType } from 'react';\nimport type { Channel, MessageResponse, User } from 'stream-chat';\n\nimport { useSearchContext } from '../SearchContext';\nimport { Avatar } from '../../../components/Avatar';\nimport { ChannelListItem } from '../../../components/ChannelListItem';\nimport {\n  useChannelListContext,\n  useChatContext,\n  useTranslationContext,\n} from '../../../context';\nimport { DEFAULT_JUMP_TO_PAGE_SIZE } from '../../../constants/limits';\nimport { Timestamp } from '../../../components/Message/Timestamp';\n\nexport type ChannelSearchResultItemProps = {\n  item: Channel;\n};\n\nexport const ChannelSearchResultItem = ({ item }: ChannelSearchResultItemProps) => {\n  const { setActiveChannel } = useChatContext();\n  const { setChannels } = useChannelListContext();\n\n  const onSelect = useCallback(() => {\n    setActiveChannel(item);\n    setChannels?.((channels) => uniqBy([item, ...channels], 'cid'));\n  }, [item, setActiveChannel, setChannels]);\n\n  return (\n    <ChannelListItem\n      channel={item}\n      className='str-chat__search-result'\n      onSelect={onSelect}\n    />\n  );\n};\n\nexport type ChannelByMessageSearchResultItemProps = {\n  item: MessageResponse;\n};\n\nexport const MessageSearchResultItem = ({\n  item,\n}: ChannelByMessageSearchResultItemProps) => {\n  const {\n    channel: activeChannel,\n    client,\n    searchController,\n    setActiveChannel,\n  } = useChatContext();\n  const { setChannels } = useChannelListContext();\n\n  const channel = useMemo(() => {\n    const { channel: channelData } = item;\n    const type = channelData?.type ?? 'unknown';\n    const id = channelData?.id ?? 'unknown';\n    return client.channel(type, id);\n  }, [client, item]);\n\n  const onSelect = useCallback(async () => {\n    if (!channel) return;\n    await channel.state.loadMessageIntoState(\n      item.id,\n      undefined,\n      DEFAULT_JUMP_TO_PAGE_SIZE,\n    );\n    // FIXME: message focus should be handled by yet non-existent msg list controller in client packaged\n    searchController._internalState.partialNext({ focusedMessage: item });\n    setActiveChannel(channel);\n    setChannels?.((channels) => uniqBy([channel, ...channels], 'cid'));\n  }, [channel, item, searchController, setActiveChannel, setChannels]);\n\n  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n  const getLatestMessagePreview = useCallback(() => item.text!, [item]);\n\n  if (!channel) return;\n\n  return (\n    <ChannelListItem\n      active={\n        channel.cid === activeChannel?.cid &&\n        item.id === searchController._internalState.getLatestValue().focusedMessage?.id\n      }\n      channel={channel}\n      className='str-chat__search-result'\n      getLatestMessagePreview={getLatestMessagePreview}\n      onSelect={onSelect}\n    />\n  );\n};\n\nexport type UserSearchResultItemProps = {\n  item: User;\n};\n\nexport const UserSearchResultItem = ({ item }: UserSearchResultItemProps) => {\n  const { client, setActiveChannel } = useChatContext();\n  const { setChannels } = useChannelListContext();\n  const { directMessagingChannelType } = useSearchContext();\n  const { t } = useTranslationContext();\n\n  const onClick = useCallback(() => {\n    const newChannel = client.channel(directMessagingChannelType, {\n      members: [client.userID as string, item.id],\n    });\n    newChannel.watch();\n    setActiveChannel(newChannel);\n    setChannels?.((channels) => uniqBy([newChannel, ...channels], 'cid'));\n  }, [client, item, setActiveChannel, setChannels, directMessagingChannelType]);\n\n  return (\n    <div className='str-chat__search-result-container'>\n      <button\n        aria-label={t('aria/Select User Channel: {{ name }}', {\n          name: item.name || '',\n        })}\n        className='str-chat__search-result str-chat__search-result--user'\n        data-testid='search-result-user'\n        onClick={onClick}\n        role='option'\n      >\n        <Avatar\n          imageUrl={item.image}\n          isOnline={item.online}\n          size='xl'\n          userName={item.name || item.id}\n        />\n        <div className='str-chat__search-result-data'>\n          <div className='str-chat__search-result__display-name'>\n            {item.name || item.username || item.id}\n          </div>\n          <Timestamp\n            customClass='str-chat__search-result__last-active-timestamp'\n            timestamp={item.last_active}\n          />\n        </div>\n      </button>\n    </div>\n  );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SearchResultItemComponents = Record<string, ComponentType<{ item: any }>>;\n\nexport const DefaultSearchResultItems: SearchResultItemComponents = {\n  channels: ChannelSearchResultItem,\n  messages: MessageSearchResultItem,\n  users: UserSearchResultItem,\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { createContext, useContext } from 'react';\nimport type { SearchSource } from 'stream-chat';\n\nexport type SearchSourceResultsContextValue = {\n  searchSource: SearchSource;\n};\n\nexport const SearchSourceResultsContext = createContext<\n  SearchSourceResultsContextValue | undefined\n>(undefined);\n\n/**\n * Context provider for components rendered within the `SearchSourceResults`\n */\nexport const SearchSourceResultsContextProvider = ({\n  children,\n  value,\n}: PropsWithChildren<{\n  value: SearchSourceResultsContextValue;\n}>) => (\n  <SearchSourceResultsContext.Provider\n    value={value as unknown as SearchSourceResultsContextValue}\n  >\n    {children}\n  </SearchSourceResultsContext.Provider>\n);\n\nexport const useSearchSourceResultsContext = () => {\n  const contextValue = useContext(SearchSourceResultsContext);\n  return contextValue as unknown as SearchSourceResultsContextValue;\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../../context';\nimport { useSearchSourceResultsContext } from '../SearchSourceResultsContext';\n\nexport const SearchSourceResultsLoadingIndicator = () => {\n  const { t } = useTranslationContext();\n  const { searchSource } = useSearchSourceResultsContext();\n  return (\n    <div\n      className='str-chat__search-source-results__loading-indicator'\n      data-testid='search-loading-indicator'\n    >\n      {t('Searching for {{ searchSourceType }}...', {\n        searchSourceType: searchSource.type,\n      })}\n    </div>\n  );\n};\n","import React from 'react';\nimport type { SearchSourceState } from 'stream-chat';\n\nimport { SearchSourceResultsLoadingIndicator as DefaultSearchSourceResultsLoadingIndicator } from './SearchSourceResultsLoadingIndicator';\nimport { useSearchSourceResultsContext } from '../SearchSourceResultsContext';\nimport { useComponentContext, useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst searchSourceStateSelector = (value: SearchSourceState) => ({\n  hasNext: value.hasNext,\n  isLoading: value.isLoading,\n});\n\nexport const SearchSourceResultListFooter = () => {\n  const { t } = useTranslationContext();\n  const {\n    SearchSourceResultsLoadingIndicator = DefaultSearchSourceResultsLoadingIndicator,\n  } = useComponentContext();\n  const { searchSource } = useSearchSourceResultsContext();\n  const { hasNext, isLoading } = useStateStore(\n    searchSource.state,\n    searchSourceStateSelector,\n  );\n\n  return (\n    <div\n      className='str-chat__search-source-result-list__footer'\n      data-testid='search-footer'\n    >\n      {isLoading ? (\n        <SearchSourceResultsLoadingIndicator />\n      ) : !hasNext ? (\n        <div className='str-chat__search-source-results---empty'>\n          {t('All results loaded')}\n        </div>\n      ) : null}\n    </div>\n  );\n};\n","import React from 'react';\nimport type { ComponentType } from 'react';\nimport type { SearchSourceState, SearchSourceType } from 'stream-chat';\n\nimport { DefaultSearchResultItems } from './SearchResultItem';\nimport { SearchSourceResultListFooter as DefaultSearchSourceResultListFooter } from './SearchSourceResultListFooter';\nimport { useSearchSourceResultsContext } from '../SearchSourceResultsContext';\nimport { InfiniteScrollPaginator } from '../../../components/InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport { useComponentContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { SearchResultItemComponents } from './SearchResultItem';\n\nconst searchSourceStateSelector = (nextValue: SearchSourceState) => ({\n  items: nextValue.items,\n});\n\nexport type SearchSourceResultListProps = {\n  loadMoreDebounceMs?: number;\n  loadMoreThresholdPx?: number;\n  SearchResultItems?: SearchResultItemComponents;\n};\n\nexport const SearchSourceResultList = ({\n  loadMoreDebounceMs = 100,\n  loadMoreThresholdPx = 80,\n  SearchResultItems = DefaultSearchResultItems,\n}: SearchSourceResultListProps) => {\n  const { SearchSourceResultListFooter = DefaultSearchSourceResultListFooter } =\n    useComponentContext();\n\n  const { searchSource } = useSearchSourceResultsContext();\n  const { items } = useStateStore(searchSource.state, searchSourceStateSelector);\n\n  const SearchResultItem = SearchResultItems[\n    searchSource.type as SearchSourceType\n  ] as ComponentType<{ item: unknown }>;\n\n  if (!SearchResultItem) return null;\n\n  return (\n    <div\n      className='str-chat__search-source-result-list'\n      data-testid='search-source-result-list'\n    >\n      <InfiniteScrollPaginator\n        loadNextDebounceMs={loadMoreDebounceMs}\n        loadNextOnScrollToBottom={searchSource.search}\n        threshold={loadMoreThresholdPx}\n      >\n        {items?.map((item, i) => (\n          <SearchResultItem\n            item={item}\n            key={`source-search-result-${searchSource.type}-${i}`}\n          />\n        ))}\n        <SearchSourceResultListFooter />\n      </InfiniteScrollPaginator>\n    </div>\n  );\n};\n","import React from 'react';\nimport { useTranslationContext } from '../../../context';\n\nexport const SearchSourceResultsEmpty = () => {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__search-source-results-empty'>{t('No results found')}</div>\n  );\n};\n","export const SearchSourceResultsHeader = () => null;\n","import React from 'react';\nimport type { SearchSource, SearchSourceState } from 'stream-chat';\n\nimport { SearchSourceResultList as DefaultSearchSourceResultList } from './SearchSourceResultList';\nimport { SearchSourceResultsEmpty as DefaultSearchSourceResultsEmpty } from './SearchSourceResultsEmpty';\nimport { SearchSourceResultsHeader as DefaultSearchSourceResultsHeader } from './SearchSourceResultsHeader';\nimport { SearchSourceResultsContextProvider } from '../SearchSourceResultsContext';\nimport { useComponentContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst searchSourceStateSelector = (nextValue: SearchSourceState) => ({\n  isLoading: nextValue.isLoading,\n  items: nextValue.items,\n});\n\nexport type SearchSourceResultsProps = { searchSource: SearchSource };\n\nexport const SearchSourceResults = ({ searchSource }: SearchSourceResultsProps) => {\n  const {\n    SearchSourceResultList = DefaultSearchSourceResultList,\n    SearchSourceResultsEmpty = DefaultSearchSourceResultsEmpty,\n    SearchSourceResultsHeader = DefaultSearchSourceResultsHeader,\n  } = useComponentContext();\n  const { isLoading, items } = useStateStore(\n    searchSource.state,\n    searchSourceStateSelector,\n  );\n\n  if (!items && !isLoading) return null;\n\n  return (\n    <SearchSourceResultsContextProvider value={{ searchSource }}>\n      <div\n        className='str-chat__search-source-results'\n        data-testid='search-source-results'\n      >\n        <SearchSourceResultsHeader />\n        {items?.length || isLoading ? (\n          <SearchSourceResultList />\n        ) : (\n          <SearchSourceResultsEmpty />\n        )}\n      </div>\n    </SearchSourceResultsContextProvider>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useMemo } from 'react';\nimport type { SearchSource, SearchSourceState } from 'stream-chat';\n\nimport { useSearchContext } from '../SearchContext';\nimport { useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport { Button } from '../../../components';\n\nconst searchSourceStateSelector = (nextValue: SearchSourceState) => ({\n  isActive: nextValue.isActive,\n});\n\ntype SearchSourceFilterButtonProps = {\n  source: SearchSource;\n};\n\nconst SearchSourceFilterButton = ({ source }: SearchSourceFilterButtonProps) => {\n  const { t } = useTranslationContext();\n  const { searchController } = useSearchContext();\n  const { isActive } = useStateStore(source.state, searchSourceStateSelector);\n  const label = `search-results-header-filter-source-button-label--${source.type}`;\n\n  const knownLabels = useMemo<Record<string, string>>(\n    () => ({\n      'search-results-header-filter-source-button-label--channels': t(\n        'search-results-header-filter-source-button-label--channels',\n      ),\n      'search-results-header-filter-source-button-label--messages': t(\n        'search-results-header-filter-source-button-label--messages',\n      ),\n      'search-results-header-filter-source-button-label--users': t(\n        'search-results-header-filter-source-button-label--users',\n      ),\n    }),\n    [t],\n  );\n\n  const buttonContent = knownLabels[label] ?? t(label);\n  return (\n    <Button\n      appearance='outline'\n      aria-label={t('aria/Search results header filter button for: {{ source }}', {\n        source: buttonContent,\n      })}\n      aria-pressed={isActive}\n      className={clsx('str-chat__search-results-header__filter-source-button', {\n        'str-chat__search-results-header__filter-source-button--active': isActive,\n      })}\n      key={label}\n      onClick={() => {\n        if (source.isActive) {\n          searchController.deactivateSource(source.type);\n        } else {\n          searchController.activateSource(source.type);\n          if (searchController.searchQuery && !source.items?.length)\n            source.search(searchController.searchQuery);\n        }\n      }}\n      size='xs'\n      variant='secondary'\n    >\n      {buttonContent}\n    </Button>\n  );\n};\n\nexport const SearchResultsHeader = () => {\n  const { filterButtonsContainerRef, searchController } = useSearchContext();\n\n  // render nothing if there's only one source (can't change filters)\n  if (searchController.sources.length < 2) return null;\n\n  return (\n    <div className='str-chat__search-results-header' data-testid='search-results-header'>\n      <div\n        className='str-chat__search-results-header__filter-source-buttons'\n        data-testid='filter-source-buttons'\n        ref={filterButtonsContainerRef}\n      >\n        {searchController.sources.map((source) => (\n          <SearchSourceFilterButton key={source.type} source={source} />\n        ))}\n      </div>\n    </div>\n  );\n};\n","import React from 'react';\n\nimport { useTranslationContext } from '../../../context';\n\nimport type { SearchSource } from 'stream-chat';\n\nexport type SearchResultsPresearchProps = {\n  activeSources: SearchSource[];\n};\n\nexport const SearchResultsPresearch = () => {\n  const { t } = useTranslationContext();\n  return (\n    <div className='str-chat__search-results-presearch'>\n      {t('Start typing to search')}\n    </div>\n  );\n};\n","import React from 'react';\nimport type { SearchControllerState } from 'stream-chat';\n\nimport { SearchSourceResults as DefaultSourceSearchResults } from './SearchSourceResults';\nimport { SearchResultsHeader as DefaultSearchResultsHeader } from './SearchResultsHeader';\nimport { SearchResultsPresearch as DefaultSearchResultsPresearch } from './SearchResultsPresearch';\nimport { useSearchContext } from '../SearchContext';\nimport { useComponentContext, useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst searchControllerStateSelector = (nextValue: SearchControllerState) => ({\n  activeSources: nextValue.sources.filter((s) => s.isActive),\n  isActive: nextValue.isActive,\n  searchQuery: nextValue.searchQuery,\n});\n\nexport const SearchResults = () => {\n  const { t } = useTranslationContext('ResultsContainer');\n  const {\n    SearchResultsHeader = DefaultSearchResultsHeader,\n    SearchResultsPresearch = DefaultSearchResultsPresearch,\n    SearchSourceResults = DefaultSourceSearchResults,\n  } = useComponentContext();\n  const { searchController } = useSearchContext();\n  const { activeSources, isActive, searchQuery } = useStateStore(\n    searchController.state,\n    searchControllerStateSelector,\n  );\n\n  return !isActive ? null : (\n    <div aria-label={t('aria/Search results')} className='str-chat__search-results'>\n      <SearchResultsHeader />\n      {!searchQuery ? (\n        <SearchResultsPresearch activeSources={activeSources} />\n      ) : (\n        activeSources.map((source) => (\n          <SearchSourceResults key={source.type} searchSource={source} />\n        ))\n      )}\n    </div>\n  );\n};\n","import clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport type { SearchControllerState } from 'stream-chat';\n\nimport { SearchBar as DefaultSearchBar } from './SearchBar/SearchBar';\nimport { SearchResults as DefaultSearchResults } from './SearchResults/SearchResults';\nimport { SearchContextProvider } from './SearchContext';\nimport { useChatContext, useComponentContext } from '../../context';\nimport { useStateStore } from '../../store';\n\ntype SearchControllerStateSelectorReturnValue = {\n  isActive: boolean;\n};\n\nconst searchControllerStateSelector = (\n  nextValue: SearchControllerState,\n): SearchControllerStateSelectorReturnValue => ({ isActive: nextValue.isActive });\n\nexport type SearchProps = {\n  /** The type of channel to create on user result select, defaults to `messaging` */\n  directMessagingChannelType?: string;\n  /** Sets the input element into disabled state */\n  disabled?: boolean;\n  /** Clear the search state/results on every click outside the search input, defaults to `false` */\n  exitSearchOnInputBlur?: boolean;\n  /** Custom placeholder text to be displayed in the search input */\n  placeholder?: string;\n};\n\nexport const Search = ({\n  directMessagingChannelType = 'messaging',\n  disabled,\n  exitSearchOnInputBlur = false,\n  placeholder,\n}: SearchProps) => {\n  const { SearchBar = DefaultSearchBar, SearchResults = DefaultSearchResults } =\n    useComponentContext();\n  const containerRef = useRef<HTMLDivElement | null>(null);\n  const filterButtonsContainerRef = useRef<HTMLDivElement | null>(null);\n\n  const { searchController } = useChatContext();\n\n  const { isActive } = useStateStore<\n    SearchControllerState,\n    SearchControllerStateSelectorReturnValue\n  >(searchController.state, searchControllerStateSelector);\n\n  return (\n    <SearchContextProvider\n      value={{\n        containerRef,\n        directMessagingChannelType,\n        disabled,\n        exitSearchOnInputBlur,\n        filterButtonsContainerRef,\n        placeholder,\n        searchController,\n      }}\n    >\n      <div\n        className={clsx('str-chat__search', {\n          'str-chat__search--active': isActive,\n        })}\n        data-testid='search'\n        ref={containerRef}\n      >\n        <SearchBar />\n        <SearchResults />\n      </div>\n    </SearchContextProvider>\n  );\n};\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\nimport { LoadingIndicator } from '../Loading';\nimport { useTranslationContext } from '../../context';\nimport { Button } from '../Button';\n\nexport type LoadMoreButtonProps = {\n  /** onClick handler load more button. Pagination logic should be executed in this handler. */\n  onClick: React.MouseEventHandler<HTMLButtonElement>;\n  /** indicates whether a loading request is in progress */\n  isLoading?: boolean;\n};\n\nconst UnMemoizedLoadMoreButton = ({\n  children,\n  isLoading,\n  onClick,\n}: PropsWithChildren<LoadMoreButtonProps>) => {\n  const { t } = useTranslationContext('UnMemoizedLoadMoreButton');\n\n  const childrenOrDefaultString = children ?? t('Load more');\n\n  return (\n    <div className='str-chat__load-more-button'>\n      <Button\n        appearance='ghost'\n        aria-label={t('Load more')}\n        data-testid='load-more-button'\n        disabled={isLoading}\n        onClick={onClick}\n        size='sm'\n        variant='secondary'\n      >\n        {isLoading ? <LoadingIndicator /> : childrenOrDefaultString}\n      </Button>\n    </div>\n  );\n};\n\nexport const LoadMoreButton = React.memo(\n  UnMemoizedLoadMoreButton,\n) as typeof UnMemoizedLoadMoreButton;\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport type { LoadMoreButtonProps } from './LoadMoreButton';\nimport { LoadMoreButton as DefaultLoadMoreButton } from './LoadMoreButton';\nimport type { PaginatorProps } from '../../types/types';\n\nexport type LoadMorePaginatorProps = PaginatorProps & {\n  /** A UI button component that handles pagination logic */\n  LoadMoreButton?: React.ComponentType<LoadMoreButtonProps>;\n  /** indicates if the `LoadMoreButton` should be displayed at the top of the list of channels instead of the bottom of the list (the default) */\n  reverse?: boolean;\n};\n\nexport const UnMemoizedLoadMorePaginator = (\n  props: PropsWithChildren<LoadMorePaginatorProps>,\n) => {\n  const {\n    children,\n    hasNextPage,\n    isLoading,\n    LoadMoreButton = DefaultLoadMoreButton,\n    loadNextPage,\n    reverse,\n  } = props;\n\n  return (\n    <>\n      {!reverse && children}\n      {hasNextPage && <LoadMoreButton isLoading={isLoading} onClick={loadNextPage} />}\n      {reverse && children}\n    </>\n  );\n};\n\nexport const LoadMorePaginator = React.memo(\n  UnMemoizedLoadMorePaginator,\n) as typeof UnMemoizedLoadMorePaginator;\n","import React from 'react';\nimport {\n  useChatContext,\n  useComponentContext,\n  useTranslationContext,\n} from '../../context';\n\nexport const ChannelListHeader = () => {\n  const { t } = useTranslationContext();\n  const { channel } = useChatContext();\n  const { HeaderEndContent } = useComponentContext();\n  return (\n    <div className='str-chat__channel-list__header'>\n      <div className='str-chat__channel-list__header__title'>{t('Chats')}</div>\n      {channel && HeaderEndContent && <HeaderEndContent />}\n    </div>\n  );\n};\n","import type { ReactNode } from 'react';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport type {\n  Channel,\n  ChannelFilters,\n  ChannelOptions,\n  ChannelSort,\n  Event,\n  SearchControllerState,\n} from 'stream-chat';\n\nimport { useConnectionRecoveredListener } from './hooks/useConnectionRecoveredListener';\nimport type { CustomQueryChannelsFn } from './hooks/usePaginatedChannels';\nimport { usePaginatedChannels } from './hooks/usePaginatedChannels';\nimport {\n  useChannelListShape,\n  usePrepareShapeHandlers,\n} from './hooks/useChannelListShape';\nimport { useStateStore } from '../../store';\nimport { ChannelListUI as DefaultChannelListUI } from './ChannelListUI';\nimport { ChannelListItem } from '../ChannelListItem/ChannelListItem';\nimport { Search as DefaultSearch } from '../Search';\nimport type { EmptyStateIndicatorProps } from '../EmptyStateIndicator';\nimport { EmptyStateIndicator as DefaultEmptyStateIndicator } from '../EmptyStateIndicator';\nimport type { LoadMorePaginatorProps } from '../LoadMore/LoadMorePaginator';\nimport { LoadMorePaginator } from '../LoadMore/LoadMorePaginator';\nimport { NotificationList as DefaultNotificationList } from '../Notifications';\nimport type { ChatContextValue } from '../../context';\nimport {\n  ChannelListContextProvider,\n  DialogManagerProvider,\n  useChatContext,\n  useComponentContext,\n} from '../../context';\nimport { moveChannelUpwards } from './utils';\nimport type { TranslationContextValue } from '../../context/TranslationContext';\nimport type { PaginatorProps } from '../../types/types';\nimport { ChannelListHeader } from './ChannelListHeader';\nimport { useStableId } from '../UtilityComponents/useStableId';\n\nconst DEFAULT_FILTERS = {};\nconst DEFAULT_OPTIONS = {};\nconst DEFAULT_SORT = {};\n\nconst searchControllerStateSelector = (nextValue: SearchControllerState) => ({\n  searchIsActive: nextValue.isActive,\n});\n\nexport type ChannelListProps = {\n  /**\n   * When the client receives `message.new`, `notification.message_new`, and `notification.added_to_channel` events, we automatically\n   * push that channel to the top of the list. If the channel doesn't currently exist in the list, we grab the channel from\n   * `client.activeChannels` and push it to the top of the list. You can disable this behavior by setting this prop\n   * to false, which will prevent channels not in the list from incrementing the list. The default is true.\n   */\n  allowNewMessagesFromUnfilteredChannels?: boolean;\n  /** Optional function to filter channels prior to loading in the DOM. Do not use any complex or async logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */\n  channelRenderFilterFn?: (channels: Array<Channel>) => Array<Channel>;\n  // FIXME: how is this even legal (WHY IS IT STRING?!)\n  /** Set a channel (with this ID) to active and manually move it to the top of the list */\n  customActiveChannel?: string;\n  /** Custom function that handles the channel pagination. Has to build query filters, sort and options and query and append channels to the current channels state and update the hasNext pagination flag after each query. */\n  customQueryChannels?: CustomQueryChannelsFn;\n  /** Custom UI component for rendering an empty list, defaults to and accepts same props as: [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx) */\n  EmptyStateIndicator?: React.ComponentType<EmptyStateIndicatorProps>;\n  /** An object containing channel query filters */\n  filters?: ChannelFilters;\n  /** Custom function that generates the message preview in ChannelPreview component */\n  getLatestMessagePreview?: (\n    channel: Channel,\n    t: TranslationContextValue['t'],\n    userLanguage: TranslationContextValue['userLanguage'],\n    isMessageAIGenerated?: ChatContextValue['isMessageAIGenerated'],\n  ) => ReactNode;\n  /** When true, channels won't dynamically sort by most recent message */\n  lockChannelOrder?: boolean;\n  /** Function to override the default behavior when a user is added to a channel, corresponds to [notification.added\\_to\\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onAddedToChannel?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a channel is deleted, corresponds to [channel.deleted](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onChannelDeleted?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a channel is hidden, corresponds to [channel.hidden](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onChannelHidden?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a channel is truncated, corresponds to [channel.truncated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onChannelTruncated?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a channel is updated, corresponds to [channel.updated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onChannelUpdated?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default channel visible behavior, corresponds to [channel.visible](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onChannelVisible?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a message is received on a channel not being watched, corresponds to [notification.message\\_new](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onMessageNew?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a message is received on a channel being watched, handles [message.new](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onMessageNewHandler?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** Function to override the default behavior when a user gets removed from a channel, corresponds to [notification.removed\\_from\\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */\n  onRemovedFromChannel?: (\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n    event: Event,\n  ) => void;\n  /** An object containing channel query options */\n  options?: ChannelOptions;\n  /** Custom UI component to handle channel pagination logic, defaults to and accepts same props as: [LoadMorePaginator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/LoadMore/LoadMorePaginator.tsx) */\n  Paginator?: React.ComponentType<PaginatorProps | LoadMorePaginatorProps>;\n  /**\n   * Custom interval during which the recovery channel list queries will be prevented.\n   * This is to avoid firing unnecessary queries during internet connection fluctuation.\n   * Recovery channel query is triggered upon `connection.recovered` and leads to complete channel list reload with pagination offset 0.\n   * The minimum throttle interval is 2000ms. The default throttle interval is 5000ms.\n   */\n  recoveryThrottleIntervalMs?: number;\n  /** Function to override the default behavior when rendering channels, so this function is called instead of rendering the Preview directly */\n  renderChannels?: (\n    channels: Channel[],\n    channelPreview: (item: Channel) => React.ReactNode,\n  ) => React.ReactNode;\n  /** If true, sends the list's currently loaded channels to the `List` component as the `loadedChannels` prop */\n  sendChannelsToList?: boolean;\n  /** Last channel will be set as active channel if true, defaults to true */\n  setActiveChannelOnMount?: boolean;\n  /** Whether or not to load the list with a search component, defaults to false */\n  showChannelSearch?: boolean;\n  /** An object containing channel query sort parameters */\n  sort?: ChannelSort;\n  /** An object containing query parameters for fetching channel watchers */\n  watchers?: { limit?: number; offset?: number };\n};\n\nconst UnMemoizedChannelList = (props: ChannelListProps) => {\n  const {\n    allowNewMessagesFromUnfilteredChannels = true,\n    channelRenderFilterFn,\n    customActiveChannel,\n    customQueryChannels,\n    EmptyStateIndicator = DefaultEmptyStateIndicator,\n    filters = {},\n    getLatestMessagePreview,\n    lockChannelOrder = false,\n    onAddedToChannel,\n    onChannelDeleted,\n    onChannelHidden,\n    onChannelTruncated,\n    onChannelUpdated,\n    onChannelVisible,\n    onMessageNew,\n    onMessageNewHandler,\n    onRemovedFromChannel,\n    options,\n    Paginator = LoadMorePaginator,\n    recoveryThrottleIntervalMs,\n    renderChannels,\n    sendChannelsToList = false,\n    setActiveChannelOnMount = true,\n    showChannelSearch = false,\n    sort = DEFAULT_SORT,\n    watchers = {},\n  } = props;\n\n  const stableId = useStableId();\n\n  const {\n    channel,\n    channelsQueryState,\n    client,\n    customClasses,\n    searchController,\n    setActiveChannel,\n    theme,\n    useImageFlagEmojisOnWindows,\n  } = useChatContext('ChannelList');\n  const {\n    ChannelListUI = DefaultChannelListUI,\n    NotificationList = DefaultNotificationList,\n    Search = DefaultSearch,\n  } = useComponentContext();\n\n  const channelListRef = useRef<HTMLDivElement | null>(null);\n  const [channelUpdateCount, setChannelUpdateCount] = useState(0);\n\n  // Indicator relevant when Search component that relies on SearchController is used\n  const { searchIsActive } = useStateStore(\n    searchController.state,\n    searchControllerStateSelector,\n  );\n  /**\n   * Set a channel with id {customActiveChannel} as active and move it to the top of the list.\n   * If customActiveChannel prop is absent, then set the first channel in list as active channel.\n   */\n  const activeChannelHandler = async (\n    channels: Array<Channel>,\n    setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>,\n  ) => {\n    if (!channels.length) {\n      return;\n    }\n\n    if (customActiveChannel) {\n      // FIXME: this is wrong...\n      let customActiveChannelObject = channels.find(\n        (chan) => chan.id === customActiveChannel,\n      );\n\n      if (!customActiveChannelObject) {\n        [customActiveChannelObject] = await client.queryChannels({\n          id: customActiveChannel,\n        });\n      }\n\n      if (customActiveChannelObject) {\n        setActiveChannel(customActiveChannelObject, watchers);\n\n        const newChannels = moveChannelUpwards({\n          channels,\n          channelToMove: customActiveChannelObject,\n          sort,\n        });\n\n        setChannels(newChannels);\n        return;\n      }\n    }\n\n    if (setActiveChannelOnMount) {\n      setActiveChannel(channels[0], watchers);\n    }\n  };\n\n  /**\n   * For some events, inner properties on the channel will update but the shallow comparison will not\n   * force a re-render. Incrementing this dummy variable ensures the channel previews update.\n   */\n  const forceUpdate = useCallback(() => setChannelUpdateCount((count) => count + 1), []);\n\n  const { channels, hasNextPage, loadNextPage, setChannels } = usePaginatedChannels(\n    client,\n    filters || DEFAULT_FILTERS,\n    sort || DEFAULT_SORT,\n    options || DEFAULT_OPTIONS,\n    activeChannelHandler,\n    recoveryThrottleIntervalMs,\n    customQueryChannels,\n  );\n\n  const loadedChannels = channelRenderFilterFn\n    ? channelRenderFilterFn(channels)\n    : channels;\n\n  const { customHandler, defaultHandler } = usePrepareShapeHandlers({\n    allowNewMessagesFromUnfilteredChannels,\n    filters,\n    lockChannelOrder,\n    onAddedToChannel,\n    onChannelDeleted,\n    onChannelHidden,\n    onChannelTruncated,\n    onChannelUpdated,\n    onChannelVisible,\n    onMessageNew,\n    onMessageNewHandler,\n    onRemovedFromChannel,\n    setChannels,\n    sort,\n    // TODO: implement\n    // customHandleChannelListShape\n  });\n\n  useChannelListShape(customHandler ?? defaultHandler);\n\n  // TODO: maybe move this too\n  useConnectionRecoveredListener(forceUpdate);\n\n  useEffect(() => {\n    const handleEvent = (event: Event) => {\n      if (event.cid === channel?.cid) {\n        setActiveChannel();\n      }\n    };\n\n    client.on('channel.deleted', handleEvent);\n    client.on('channel.hidden', handleEvent);\n\n    return () => {\n      client.off('channel.deleted', handleEvent);\n      client.off('channel.hidden', handleEvent);\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [channel?.cid]);\n\n  const renderChannel = (item: Channel) => {\n    const previewProps = {\n      activeChannel: channel,\n      channel: item,\n      // forces the update of preview component on channel update\n      channelUpdateCount,\n      getLatestMessagePreview,\n      setActiveChannel,\n      watchers,\n    };\n\n    return <ChannelListItem key={item.cid} {...previewProps} />;\n  };\n\n  const baseClass = 'str-chat__channel-list';\n  const className = clsx(\n    customClasses?.chat ?? 'str-chat',\n    theme,\n    customClasses?.channelList ?? `${baseClass}`,\n    {\n      'str-chat--windows-flags':\n        useImageFlagEmojisOnWindows && navigator.userAgent.match(/Win/),\n    },\n  );\n\n  const showChannelList = !searchIsActive;\n  return (\n    <ChannelListContextProvider\n      value={{ channels, hasNextPage, loadNextPage, setChannels }}\n    >\n      <div className={className} ref={channelListRef}>\n        <DialogManagerProvider id={`channel-list-dialog-manager-${stableId}`}>\n          <ChannelListHeader />\n          {showChannelSearch && <Search />}\n          {showChannelList && (\n            <ChannelListUI\n              error={channelsQueryState.error}\n              loadedChannels={sendChannelsToList ? loadedChannels : undefined}\n              loading={\n                !!channelsQueryState.queryInProgress &&\n                ['reload', 'uninitialized'].includes(channelsQueryState.queryInProgress)\n              }\n              setChannels={setChannels}\n            >\n              {!loadedChannels?.length ? (\n                <EmptyStateIndicator listType='channel' />\n              ) : (\n                <Paginator\n                  hasNextPage={hasNextPage}\n                  isLoading={channelsQueryState.queryInProgress === 'load-more'}\n                  loadNextPage={loadNextPage}\n                >\n                  {renderChannels\n                    ? renderChannels(loadedChannels, renderChannel)\n                    : loadedChannels.map((channel) => renderChannel(channel))}\n                </Paginator>\n              )}\n            </ChannelListUI>\n          )}\n          <NotificationList panel='channel-list' />\n        </DialogManagerProvider>\n      </div>\n    </ChannelListContextProvider>\n  );\n};\n\n/**\n * Renders a preview list of Channels, allowing you to select the Channel you want to open\n */\nexport const ChannelList = React.memo(\n  UnMemoizedChannelList,\n) as typeof UnMemoizedChannelList;\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 type { Channel, ChannelMemberResponse, EventTypes } from 'stream-chat';\nimport { useSelectedChannelState } from './useSelectedChannelState';\n\nconst selector = (c: Channel) => c.state.members;\nconst keys: EventTypes[] = [\n  'member.updated',\n  'member.added',\n  'member.removed',\n  'user.banned',\n  'user.unbanned',\n  'user.deleted',\n  'user.presence.changed',\n];\n\nexport function useChannelMembersState(\n  channel: Channel,\n): Record<string, ChannelMemberResponse>;\nexport function useChannelMembersState(\n  channel?: Channel | undefined,\n): Record<string, ChannelMemberResponse> | undefined;\nexport function useChannelMembersState(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 {\n  type ComponentPropsWithoutRef,\n  type ComponentPropsWithRef,\n  forwardRef,\n  useMemo,\n  useState,\n} from 'react';\n\nimport { useChatContext, useTranslationContext } from '../../context';\nimport { useChannelMembershipState, useChannelMembersState } from '../ChannelList';\nimport { useChannelListItemContext } from './ChannelListItem';\nimport { Button } from '../Button';\nimport {\n  IconArchive,\n  IconLeave,\n  IconMore,\n  IconMute,\n  IconNoSign,\n  IconPin,\n} from '../Icons';\nimport { useIsChannelMuted } from './hooks/useIsChannelMuted';\nimport { ContextMenuButton, useDialogIsOpen, useDialogOnNearestManager } from '../Dialog';\nimport { useNotificationApi } from '../Notifications';\nimport { ChannelListItemActionButtons } from './ChannelListItemActionButtons';\n\nconst useMuteActionButtonBehavior = () => {\n  const { addNotification } = useNotificationApi();\n  const { channel } = useChannelListItemContext();\n  const { t } = useTranslationContext();\n  const { muted: isMuted } = useIsChannelMuted(channel);\n  const [inProgress, setInProgress] = useState(false);\n\n  return {\n    'aria-pressed': isMuted,\n    disabled: inProgress,\n    onClick: async (e: React.MouseEvent<HTMLButtonElement>) => {\n      e.stopPropagation();\n      try {\n        setInProgress(true);\n        if (isMuted) {\n          await channel.unmute();\n          addNotification({\n            context: {\n              channel,\n            },\n            emitter: ChannelListItemActionButtons.name,\n            message: t('Channel unmuted'),\n            severity: 'success',\n            type: 'api:channel:unmute:success',\n          });\n        } else {\n          await channel.mute();\n          addNotification({\n            context: {\n              channel,\n            },\n            emitter: ChannelListItemActionButtons.name,\n            message: t('Channel muted'),\n            severity: 'success',\n            type: 'api:channel:mute:success',\n          });\n        }\n      } catch (error) {\n        addNotification({\n          context: {\n            channel,\n          },\n          emitter: ChannelListItemActionButtons.name,\n          error: error instanceof Error ? error : new Error('An unknown error occurred'),\n          message: t('Failed to update channel mute status'),\n          severity: 'error',\n          type: 'api:channel:mute:failed',\n        });\n      } finally {\n        setInProgress(false);\n      }\n    },\n    title: isMuted ? t('Unmute') : t('Mute'),\n  } satisfies ComponentPropsWithoutRef<'button'>;\n};\n\nconst useArchiveActionButtonBehavior = () => {\n  const { channel } = useChannelListItemContext();\n  const { addNotification } = useNotificationApi();\n  const membership = useChannelMembershipState(channel);\n  const { t } = useTranslationContext();\n  const [inProgress, setInProgress] = useState(false);\n\n  return {\n    'aria-pressed': typeof membership.archived_at === 'string',\n    disabled: inProgress,\n    onClick: async (e: React.MouseEvent<HTMLButtonElement>) => {\n      e.stopPropagation();\n      try {\n        setInProgress(true);\n        if (membership.archived_at) {\n          await channel.unarchive();\n          addNotification({\n            context: {\n              channel,\n            },\n            emitter: ChannelListItemActionButtons.name,\n            message: t('Channel unarchived'),\n            severity: 'success',\n            type: 'api:channel:unarchive:success',\n          });\n        } else {\n          await channel.archive();\n          addNotification({\n            context: {\n              channel,\n            },\n            emitter: ChannelListItemActionButtons.name,\n            message: t('Channel archived'),\n            severity: 'success',\n            type: 'api:channel:archive:success',\n          });\n        }\n      } catch (error) {\n        addNotification({\n          context: {\n            channel,\n          },\n          emitter: ChannelListItemActionButtons.name,\n          error: error instanceof Error ? error : new Error('An unknown error occurred'),\n          message: t('Failed to update channel archive status'),\n          severity: 'error',\n          type: 'api:channel:archive:failed',\n        });\n      } finally {\n        setInProgress(false);\n      }\n    },\n    title: membership.archived_at ? t('Unarchive') : t('Archive'),\n  } satisfies ComponentPropsWithoutRef<'button'>;\n};\n\ntype ChannelActionItem =\n  | (({ placement: 'quick' } | { placement: 'dropdown' }) & {\n      type: string;\n      Component: React.ComponentType;\n    })\n  | {\n      placement: 'quick-dropdown-toggle';\n      Component: React.ComponentType<ComponentPropsWithRef<'button'>>;\n    };\n\nconst defaultComponents = {\n  dropdown: {\n    Archive() {\n      const behaviorProps = useArchiveActionButtonBehavior();\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-archive'\n          Icon={IconArchive}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Ban() {\n      const { client } = useChatContext();\n      const { addNotification } = useNotificationApi();\n      const { t } = useTranslationContext();\n      const { channel } = useChannelListItemContext();\n      const [inProgress, setInProgress] = useState(false);\n      const members = useChannelMembersState(channel);\n      const isUserBanned = Object.values(members || {}).some(\n        (member) => member.user?.id !== client.userID && member.banned,\n      );\n\n      const title = isUserBanned ? t('Unblock User') : t('Block User');\n\n      return (\n        <ContextMenuButton\n          aria-label={title}\n          data-testid='dropdown-action-ban'\n          disabled={inProgress}\n          Icon={IconNoSign}\n          onClick={async () => {\n            try {\n              setInProgress(true);\n              const otherUserId = Object.keys(channel.state.members).find(\n                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n                (userId) => userId !== client.userID!,\n              );\n\n              if (!otherUserId) return;\n\n              if (isUserBanned) {\n                await channel.unbanUser(otherUserId);\n                addNotification({\n                  context: {\n                    channel,\n                  },\n                  emitter: ChannelListItemActionButtons.name,\n                  message: t('User unblocked'),\n                  severity: 'success',\n                  type: 'api:user:unban:success',\n                });\n              } else {\n                await channel.banUser(otherUserId, {});\n                addNotification({\n                  context: {\n                    channel,\n                  },\n                  emitter: ChannelListItemActionButtons.name,\n                  message: t('User blocked'),\n                  severity: 'success',\n                  type: 'api:user:ban:success',\n                });\n              }\n            } catch (error) {\n              addNotification({\n                context: {\n                  channel,\n                },\n                emitter: ChannelListItemActionButtons.name,\n                error:\n                  error instanceof Error ? error : new Error('An unknown error occurred'),\n                message: t('Failed to block user'),\n                severity: 'error',\n                type: 'api:user:ban:failed',\n              });\n            } finally {\n              setInProgress(false);\n            }\n          }}\n        >\n          {title}\n        </ContextMenuButton>\n      );\n    },\n    Leave() {\n      const { t } = useTranslationContext();\n      const { channel } = useChannelListItemContext();\n      const { client } = useChatContext();\n      const { addNotification } = useNotificationApi();\n      const [inProgress, setInProgress] = useState(false);\n\n      const title = t('Leave Channel');\n\n      return (\n        <ContextMenuButton\n          aria-label={title}\n          data-testid='dropdown-action-leave'\n          disabled={inProgress}\n          Icon={IconLeave}\n          onClick={async (e) => {\n            e.stopPropagation();\n            try {\n              setInProgress(true);\n              // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n              await channel.removeMembers([client.userID!]);\n              addNotification({\n                context: {\n                  channel,\n                },\n                emitter: ChannelListItemActionButtons.name,\n                message: t('Left channel'),\n                severity: 'success',\n                type: 'api:channel:leave:success',\n              });\n            } catch (error) {\n              addNotification({\n                context: {\n                  channel,\n                },\n                emitter: ChannelListItemActionButtons.name,\n                error:\n                  error instanceof Error ? error : new Error('An unknown error occurred'),\n                message: t('Failed to leave channel'),\n                severity: 'error',\n                type: 'api:channel:leave:failed',\n              });\n            } finally {\n              setInProgress(false);\n            }\n          }}\n          title={title}\n          variant='destructive'\n        >\n          {title}\n        </ContextMenuButton>\n      );\n    },\n    Mute() {\n      const behaviorProps = useMuteActionButtonBehavior();\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-mute'\n          Icon={IconMute}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Pin() {\n      const { t } = useTranslationContext();\n      const { addNotification } = useNotificationApi();\n      const { channel } = useChannelListItemContext();\n      const membership = useChannelMembershipState(channel);\n      const dialogId = ChannelListItemActionButtons.getDialogId(\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        { channelId: channel.id! },\n      );\n      const { dialog } = useDialogOnNearestManager({ id: dialogId });\n      const [inProgress, setInProgress] = useState(false);\n\n      const title = membership.pinned_at ? t('Unpin') : t('Pin');\n\n      return (\n        <ContextMenuButton\n          aria-label={title}\n          data-testid='dropdown-action-pin'\n          disabled={inProgress}\n          Icon={IconPin}\n          onClick={async (e) => {\n            e.stopPropagation();\n            let error: Error | null = null;\n            try {\n              setInProgress(true);\n              if (membership.pinned_at) {\n                await channel.unpin();\n                addNotification({\n                  context: {\n                    channel,\n                  },\n                  emitter: ChannelListItemActionButtons.name,\n                  message: t('Channel unpinned'),\n                  severity: 'success',\n                  type: 'api:channel:unpin:success',\n                });\n              } else {\n                await channel.pin();\n                addNotification({\n                  context: {\n                    channel,\n                  },\n                  emitter: ChannelListItemActionButtons.name,\n                  message: t('Channel pinned'),\n                  severity: 'success',\n                  type: 'api:channel:pin:success',\n                });\n              }\n            } catch (e) {\n              error = e instanceof Error ? e : new Error('An unknown error occurred');\n              addNotification({\n                context: {\n                  channel,\n                },\n                emitter: ChannelListItemActionButtons.name,\n                error,\n                message: t('Failed to update channel pinned status'),\n                severity: 'error',\n                type: 'api:channel:pin:failed',\n              });\n            } finally {\n              if (!error) dialog?.close();\n              setInProgress(false);\n            }\n          }}\n          title={title}\n        >\n          {title}\n        </ContextMenuButton>\n      );\n    },\n  },\n  quick: {\n    Archive() {\n      const behaviorProps = useArchiveActionButtonBehavior();\n\n      return (\n        <Button\n          appearance='ghost'\n          aria-label={behaviorProps.title}\n          circular\n          data-testid='quick-action-archive'\n          size='sm'\n          variant='secondary'\n          {...behaviorProps}\n        >\n          <IconArchive />\n        </Button>\n      );\n    },\n    Mute() {\n      const behaviorProps = useMuteActionButtonBehavior();\n\n      return (\n        <Button\n          appearance='ghost'\n          aria-label={behaviorProps.title}\n          circular\n          data-testid='quick-action-mute'\n          size='sm'\n          variant='secondary'\n          {...behaviorProps}\n        >\n          <IconMute />\n        </Button>\n      );\n    },\n  },\n  QuickDropdownToggle: forwardRef<HTMLButtonElement>((_, ref) => {\n    const { channel } = useChannelListItemContext();\n    const { t } = useTranslationContext();\n\n    const dialogId = ChannelListItemActionButtons.getDialogId({\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      channelId: channel.id!,\n    });\n    const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n    const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n    return (\n      <Button\n        appearance='ghost'\n        aria-expanded={dialogIsOpen}\n        aria-label={t('aria/Open Channel Actions Menu')}\n        aria-pressed={dialogIsOpen}\n        circular\n        data-testid='channel-list-item-dropdown-toggle'\n        onClick={(e) => {\n          e.stopPropagation();\n\n          dialog.toggle();\n        }}\n        ref={ref}\n        size='sm'\n        variant='secondary'\n      >\n        <IconMore />\n      </Button>\n    );\n  }),\n};\n\ndefaultComponents.QuickDropdownToggle.displayName = 'QuickDropdownToggle';\n\nexport const defaultChannelActionSet: ChannelActionItem[] = [\n  {\n    Component: defaultComponents.QuickDropdownToggle,\n    placement: 'quick-dropdown-toggle',\n  },\n  {\n    Component: defaultComponents.quick.Mute,\n    placement: 'quick',\n    type: 'mute',\n  },\n  {\n    Component: defaultComponents.dropdown.Archive,\n    placement: 'dropdown',\n    type: 'archive',\n  },\n  {\n    Component: defaultComponents.dropdown.Ban,\n    placement: 'dropdown',\n    type: 'ban',\n  },\n  {\n    Component: defaultComponents.dropdown.Pin,\n    placement: 'dropdown',\n    type: 'pin',\n  },\n  {\n    Component: defaultComponents.dropdown.Leave,\n    placement: 'dropdown',\n    type: 'leave',\n  },\n];\n\nexport const useBaseChannelActionSetFilter = (channelActionSet: ChannelActionItem[]) => {\n  const { channel } = useChannelListItemContext();\n  const membership = useChannelMembershipState(channel);\n  const memberCount = channel.data?.member_count ?? 0;\n  const connectedUserIsMember = typeof membership.user !== 'undefined';\n  const isDirectMessageChannel = connectedUserIsMember && memberCount === 2;\n\n  const ownCapabilities = channel.data?.own_capabilities;\n\n  return useMemo(() => {\n    const filtered = channelActionSet.filter((action) => {\n      if (action.placement === 'quick-dropdown-toggle') return true;\n\n      switch (action.type) {\n        case 'archive':\n          return connectedUserIsMember;\n        case 'mute':\n          return ownCapabilities?.includes('mute-channel');\n        case 'ban':\n          return (\n            isDirectMessageChannel && ownCapabilities?.includes('ban-channel-members')\n          );\n        case 'leave':\n          return ownCapabilities?.includes('leave-channel');\n        case 'pin':\n          return connectedUserIsMember;\n        default:\n          return true;\n      }\n    });\n\n    return filtered;\n  }, [channelActionSet, connectedUserIsMember, ownCapabilities, isDirectMessageChannel]);\n};\n","import React, { type ComponentProps, type ComponentType, type ReactNode } from 'react';\n\nimport clsx from 'clsx';\nimport { ContextMenu, useDialogIsOpen, useDialogOnNearestManager } from '../Dialog';\nimport { useComponentContext, useTranslationContext } from '../../context';\nimport {\n  defaultChannelActionSet,\n  useBaseChannelActionSetFilter,\n} from './ChannelListItemActionButtons.defaults';\nimport { useSplitActionSet } from '../Chat/hooks/useSplitActionSet';\nimport { useChannelListItemContext } from './ChannelListItem';\n\nexport type ChannelListItemActionButtonsProps = ComponentProps<ComponentType>; // hack to allow empty props\n\ninterface ChannelListItemActionButtonsInterface {\n  (props: ChannelListItemActionButtonsProps): ReactNode;\n  getDialogId: (_: { channelId: string }) => string;\n  displayName: string;\n}\n\nexport const ChannelListItemActionButtons: ChannelListItemActionButtonsInterface = () => {\n  const { ContextMenu: ContextMenuComponent = ContextMenu } = useComponentContext();\n  const { t } = useTranslationContext();\n  const { channel } = useChannelListItemContext();\n  const [referenceElement, setReferenceElement] =\n    React.useState<HTMLButtonElement | null>(null);\n  const [isRestoringFocus, setIsRestoringFocus] = React.useState(false);\n  const dialogId = ChannelListItemActionButtons.getDialogId({\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    channelId: channel.id!,\n  });\n  const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n  const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n  const closeContextMenu = React.useCallback(() => {\n    setIsRestoringFocus(true);\n    dialog?.close();\n\n    requestAnimationFrame(() => {\n      if (!referenceElement?.isConnected) {\n        setIsRestoringFocus(false);\n        return;\n      }\n\n      referenceElement.focus();\n\n      requestAnimationFrame(() => {\n        if (document.activeElement !== referenceElement) {\n          setIsRestoringFocus(false);\n        }\n      });\n    });\n  }, [dialog, referenceElement]);\n\n  const filteredActionSet = useBaseChannelActionSetFilter(defaultChannelActionSet);\n  const { dropdownActionSet, quickActionSet, quickDropdownToggleAction } =\n    useSplitActionSet(filteredActionSet);\n\n  if (quickActionSet.length + dropdownActionSet.length === 0) {\n    // no buttons to render, omit rendering wrapper\n    return null;\n  }\n\n  return (\n    <div\n      className={clsx('str-chat__channel-list-item__action-buttons', {\n        'str-chat__channel-list-item__action-buttons--active':\n          dialogIsOpen || isRestoringFocus,\n      })}\n      data-testid='channel-list-item-action-buttons'\n      onFocusCapture={() => {\n        setIsRestoringFocus(false);\n      }}\n    >\n      {quickDropdownToggleAction && dropdownActionSet.length > 0 && (\n        <quickDropdownToggleAction.Component ref={setReferenceElement} />\n      )}\n      {quickActionSet.map(({ Component, type }) => (\n        <Component key={type} />\n      ))}\n      <ContextMenuComponent\n        aria-label={t('aria/Channel Actions')}\n        className='str-chat__channel-list-item__action-buttons-context-menu'\n        data-testid='channel-list-item-context-menu'\n        dialogManagerId={dialogManager?.id}\n        id={dialog.id}\n        onClose={closeContextMenu}\n        placement='bottom-start'\n        referenceElement={referenceElement}\n        tabIndex={-1}\n        trapFocus\n      >\n        {dropdownActionSet.map(({ Component, type }) => (\n          <Component key={type} />\n        ))}\n      </ContextMenuComponent>\n    </div>\n  );\n};\n\nChannelListItemActionButtons.getDialogId = ({ channelId }) =>\n  `channel-action-buttons-${channelId}`;\n\nChannelListItemActionButtons.displayName = 'ChannelListItemActionButtons';\n","import React, { useMemo } from 'react';\nimport type { LocalMessage } from 'stream-chat';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { getDateString, isDate } from '../../i18n/utils';\n\nexport type ChannelListItemTimestampProps = {\n  /** The last message in the channel, used to extract the timestamp */\n  lastMessage?: LocalMessage;\n};\n\nexport function ChannelListItemTimestamp({ lastMessage }: ChannelListItemTimestampProps) {\n  const { t, tDateTimeParser } = useTranslationContext('ChannelListItemTimestamp');\n\n  const timestamp = lastMessage?.created_at;\n  const normalizedTimestamp =\n    timestamp && isDate(timestamp) ? timestamp.toISOString() : undefined;\n\n  const when = useMemo(\n    () =>\n      getDateString({\n        messageCreatedAt: normalizedTimestamp,\n        t,\n        tDateTimeParser,\n        timestampTranslationKey: 'timestamp/ChannelPreviewTimestamp',\n      }),\n    [normalizedTimestamp, t, tDateTimeParser],\n  );\n\n  if (!when) return null;\n\n  return (\n    <time\n      className='str-chat__channel-list-item-timestamp'\n      dateTime={normalizedTimestamp}\n    >\n      {when}\n    </time>\n  );\n}\n","import { useMemo } from 'react';\nimport type { Attachment, LocalMessage } from 'stream-chat';\nimport {\n  isAudioAttachment,\n  isFileAttachment,\n  isImageAttachment,\n  isScrapedContent,\n  isVideoAttachment,\n  isVoiceRecordingAttachment,\n} from 'stream-chat';\n\nimport {\n  getTranslatedMessageText,\n  type TranslationContextValue,\n  useChatContext,\n  useTranslationContext,\n} from '../../../context';\nimport { isMessageDeleted } from '../../Message/utils';\n\nimport type { MessageDeliveryStatus } from '../../ChannelListItem';\n\nexport type ChannelPreviewMessageType =\n  | 'text'\n  | 'deleted'\n  | 'error'\n  | 'empty'\n  | 'image'\n  | 'giphy'\n  | 'video'\n  | 'voice'\n  | 'file'\n  | 'unsupported'\n  | 'link'\n  | 'location'\n  | 'poll';\n\nconst SUPPORTED_VIDEO_FORMATS: string[] = [\n  'video/mp4',\n  'video/ogg',\n  'video/webm',\n  'video/quicktime',\n];\n\n/**\n * Delivery status of the last own message.\n * Determines which delivery status icon to render in the preview.\n *\n * - `sending` — Clock icon\n * - `sent` — Single checkmark icon\n * - `delivered` — Double checkmark icon\n * - `read` — Double checkmark icon (with distinct color)\n */\nexport type ChannelPreviewDeliveryStatus = 'sending' | 'sent' | 'delivered' | 'read';\n\nexport type LatestMessagePreviewData = {\n  /**\n   * The type of content being previewed.\n   * Use this to render the appropriate content-type icon.\n   */\n  type: ChannelPreviewMessageType;\n  /**\n   * The preview text to display.\n   */\n  text: string;\n  /**\n   * Delivery status of own message.\n   * Only present for own messages that are not in error state.\n   * Use this to render the delivery status icon (clock, checkmark, double checkmark).\n   */\n  deliveryStatus?: ChannelPreviewDeliveryStatus;\n  /**\n   * Sender name prefix.\n   * - `\"You\"` (translated) for own messages\n   * - Sender's display name for incoming messages in group channels (>2 members)\n   * - `undefined` for incoming messages in direct conversations\n   */\n  senderName?: string;\n};\n\nfunction getAttachmentContentType(attachment: Attachment): ChannelPreviewMessageType {\n  if (!attachment) return 'text';\n\n  if (attachment.type === 'giphy') return 'giphy';\n  if (isScrapedContent(attachment)) return 'link';\n  if (isImageAttachment(attachment)) return 'image';\n  if (isVideoAttachment(attachment, SUPPORTED_VIDEO_FORMATS)) return 'video';\n  if (isVoiceRecordingAttachment(attachment)) return 'voice';\n  if (\n    isAudioAttachment(attachment) ||\n    isFileAttachment(attachment, SUPPORTED_VIDEO_FORMATS)\n  ) {\n    return 'file';\n  }\n\n  return 'unsupported';\n}\n\nfunction getAttachmentFallbackText(\n  type: ChannelPreviewMessageType,\n  count: number,\n  t: TranslationContextValue['t'],\n): string {\n  switch (type) {\n    case 'image':\n      return t('imageCount', { count });\n    case 'video':\n      return t('videoCount', { count });\n    case 'voice':\n      return t('voiceMessageCount', { count });\n    case 'link':\n      return t('linkCount', { count });\n    case 'file':\n      return t('fileCount', { count });\n    case 'unsupported':\n      return t('Unsupported attachment');\n    default:\n      return t('fileCount', { count });\n  }\n}\n\nexport type UseLatestMessagePreviewParams = {\n  /** The channel to generate preview for */\n  participantCount?: number;\n  /** The latest message in the channel */\n  latestMessage?: LocalMessage;\n  /**\n   * Delivery status from the `useMessageDeliveryStatus` hook.\n   * When provided, used to determine the delivery status icon.\n   * When omitted, delivery status icons are not shown.\n   */\n  messageDeliveryStatus?: MessageDeliveryStatus;\n};\n\nexport const useLatestMessagePreview = ({\n  latestMessage,\n  messageDeliveryStatus,\n  participantCount,\n}: UseLatestMessagePreviewParams): LatestMessagePreviewData => {\n  const { client } = useChatContext('useLatestMessagePreview');\n  const { t, userLanguage } = useTranslationContext('useLatestMessagePreview');\n\n  return useMemo(() => {\n    if (!latestMessage) {\n      return { text: t('Nothing yet...'), type: 'empty' as const };\n    }\n\n    if (latestMessage.status === 'failed' || latestMessage.type === 'error') {\n      return { text: t('Message failed to send'), type: 'error' as const };\n    }\n\n    const isOwnMessage = latestMessage.user?.id === client.user?.id;\n\n    let deliveryStatus: ChannelPreviewDeliveryStatus | undefined;\n    if (isOwnMessage) {\n      deliveryStatus = messageDeliveryStatus ?? (latestMessage.status as 'sending');\n    }\n\n    let senderName: string | undefined;\n    if (isOwnMessage) {\n      senderName = t('You');\n    } else if (!isOwnMessage && participantCount !== undefined && participantCount > 2) {\n      senderName = latestMessage.user?.name || latestMessage.user?.id;\n    }\n\n    if (isMessageDeleted(latestMessage)) {\n      return {\n        deliveryStatus,\n        senderName,\n        text: t('Message deleted'),\n        type: 'deleted' as const,\n      };\n    }\n\n    if (latestMessage.poll) {\n      return {\n        deliveryStatus,\n        senderName,\n        text: t('Poll'),\n        type: 'poll' as const,\n      };\n    }\n\n    const textContent =\n      getTranslatedMessageText({ language: userLanguage, message: latestMessage }) ||\n      latestMessage.text;\n\n    if (latestMessage.shared_location) {\n      return {\n        deliveryStatus,\n        senderName,\n        text: textContent || t('Location'),\n        type: 'location' as const,\n      };\n    }\n\n    if (latestMessage.attachments && latestMessage.attachments.length) {\n      const attachments = latestMessage.attachments;\n\n      let contentType: ChannelPreviewMessageType;\n\n      const [firstAttachment] = attachments;\n      const firstAttachmentType = getAttachmentContentType(firstAttachment);\n\n      if (\n        attachments.every(\n          (attachment) => getAttachmentContentType(attachment) === firstAttachmentType,\n        )\n      ) {\n        contentType = firstAttachmentType;\n      } else {\n        contentType = 'file';\n      }\n\n      let text =\n        contentType === 'giphy'\n          ? `GIPHY ${firstAttachment.title ?? ''}`.trim()\n          : // prioritize message text content if available\n            textContent ||\n            // then fallback text of the single attachment if only one attachment is present and it's not a voice recording (fallback text is generic for voice recordings, so not useful in the preview)\n            (attachments.length === 1 &&\n            contentType !== 'voice' &&\n            contentType !== 'unsupported'\n              ? firstAttachment.fallback || firstAttachment.title\n              : '') ||\n            // then generic fallback text based on attachment type and count\n            getAttachmentFallbackText(contentType, attachments.length, t);\n\n      // attach duration for audio/video attachments if available\n      if (attachments.length === 1 && typeof firstAttachment.duration === 'number') {\n        const minutes = Math.floor(firstAttachment.duration / 60);\n        const seconds = Math.ceil(firstAttachment.duration) % 60;\n        const durationString = `${minutes}:${seconds.toString().padStart(2, '0')}`;\n        text += ` (${durationString})`;\n      }\n\n      return {\n        deliveryStatus,\n        senderName,\n        text,\n        type: contentType,\n      };\n    }\n\n    if (textContent) {\n      return {\n        deliveryStatus,\n        senderName,\n        text: textContent,\n        type: 'text' as const,\n      };\n    }\n\n    return { text: t('Empty message...'), type: 'empty' as const };\n  }, [\n    client.user?.id,\n    latestMessage,\n    messageDeliveryStatus,\n    participantCount,\n    t,\n    userLanguage,\n  ]);\n};\n","import React from 'react';\nimport clsx from 'clsx';\nimport {\n  type ChannelPreviewDeliveryStatus,\n  type ChannelPreviewMessageType,\n  useLatestMessagePreview,\n  type UseLatestMessagePreviewParams,\n} from './hooks/useLatestMessagePreview';\nimport {\n  IconCamera,\n  IconCheckmark1Small,\n  IconChecks,\n  IconClock,\n  IconExclamationCircleFill,\n  IconFile,\n  IconGiphy,\n  IconLink,\n  IconLocation,\n  IconNoSign,\n  IconUnsupportedAttachment,\n  IconVideo,\n  IconVoice,\n} from '../Icons';\n\nconst deliveryStatusIconMap: Record<ChannelPreviewDeliveryStatus, React.ComponentType> = {\n  delivered: IconChecks,\n  read: IconChecks,\n  sending: IconClock,\n  sent: IconCheckmark1Small,\n};\n\nconst contentTypeIconMap: Partial<\n  Record<ChannelPreviewMessageType, React.ComponentType>\n> = {\n  deleted: IconNoSign,\n  error: IconExclamationCircleFill,\n  file: IconFile,\n  giphy: IconGiphy,\n  image: IconCamera,\n  link: IconLink,\n  location: IconLocation,\n  unsupported: IconUnsupportedAttachment,\n  video: IconVideo,\n  voice: IconVoice,\n};\n\nexport const SummarizedMessagePreview = ({\n  latestMessage,\n  messageDeliveryStatus,\n  participantCount,\n}: UseLatestMessagePreviewParams) => {\n  const { deliveryStatus, senderName, text, type } = useLatestMessagePreview({\n    latestMessage,\n    messageDeliveryStatus,\n    participantCount,\n  });\n\n  const DeliveryStatusIcon = deliveryStatus\n    ? deliveryStatusIconMap[deliveryStatus]\n    : undefined;\n  const ContentTypeIcon = contentTypeIconMap[type];\n\n  return (\n    <div\n      className={clsx('str-chat__summarized-message-preview', {\n        [`str-chat__summarized-message-preview--${type}`]: type,\n      })}\n    >\n      {type !== 'error' && (\n        <>\n          {DeliveryStatusIcon && (\n            <span\n              className={clsx('str-chat__summarized-message-preview__delivery-status', {\n                [`str-chat__summarized-message-preview__delivery-status--${deliveryStatus}`]:\n                  deliveryStatus,\n              })}\n            >\n              <DeliveryStatusIcon />\n            </span>\n          )}\n          {senderName && (\n            <span className='str-chat__summarized-message-preview__sender'>\n              {senderName}:\n            </span>\n          )}\n        </>\n      )}\n      {ContentTypeIcon && <ContentTypeIcon />}\n      <span className='str-chat__summarized-message-preview__text'>{text}</span>\n    </div>\n  );\n};\n","import React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { ChannelListItemActionButtons as DefaultChannelListItemActionButtons } from './ChannelListItemActionButtons';\nimport { ChannelListItemTimestamp } from './ChannelListItemTimestamp';\n\nimport { ChannelAvatar as DefaultChannelAvatar } from '../Avatar';\nimport { Badge } from '../Badge';\nimport { IconMute, IconPin } from '../Icons';\nimport { useComponentContext, useTranslationContext } from '../../context';\nimport type { ChannelListItemUIProps } from './ChannelListItem';\nimport { SummarizedMessagePreview } from '../SummarizedMessagePreview';\n\nconst UnMemoizedChannelListItemUI = (props: ChannelListItemUIProps) => {\n  const {\n    active,\n    channel,\n    className: customClassName = '',\n    displayImage,\n    displayTitle,\n    groupChannelDisplayInfo,\n    lastMessage,\n    messageDeliveryStatus,\n    muted,\n    onSelect: customOnSelectChannel,\n    pinned,\n    setActiveChannel,\n    unread,\n    watchers,\n  } = props;\n\n  const {\n    Avatar = DefaultChannelAvatar,\n    ChannelListItemActionButtons = DefaultChannelListItemActionButtons,\n  } = useComponentContext();\n  const { t } = useTranslationContext();\n\n  const channelPreviewButton = useRef<HTMLButtonElement | null>(null);\n\n  const avatarName =\n    displayTitle || channel.state.messages[channel.state.messages.length - 1]?.user?.id;\n\n  const onSelectChannel = (e: React.MouseEvent<HTMLButtonElement>) => {\n    if (customOnSelectChannel) {\n      customOnSelectChannel(e);\n    } else if (setActiveChannel) {\n      setActiveChannel(channel, watchers);\n    }\n    if (channelPreviewButton?.current) {\n      channelPreviewButton.current.blur();\n    }\n  };\n\n  return (\n    <div className='str-chat__channel-list-item-container'>\n      <button\n        aria-label={t('aria/Select Channel: {{ channelName }}', {\n          channelName: displayTitle || '',\n        })}\n        aria-selected={active}\n        className={clsx(\n          'str-chat__channel-list-item',\n          {\n            'str-chat__channel-list-item--muted': muted,\n            'str-chat__channel-list-item--pinned': pinned,\n            'str-chat__channel-list-item--unread':\n              typeof unread === 'number' && unread > 0,\n          },\n          customClassName,\n        )}\n        data-testid='channel-list-item-button'\n        onClick={onSelectChannel}\n        ref={channelPreviewButton}\n        role='option'\n      >\n        <Avatar\n          displayMembers={groupChannelDisplayInfo?.members}\n          imageUrl={displayImage}\n          size='xl'\n          userName={avatarName}\n        />\n        <div className='str-chat__channel-list-item-data'>\n          <div className='str-chat__channel-list-item-data__first-row'>\n            <div className='str-chat__channel-list-item-data__title'>\n              <span>{displayTitle || 'N/A'}</span>\n              {pinned && <IconPin />}\n              {muted && <IconMute />}\n            </div>\n            <div className='str-chat__channel-list-item-data__timestamp-and-badge'>\n              <ChannelListItemTimestamp lastMessage={lastMessage} />\n              {typeof unread === 'number' && unread > 0 && (\n                <Badge data-testid='unread-badge' size='md' variant='primary'>\n                  {unread}\n                </Badge>\n              )}\n            </div>\n          </div>\n          <SummarizedMessagePreview\n            latestMessage={lastMessage}\n            messageDeliveryStatus={messageDeliveryStatus}\n            participantCount={channel.data?.member_count}\n          />\n        </div>\n      </button>\n      <ChannelListItemActionButtons />\n    </div>\n  );\n};\n\n/**\n * Used as preview component for channel item in [ChannelList](#channellist) component.\n * Its best suited for messenger type chat.\n */\nexport const ChannelListItemUI = React.memo(\n  UnMemoizedChannelListItemUI,\n) as typeof UnMemoizedChannelListItemUI;\n","import { useCallback, useEffect, useState } from 'react';\nimport type { Channel, Event, LocalMessage, UserResponse } from 'stream-chat';\n\nimport { useChatContext } from '../../../context';\n\nexport enum MessageDeliveryStatus {\n  SENT = 'sent',\n  DELIVERED = 'delivered',\n  READ = 'read',\n}\n\ntype UseMessageStatusParamsChannelPreviewProps = {\n  channel: Channel;\n  /** The last message received in a channel */\n  lastMessage?: LocalMessage;\n};\n\nexport const useMessageDeliveryStatus = ({\n  channel,\n  lastMessage,\n}: UseMessageStatusParamsChannelPreviewProps) => {\n  const { client } = useChatContext();\n  const [messageDeliveryStatus, setMessageDeliveryStatus] = useState<\n    MessageDeliveryStatus | undefined\n  >();\n\n  const isOwnMessage = useCallback(\n    (message?: { user?: UserResponse | null }) =>\n      client.user && message && message.user?.id === client.user.id,\n    [client],\n  );\n\n  useEffect(() => {\n    // empty channel\n    if (!lastMessage) {\n      setMessageDeliveryStatus(undefined);\n    }\n\n    const lastMessageIsOwn = isOwnMessage(lastMessage);\n    if (!lastMessage?.created_at || !lastMessageIsOwn) return;\n\n    const msgRef = {\n      msgId: lastMessage.id,\n      timestampMs: lastMessage.created_at.getTime(),\n    };\n    const readersForMessage = channel.messageReceiptsTracker.readersForMessage(msgRef);\n    const deliveredForMessage =\n      channel.messageReceiptsTracker.deliveredForMessage(msgRef);\n    setMessageDeliveryStatus(\n      readersForMessage.length > 1 ||\n        (readersForMessage.length === 1 && readersForMessage[0].id !== client.user?.id)\n        ? MessageDeliveryStatus.READ\n        : deliveredForMessage.length > 1 ||\n            (deliveredForMessage.length === 1 &&\n              deliveredForMessage[0].id !== client.user?.id)\n          ? MessageDeliveryStatus.DELIVERED\n          : MessageDeliveryStatus.SENT,\n    );\n  }, [channel, client, isOwnMessage, lastMessage]);\n\n  useEffect(() => {\n    const handleMessageNew = (event: Event) => {\n      // the last message is not mine, so do not show the delivery status\n      if (!isOwnMessage(event.message)) {\n        return setMessageDeliveryStatus(undefined);\n      }\n      return setMessageDeliveryStatus(MessageDeliveryStatus.SENT);\n    };\n\n    channel.on('message.new', handleMessageNew);\n\n    return () => {\n      channel.off('message.new', handleMessageNew);\n    };\n  }, [channel, isOwnMessage]);\n\n  useEffect(() => {\n    if (!isOwnMessage(lastMessage)) return;\n    const handleMessageDelivered = (event: Event) => {\n      if (\n        event.user?.id !== client.user?.id &&\n        lastMessage &&\n        lastMessage.id === event.last_delivered_message_id\n      )\n        setMessageDeliveryStatus(MessageDeliveryStatus.DELIVERED);\n    };\n\n    const handleMarkRead = (event: Event) => {\n      if (event.user?.id !== client.user?.id)\n        setMessageDeliveryStatus(MessageDeliveryStatus.READ);\n    };\n\n    channel.on('message.delivered', handleMessageDelivered);\n    channel.on('message.read', handleMarkRead);\n\n    return () => {\n      channel.off('message.delivered', handleMessageDelivered);\n      channel.off('message.read', handleMarkRead);\n    };\n  }, [channel, client, isOwnMessage, lastMessage]);\n\n  return {\n    messageDeliveryStatus,\n  };\n};\n","import throttle from 'lodash.throttle';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport type { Channel, Event, LocalMessage } from 'stream-chat';\n\nimport { ChannelListItemUI as DefaultChannelListItemUI } from './ChannelListItemUI';\nimport { useIsChannelMuted } from './hooks/useIsChannelMuted';\nimport { useChannelPreviewInfo } from './hooks/useChannelPreviewInfo';\nimport { getLatestMessagePreview as defaultGetLatestMessagePreview } from './utils';\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useMessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';\nimport type { MessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';\nimport type { GroupChannelDisplayInfo } from './utils';\nimport {\n  type ChatContextValue,\n  type TranslationContextValue,\n  useChatContext,\n  useComponentContext,\n} from '../../context';\nimport { useChannelMembershipState } from '../ChannelList';\n\nexport type ChannelListItemUIProps = ChannelListItemProps & {\n  /** Image of Channel to display */\n  displayImage?: string;\n  /** Title of Channel to display */\n  displayTitle?: string;\n  /** Title of Channel to display */\n  groupChannelDisplayInfo?: GroupChannelDisplayInfo;\n  /** The last message received in a channel */\n  lastMessage?: LocalMessage;\n  /** Latest message preview to display, will be a string or JSX element supporting markdown. */\n  latestMessagePreview?: ReactNode;\n  /** Status describing whether own message has been delivered or read by another. If the last message is not an own message, then the status is undefined. */\n  messageDeliveryStatus?: MessageDeliveryStatus;\n  /** Whether the channel is muted by the current user */\n  muted?: boolean;\n  /** Whether the channel is pinned by the current user */\n  pinned?: boolean;\n  /** Number of unread Messages */\n  unread?: number;\n};\n\nexport type ChannelListItemProps = {\n  /** Comes from either the `channelRenderFilterFn` or `usePaginatedChannels` call from [ChannelList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelList.tsx) */\n  channel: Channel;\n  /** If the component's channel is the active (selected) Channel */\n  active?: boolean;\n  /** Current selected channel object */\n  activeChannel?: Channel;\n  /** Forces the update of preview component on channel update */\n  channelUpdateCount?: number;\n  /** Custom class for the channel preview root */\n  className?: string;\n  /** Custom function that generates the message preview in ChannelListItem component */\n  getLatestMessagePreview?: (\n    channel: Channel,\n    t: TranslationContextValue['t'],\n    userLanguage: TranslationContextValue['userLanguage'],\n    isMessageAIGenerated: ChatContextValue['isMessageAIGenerated'],\n  ) => ReactNode;\n  key?: string;\n  /** Custom ChannelListItem click handler function */\n  onSelect?: (event: React.MouseEvent) => void;\n  /** Setter for selected Channel */\n  setActiveChannel?: ChatContextValue['setActiveChannel'];\n  /** Object containing watcher parameters */\n  watchers?: { limit?: number; offset?: number };\n};\n\nconst ChannelListItemContext = React.createContext<{ channel: Channel }>({\n  channel: null as unknown as Channel,\n});\n\nexport const useChannelListItemContext = () => useContext(ChannelListItemContext);\n\nexport const ChannelListItem = (props: ChannelListItemProps) => {\n  const {\n    active,\n    channel,\n    channelUpdateCount,\n    getLatestMessagePreview = defaultGetLatestMessagePreview,\n  } = props;\n  const { ChannelListItemUI = DefaultChannelListItemUI } = useComponentContext();\n  const {\n    channel: activeChannel,\n    client,\n    isMessageAIGenerated,\n    setActiveChannel,\n  } = useChatContext('ChannelPreview');\n  const { t, userLanguage } = useTranslationContext('ChannelPreview');\n  const { displayImage, displayTitle, groupChannelDisplayInfo } = useChannelPreviewInfo({\n    channel,\n  });\n  const membership = useChannelMembershipState(channel);\n\n  const [lastMessage, setLastMessage] = useState<LocalMessage>(\n    channel.state.messages[channel.state.messages.length - 1],\n  );\n  const [latestMessagePreview, setLatestMessagePreview] = useState<ReactNode>(() =>\n    getLatestMessagePreview(channel, t, userLanguage, isMessageAIGenerated),\n  );\n\n  const [unread, setUnread] = useState(0);\n  const { messageDeliveryStatus } = useMessageDeliveryStatus({\n    channel,\n    lastMessage,\n  });\n\n  const isActive =\n    typeof active === 'undefined' ? activeChannel?.cid === channel.cid : active;\n  const { muted } = useIsChannelMuted(channel);\n\n  useEffect(() => {\n    const handleEvent = (event: Event) => {\n      if (!event.cid) return setUnread(0);\n      if (channel.cid === event.cid) setUnread(0);\n    };\n\n    client.on('notification.mark_read', handleEvent);\n    return () => client.off('notification.mark_read', handleEvent);\n  }, [channel, client]);\n\n  useEffect(() => {\n    const handleEvent = (event: Event) => {\n      if (channel.cid !== event.cid) return;\n      if (event.user?.id !== client.user?.id) return;\n      setUnread(channel.countUnread());\n    };\n    channel.on('notification.mark_unread', handleEvent);\n    return () => {\n      channel.off('notification.mark_unread', handleEvent);\n    };\n  }, [channel, client]);\n\n  const refreshUnreadCount = useMemo(\n    () =>\n      throttle(() => {\n        if (muted) {\n          setUnread(0);\n        } else {\n          setUnread(channel.countUnread());\n        }\n      }, 400),\n    [channel, muted],\n  );\n\n  useEffect(() => {\n    refreshUnreadCount();\n    setLatestMessagePreview(\n      getLatestMessagePreview(channel, t, userLanguage, isMessageAIGenerated),\n    );\n\n    const handleEvent = (event: Event) => {\n      const deletedMessagesInAnotherChannel =\n        event.type === 'user.messages.deleted' && event.cid && event.cid !== channel.cid;\n\n      if (deletedMessagesInAnotherChannel) return;\n\n      setLastMessage(\n        channel.state.latestMessages[channel.state.latestMessages.length - 1],\n      );\n      setLatestMessagePreview(\n        getLatestMessagePreview(channel, t, userLanguage, isMessageAIGenerated),\n      );\n      refreshUnreadCount();\n    };\n\n    channel.on('message.new', handleEvent);\n    channel.on('message.updated', handleEvent);\n    channel.on('message.deleted', handleEvent);\n    client.on('user.messages.deleted', handleEvent);\n    channel.on('message.undeleted', handleEvent);\n    channel.on('channel.truncated', handleEvent);\n\n    return () => {\n      channel.off('message.new', handleEvent);\n      channel.off('message.updated', handleEvent);\n      channel.off('message.deleted', handleEvent);\n      client.off('user.messages.deleted', handleEvent);\n      channel.off('message.undeleted', handleEvent);\n      channel.off('channel.truncated', handleEvent);\n    };\n  }, [\n    channel,\n    client,\n    refreshUnreadCount,\n    channelUpdateCount,\n    getLatestMessagePreview,\n    t,\n    userLanguage,\n    isMessageAIGenerated,\n  ]);\n\n  const channelPreviewContextValue = useMemo(() => ({ channel }), [channel]);\n\n  if (!ChannelListItemUI) return null;\n\n  return (\n    <ChannelListItemContext.Provider value={channelPreviewContextValue}>\n      <ChannelListItemUI\n        {...props}\n        active={isActive}\n        displayImage={displayImage}\n        displayTitle={displayTitle}\n        groupChannelDisplayInfo={groupChannelDisplayInfo}\n        lastMessage={lastMessage}\n        latestMessagePreview={latestMessagePreview}\n        messageDeliveryStatus={messageDeliveryStatus}\n        muted={muted}\n        pinned={!!membership.pinned_at}\n        setActiveChannel={setActiveChannel}\n        unread={unread}\n      />\n    </ChannelListItemContext.Provider>\n  );\n};\n","import React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport type { ThreadState } from 'stream-chat';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { Timestamp } from '../../Message/Timestamp';\nimport { Avatar, type AvatarProps, AvatarStack } from '../../Avatar';\nimport { useChannelPreviewInfo } from '../../ChannelListItem';\nimport { useChatContext, useTranslationContext } from '../../../context';\nimport { useThreadsViewContext } from '../../ChatView';\nimport { useThreadListItemContext } from './ThreadListItem';\nimport { useStateStore } from '../../../store';\nimport { Badge } from '../../Badge';\nimport { SummarizedMessagePreview } from '../../SummarizedMessagePreview';\n\nexport type ThreadListItemUIProps = ComponentPropsWithoutRef<'button'> & {\n  resetHighlighting?: () => void;\n};\n\nexport const ThreadListItemUI = ({\n  resetHighlighting,\n  ...props\n}: ThreadListItemUIProps) => {\n  const { client } = useChatContext();\n  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n  const thread = useThreadListItemContext()!;\n\n  const selector = useCallback(\n    (nextValue: ThreadState) => ({\n      channel: nextValue.channel,\n      deletedAt: nextValue.deletedAt,\n      latestReply: nextValue.replies.at(-1),\n      ownUnreadMessageCount:\n        (client.userID && nextValue.read[client.userID]?.unreadMessageCount) || 0,\n      parentMessage: nextValue.parentMessage,\n      participants: nextValue.participants,\n      replyCount: nextValue.replyCount,\n    }),\n    [client],\n  );\n\n  const {\n    channel,\n    deletedAt,\n    latestReply,\n    ownUnreadMessageCount,\n    parentMessage,\n    participants,\n    replyCount,\n  } = useStateStore(thread.state, selector);\n\n  const { displayTitle: channelDisplayTitle } = useChannelPreviewInfo({ channel });\n  const { t } = useTranslationContext('ThreadListItemUI');\n\n  const { activeThread, setActiveThread } = useThreadsViewContext();\n\n  const avatarProps: Partial<AvatarProps> | undefined = deletedAt\n    ? undefined\n    : ({\n        imageUrl: latestReply?.user?.image,\n        userName: latestReply?.user?.name || latestReply?.user?.id,\n      } as const);\n\n  const displayInfo = useMemo(() => {\n    if (!participants) return [];\n\n    return participants.slice(0, 3).map((participant) => ({\n      id: participant.user?.id ?? undefined,\n      imageUrl: participant.user?.image,\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      userName: participant.user?.name || participant.user!.id,\n    }));\n  }, [participants]);\n\n  useEffect(() => {\n    if (!resetHighlighting) return;\n\n    const reset = resetHighlighting;\n\n    const timeout = setTimeout(() => {\n      reset();\n    }, 2000);\n\n    return () => clearTimeout(timeout);\n  }, [resetHighlighting]);\n\n  return (\n    <div className='str-chat__thread-list-item-container'>\n      <button\n        aria-selected={activeThread === thread}\n        className={clsx('str-chat__thread-list-item', {\n          'str-chat__thread-list-item--highlighted':\n            typeof resetHighlighting !== 'undefined',\n        })}\n        data-thread-id={thread.id}\n        onClick={() => setActiveThread(thread)}\n        role='option'\n        {...props}\n      >\n        <Avatar size='xl' {...avatarProps} />\n        <div className='str-chat__thread-list-item__content'>\n          <div className='str-chat__thread-list-item__content-leading'>\n            <span className='str-chat__thread-list-item__title'>\n              {channelDisplayTitle}\n            </span>\n            <SummarizedMessagePreview\n              latestMessage={parentMessage}\n              participantCount={participants?.length}\n            />\n          </div>\n          <div className='str-chat__thread-list-item__content-trailing'>\n            <div className='str-chat__thread-list-item__reply-information'>\n              <AvatarStack displayInfo={displayInfo} size='sm' />\n              <span className='str-chat__thread-list-item__reply-count'>\n                {t('replyCount', { count: replyCount })}\n              </span>\n            </div>\n            <Timestamp\n              customClass='str-chat__thread-list-item__timestamp'\n              timestamp={latestReply?.created_at}\n            />\n          </div>\n        </div>\n        {ownUnreadMessageCount > 0 && (\n          <Badge size='md' variant='primary'>\n            {ownUnreadMessageCount}\n          </Badge>\n        )}\n      </button>\n    </div>\n  );\n};\n","import React, { createContext, useContext } from 'react';\n\nimport type { Thread } from 'stream-chat';\n\nimport { useComponentContext } from '../../../context';\nimport { ThreadListItemUI as DefaultThreadListItemUI } from './ThreadListItemUI';\n\nimport type { ThreadListItemUIProps } from './ThreadListItemUI';\n\nexport type ThreadListItemProps = {\n  thread: Thread;\n  threadListItemUIProps?: ThreadListItemUIProps;\n};\n\nconst ThreadListItemContext = createContext<Thread | undefined>(undefined);\n\nexport const useThreadListItemContext = () => useContext(ThreadListItemContext);\n\nexport const ThreadListItem = ({\n  thread,\n  threadListItemUIProps,\n}: ThreadListItemProps) => {\n  const { ThreadListItemUI = DefaultThreadListItemUI } = useComponentContext();\n\n  return (\n    <ThreadListItemContext.Provider value={thread}>\n      <ThreadListItemUI {...threadListItemUIProps} />\n    </ThreadListItemContext.Provider>\n  );\n};\n","import React from 'react';\n\nimport { useTranslationContext } from '../../../context';\nimport { IconMessageBubbles } from '../../Icons';\n\nexport const ThreadListEmptyPlaceholder = () => {\n  const { t } = useTranslationContext('ThreadListEmptyPlaceholder');\n\n  return (\n    <div className='str-chat__thread-list-empty-placeholder'>\n      <IconMessageBubbles />\n      <p>{t('Reply to a message to start a thread')}</p>\n    </div>\n  );\n};\n","import React from 'react';\nimport clsx from 'clsx';\n\nimport type { ThreadManagerState } from 'stream-chat';\n\nimport { IconRefresh } from '../../Icons';\nimport { useChatContext, useTranslationContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport { LoadingIndicator } from '../../Loading';\n\nconst selector = (nextValue: ThreadManagerState) => ({\n  isLoading: nextValue.pagination.isLoading,\n  unseenThreadIds: nextValue.unseenThreadIds,\n});\n\nexport const ThreadListUnseenThreadsBanner = () => {\n  const { client } = useChatContext();\n  const { t } = useTranslationContext();\n  const { isLoading, unseenThreadIds } = useStateStore(client.threads.state, selector);\n\n  if (!unseenThreadIds.length) return null;\n\n  return (\n    <button\n      className={clsx('str-chat__unseen-threads-banner', {\n        'str-chat__unseen-threads-banner--loading': isLoading,\n      })}\n      disabled={isLoading}\n      onClick={() => client.threads.reload()}\n    >\n      {!isLoading && (\n        <>\n          <IconRefresh />\n          <span>\n            {t('ThreadListUnseenThreadsBanner/unreadThreads', {\n              count: unseenThreadIds.length,\n            })}\n          </span>\n        </>\n      )}\n      {isLoading && (\n        <>\n          <LoadingIndicator />\n          <span>{t('ThreadListUnseenThreadsBanner/loading')}</span>\n        </>\n      )}\n    </button>\n  );\n};\n","import React from 'react';\n\nimport type { ThreadManagerState } from 'stream-chat';\n\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../../Loading';\nimport { useChatContext, useComponentContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nconst selector = (nextValue: ThreadManagerState) => ({\n  isLoadingNext: nextValue.pagination.isLoadingNext,\n});\n\nexport const ThreadListLoadingIndicator = () => {\n  const { LoadingIndicator = DefaultLoadingIndicator } = useComponentContext();\n  const { client } = useChatContext();\n  const { isLoadingNext } = useStateStore(client.threads.state, selector);\n\n  if (!isLoadingNext) return null;\n\n  return (\n    <div className='str-chat__thread-list-loading-indicator'>\n      <LoadingIndicator />\n    </div>\n  );\n};\n","import React from 'react';\nimport { useComponentContext, useTranslationContext } from '../../../context';\nimport { useThreadsViewContext } from '../../ChatView';\n\nexport const ThreadListHeader = () => {\n  const { t } = useTranslationContext();\n  const { HeaderEndContent } = useComponentContext();\n  const { activeThread } = useThreadsViewContext();\n  return (\n    <div className='str-chat__thread-list__header'>\n      <div className='str-chat__thread-list__header__title'>{t('Threads')}</div>\n      {activeThread && HeaderEndContent && <HeaderEndContent />}\n    </div>\n  );\n};\n","import React, { useEffect, useState } from 'react';\nimport type { ComputeItemKey, VirtuosoProps } from 'react-virtuoso';\nimport { Virtuoso } from 'react-virtuoso';\nimport type { Thread, ThreadManager, ThreadManagerState } from 'stream-chat';\n\nimport { ThreadListItem as DefaultThreadListItem } from './ThreadListItem';\nimport { ThreadListEmptyPlaceholder as DefaultThreadListEmptyPlaceholder } from './ThreadListEmptyPlaceholder';\nimport { ThreadListUnseenThreadsBanner as DefaultThreadListUnseenThreadsBanner } from './ThreadListUnseenThreadsBanner';\nimport { ThreadListLoadingIndicator as DefaultThreadListLoadingIndicator } from './ThreadListLoadingIndicator';\nimport { LoadingChannels } from '../../Loading';\nimport { NotificationList } from '../../Notifications';\nimport {\n  useChatContext,\n  useComponentContext,\n  useTranslationContext,\n} from '../../../context';\nimport { useStateStore } from '../../../store';\nimport { ThreadListHeader } from './ThreadListHeader';\n\nconst selector = (nextValue: ThreadManagerState) => ({\n  isLoading: nextValue.pagination.isLoading,\n  threads: nextValue.threads,\n});\n\nconst computeItemKey: ComputeItemKey<Thread, unknown> = (_, item) => item.id;\n\ntype ThreadListProps = {\n  virtuosoProps?: VirtuosoProps<Thread, unknown>;\n};\n\nexport const useThreadList = () => {\n  const { client } = useChatContext();\n\n  useEffect(() => {\n    const handleVisibilityChange = () => {\n      if (document.visibilityState === 'visible') {\n        client.threads.activate();\n      }\n      if (document.visibilityState === 'hidden') {\n        client.threads.deactivate();\n      }\n    };\n\n    handleVisibilityChange();\n\n    document.addEventListener('visibilitychange', handleVisibilityChange);\n    return () => {\n      client.threads.deactivate();\n      document.removeEventListener('visibilitychange', handleVisibilityChange);\n    };\n  }, [client]);\n};\n\nconst useThreadHighlighting = (threadManager: ThreadManager) => {\n  const [threadsToHighlight, setThreadsToHighlight] = useState<\n    Record<string, () => void>\n  >({});\n\n  useEffect(() => {\n    const unsubscribe = threadManager.state.subscribeWithSelector(\n      (state) => state.threads,\n      (nextThreads, previousThreads) => {\n        if (!previousThreads) return;\n\n        const resetByThreadId: Record<string, () => void> = {};\n\n        for (const thread of nextThreads) {\n          if (previousThreads.includes(thread)) continue;\n\n          resetByThreadId[thread.id] = () => {\n            setThreadsToHighlight((pv) => {\n              const copy = { ...pv };\n              delete copy[thread.id];\n              return copy;\n            });\n          };\n        }\n\n        setThreadsToHighlight(resetByThreadId);\n      },\n    );\n\n    return unsubscribe;\n  });\n\n  return threadsToHighlight;\n};\n\nexport const ThreadList = ({ virtuosoProps }: ThreadListProps) => {\n  const { client } = useChatContext();\n  const { t } = useTranslationContext('ThreadList');\n  const {\n    NotificationList: NotificationListFromContext = NotificationList,\n    ThreadListEmptyPlaceholder = DefaultThreadListEmptyPlaceholder,\n    ThreadListItem = DefaultThreadListItem,\n    ThreadListLoadingIndicator = DefaultThreadListLoadingIndicator,\n    ThreadListUnseenThreadsBanner = DefaultThreadListUnseenThreadsBanner,\n  } = useComponentContext();\n  const { isLoading, threads } = useStateStore(client.threads.state, selector);\n\n  const resetByThreadId = useThreadHighlighting(client.threads);\n\n  useThreadList();\n\n  if (isLoading && !threads.length) {\n    return (\n      <div className='str-chat__thread-list-container'>\n        <ThreadListHeader />\n        <div className='str-chat__thread-list str-chat__thread-list--loading'>\n          <LoadingChannels />\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div className='str-chat__thread-list-container'>\n      <ThreadListHeader />\n      {/* TODO: allow re-load on stale ThreadManager state */}\n      <ThreadListUnseenThreadsBanner />\n      <Virtuoso\n        aria-label={t('aria/Thread list')}\n        atBottomStateChange={(atBottom) => atBottom && client.threads.loadNextPage()}\n        className='str-chat__thread-list'\n        components={{\n          EmptyPlaceholder: ThreadListEmptyPlaceholder,\n          Footer: ThreadListLoadingIndicator,\n        }}\n        computeItemKey={computeItemKey}\n        data={threads}\n        itemContent={(_, thread) => (\n          <ThreadListItem\n            thread={thread}\n            threadListItemUIProps={{\n              resetHighlighting: resetByThreadId[thread.id],\n            }}\n          />\n        )}\n        role='listbox'\n        // TODO: handle visibility (for a button that scrolls to the unread thread)\n        // itemsRendered={(items) => console.log({ items })}\n        {...virtuosoProps}\n      />\n      <NotificationListFromContext panel='thread-list' />\n    </div>\n  );\n};\n","import { useCallback } from 'react';\n\nimport type { Notification, NotificationManagerState } from 'stream-chat';\n\nimport { useChatContext } from '../../../context';\nimport { useStateStore } from '../../../store';\n\nimport { hasSystemNotificationTag } from './useNotificationApi';\n\nexport type UseSystemNotificationsFilter = (notification: Notification) => boolean;\n\nexport type UseSystemNotificationsOptions = {\n  /**\n   * Applied after the built-in filter that keeps only notifications tagged for the system banner.\n   */\n  filter?: UseSystemNotificationsFilter;\n};\n\n/**\n * Subscribes to `client.notifications` and returns only **system** banner notifications\n * (same subset `NotificationList` excludes from toasts). Optional `filter` narrows further.\n */\nexport const useSystemNotifications = (\n  options?: UseSystemNotificationsOptions,\n): Notification[] => {\n  const { client } = useChatContext();\n  const selector = useCallback(\n    (state: NotificationManagerState) => {\n      const withSystemTag = state.notifications.filter(hasSystemNotificationTag);\n      const notifications = options?.filter\n        ? withSystemTag.filter(options.filter)\n        : withSystemTag;\n\n      return { notifications };\n    },\n    [options?.filter],\n  );\n\n  const { notifications } = useStateStore(client.notifications.store, selector);\n\n  return notifications;\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\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  /** 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;\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\nexport const NotificationList = ({\n  className,\n  enterFrom = 'bottom',\n  fallbackPanel,\n  filter,\n  panel,\n  verticalAlignment = 'bottom',\n}: NotificationListProps) => {\n  const { Notification: NotificationComponent = DefaultNotification } =\n    useComponentContext();\n  const { t } = useTranslationContext();\n  const { removeNotification, startNotificationTimeout } = useNotificationApi();\n  const exitTimeoutRef = useRef<number | null>(null);\n  const latestNotificationRef = useRef<Notification | 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    fallbackPanel,\n    filter: combinedFilter,\n    panel,\n  });\n  const nextNotification = notifications[0] ?? null;\n\n  const dismiss = useCallback(\n    (id: string) => {\n      startedTimeoutIdsRef.current?.delete(id);\n      removeNotification(id);\n    },\n    [removeNotification],\n  );\n\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  useEffect(() => {\n    latestNotificationRef.current = nextNotification;\n  }, [nextNotification]);\n\n  useEffect(\n    () => () => {\n      if (exitTimeoutRef.current) {\n        window.clearTimeout(exitTimeoutRef.current);\n      }\n    },\n    [],\n  );\n\n  useEffect(() => {\n    if (!displayedNotification) {\n      if (!nextNotification) return;\n\n      setDisplayedNotification(nextNotification);\n      setTransitionState('enter');\n      return;\n    }\n\n    if (displayedNotification.id === nextNotification?.id) return;\n    if (transitionState === 'exit') return;\n\n    setTransitionState('exit');\n    exitTimeoutRef.current = window.setTimeout(() => {\n      setDisplayedNotification(latestNotificationRef.current);\n      setTransitionState('enter');\n      exitTimeoutRef.current = null;\n    }, EXIT_ANIMATION_MS);\n  }, [displayedNotification, nextNotification, transitionState]);\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 React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { Notification } from 'stream-chat';\n\nimport { useNotifications } from '../Notifications';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useTranslationContext } from '../../context';\n\ntype LivePriority = 'assertive' | 'polite';\n\ntype QueuedAnnouncement = {\n  id: string;\n  message: string;\n  priority: LivePriority;\n};\n\nexport type NotificationAnnouncementBuilderParams = {\n  defaultMessage: string;\n  notification: Notification;\n  translatedMessage: string;\n};\n\nexport type NotificationAnnouncementBuilder = (\n  params: NotificationAnnouncementBuilderParams,\n) => string;\nexport type NotificationAnnouncementFilter = (notification: Notification) => boolean;\n\nconst ANNOUNCEMENT_CLEAR_DELAY_MS = 50;\nconst ANNOUNCEMENT_QUEUE_GAP_MS = 120;\n\nconst getAnnouncementPriority = (notification: Notification): LivePriority =>\n  notification.severity === 'error' ? 'assertive' : 'polite';\n\nconst getSeverityLabel = (notification: Notification) => {\n  if (!notification.severity) return null;\n  return `${notification.severity[0].toUpperCase()}${notification.severity.slice(1)}`;\n};\n\nconst getDefaultAnnouncementMessage = (notification: Notification, message: string) => {\n  const severityLabel = getSeverityLabel(notification);\n\n  if (severityLabel) {\n    return `${severityLabel} notification: ${message}`;\n  }\n\n  return `Notification: ${message}`;\n};\n\nexport type NotificationAnnouncerProps = {\n  buildNotificationAnnouncement?: NotificationAnnouncementBuilder;\n  notificationFilter?: NotificationAnnouncementFilter;\n};\n\nconst defaultBuildNotificationAnnouncement: NotificationAnnouncementBuilder = ({\n  defaultMessage,\n}) => defaultMessage;\nconst defaultNotificationFilter: NotificationAnnouncementFilter = () => true;\n\nexport const NotificationAnnouncer = ({\n  buildNotificationAnnouncement = defaultBuildNotificationAnnouncement,\n  notificationFilter = defaultNotificationFilter,\n}: NotificationAnnouncerProps) => {\n  const { t } = useTranslationContext();\n  const notifications = useNotifications();\n  const [announcementQueue, setAnnouncementQueue] = useState<QueuedAnnouncement[]>([]);\n  const [isAnnouncing, setIsAnnouncing] = useState(false);\n  const [politeAnnouncement, setPoliteAnnouncement] = useState('');\n  const [assertiveAnnouncement, setAssertiveAnnouncement] = useState('');\n  const initializedRef = useRef(false);\n  const seenNotificationIdsRef = useRef(new Set<string>());\n  const announceTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n  const dequeueTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n  const clearTimeouts = useCallback(() => {\n    if (announceTimeoutRef.current) {\n      clearTimeout(announceTimeoutRef.current);\n      announceTimeoutRef.current = null;\n    }\n\n    if (dequeueTimeoutRef.current) {\n      clearTimeout(dequeueTimeoutRef.current);\n      dequeueTimeoutRef.current = null;\n    }\n  }, []);\n\n  useEffect(\n    () => () => {\n      clearTimeouts();\n    },\n    [clearTimeouts],\n  );\n\n  useEffect(() => {\n    const visibleNotificationIds = new Set(notifications.map(({ id }) => id));\n\n    seenNotificationIdsRef.current.forEach((id) => {\n      if (!visibleNotificationIds.has(id)) {\n        seenNotificationIdsRef.current.delete(id);\n      }\n    });\n\n    if (!initializedRef.current) {\n      notifications.forEach(({ id }) => {\n        seenNotificationIdsRef.current.add(id);\n      });\n      initializedRef.current = true;\n      return;\n    }\n\n    const nextAnnouncements: QueuedAnnouncement[] = [];\n\n    notifications.forEach((notification) => {\n      if (seenNotificationIdsRef.current.has(notification.id)) return;\n\n      seenNotificationIdsRef.current.add(notification.id);\n      if (!notificationFilter(notification)) return;\n\n      const message = t('translationBuilderTopic/notification', {\n        notification,\n        value: notification.message,\n      });\n\n      if (!message) return;\n\n      const defaultMessage = getDefaultAnnouncementMessage(notification, message);\n      const announcementMessage = buildNotificationAnnouncement({\n        defaultMessage,\n        notification,\n        translatedMessage: message,\n      });\n\n      if (!announcementMessage) return;\n\n      nextAnnouncements.push({\n        id: notification.id,\n        message: announcementMessage,\n        priority: getAnnouncementPriority(notification),\n      });\n    });\n\n    if (!nextAnnouncements.length) return;\n\n    setAnnouncementQueue((currentQueue) => [...currentQueue, ...nextAnnouncements]);\n  }, [buildNotificationAnnouncement, notificationFilter, notifications, t]);\n\n  useEffect(() => {\n    if (isAnnouncing) return;\n\n    const nextAnnouncement = announcementQueue[0];\n    if (!nextAnnouncement) return;\n\n    setIsAnnouncing(true);\n    clearTimeouts();\n    setPoliteAnnouncement('');\n    setAssertiveAnnouncement('');\n\n    announceTimeoutRef.current = setTimeout(() => {\n      if (nextAnnouncement.priority === 'assertive') {\n        setAssertiveAnnouncement(nextAnnouncement.message);\n      } else {\n        setPoliteAnnouncement(nextAnnouncement.message);\n      }\n\n      dequeueTimeoutRef.current = setTimeout(() => {\n        setAnnouncementQueue((currentQueue) =>\n          currentQueue.filter(({ id }) => id !== nextAnnouncement.id),\n        );\n        setIsAnnouncing(false);\n        dequeueTimeoutRef.current = null;\n      }, ANNOUNCEMENT_QUEUE_GAP_MS);\n\n      announceTimeoutRef.current = null;\n    }, ANNOUNCEMENT_CLEAR_DELAY_MS);\n  }, [announcementQueue, clearTimeouts, isAnnouncing]);\n\n  return (\n    <VisuallyHidden data-testid='notification-announcer'>\n      <div aria-atomic='true' aria-live='polite' role='status'>\n        {politeAnnouncement}\n      </div>\n      <div aria-atomic='true' aria-live='assertive' role='alert'>\n        {assertiveAnnouncement}\n      </div>\n    </VisuallyHidden>\n  );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport type { Channel, Event, MessageResponse } from 'stream-chat';\n\nimport { useAriaLiveAnnouncer } from '../useAriaLiveAnnouncer';\nimport { useTranslationContext } from '../../../context/TranslationContext';\n\nconst MESSAGE_ANNOUNCEMENT_THROTTLE_MS = 1000;\n\nconst isAnnounceableIncomingMessage = (\n  message: MessageResponse,\n  ownUserId?: string,\n): boolean => {\n  const messageUserId = message.user?.id;\n\n  if (!message.id || !messageUserId || messageUserId === ownUserId) {\n    return false;\n  }\n\n  return (\n    message.type !== 'deleted' &&\n    message.type !== 'ephemeral' &&\n    message.type !== 'error' &&\n    message.type !== 'system' &&\n    message.status !== 'failed' &&\n    message.status !== 'sending'\n  );\n};\n\nconst getSenderName = (\n  message: MessageResponse,\n  t: ReturnType<typeof useTranslationContext>['t'],\n) => message.user?.name?.trim() || message.user?.id || t('Anonymous');\n\nexport type UseIncomingMessageAnnouncementsParams = {\n  activeThreadId?: string;\n  channel?: Channel;\n  ownUserId?: string;\n  threadList?: boolean;\n};\n\nexport const useIncomingMessageAnnouncements = ({\n  activeThreadId,\n  channel,\n  ownUserId,\n  threadList = false,\n}: UseIncomingMessageAnnouncementsParams) => {\n  const announce = useAriaLiveAnnouncer();\n  const { t } = useTranslationContext('useIncomingMessageAnnouncements');\n  const lastAnnouncementTimestampRef = useRef(0);\n  const flushTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const announcedMessageIdsRef = useRef(new Set<string>());\n  const pendingAnnouncementBatchRef = useRef<{\n    count: number;\n    firstSender: string | null;\n  }>({\n    count: 0,\n    firstSender: null,\n  });\n\n  const flushPendingAnnouncements = useCallback(() => {\n    const pendingAnnouncementBatch = pendingAnnouncementBatchRef.current;\n\n    if (pendingAnnouncementBatch.count <= 0) return;\n\n    if (pendingAnnouncementBatch.count === 1) {\n      announce(\n        t('New message from {{user}}', {\n          user: pendingAnnouncementBatch.firstSender || t('Anonymous'),\n        }),\n      );\n    } else {\n      announce(t('{{count}} new messages', { count: pendingAnnouncementBatch.count }));\n    }\n\n    pendingAnnouncementBatch.count = 0;\n    pendingAnnouncementBatch.firstSender = null;\n    lastAnnouncementTimestampRef.current = Date.now();\n  }, [announce, t]);\n\n  const scheduleFlush = useCallback(() => {\n    if (flushTimeoutRef.current) return;\n\n    const now = Date.now();\n    const elapsedSinceLastAnnouncement = now - lastAnnouncementTimestampRef.current;\n\n    if (elapsedSinceLastAnnouncement >= MESSAGE_ANNOUNCEMENT_THROTTLE_MS) {\n      flushPendingAnnouncements();\n      return;\n    }\n\n    flushTimeoutRef.current = setTimeout(() => {\n      flushTimeoutRef.current = undefined;\n      flushPendingAnnouncements();\n    }, MESSAGE_ANNOUNCEMENT_THROTTLE_MS - elapsedSinceLastAnnouncement);\n  }, [flushPendingAnnouncements]);\n\n  useEffect(\n    () => () => {\n      if (flushTimeoutRef.current) {\n        clearTimeout(flushTimeoutRef.current);\n      }\n    },\n    [],\n  );\n\n  useEffect(() => {\n    if (!channel) {\n      return;\n    }\n\n    const handleMessageNew = (event: Event) => {\n      const message = event.message;\n      if (!message) return;\n\n      if (\n        (event.cid && event.cid !== channel.cid) ||\n        !isAnnounceableIncomingMessage(message, ownUserId)\n      ) {\n        return;\n      }\n\n      const isReply = !!message.parent_id;\n      const belongsToActiveThread =\n        !!activeThreadId && message.parent_id === activeThreadId;\n      const shouldAnnounceInThreadList = threadList && belongsToActiveThread;\n      const shouldAnnounceInMainList = !threadList && !isReply;\n\n      if (!shouldAnnounceInThreadList && !shouldAnnounceInMainList) {\n        return;\n      }\n\n      if (announcedMessageIdsRef.current.has(message.id || '')) {\n        return;\n      }\n\n      if (message.id) {\n        if (announcedMessageIdsRef.current.size > 500) {\n          announcedMessageIdsRef.current.clear();\n        }\n        announcedMessageIdsRef.current.add(message.id);\n      }\n\n      pendingAnnouncementBatchRef.current.count += 1;\n      if (!pendingAnnouncementBatchRef.current.firstSender) {\n        pendingAnnouncementBatchRef.current.firstSender = getSenderName(message, t);\n      }\n\n      scheduleFlush();\n    };\n\n    const subscription = channel.on('message.new', handleMessageNew);\n\n    return () => {\n      subscription.unsubscribe();\n      if (flushTimeoutRef.current) {\n        clearTimeout(flushTimeoutRef.current);\n        flushTimeoutRef.current = undefined;\n      }\n    };\n  }, [activeThreadId, channel, ownUserId, scheduleFlush, t, threadList]);\n};\n","import { useEffect, useState } from 'react';\nimport type { ChannelState } from 'stream-chat';\n\nimport { useChannelStateContext } from '../../../context/ChannelStateContext';\nimport { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\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(): string | null {\n  const { t } = useTranslationContext();\n  const { client } = useChatContext();\n  const { channel, watcherCount = 0 } = useChannelStateContext();\n  const { member_count: memberCount = 0 } = channel?.data || {};\n\n  // todo: we need reactive state for watchers in LLC\n  const [watchers, setWatchers] = useState<ChannelState['watchers']>(() =>\n    Object.assign({}, channel?.state?.watchers ?? {}),\n  );\n\n  useEffect(() => {\n    if (!channel) return;\n    const subscription = channel.on('user.watching.start', (event) => {\n      setWatchers((prev) => {\n        if (!event.user?.id) return prev;\n        if (prev[event.user.id]) return prev;\n        return Object.assign({ [event.user.id]: event.user }, prev);\n      });\n    });\n    return () => subscription.unsubscribe();\n  }, [channel]);\n\n  if (!memberCount) return null;\n\n  const isDmChannel =\n    memberCount === 1 ||\n    (memberCount === 2 &&\n      Object.values(channel?.state?.members ?? {}).some(\n        ({ user }) => user?.id === client.user?.id,\n      ));\n\n  if (isDmChannel) {\n    const hasWatchers = Object.keys(watchers).length > 0;\n    return hasWatchers ? t('Online') : t('Offline');\n  }\n\n  return `${t('{{ memberCount }} members', { memberCount })}, ${t('{{ watcherCount }} online', { watcherCount })}`;\n}\n","import React from 'react';\n\nimport { type ChannelAvatarProps, ChannelAvatar as DefaultAvatar } from '../Avatar';\nimport { TypingIndicatorHeader } from '../TypingIndicator/TypingIndicatorHeader';\nimport { useChannelHeaderOnlineStatus } from './hooks/useChannelHeaderOnlineStatus';\nimport { useChannelPreviewInfo } from '../ChannelListItem/hooks/useChannelPreviewInfo';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { useTypingContext } from '../../context/TypingContext';\n\nconst ChannelHeaderSubtitle = () => {\n  const { channelConfig } = useChannelStateContext('ChannelHeaderSubtitle');\n  const { client } = useChatContext('ChannelHeaderSubtitle');\n  const { typing = {} } = useTypingContext('ChannelHeaderSubtitle');\n  const onlineStatusText = useChannelHeaderOnlineStatus();\n  const typingInChannel = Object.values(typing).filter(\n    ({ parent_id, user }) => user?.id !== client.user?.id && !parent_id,\n  );\n  const hasTyping = channelConfig?.typing_events !== false && typingInChannel.length > 0;\n\n  if (!hasTyping && !onlineStatusText) return null;\n\n  return (\n    <div className='str-chat__channel-header__data__subtitle'>\n      <span\n        className='str-chat__subtitle-content-transition'\n        key={hasTyping ? 'typing' : 'default'}\n      >\n        {hasTyping ? <TypingIndicatorHeader /> : onlineStatusText}\n      </span>\n    </div>\n  );\n};\n\nexport type ChannelHeaderProps = {\n  /** UI component to display an avatar, defaults to [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) component and accepts the same props as: [ChannelAvatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/ChannelAvatar.tsx) */\n  Avatar?: React.ComponentType<ChannelAvatarProps>;\n  /** Manually set the image to render, defaults to the Channel image */\n  image?: string;\n  /** Set title manually */\n  title?: string;\n};\n\n/**\n * The ChannelHeader component renders some basic information about a Channel.\n */\nexport const ChannelHeader = (props: ChannelHeaderProps) => {\n  const { Avatar = DefaultAvatar, image: overrideImage, title: overrideTitle } = props;\n\n  const { channel } = useChannelStateContext();\n  const { HeaderStartContent } = useComponentContext();\n  const { displayImage, displayTitle, groupChannelDisplayInfo } = useChannelPreviewInfo({\n    channel,\n    overrideImage,\n    overrideTitle,\n  });\n\n  return (\n    <div className='str-chat__channel-header'>\n      <div className='str-chat__channel-header__start'>\n        {HeaderStartContent && <HeaderStartContent />}\n      </div>\n      <div className='str-chat__channel-header__data'>\n        <div className='str-chat__channel-header__data__title'>{displayTitle}</div>\n        <ChannelHeaderSubtitle />\n      </div>\n      <div className='str-chat__channel-header__end'>\n        <Avatar\n          className='str-chat__avatar--channel-header'\n          displayMembers={groupChannelDisplayInfo?.members}\n          imageUrl={displayImage}\n          size='lg'\n          userName={displayTitle}\n        />\n      </div>\n    </div>\n  );\n};\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport React, { useEffect, useRef } from 'react';\n\n/**\n * `SkipNavigation` is an opt-in skip links helper for integrators and is not rendered by `Chat`.\n *\n * Intended integration:\n * - Render as the first keyboard-focusable element in your chat layout.\n * - Pass `targetIds` ordered by keyboard priority (for example message composer first).\n * - Each value must be a DOM id (without `#`) so links keep native hash navigation semantics.\n *\n * Activation behavior:\n * - Renders one link per target id.\n * - Keeps native hash-link behavior via `href=\"#{targetId}\"`.\n * - Programmatically moves focus to each target element for reliable keyboard navigation.\n * - If the target is not naturally focusable, temporarily applies `tabindex=\"-1\"` and\n *   removes it on blur.\n *\n * The caller can intercept activation by passing `onClick` and calling `event.preventDefault()`.\n *\n * @example\n * ```tsx\n * <SkipNavigation\n *   getLinkLabel={(targetId) =>\n *     targetId === 'my-message-composer-textarea'\n *       ? 'Skip to message composer'\n *       : 'Skip to channel messages'\n *   }\n *   targetIds={['my-message-composer-textarea', 'my-channel-root']}\n * />\n * ```\n */\nexport type SkipNavigationProps = Omit<ComponentPropsWithoutRef<'a'>, 'href'> & {\n  /** Optional per-link label generator. Defaults to `Skip to {targetId}`. */\n  getLinkLabel?: (targetId: string, index: number) => ReactNode;\n  /** Ordered DOM ids of elements that should receive focus when links are activated. */\n  targetIds: string[];\n};\n\nconst normalizeTargetId = (targetId: string) =>\n  targetId.startsWith('#') ? targetId.slice(1) : targetId;\nconst isActivationKey = (event: React.KeyboardEvent<HTMLAnchorElement>) =>\n  event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar';\n\ntype FocusCleanupState = {\n  cleanup: () => void;\n  hasTemporaryTabIndex: boolean;\n};\n\nconst focusTargetElement = (\n  targetId: string,\n  focusCleanupRegistry: React.MutableRefObject<Map<HTMLElement, FocusCleanupState>>,\n) => {\n  const targetElement = document.getElementById(targetId);\n  if (!targetElement) return;\n\n  const hasTabIndexAttribute = targetElement.hasAttribute('tabindex');\n  if (!hasTabIndexAttribute) {\n    targetElement.setAttribute('tabindex', '-1');\n  }\n\n  targetElement.focus();\n\n  if (!hasTabIndexAttribute) {\n    const existingFocusCleanup = focusCleanupRegistry.current.get(targetElement);\n    if (existingFocusCleanup) {\n      existingFocusCleanup.cleanup();\n    }\n\n    const handleBlur = () => {\n      targetElement.removeAttribute('tabindex');\n      focusCleanupRegistry.current.delete(targetElement);\n    };\n\n    targetElement.addEventListener('blur', handleBlur, { once: true });\n\n    focusCleanupRegistry.current.set(targetElement, {\n      cleanup: () => targetElement.removeEventListener('blur', handleBlur),\n      hasTemporaryTabIndex: true,\n    });\n  }\n};\n\nexport const SkipNavigation = ({\n  className,\n  getLinkLabel,\n  onClick,\n  onKeyDown,\n  targetIds,\n  ...anchorProps\n}: SkipNavigationProps) => {\n  const focusCleanupRegistry = useRef<Map<HTMLElement, FocusCleanupState>>(new Map());\n\n  useEffect(\n    () => () => {\n      focusCleanupRegistry.current.forEach(\n        ({ cleanup, hasTemporaryTabIndex }, targetElement) => {\n          cleanup();\n          if (hasTemporaryTabIndex && targetElement.getAttribute('tabindex') === '-1') {\n            targetElement.removeAttribute('tabindex');\n          }\n        },\n      );\n\n      focusCleanupRegistry.current.clear();\n    },\n    [],\n  );\n\n  if (!targetIds.length) return null;\n\n  const handleClick = (event: React.MouseEvent<HTMLAnchorElement>, targetId: string) => {\n    onClick?.(event);\n    if (event.defaultPrevented) return;\n\n    // Move keyboard focus to the target element and keep hash-link fallback behavior.\n    focusTargetElement(targetId, focusCleanupRegistry);\n  };\n  const handleKeyDown = (\n    event: React.KeyboardEvent<HTMLAnchorElement>,\n    targetId: string,\n  ) => {\n    onKeyDown?.(event);\n    if (event.defaultPrevented || !isActivationKey(event)) return;\n\n    event.preventDefault();\n    focusTargetElement(targetId, focusCleanupRegistry);\n  };\n\n  return (\n    <>\n      {targetIds.map((targetId, index) => {\n        const normalizedTargetId = normalizeTargetId(targetId);\n        const linkLabel =\n          getLinkLabel?.(normalizedTargetId, index) ?? `Skip to ${normalizedTargetId}`;\n\n        return (\n          <a\n            {...anchorProps}\n            className={['str-chat__skip-navigation-link', className]\n              .filter(Boolean)\n              .join(' ')}\n            href={`#${normalizedTargetId}`}\n            key={`${normalizedTargetId}-${index}`}\n            onClick={(event) => handleClick(event, normalizedTargetId)}\n            onKeyDown={(event) => handleKeyDown(event, normalizedTargetId)}\n          >\n            {linkLabel}\n          </a>\n        );\n      })}\n    </>\n  );\n};\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { TranslationContextValue } from '../../../context/TranslationContext';\nimport type { SupportedTranslations } from '../../../i18n';\nimport {\n  defaultDateTimeParser,\n  defaultTranslatorFunction,\n  isLanguageSupported,\n  Streami18n,\n} from '../../../i18n';\n\nimport type {\n  AppSettingsAPIResponse,\n  Channel,\n  Event,\n  Mute,\n  OwnUserResponse,\n  StreamChat,\n} from 'stream-chat';\n\nexport type UseChatParams = {\n  client: StreamChat;\n  defaultLanguage?: SupportedTranslations;\n  i18nInstance?: Streami18n;\n};\n\nexport const useChat = ({\n  client,\n  defaultLanguage = 'en',\n  i18nInstance,\n}: UseChatParams) => {\n  const [translators, setTranslators] = useState<TranslationContextValue>({\n    t: defaultTranslatorFunction,\n    tDateTimeParser: defaultDateTimeParser,\n    userLanguage: 'en',\n  });\n\n  const [channel, setChannel] = useState<Channel>();\n  const [mutes, setMutes] = useState<Array<Mute>>([]);\n  const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = useState({});\n\n  const clientMutes = (client.user as OwnUserResponse)?.mutes ?? [];\n\n  const appSettings = useRef<Promise<AppSettingsAPIResponse> | null>(null);\n\n  const getAppSettings = () => {\n    if (appSettings.current) {\n      return appSettings.current;\n    }\n    appSettings.current = client.getAppSettings();\n    return appSettings.current;\n  };\n\n  useEffect(() => {\n    if (!client) return;\n\n    const version = process.env.STREAM_CHAT_REACT_VERSION;\n\n    const userAgent = client.getUserAgent();\n    if (!userAgent.includes('stream-chat-react')) {\n      // result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'\n      // the upper-case text between double underscores is replaced with the actual semantic version of the library\n      client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);\n    }\n\n    client.threads.registerSubscriptions();\n    client.polls.registerSubscriptions();\n    client.reminders.registerSubscriptions();\n    client.reminders.initTimers();\n\n    return () => {\n      client.threads.unregisterSubscriptions();\n      client.polls.unregisterSubscriptions();\n      client.reminders.unregisterSubscriptions();\n      client.reminders.clearTimers();\n    };\n  }, [client]);\n\n  useEffect(() => {\n    setMutes(clientMutes);\n\n    const handleEvent = (event: Event) => {\n      setMutes(event.me?.mutes || []);\n    };\n\n    client.on('notification.mutes_updated', handleEvent);\n    return () => client.off('notification.mutes_updated', handleEvent);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [clientMutes?.length]);\n\n  useEffect(() => {\n    let userLanguage = client.user?.language;\n\n    if (!userLanguage) {\n      const browserLanguage = window.navigator.language.slice(0, 2); // just get language code, not country-specific version\n      userLanguage = isLanguageSupported(browserLanguage)\n        ? browserLanguage\n        : defaultLanguage;\n    }\n\n    const streami18n = i18nInstance || new Streami18n({ language: userLanguage });\n\n    streami18n.registerSetLanguageCallback((t) =>\n      setTranslators((prevTranslator) => ({ ...prevTranslator, t })),\n    );\n\n    streami18n.getTranslators().then((translator) => {\n      setTranslators({\n        ...translator,\n        userLanguage: userLanguage || defaultLanguage,\n      });\n    });\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [i18nInstance]);\n\n  const setActiveChannel = useCallback(\n    async (\n      activeChannel?: Channel,\n      watchers: { limit?: number; offset?: number } = {},\n      event?: React.BaseSyntheticEvent,\n    ) => {\n      if (event && event.preventDefault) event.preventDefault();\n\n      if (activeChannel && Object.keys(watchers).length) {\n        await activeChannel.query({ watch: true, watchers });\n      }\n\n      setChannel(activeChannel);\n    },\n    [],\n  );\n\n  useEffect(() => {\n    setLatestMessageDatesByChannels({});\n  }, [client.user?.id]);\n\n  return {\n    channel,\n    getAppSettings,\n    latestMessageDatesByChannels,\n    mutes,\n    setActiveChannel,\n    translators,\n  };\n};\n","import { useEffect, useRef } from 'react';\n\nimport { useChatContext } from '../../../context/ChatContext';\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { useNotificationApi } from '../../Notifications/hooks/useNotificationApi';\n\n/**\n * Publishes a persistent system notification while the client is offline and removes it when\n * back online. Must run under `ChatProvider` and `TranslationProvider` (e.g. from a child of `<Chat>`).\n */\nexport const useReportLostConnectionSystemNotification = () => {\n  const { t } = useTranslationContext();\n  const { client } = useChatContext();\n  const { addSystemNotification, removeNotification } = useNotificationApi();\n  const connectionLostNotificationIdRef = useRef<string | null>(null);\n\n  useEffect(() => {\n    if (!t || !client) return;\n\n    const dismissConnectionLostNotification = () => {\n      if (!connectionLostNotificationIdRef.current) return;\n      removeNotification(connectionLostNotificationIdRef.current);\n      connectionLostNotificationIdRef.current = null;\n    };\n\n    const handleConnectionChanged = ({ online }: { online?: boolean }) => {\n      if (!online) {\n        if (connectionLostNotificationIdRef.current) return;\n\n        connectionLostNotificationIdRef.current = addSystemNotification({\n          duration: 0,\n          emitter: 'Chat',\n          message: t('Waiting for network…'),\n          severity: 'loading',\n          type: 'system:network:connection:lost',\n        });\n        return;\n      }\n\n      dismissConnectionLostNotification();\n    };\n\n    client.on('connection.changed', handleConnectionChanged);\n\n    return () => {\n      client.off('connection.changed', handleConnectionChanged);\n      dismissConnectionLostNotification();\n    };\n  }, [addSystemNotification, client, removeNotification, t]);\n};\n","import { useMemo } from 'react';\n\nimport type { ChatContextValue } from '../../../context/ChatContext';\n\nexport const useCreateChatContext = (value: ChatContextValue) => {\n  const {\n    channel,\n    channelsQueryState,\n    client,\n    customClasses,\n    getAppSettings,\n    isMessageAIGenerated,\n    latestMessageDatesByChannels,\n    mutes,\n    searchController,\n    setActiveChannel,\n    theme,\n    useImageFlagEmojisOnWindows,\n  } = value;\n\n  const channelCid = channel?.cid;\n  const channelsQueryError = channelsQueryState.error;\n  const channelsQueryInProgress = channelsQueryState.queryInProgress;\n  const clientValues = `${client.clientID}${Object.keys(client.activeChannels).length}${\n    Object.keys(client.listeners).length\n  }${client.mutedChannels.length}\n  ${client.user?.id}`;\n  const mutedUsersLength = mutes.length;\n\n  const chatContext: ChatContextValue = useMemo(\n    () => ({\n      channel,\n      channelsQueryState,\n      client,\n      customClasses,\n      getAppSettings,\n      isMessageAIGenerated,\n      latestMessageDatesByChannels,\n      mutes,\n      searchController,\n      setActiveChannel,\n      theme,\n      useImageFlagEmojisOnWindows,\n    }),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      channelCid,\n      channelsQueryError,\n      channelsQueryInProgress,\n      clientValues,\n      getAppSettings,\n      searchController,\n      mutedUsersLength,\n      isMessageAIGenerated,\n    ],\n  );\n\n  return chatContext;\n};\n","import type { Dispatch, SetStateAction } from 'react';\nimport { useState } from 'react';\nimport type { APIErrorResponse, ErrorFromResponse } from 'stream-chat';\n\ntype ChannelQueryState =\n  | 'uninitialized' // the initial state before the first channels query is triggered\n  | 'reload' // the initial channels query (loading the first page) is in progress\n  | 'load-more' // loading the next page of channels\n  | null; // at least one channels page has been loaded and there is no query in progress at the moment\n\nexport interface ChannelsQueryState {\n  error: ErrorFromResponse<APIErrorResponse> | null;\n  queryInProgress: ChannelQueryState;\n  setError: Dispatch<SetStateAction<ErrorFromResponse<APIErrorResponse> | null>>;\n  setQueryInProgress: Dispatch<SetStateAction<ChannelQueryState>>;\n}\n\nexport const useChannelsQueryState = (): ChannelsQueryState => {\n  const [error, setError] = useState<ErrorFromResponse<APIErrorResponse> | null>(null);\n  const [queryInProgress, setQueryInProgress] =\n    useState<ChannelQueryState>('uninitialized');\n\n  return {\n    error,\n    queryInProgress,\n    setError,\n    setQueryInProgress,\n  };\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useMemo } from 'react';\nimport type { StreamChat } from 'stream-chat';\nimport {\n  ChannelSearchSource,\n  MessageSearchSource,\n  SearchController,\n  UserSearchSource,\n} from 'stream-chat';\n\nimport { NotificationAnnouncer as DefaultNotificationAnnouncer } from '../Accessibility';\nimport { useChat } from './hooks/useChat';\nimport { useReportLostConnectionSystemNotification } from './hooks/useReportLostConnectionSystemNotification';\nimport { useCreateChatContext } from './hooks/useCreateChatContext';\nimport { useChannelsQueryState } from './hooks/useChannelsQueryState';\nimport type { CustomClasses } from '../../context/ChatContext';\nimport { ChatProvider } from '../../context/ChatContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { TranslationProvider } from '../../context/TranslationContext';\nimport { type MessageContextValue, ModalDialogManagerProvider } from '../../context';\nimport type { SupportedTranslations } from '../../i18n/types';\nimport type { Streami18n } from '../../i18n/Streami18n';\n\nconst NetworkConnectionNotificationReporter = () => {\n  useReportLostConnectionSystemNotification();\n  return null;\n};\n\nexport type ChatProps = {\n  /** The StreamChat client object */\n  client: StreamChat;\n  /** Object containing custom CSS classnames to override the library's default container CSS */\n  customClasses?: CustomClasses;\n  /** Sets the default fallback language for UI component translation, defaults to 'en' for English */\n  defaultLanguage?: SupportedTranslations;\n  /** Instance of Stream i18n */\n  i18nInstance?: Streami18n;\n  /** Instance of SearchController class that allows to control all the search operations. */\n  searchController?: SearchController;\n  /** Used for injecting className/s to the Channel and ChannelList components */\n  theme?: string;\n  /**\n   * Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream\n   * Chat can override this behavior by loading a custom web font that will render images instead (PNGs or SVGs depending on the platform).\n   * Set this prop to true if you want to use these custom emojis for Windows users.\n   *\n   * Note: requires importing `stream-chat-react/css/v2/emoji-replacement.css` style sheet\n   */\n  useImageFlagEmojisOnWindows?: boolean;\n} & Partial<Pick<MessageContextValue, 'isMessageAIGenerated'>>;\n\n/**\n * Wrapper component for a StreamChat application. Chat needs to be placed around any other chat components\n * as it provides the ChatContext.\n */\nexport const Chat = (props: PropsWithChildren<ChatProps>) => {\n  const {\n    children,\n    client,\n    customClasses,\n    defaultLanguage,\n    i18nInstance,\n    isMessageAIGenerated,\n    searchController: customChannelSearchController,\n    theme = 'messaging light',\n    useImageFlagEmojisOnWindows = false,\n  } = props;\n\n  const {\n    channel,\n    getAppSettings,\n    latestMessageDatesByChannels,\n    mutes,\n    setActiveChannel,\n    translators,\n  } = useChat({\n    client,\n    defaultLanguage,\n    i18nInstance,\n  });\n\n  const channelsQueryState = useChannelsQueryState();\n\n  const searchController = useMemo(\n    () =>\n      customChannelSearchController ??\n      new SearchController({\n        sources: [\n          new ChannelSearchSource(client),\n          new UserSearchSource(client),\n          new MessageSearchSource(client),\n        ],\n      }),\n    [client, customChannelSearchController],\n  );\n\n  const chatContextValue = useCreateChatContext({\n    channel,\n    channelsQueryState,\n    client,\n    customClasses,\n    getAppSettings,\n    isMessageAIGenerated,\n    latestMessageDatesByChannels,\n    mutes,\n    searchController,\n    setActiveChannel,\n    theme,\n    useImageFlagEmojisOnWindows,\n  });\n  const { NotificationAnnouncer = DefaultNotificationAnnouncer } = useComponentContext();\n\n  if (!translators.t) return null;\n\n  return (\n    <ChatProvider value={chatContextValue}>\n      <TranslationProvider value={translators}>\n        <ModalDialogManagerProvider>\n          <NetworkConnectionNotificationReporter />\n          <NotificationAnnouncer />\n          {children}\n        </ModalDialogManagerProvider>\n      </TranslationProvider>\n    </ChatProvider>\n  );\n};\n","import { useEffect, useState } from 'react';\n\nimport { StreamChat } from 'stream-chat';\n\nimport type {\n  OwnUserResponse,\n  StreamChatOptions,\n  TokenOrProvider,\n  UserResponse,\n} from 'stream-chat';\n\n/**\n * React hook to create, connect and return `StreamChat` client.\n */\nexport const useCreateChatClient = ({\n  apiKey,\n  options,\n  tokenOrProvider,\n  userData,\n}: {\n  apiKey: string;\n  tokenOrProvider: TokenOrProvider;\n  userData: OwnUserResponse | UserResponse;\n  options?: StreamChatOptions;\n}) => {\n  const [chatClient, setChatClient] = useState<StreamChat | null>(null);\n  const [cachedUserData, setCachedUserData] = useState(userData);\n\n  if (userData.id !== cachedUserData.id) {\n    setCachedUserData(userData);\n  }\n\n  const [cachedOptions] = useState(options);\n\n  useEffect(() => {\n    const client = new StreamChat(apiKey, undefined, cachedOptions);\n    let didUserConnectInterrupt = false;\n\n    const connectionPromise = client\n      .connectUser(cachedUserData, tokenOrProvider)\n      .then(() => {\n        if (!didUserConnectInterrupt) setChatClient(client);\n      });\n\n    return () => {\n      didUserConnectInterrupt = true;\n      setChatClient(null);\n      connectionPromise\n        .then(() => client.disconnectUser())\n        .then(() => {\n          console.log(`Connection for user \"${cachedUserData.id}\" has been closed`);\n        });\n    };\n  }, [apiKey, cachedUserData, cachedOptions, tokenOrProvider]);\n\n  return chatClient;\n};\n","import type { PropsWithChildren } from 'react';\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport type { LocalMessage } from 'stream-chat';\nimport { useChannelStateContext } from '../../context/ChannelStateContext';\n\nexport type WindowProps = {\n  /** optional prop to force addition of class str-chat__main-panel---with-thread-opn to the Window root element */\n  thread?: LocalMessage;\n};\n\nconst UnMemoizedWindow = (props: PropsWithChildren<WindowProps>) => {\n  const { children, thread: propThread } = props;\n\n  const { thread: contextThread } = useChannelStateContext('Window');\n\n  return (\n    <div\n      className={clsx('str-chat__main-panel', {\n        'str-chat__main-panel--thread-open': contextThread || propThread,\n      })}\n    >\n      {children}\n    </div>\n  );\n};\n\n/**\n * A UI component for conditionally displaying a Thread or Channel\n */\nexport const Window = React.memo(UnMemoizedWindow) as typeof UnMemoizedWindow;\n"],"names":["id","dialogId","selector","notifications","this","e","n","t","o","u","a","r","i","d","s","h","c","f","m","topic","require$$0","_","TranslationTopic","LoadingIndicator","DefaultLoadingIndicator","DefaultProgressIndicator","FileSizeIndicator","DefaultFileSizeIndicator","message","text","Header","Component","Avatar","DefaultAvatar","ContextMenuRoot","menuClassName","Item","MessageBouncePrompt","AvatarStack","DefaultAvatarStack","transform","visitor","remarkPlugins","renderText","defaultRenderText","calendar","Timestamp","DefaultTimestamp","FileArchiveIcon","FileCodeIcon","FileExcelIcon","FilePdfIcon","FilePowerPointIcon","FileWordIcon","FileAudioIcon","FileVideoIcon","fileIconSet.FileFallbackIcon","duration","SUPPORTED_VIDEO_FORMATS","rootClassName","audioPlayerStateSelector","BaseImage","DefaultImagePlaceholder","MessageTimestamp","DefaultMessageTimestamp","GalleryUI","DefaultGalleryUI","DefaultBaseImage","Gallery","DefaultGallery","ModalGallery","DefaultModalGallery","VideoPlayer","DefaultVideoPlayer","AttachmentActions","DefaultAttachmentActions","Card","DefaultCard","Giphy","DefaultGiphy","attachment","Image","DefaultImage","File","DefaultFile","Audio","DefaultAudioAttachment","VoiceRecording","DefaultVoiceRecording","Geolocation","DefaultGeolocation","UnsupportedAttachment","DefaultUnsupportedAttachment","stateSelector","attachmentManagerStateSelector","pollComposerStateSelector","locationComposerStateSelector","MessageComposer","attachmentManagerConfigStateSelector","FileInput","UploadFileInput","RecordingPermission","logError","MediaRecordingState","RecordingAttachmentType","recording","messageComposerStateSelector","editingAuditStateStateSelector","AttachmentIcon","PreviewImage","renderedText","pollStateSelector","NumericInput","TextInput","paginationStateSelector","votes","mousewheelListener","AddCommentPrompt","DefaultAddCommentPrompt","EndPollAlert","DefaultEndPollAlert","PollAnswerList","DefaultPollAnswerList","PollResults","DefaultPollResults","DefaultSuggestPollOptionForm","PollOptionsFullList","DefaultPollOptionsFullList","PollOptionSelector","DefaultPollOptionSelector","PollActions","DefaultPollActions","PollHeader","DefaultPollHeader","PollContent","DefaultPollContent","AttachmentSelectorButton","PollCreationDialog","DefaultPollCreationDialog","ShareLocationDialog","DefaultLocationDialog","UploadedSizeIndicator","DefaultUploadedSizeIndicator","AudioAttachmentPreview","DefaultFileAttachmentPreview","FileAttachmentPreview","UnsupportedAttachmentPreview","DefaultUnknownAttachmentPreview","linkPreviewsManagerStateSelector","RecordingPermissionDeniedNotification","DefaultRecordingPermissionDeniedNotification","StartRecordingAudioButton","isRecording","textComposerStateSelector","searchSourceStateSelector","defaultComponents","DefaultSuggestionListItem","DefaultSuggestionList","CooldownTimer","DefaultCooldownTimer","SendButton","StopAIGenerationButton","DefaultStopAIGenerationButton","DefaultSendButton","AttachmentPreviewList","DefaultAttachmentPreviewList","EditedMessagePreview","DefaultEditedMessagePreview","LinkPreviewList","DefaultLinkPreviewList","QuotedMessagePreview","DefaultQuotedMessagePreview","VoiceRecordingPreviewSlot","DefaultVoiceRecordingPreviewSlot","AdditionalMessageComposerActions","DefaultAdditionalMessageComposerActions","AttachmentSelector","DefaultAttachmentSelector","AudioRecorder","DefaultAudioRecorder","CommandChip","DefaultCommandChip","SendToChannelCheckbox","DefaultSendToChannelCheckbox","TextareaComposer","DefaultTextareaComposer","MessageComposerUI","DefaultMessageComposerUI","threadStateSelector","ThreadStart","DefaultThreadStart","ThreadHead","DefaultThreadHead","ThreadHeader","DefaultThreadHeader","ReactionSelectorExtendedList","reactions","MessageReactionsDetail","DefaultMessageReactionsDetail","ReactionSelector","DefaultReactionSelector","getErrorMessage","getNotificationError","filename","Attachment","DefaultAttachment","MessageActions","DefaultMessageActions","MessageAlsoSentInChannelIndicator","DefaultMessageAlsoSentInChannelIndicator","MessageBlocked","DefaultMessageBlocked","DefaultMessageBouncePrompt","MessageDeletedBubble","DefaultMessageDeletedBubble","MessageEditedIndicator","DefaultMessageEditedIndicator","MessageReactions","DefaultMessageReactions","MessageRepliesCountButton","DefaultMessageRepliesCountButton","MessageStatus","DefaultMessageStatus","MessageTranslationIndicator","DefaultMessageTranslationIndicator","PinIndicator","DefaultPinIndicator","QuotedMessage","DefaultQuotedMessage","ReminderNotification","DefaultReminderNotification","StreamedMessageText","DefaultStreamedMessageText","DefaultMessageUI","observedTarget","DateSeparator","DefaultDateSeparator","DefaultMessageSystem","UnreadMessagesSeparator","DefaultUnreadMessagesSeparator","Fragment","EmptyStateIndicator","DefaultEmptyStateIndicator","MessageListMainPanel","DefaultMessageListMainPanel","NewMessageNotification","DefaultNewMessageNotification","NotificationList","DefaultNotificationList","ScrollToLatestMessageButton","DefaultScrollToLatestMessageButton","TypingIndicator","DefaultTypingIndicator","UnreadMessagesNotification","DefaultUnreadMessagesNotification","GiphyPreviewMessage","DefaultGiphyPreviewMessage","computeItemKey","numItemsPrepended","processedMessages","searchControllerStateSelector","error","getLatestMessagePreview","SearchSourceResultsLoadingIndicator","DefaultSearchSourceResultsLoadingIndicator","SearchSourceResultListFooter","DefaultSearchSourceResultListFooter","SearchSourceResultList","DefaultSearchSourceResultList","SearchSourceResultsEmpty","DefaultSearchSourceResultsEmpty","SearchSourceResultsHeader","DefaultSearchSourceResultsHeader","SearchResultsHeader","DefaultSearchResultsHeader","SearchResultsPresearch","DefaultSearchResultsPresearch","SearchSourceResults","DefaultSourceSearchResults","SearchBar","DefaultSearchBar","SearchResults","DefaultSearchResults","LoadMoreButton","DefaultLoadMoreButton","ChannelListUI","DefaultChannelListUI","Search","DefaultSearch","channels","setChannels","channel","useSyncExternalStore","keys","DefaultChannelAvatar","ChannelListItemActionButtons","DefaultChannelListItemActionButtons","MessageDeliveryStatus","defaultGetLatestMessagePreview","ChannelListItemUI","DefaultChannelListItemUI","ThreadListItemUI","DefaultThreadListItemUI","ThreadListEmptyPlaceholder","DefaultThreadListEmptyPlaceholder","ThreadListItem","DefaultThreadListItem","ThreadListLoadingIndicator","DefaultThreadListLoadingIndicator","ThreadListUnseenThreadsBanner","DefaultThreadListUnseenThreadsBanner","DefaultNotification","notification","NotificationAnnouncer","DefaultNotificationAnnouncer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AACZ;AAOO,MAAM,aAAa,CAAC,YAA4C;AACrE,QAAM,CAAC,SAAS,UAAU,IAAI,SAAkB,SAAS,IAAI;AAE7D,YAAU,MAAM;AACd,QAAI,CAAC,SAAS;AACZ;AAAA,IACF;AAEA,UAAM,2BAA2B,QAAQ,GAAG,uBAAuB,CAAC,UAAiB;AACnF,YAAM,EAAE,QAAQ;AAChB,YAAM,QAAQ,MAAM;AACpB,UAAI,QAAQ,QAAQ,KAAK;AACvB,mBAAW,KAAK;AAAA,MAClB;AAAA,IACF,CAAC;AAED,UAAM,2BAA2B,QAAQ,GAAG,sBAAsB,CAAC,UAAU;AAC3E,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