import React__default from 'react';
import { u as useOpenChannelContext } from '../../chunks/bundle-BoZwl2OL.js';
import OpenChannelInput from './OpenChannelInput.js';
import FrozenNotification from './FrozenChannelNotification.js';
import OpenchannelConversationHeader from './OpenChannelHeader.js';
import PlaceHolder, { PlaceHolderTypes } from '../../ui/PlaceHolder.js';
import OpenChannelMessageList from './OpenChannelMessageList.js';
import '../../chunks/bundle-l_QLKq1Y.js';
import '../../chunks/bundle-B8Grfnrx.js';
import '../../chunks/bundle-Y2KBbxRr.js';
import '../../chunks/bundle-BYOddwmS.js';
import '../../chunks/bundle-BYqblmEM.js';
import '../../chunks/bundle-I25ah_Bv.js';
import '../../chunks/bundle-C4OmfIXk.js';
import '../../chunks/bundle-Ob7Cw3V-.js';
import '@sendbird/chat';
import '@sendbird/chat/groupChannel';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-Djq12iSf.js';
import '../../chunks/bundle--1cImOGd.js';
import '../../chunks/bundle-CTkGIdt8.js';
import '../../chunks/bundle-CSDZhWAY.js';
import '../../chunks/bundle-C_ngoQD_.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-De-3zaYV.js';
import '../../chunks/bundle-CDcu1I4f.js';
import '../../chunks/bundle-LnGQMQVt.js';
import 'react-dom';
import '../../chunks/bundle-yKqHFFfz.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../chunks/bundle-HspRRkmy.js';
import '../../ui/Icon.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-DXneAdAp.js';
import '../../chunks/bundle-BciLDE6M.js';
import '../../chunks/bundle-DwLTEVMK.js';
import 'dompurify';
import '../../chunks/bundle-Dp_oW1ks.js';
import '../../chunks/bundle-Cn2czFA-.js';
import '../../chunks/bundle-4w9Y7uxA.js';
import '../../chunks/bundle-CgLhYjm5.js';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-BTxw_tIt.js';
import '../../chunks/bundle-DYBTopZK.js';
import '../../chunks/bundle-DT1VcdMs.js';
import '../../chunks/bundle-DgFzcADJ.js';
import '../../ui/ImageRenderer.js';
import '../../ui/Loader.js';
import '../../chunks/bundle-C8TP-mjp.js';
import './OpenChannelMessage.js';
import '../../chunks/bundle-Dy1IZ181.js';
import '../../ui/OpenchannelUserMessage.js';
import '../../chunks/bundle-QCH8CZT8.js';
import '../../ui/SortByRow.js';
import '../../ui/UserProfile.js';
import '../../sendbirdSelectors.js';
import '../../chunks/bundle-jhdKInOw.js';
import '../../chunks/bundle-D_SH0JG9.js';
import '../../chunks/bundle-CJmXP56m.js';
import '../../ui/OpenChannelAdminMessage.js';
import '../../ui/OpenchannelOGMessage.js';
import '../../ui/LinkLabel.js';
import '../../chunks/bundle-Do9UFGCD.js';
import '../../Message/context.js';
import '../../ui/MentionLabel.js';
import '../../ui/OpenchannelThumbnailMessage.js';
import '../../ui/OpenchannelFileMessage.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-DED6q4Ti.js';
import '../../ui/DateSeparator.js';
import '../../ui/FileViewer.js';
import '../../chunks/bundle-DgpfIrde.js';
import '@sendbird/uikit-tools';
import '../../chunks/bundle-DDZn5buS.js';
import '../../chunks/bundle-CYGowmbA.js';
import '../../chunks/bundle-C3VM5eS8.js';
import '../../chunks/bundle-D_tSqvX6.js';
import '@sendbird/chat/message';
import '../../Channel/utils/compareMessagesForGrouping.js';

var COMPONENT_CLASS_NAME = 'sendbird-openchannel-conversation';
var OpenChannelUI = function (_a) {
    var renderMessage = _a.renderMessage, renderHeader = _a.renderHeader, renderPlaceHolderEmptyList = _a.renderPlaceHolderEmptyList, renderPlaceHolderError = _a.renderPlaceHolderError, renderPlaceHolderLoading = _a.renderPlaceHolderLoading, renderMessageInput = _a.renderMessageInput, renderInput = _a.renderInput;
    var _b = useOpenChannelContext(), currentOpenChannel = _b.currentOpenChannel, amIBanned = _b.amIBanned, loading = _b.loading, isInvalid = _b.isInvalid, messageInputRef = _b.messageInputRef, conversationScrollRef = _b.conversationScrollRef;
    if (!currentOpenChannel
        || !(currentOpenChannel === null || currentOpenChannel === void 0 ? void 0 : currentOpenChannel.url)
        || amIBanned) {
        return ((renderPlaceHolderError === null || renderPlaceHolderError === void 0 ? void 0 : renderPlaceHolderError())
            || React__default.createElement("div", { className: COMPONENT_CLASS_NAME },
                React__default.createElement(PlaceHolder, { type: PlaceHolderTypes.NO_CHANNELS })));
    }
    if (loading) {
        return ((renderPlaceHolderLoading === null || renderPlaceHolderLoading === void 0 ? void 0 : renderPlaceHolderLoading())
            || React__default.createElement("div", { className: COMPONENT_CLASS_NAME },
                React__default.createElement(PlaceHolder, { type: PlaceHolderTypes.LOADING })));
    }
    if (isInvalid) {
        return ((renderPlaceHolderError === null || renderPlaceHolderError === void 0 ? void 0 : renderPlaceHolderError())
            || React__default.createElement("div", { className: COMPONENT_CLASS_NAME },
                React__default.createElement(PlaceHolder, { type: PlaceHolderTypes.WRONG })));
    }
    var renderInputComponent = renderMessageInput || renderInput;
    return (React__default.createElement("div", { className: COMPONENT_CLASS_NAME },
        (renderHeader === null || renderHeader === void 0 ? void 0 : renderHeader()) || React__default.createElement(OpenchannelConversationHeader, null),
        (currentOpenChannel === null || currentOpenChannel === void 0 ? void 0 : currentOpenChannel.isFrozen) && React__default.createElement(FrozenNotification, null),
        React__default.createElement(OpenChannelMessageList, { ref: conversationScrollRef, renderMessage: renderMessage, renderPlaceHolderEmptyList: renderPlaceHolderEmptyList }),
        (renderInputComponent === null || renderInputComponent === void 0 ? void 0 : renderInputComponent()) || React__default.createElement(OpenChannelInput, { ref: messageInputRef })));
};

export { OpenChannelUI as default };
//# sourceMappingURL=OpenChannelUI.js.map
