import React__default from 'react';
import { u as useOpenChannelContext } from '../../chunks/bundle-JA614av1.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-CfVl8s4A.js';
import '../../chunks/bundle-BL7mChau.js';
import '../../chunks/bundle-DQaFQR2q.js';
import '../../chunks/bundle-BtIszx7q.js';
import '@sendbird/uikit-tools';
import '../../withSendbird.js';
import '../../chunks/bundle-PPnIQFif.js';
import '../../chunks/bundle-ca6IMmD9.js';
import '@sendbird/chat/groupChannel';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-RX4SHzNN.js';
import '../../chunks/bundle-Cj_Dxz14.js';
import '../../chunks/bundle-DOfvZYT8.js';
import '../../chunks/bundle-c8Tan9dw.js';
import 'react-dom';
import '../../chunks/bundle-Bvh73TsV.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../chunks/bundle-BoHJWlEb.js';
import '../../ui/Icon.js';
import 'css-vars-ponyfill';
import '@sendbird/chat';
import '../../chunks/bundle-0P_11xTV.js';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-hFyf4W91.js';
import '../../useSendbirdStateContext.js';
import '../../chunks/bundle-BjZ9zlI7.js';
import '../../ui/SortByRow.js';
import '../../chunks/bundle-Cf9I1_PI.js';
import '../../chunks/bundle-CmhRN4oW.js';
import '../../chunks/bundle-DF5wKiiH.js';
import '../../chunks/bundle-BJvmAi6P.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-DV0yjj9U.js';
import '../../chunks/bundle-T1C3QunC.js';
import '../../chunks/bundle-CbEx5Qjw.js';
import 'dompurify';
import '../../chunks/bundle-Cdm9wGwJ.js';
import '../../chunks/bundle-SJt9ZQEH.js';
import '../../chunks/bundle-DuBNYf2a.js';
import '../../chunks/bundle-095SzdU2.js';
import '../../chunks/bundle-BLuTnfAP.js';
import '../../ui/ImageRenderer.js';
import '../../ui/Loader.js';
import '../../chunks/bundle-Dp-XZCMz.js';
import './OpenChannelMessage.js';
import '../../chunks/bundle-C_D936HH.js';
import '../../ui/OpenchannelUserMessage.js';
import '../../ui/UserProfile.js';
import '../../sendbirdSelectors.js';
import '../../chunks/bundle-DK3fjTlh.js';
import '../../chunks/bundle-Cl2CHKP9.js';
import '../../chunks/bundle-C-LUJN0d.js';
import '../../ui/OpenChannelAdminMessage.js';
import '../../ui/OpenchannelOGMessage.js';
import '../../ui/LinkLabel.js';
import '../../chunks/bundle-bXE_2h0x.js';
import '../../Message/context.js';
import '../../ui/MentionLabel.js';
import '../../ui/OpenchannelThumbnailMessage.js';
import '../../ui/OpenchannelFileMessage.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-CE4y6Xvr.js';
import '../../ui/DateSeparator.js';
import '../../ui/FileViewer.js';
import '../../chunks/bundle-BcIO-0xx.js';
import '../../chunks/bundle-BzWcA5Xa.js';
import '../../chunks/bundle-D6WI25Sy.js';
import '../../chunks/bundle-D7UVZS9Q.js';
import '../../chunks/bundle-BOZOvKGQ.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
