'use strict';

var _tslib = require('../../chunks/bundle-5ru_FO5x.js');
var React = require('react');
var useSendbirdStateContext = require('../../useSendbirdStateContext.js');
var Channel_context = require('../context.js');
var index = require('../../chunks/bundle-Ce6jCnmC.js');
var utils = require('../../chunks/bundle-Bi2wvpu_.js');
var MessageView = require('../../chunks/bundle-asVjYr1M.js');
var Channel_components_FileViewer = require('./FileViewer.js');
var Channel_components_RemoveMessageModal = require('./RemoveMessageModal.js');
require('../../withSendbird.js');
require('../../chunks/bundle-Cgk-lpZZ.js');
require('../../chunks/bundle-DrCmmE89.js');
require('../../chunks/bundle-CGX-vhe9.js');
require('../../chunks/bundle-De62SpYH.js');
require('../../chunks/bundle-V-_XUHW5.js');
require('@sendbird/chat/message');
require('../../chunks/bundle-BFtlkbFV.js');
require('../../chunks/bundle-CIO_k2aH.js');
require('../../chunks/bundle-C0PM57R_.js');
require('../../chunks/bundle-D0Tt_yWl.js');
require('../../chunks/bundle-MDcnM2N1.js');
require('@sendbird/chat/groupChannel');
require('../../chunks/bundle-slS7A2f9.js');
require('../../chunks/bundle-Ca2tfuK5.js');
require('../../chunks/bundle-BedaAirg.js');
require('../../chunks/bundle-Dv4YKtdL.js');
require('../../chunks/bundle-ghdvllVc.js');
require('../../chunks/bundle-D1GC3Mlw.js');
require('../../utils/message/getOutgoingMessageState.js');
require('../../chunks/bundle-BLV9zZk1.js');
require('../../chunks/bundle-Ck_8lQa-.js');
require('../../chunks/bundle-MOn9SqMU.js');
require('../../Message/hooks/useDirtyGetMentions.js');
require('../../ui/DateSeparator.js');
require('../../chunks/bundle-xUIqwbO0.js');
require('../../chunks/bundle-DCPc6-Im.js');
require('../../ui/MessageInput.js');
require('../../chunks/bundle-DrV1GooU.js');
require('../../ui/IconButton.js');
require('../../ui/Button.js');
require('../../chunks/bundle-D0hE0g6d.js');
require('dompurify');
require('../../chunks/bundle-B20ESzEn.js');
require('../../chunks/bundle-9ogjIkrJ.js');
require('../../chunks/bundle-B3qxP7Hx.js');
require('../../ui/Icon.js');
require('../../chunks/bundle-Cd8aIDXf.js');
require('../../chunks/bundle-lBIlhpy4.js');
require('../../ui/MessageContent.js');
require('../../chunks/bundle-DDwAQ_Z-.js');
require('../../ui/Loader.js');
require('../../chunks/bundle-CMTxpe5r.js');
require('../../chunks/bundle-Cf4R8HbK.js');
require('../../ui/MessageItemMenu.js');
require('../../ui/ContextMenu.js');
require('react-dom');
require('@sendbird/chat');
require('@sendbird/chat/openChannel');
require('../../ui/SortByRow.js');
require('../../chunks/bundle-Bm-ZyNnL.js');
require('../../ui/MessageItemReactionMenu.js');
require('../../ui/ImageRenderer.js');
require('../../ui/ReactionButton.js');
require('../../chunks/bundle-Bzoa2z57.js');
require('../../chunks/bundle-DqTUSoNi.js');
require('../../ui/EmojiReactions.js');
require('../../ui/ReactionBadge.js');
require('../../ui/BottomSheet.js');
require('../../hooks/useModal.js');
require('../../chunks/bundle-CHERnV8x.js');
require('../../ui/UserListItem.js');
require('../../chunks/bundle-BFWd_LLn.js');
require('../../chunks/bundle-Bvh9LUfE.js');
require('../../ui/MutedAvatarOverlay.js');
require('../../ui/Checkbox.js');
require('../../ui/UserProfile.js');
require('../../sendbirdSelectors.js');
require('../../ui/Tooltip.js');
require('../../ui/TooltipWrapper.js');
require('../../Message/context.js');
require('../../ui/AdminMessage.js');
require('../../ui/QuoteMessage.js');
require('../../chunks/bundle-DqRKg94l.js');
require('../../chunks/bundle-BOisWxx6.js');
require('../../ui/ThreadReplies.js');
require('../../ui/OGMessageItemBody.js');
require('../../chunks/bundle-B2jW5UwW.js');
require('../../ui/MentionLabel.js');
require('../../ui/LinkLabel.js');
require('../../ui/TextMessageItemBody.js');
require('../../ui/FileMessageItemBody.js');
require('../../ui/TextButton.js');
require('../../chunks/bundle-BrG6R1ys.js');
require('../../chunks/bundle-CGDy7a1C.js');
require('../../chunks/bundle-OAOzXmfa.js');
require('@sendbird/uikit-tools');
require('../../ui/VoiceMessageItemBody.js');
require('../../ui/ProgressBar.js');
require('../../VoicePlayer/useVoicePlayer.js');
require('../../chunks/bundle-BMU1Zuos.js');
require('../../VoiceRecorder/context.js');
require('../../ui/PlaybackTime.js');
require('../../ui/ThumbnailMessageItemBody.js');
require('../../ui/UnknownMessageItemBody.js');
require('../../ui/TemplateMessageItemBody.js');
require('../../chunks/bundle-CRIqKUCJ.js');
require('../../ui/FallbackTemplateMessageItemBody.tsx.js');
require('../../ui/LoadingTemplateMessageItemBody.tsx.js');
require('../../ui/FeedbackIconButton.js');
require('../../ui/MobileFeedbackMenu.js');
require('../../ui/MessageFeedbackModal.js');
require('../../ui/Input.js');
require('../../ui/MessageFeedbackFailedModal.js');
require('../../GroupChannel/components/SuggestedReplies.js');
require('../../chunks/bundle-DrPY0rWx.js');
require('../../chunks/bundle-iCZhCxHm.js');
require('../../chunks/bundle-BaxkaZ7Q.js');
require('../../chunks/bundle-DHHo4V-U.js');

