"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const PeerView_1 = __importDefault(require("./PeerView"));
const participantSlice_1 = require("../../store/participantSlice");
const PeersService_1 = require("../../services/PeersService");
const react_1 = __importStar(require("react"));
const components_1 = require("../../themes/components");
const react_redux_1 = require("react-redux");
const PIPModeContainer = (props) => {
    const { isMobile } = props;
    const { joinedProcessedPeers, selfPeer } = react_1.useContext(PeersService_1.PeersServiceContext);
    const gridView = react_redux_1.useSelector((state) => state.room.gridView);
    const pipPeers = joinedProcessedPeers.concat([selfPeer]).filter((el) => !(el === null || el === void 0 ? void 0 : el.webinarHiddenParticipant) && (el === null || el === void 0 ? void 0 : el.requestToJoinType) === participantSlice_1.RequestToJoinType.ask);
    return (react_1.default.createElement(components_1.Flex, { direction: "row", width: "100%", position: "absolute", zIndex: "1", alignItems: "flex-end", justifyContent: "flex-end", bottom: "70", right: "20" },
        pipPeers.map((peer) => (react_1.default.createElement(components_1.Box, { key: peer.id },
            react_1.default.createElement(PeerView_1.default, { peer: peer, height: 80, width: 130, hideBadge: true, zIndex: 1 })))),
        pipPeers.length === 0 && gridView === 'multi_alternate'
            && joinedProcessedPeers.length !== 0
            && (react_1.default.createElement(components_1.Box, { key: selfPeer.id },
                react_1.default.createElement(PeerView_1.default, { peer: selfPeer, height: 156, width: 96, hideBadge: true })))));
};
PIPModeContainer.defaultProps = {
    isMobile: false,
};
exports.default = PIPModeContainer;
//# sourceMappingURL=PIPModeContainer.js.map