import React__default from 'react';
import { u as useOpenChannelContext } from '../../chunks/bundle-c1LUbaVa.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-vOT5acXc.js';
import '../../chunks/bundle-BA7tv0JB.js';
import '../../chunks/bundle-NwZvowyL.js';
import '../../chunks/bundle-nlOgiAcu.js';
import '@sendbird/chat';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-YoWLsJ0C.js';
import '../../chunks/bundle-8JX3bIpj.js';
import '../../chunks/bundle-jDjj3eHU.js';
import '../../useSendbirdStateContext.js';
import '../../withSendbird.js';
import '../../hooks/useModal.js';
import '../../chunks/bundle-aKXnhi3A.js';
import '../../chunks/bundle-cA_r9HRx.js';
import '../../chunks/bundle-cvTUkQV_.js';
import 'react-dom';
import '../../chunks/bundle-BBjosDA0.js';
import '../../chunks/bundle-jy6_UG14.js';
import '../../chunks/bundle-ULVw0l0r.js';
import '../../chunks/bundle-r9j_eCHc.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../chunks/bundle-I8JFwttJ.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-MBrlu_LK.js';
import '../../ui/MessageInput.js';
import '../../chunks/bundle-GGE6HRof.js';
import '../../chunks/bundle-poK2Vr1v.js';
import '../../chunks/bundle-62ej9afV.js';
import 'dompurify';
import '../../chunks/bundle-zV8TJWvL.js';
import '../../chunks/bundle-4GPpeoNf.js';
import '../../chunks/bundle-iwZaUd9o.js';
import '../../chunks/bundle-N9hMnIRl.js';
import '@sendbird/chat/groupChannel';
import '../../utils/message/getOutgoingMessageState.js';
import '../../chunks/bundle-IRlSmJVg.js';
import '../../chunks/bundle-Qufz6_i_.js';
import '../../ui/ImageRenderer.js';
import '../../ui/Loader.js';
import '../../chunks/bundle-nD2ZWBq4.js';
import '../../chunks/bundle-hDx2-CRe.js';
import './OpenChannelMessage.js';
import '../../ui/OpenchannelUserMessage.js';
import '../../ui/ContextMenu.js';
import '../../ui/SortByRow.js';
import '../../ui/UserProfile.js';
import '../../sendbirdSelectors.js';
import '../../chunks/bundle-YHAMs1sP.js';
import '../../chunks/bundle-SlaQb7y0.js';
import '../../chunks/bundle-0jbuC1o3.js';
import '../../ui/OpenChannelAdminMessage.js';
import '../../ui/OpenchannelOGMessage.js';
import '../../ui/LinkLabel.js';
import '../../chunks/bundle-agW9Hw66.js';
import '../../Message/context.js';
import '../../ui/MentionLabel.js';
import '../../ui/OpenchannelThumbnailMessage.js';
import '../../ui/OpenchannelFileMessage.js';
import '../../ui/TextButton.js';
import '../../chunks/bundle-LWD0OLz8.js';
import '../../ui/DateSeparator.js';
import '../../chunks/bundle-wMP1pqZM.js';
import '../../chunks/bundle-fQ1V_U8F.js';
import '@sendbird/uikit-tools';
import '../../chunks/bundle-vz3GEsoi.js';
import '../../chunks/bundle-o1Ev7FSN.js';
import '../../chunks/bundle-BVtLlpwZ.js';
import '../../chunks/bundle-d5KevIXI.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, renderInput = _a.renderInput, renderPlaceHolderEmptyList = _a.renderPlaceHolderEmptyList, renderPlaceHolderError = _a.renderPlaceHolderError, renderPlaceHolderLoading = _a.renderPlaceHolderLoading;
    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 })));
    }
    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 }),
        (renderInput === null || renderInput === void 0 ? void 0 : renderInput()) || (React__default.createElement(OpenChannelInput, { ref: messageInputRef }))));
};

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