var Message = function (props) {
    var _a, _b, _c;
    var config = useSendbirdStateContext.useSendbirdStateContext().config;
    var _d = Channel_context.useChannelContext(), initialized = _d.initialized, currentGroupChannel = _d.currentGroupChannel, animatedMessageId = _d.animatedMessageId, setAnimatedMessageId = _d.setAnimatedMessageId, updateMessage = _d.updateMessage, scrollToMessage = _d.scrollToMessage, replyType = _d.replyType, threadReplySelectType = _d.threadReplySelectType, isReactionEnabled = _d.isReactionEnabled, toggleReaction = _d.toggleReaction, emojiContainer = _d.emojiContainer, nicknamesMap = _d.nicknamesMap, setQuoteMessage = _d.setQuoteMessage, resendMessage = _d.resendMessage, deleteMessage = _d.deleteMessage, renderUserMentionItem = _d.renderUserMentionItem, onReplyInThread = _d.onReplyInThread, onQuoteMessageClick = _d.onQuoteMessageClick, onMessageAnimated = _d.onMessageAnimated, sendMessage = _d.sendMessage, localMessages = _d.localMessages;
    var message = props.message;
    return (React.createElement(MessageView.MessageView, _tslib.__assign({}, props, { channel: currentGroupChannel, emojiContainer: emojiContainer, editInputDisabled: !initialized || utils.isDisabledBecauseFrozen(currentGroupChannel) || utils.isDisabledBecauseMuted(currentGroupChannel) || !config.isOnline, shouldRenderSuggestedReplies: ((_a = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _a === void 0 ? void 0 : _a.enableSuggestedReplies)
            && (((_b = config === null || config === void 0 ? void 0 : config.groupChannel) === null || _b === void 0 ? void 0 : _b.showSuggestedRepliesFor) === 'all_messages'
                ? true
                : message.messageId === ((_c = currentGroupChannel === null || currentGroupChannel === void 0 ? void 0 : currentGroupChannel.lastMessage) === null || _c === void 0 ? void 0 : _c.messageId))
            // the options should appear only when there's no failed or pending messages
            && (localMessages === null || localMessages === void 0 ? void 0 : localMessages.length) === 0
            && index.getSuggestedReplies(message).length > 0, isReactionEnabled: isReactionEnabled, replyType: replyType, threadReplySelectType: threadReplySelectType, nicknamesMap: nicknamesMap, renderUserMentionItem: renderUserMentionItem, scrollToMessage: scrollToMessage, toggleReaction: toggleReaction, setQuoteMessage: setQuoteMessage, onQuoteMessageClick: onQuoteMessageClick, onReplyInThreadClick: onReplyInThread, sendUserMessage: function (params) {
            sendMessage({
                message: params.message,
                mentionedUsers: params.mentionedUsers,
                mentionTemplate: params.mentionedMessageTemplate,
            });
        }, updateUserMessage: function (messageId, params) {
            updateMessage({
                messageId: messageId,
                message: params.message,
                mentionedUsers: params.mentionedUsers,
                mentionTemplate: params.mentionedMessageTemplate,
            });
        }, resendMessage: resendMessage, deleteMessage: deleteMessage, animatedMessageId: animatedMessageId, setAnimatedMessageId: setAnimatedMessageId, onMessageAnimated: onMessageAnimated, renderFileViewer: function (props) { return React.createElement(Channel_components_FileViewer.FileViewer, _tslib.__assign({}, props)); }, renderRemoveMessageModal: function (props) { return React.createElement(Channel_components_RemoveMessageModal, _tslib.__assign({}, props)); } })));
};

module.exports = Message;
//# sourceMappingURL=Message.js.map
