var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
        r = Reflect.decorate(decorators, target, key, desc);
    else
        for (var i = decorators.length - 1; i >= 0; i--)
            if (d = decorators[i])
                r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Host, h, writeTask } from "@stencil/core";
import RTKNotificationsAudio from "../../lib/notification";
import { formatName } from "../../utils/string";
import { defaultIconPack } from "../../lib/icons";
import { useLanguage } from "../../lib/lang";
import { DEFAULT_NOTIFICATION_CONFIG, DEFAULT_NOTIFICATION_DURATION, } from "../../types/ui-config/config";
import { createDefaultConfig } from "../../exports";
import { parseMessageForTarget } from "../../utils/chat";
import { SyncWithStore } from "../../utils/sync-with-store";
import { showLivestream } from "../../utils/livestream";
function parseConfig(config) {
    const permissions = Object.assign({}, DEFAULT_NOTIFICATION_CONFIG);
    if (config == null)
        return permissions;
    Object.assign(permissions.notification_sounds, config.notification_sounds);
    Object.assign(permissions.notifications, config.notifications);
    Object.assign(permissions.notification_duration, config.notification_duration);
    permissions.participant_chat_message_sound_notification_limit =
        config.participant_chat_message_sound_notification_limit;
    permissions.participant_joined_sound_notification_limit =
        config.participant_joined_sound_notification_limit;
    return permissions;
}
function getEnabledSounds(sounds) {
    return Object.keys(sounds).filter((key) => sounds[key]);
}
/**
 * A component which handles notifications.
 *
 * You can configure which notifications you want to see and which ones you want to hear.
 * There are also certain limits which you can set as well.
 */
export class RtkNotifications {
    constructor() {
        this.permissions = DEFAULT_NOTIFICATION_CONFIG;
        this.enabledSounds = getEnabledSounds(DEFAULT_NOTIFICATION_CONFIG.notification_sounds);
        /** Config object */
        this.config = createDefaultConfig();
        /** Language */
        this.t = useLanguage();
        /** Icon pack */
        this.iconPack = defaultIconPack;
        this.notifications = [];
        this.addStagePeersListeners = (meeting) => {
            meeting.participants.joined.addListener('participantJoined', this.participantJoinedListener);
            meeting.participants.joined.addListener('participantLeft', this.participantLeftListener);
        };
        this.removeStagePeersListeners = (meeting) => {
            meeting.participants.joined.removeListener('participantJoined', this.participantJoinedListener);
            meeting.participants.joined.removeListener('participantLeft', this.participantLeftListener);
        };
        this.onNotification = (e) => {
            this.add(e.detail);
            const playSound = e.detail.playSound;
            if (playSound != undefined)
                this.audio.play(playSound);
        };
        this.onRecordingUpdate = (recordingState) => {
            var _a, _b;
            if (recordingState === 'RECORDING' &&
                this.permissions.notifications.recording_started !== false) {
                this.add({
                    id: 'recording-started',
                    icon: this.iconPack.recording,
                    message: this.t('recording.started'),
                    duration: (_a = this.permissions.notification_duration.recording_started) !== null && _a !== void 0 ? _a : DEFAULT_NOTIFICATION_DURATION,
                });
            }
            else if (recordingState === 'STOPPING' &&
                this.permissions.notifications.recording_stopped !== false) {
                this.add({
                    id: 'recording-stopped',
                    icon: this.iconPack.stop_recording,
                    message: this.t('recording.stopped'),
                    duration: (_b = this.permissions.notification_duration.recording_stopped) !== null && _b !== void 0 ? _b : DEFAULT_NOTIFICATION_DURATION,
                });
            }
        };
        this.paused = false;
    }
    connectedCallback() {
        if (typeof document !== 'undefined') {
            document === null || document === void 0 ? void 0 : document.addEventListener('rtkNotification', this.onNotification);
        }
        this.meetingChanged(this.meeting);
        this.configChanged(this.config);
        this.statesChanged(this.states);
    }
    clearListeners(meeting) {
        var _a, _b, _c, _d, _e, _f, _g, _h;
        const isLivestream = meeting.meta.viewType === 'LIVESTREAM';
        if ((isLivestream && ((_a = meeting.stage) === null || _a === void 0 ? void 0 : _a.status) === 'ON_STAGE') || !isLivestream) {
            this.removeStagePeersListeners(meeting);
        }
        this.chatUpdateListener && ((_b = meeting.chat) === null || _b === void 0 ? void 0 : _b.removeListener('chatUpdate', this.chatUpdateListener));
        this.pollUpdateListener &&
            ((_c = meeting.polls) === null || _c === void 0 ? void 0 : _c.removeListener('pollsUpdate', this.pollUpdateListener));
        meeting.meta.removeListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
        this.stageRequestAccepted &&
            ((_d = meeting.stage) === null || _d === void 0 ? void 0 : _d.removeListener('stageRequestApproved', this.stageRequestAccepted));
        this.stageRequestRejected &&
            ((_e = meeting.stage) === null || _e === void 0 ? void 0 : _e.removeListener('stageRequestRejected', this.stageRequestRejected));
        this.newStageRequests &&
            ((_f = meeting.stage) === null || _f === void 0 ? void 0 : _f.removeListener('newStageRequest', this.newStageRequests));
        this.stageStatusUpdateListener &&
            ((_g = meeting.stage) === null || _g === void 0 ? void 0 : _g.removeListener('stageStatusUpdate', this.stageStatusUpdateListener));
        (_h = meeting.recording) === null || _h === void 0 ? void 0 : _h.removeListener('recordingUpdate', this.onRecordingUpdate);
        clearTimeout(this.disconnectTimeout);
        meeting.self.removeListener('deviceUpdate', this.deviceUpdateListener);
    }
    disconnectedCallback() {
        var _a;
        if (typeof document !== 'undefined') {
            document === null || document === void 0 ? void 0 : document.removeEventListener('rtkNotification', this.onNotification);
        }
        if (!this.meeting)
            return;
        this.clearListeners(this.meeting);
        this.waitlistedParticipantJoinedListener &&
            this.meeting.participants.waitlisted.removeListener('participantJoined', this.waitlistedParticipantJoinedListener);
        this.waitlistedParticipantLeftListener &&
            this.meeting.participants.waitlisted.removeListener('participantLeft', this.waitlistedParticipantLeftListener);
        this.activeTabUpdateListener &&
            ((_a = this.meeting.meta) === null || _a === void 0 ? void 0 : _a.removeListener('activeTabUpdate', this.activeTabUpdateListener));
        this.peerStageStatusListener &&
            this.meeting.participants.joined.removeListener('stageStatusUpdate', this.peerStageStatusListener);
    }
    meetingChanged(meeting, oldMeeting) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j;
        clearTimeout(this.disconnectTimeout);
        if (oldMeeting)
            this.clearListeners(oldMeeting);
        if (!meeting)
            return;
        const isLivestream = meeting.meta.viewType === 'LIVESTREAM';
        this.audio = new RTKNotificationsAudio(meeting);
        const { notifications, notification_duration, notification_sounds } = this.permissions;
        this.participantJoinedListener = (participant) => {
            if (notifications.participant_joined) {
                this.add({
                    id: `${participant.id}-joined`,
                    message: `${formatName(participant.name)} ${this.t('notifications.joined')}`,
                    image: participant.picture,
                    duration: notification_duration.participant_joined,
                });
            }
            if (notification_sounds.participant_joined && this.canPlayParticipantJoinedSound()) {
                this.audio.play('joined');
            }
        };
        this.participantLeftListener = (participant) => {
            const { socketState: { state }, } = this.meeting.meta;
            if (notifications.participant_left && state !== 'connected') {
                this.add({
                    id: `${participant.id}-left`,
                    message: `${formatName(participant.name)} ${this.t('notifications.left')}`,
                    image: participant.picture,
                    duration: notification_duration.participant_left,
                });
            }
            if (notification_sounds.participant_left && this.canPlayParticipantJoinedSound()) {
                this.audio.play('left');
            }
        };
        this.waitlistedParticipantJoinedListener = (participant) => {
            if (!this.canAcceptWaitingRequests())
                return;
            const id = `${participant.id}-joined-waitlist`;
            this.add({
                id,
                message: `${formatName(participant.name)} ${this.t('notifications.requesting_to_join_meeting')}`,
                image: participant.picture,
                duration: notification_duration.participant_joined_waitlist,
                button: {
                    text: this.t('notifications.accept'),
                    variant: 'primary',
                    onClick: async () => {
                        await this.meeting.participants.acceptWaitingRoomRequest(participant.id);
                        this.remove(id);
                    },
                },
            });
            if (notification_sounds.participant_joined_waitlist && this.canPlayParticipantJoinedSound()) {
                this.audio.play('message');
            }
        };
        this.waitlistedParticipantLeftListener = (participant) => {
            this.remove(`${participant.id}-joined-waitlist`);
        };
        this.chatUpdateListener = ({ message, action }) => {
            // NOTE(ikabra): we only want notifications for new messages
            if (action !== 'add')
                return;
            const parsedMessage = parseMessageForTarget(message);
            if (parsedMessage != null) {
                if (parsedMessage.userId === meeting.self.userId) {
                    return;
                }
                if (parsedMessage.type === 'text') {
                    if (notifications.chat) {
                        this.add({
                            id: `message-${Math.random().toString(36)}`,
                            icon: this.iconPack.chat,
                            message: `${parsedMessage.displayName}: ${parsedMessage.message}`,
                            duration: notification_duration.chat,
                        });
                    }
                    if (notification_sounds.chat && this.canPlayChatSound()) {
                        this.audio.play('message');
                    }
                }
            }
        };
        this.pollUpdateListener = ({ polls, newPoll }) => {
            if (newPoll === false)
                return;
            if (notifications.polls &&
                this.meeting.self.userId !== polls[polls.length - 1].createdByUserId) {
                this.add({
                    id: `poll-${Math.random().toString(36)}`,
                    icon: this.iconPack.poll,
                    message: `${this.t('notifications.new_poll_created_by')} ${polls[polls.length - 1].createdBy}`,
                    duration: notification_duration.polls,
                });
            }
            if (notification_sounds.polls &&
                this.meeting.self.userId !== polls[polls.length - 1].createdByUserId &&
                this.canPlayChatSound()) {
                this.audio.play('message');
            }
        };
        this.deviceUpdateListener = ({ device, preview }) => {
            if (preview)
                return;
            if (device.kind === 'audiooutput') {
                this.audio.setDevice(device.deviceId);
                this.remove(`speaker-switched`);
                this.add({
                    id: `speaker-switched`,
                    message: `${this.t('notifications.connected_to')} ${device.label}`,
                    icon: this.iconPack.speaker,
                    duration: 5000,
                });
            }
            if (device.kind === 'videoinput') {
                this.remove(`camera-switched`);
                this.add({
                    id: `camera-switched`,
                    message: `${this.t('notifications.connected_to')} ${device.label}`,
                    icon: this.meeting.self.videoEnabled ? this.iconPack.video_on : this.iconPack.video_off,
                    iconVariant: this.meeting.self.videoEnabled ? 'primary' : 'danger',
                    duration: 5000,
                });
            }
            if (device.kind === 'audioinput') {
                this.remove(`mic-switched`);
                this.add({
                    id: `mic-switched`,
                    message: `${this.t('notifications.connected_to')} ${device.label}`,
                    icon: this.meeting.self.audioEnabled ? this.iconPack.mic_on : this.iconPack.mic_off,
                    iconVariant: this.meeting.self.audioEnabled ? 'primary' : 'danger',
                    duration: 5000,
                });
            }
        };
        this.socketConnectionUpdateListener = ({ state, reconnectionAttempt, reconnected }) => {
            switch (state) {
                case 'connected':
                    this.remove('socket');
                    if (reconnected)
                        this.add({
                            id: `socket`,
                            icon: this.iconPack.wifi,
                            message: this.t('network.restored'),
                            duration: 3000,
                        });
                    break;
                case 'disconnected':
                    this.remove('socket');
                    this.add({
                        id: 'socket',
                        icon: this.iconPack.disconnected,
                        message: this.t('network.reconnecting'),
                    });
                    break;
                case 'reconnecting':
                    if (reconnectionAttempt >= 6) {
                        this.remove('socket');
                        this.add({
                            id: 'socket',
                            icon: this.iconPack.disconnected,
                            message: this.t('network.disconnected'),
                            button: {
                                text: this.t('end'),
                                variant: 'danger',
                                onClick: () => { var _a; return (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.leave(); },
                            },
                        });
                    }
                    else if (reconnectionAttempt >= 4) {
                        this.remove('socket');
                        this.add({
                            id: 'socket',
                            icon: this.iconPack.disconnected,
                            message: this.t('network.delay_extended'),
                        });
                    }
                    break;
                case 'failed':
                    this.remove('socket');
                    this.add({
                        id: 'socket',
                        icon: this.iconPack.disconnected,
                        message: this.t('network.leaving'),
                        button: {
                            text: this.t('end'),
                            variant: 'danger',
                            onClick: () => { var _a; return (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.leave(); },
                        },
                    });
                    break;
                default:
                    break;
            }
        };
        this.activeTabUpdateListener = (activeTab) => {
            if (!notifications.tab_sync)
                return;
            switch (activeTab.type) {
                case 'plugin':
                    const activePlugin = meeting.plugins.active
                        .toArray()
                        .find((plugin) => plugin.id == activeTab.id);
                    if (activePlugin != undefined) {
                        this.add({
                            id: 'activeTab',
                            message: `${this.t('notifications.plugin_switched_to')} ${activePlugin.name}`,
                            duration: notification_duration.participant_joined,
                        });
                    }
                    break;
                case 'screenshare':
                    const screenShareParticipant = meeting.participants.joined
                        .toArray()
                        .filter((participant) => participant.screenShareEnabled)
                        .find((participant) => participant.id == activeTab.id);
                    if (screenShareParticipant != undefined) {
                        this.add({
                            id: 'spotlight',
                            message: `Now watching ${screenShareParticipant.name}'s screen`,
                            duration: notification_duration.webinar,
                        });
                    }
                    break;
            }
        };
        this.peerStageStatusListener = (participant) => {
            if (participant.stageStatus === 'REQUESTED_TO_JOIN_STAGE') {
                this.add({
                    id: `stage-request-${participant.id}`,
                    message: `${participant.name} ${this.t('notifications.requested_to_join_stage')}`,
                    duration: notification_duration.webinar,
                    button: {
                        text: this.t('notifications.accept'),
                        variant: 'primary',
                        onClick: async () => {
                            await this.meeting.stage.grantAccess([participant.userId]);
                            this.remove(`stage-request-${participant.id}`);
                        },
                    },
                });
                if (notification_sounds.webinar) {
                    this.audio.play('joined');
                }
            }
            if (participant.stageStatus === 'ON_STAGE') {
                this.add({
                    id: `stage-joined-${participant.id}`,
                    message: `${participant.name} ${this.t('notifications.joined_stage')}`,
                    duration: notification_duration.webinar,
                });
                if (notification_sounds.webinar) {
                    this.audio.play('joined');
                }
            }
        };
        this.stageRequestAccepted = () => {
            this.add({
                id: 'stage-request-accepted',
                message: this.t('notifications.request_to_join_accepted'),
                duration: 3000,
            });
        };
        this.stageRequestRejected = () => {
            this.add({
                id: 'stage-request-rejected',
                message: this.t('notifications.request_to_join_rejected'),
                duration: 3000,
            });
        };
        this.newStageRequests = ({ count }) => {
            this.add({
                id: 'new-stage-request',
                message: `You have ${count < 0 ? 'new stage' : `${count} pending`} request${count === 1 ? '' : 's'}`,
                duration: 3000,
            });
        };
        this.stageStatusUpdateListener = (status) => {
            if (status === 'ON_STAGE')
                this.addStagePeersListeners(meeting);
            else
                this.removeStagePeersListeners(meeting);
        };
        !showLivestream(meeting) && ((_a = meeting.chat) === null || _a === void 0 ? void 0 : _a.addListener('chatUpdate', this.chatUpdateListener));
        // temp fix for viewType mismatch with CHAT
        if (((_b = meeting.self.config.viewType) === null || _b === void 0 ? void 0 : _b.toString()) === 'CHAT') {
            return;
        }
        // all non Chat viewtype code from here
        const currentDevices = meeting.self.getCurrentDevices();
        if (currentDevices.speaker != null) {
            this.audio.setDevice(currentDevices.speaker.deviceId);
        }
        if (isLivestream)
            (_c = meeting.stage) === null || _c === void 0 ? void 0 : _c.on('stageStatusUpdate', this.stageStatusUpdateListener);
        else
            this.addStagePeersListeners(meeting);
        if (this.canAcceptWaitingRequests()) {
            meeting.participants.waitlisted.addListener('participantJoined', this.waitlistedParticipantJoinedListener);
            meeting.participants.waitlisted.addListener('participantLeft', this.waitlistedParticipantLeftListener);
        }
        (_d = meeting.polls) === null || _d === void 0 ? void 0 : _d.addListener('pollsUpdate', this.pollUpdateListener);
        meeting.self.addListener('deviceUpdate', this.deviceUpdateListener);
        meeting.meta.addListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
        (_e = meeting.meta) === null || _e === void 0 ? void 0 : _e.addListener('activeTabUpdate', this.activeTabUpdateListener);
        (_f = meeting.recording) === null || _f === void 0 ? void 0 : _f.addListener('recordingUpdate', this.onRecordingUpdate);
        (_g = meeting.stage) === null || _g === void 0 ? void 0 : _g.addListener('stageRequestApproved', this.stageRequestAccepted);
        (_h = meeting.stage) === null || _h === void 0 ? void 0 : _h.addListener('stageRequestRejected', this.stageRequestRejected);
        if (meeting.self.permissions.stageEnabled && meeting.self.permissions.acceptStageRequests) {
            (_j = meeting.stage) === null || _j === void 0 ? void 0 : _j.addListener('newStageRequest', this.newStageRequests);
        }
    }
    configChanged(config) {
        if (config != null) {
            if ((config === null || config === void 0 ? void 0 : config.config) != null) {
                this.permissions = parseConfig(config.config);
                this.enabledSounds = getEnabledSounds(this.permissions.notification_sounds);
            }
        }
    }
    statesChanged(states) {
        var _a;
        if (states != null) {
            const notificationSoundsEnabled = !((_a = states === null || states === void 0 ? void 0 : states.prefs) === null || _a === void 0 ? void 0 : _a.muteNotificationSounds);
            // toggle only the notification sounds values which were enabled in the first place
            for (const permission of this.enabledSounds) {
                if (permission in this.permissions.notification_sounds) {
                    this.permissions.notification_sounds[permission] = notificationSoundsEnabled;
                }
            }
        }
    }
    apiErrorListener({ detail }) {
        const { trace, message } = detail;
        this.add({
            id: trace,
            message,
            duration: DEFAULT_NOTIFICATION_DURATION,
            icon: this.iconPack.warning,
        });
    }
    sendNotificationListener({ detail }) {
        const { trace, message } = detail;
        this.add({
            id: trace,
            message,
            duration: DEFAULT_NOTIFICATION_DURATION,
        });
    }
    add(notification) {
        // show notifications only if tab is in focus and a maximum of 5 at a time
        if (document.visibilityState === 'visible' && this.notifications.length < 5) {
            // adds new notification to start of array so they appear at the bottom
            this.notifications = [...this.notifications, notification];
        }
    }
    remove(id) {
        this.notifications = this.notifications.filter((notification) => notification.id !== id);
    }
    handleDismiss(e) {
        e.stopPropagation();
        const id = e.detail;
        const el = this.host.shadowRoot.querySelector(`[data-id="${id}"]`);
        // exit animation
        el === null || el === void 0 ? void 0 : el.classList.add('exit');
        setTimeout(() => {
            writeTask(() => {
                this.remove(id);
            });
        }, 400);
    }
    canPlayParticipantJoinedSound() {
        return (this.permissions.participant_joined_sound_notification_limit == undefined ||
            this.permissions.participant_joined_sound_notification_limit <= 0 ||
            this.meeting.participants.count <=
                this.permissions.participant_joined_sound_notification_limit);
    }
    canPlayChatSound() {
        return (this.permissions.participant_chat_message_sound_notification_limit == undefined ||
            this.permissions.participant_chat_message_sound_notification_limit <= 0 ||
            this.meeting.participants.count <=
                this.permissions.participant_chat_message_sound_notification_limit);
    }
    canAcceptWaitingRequests() {
        return (this.permissions.notifications.participant_joined_waitlist &&
            this.meeting.self.permissions.acceptWaitingRequests);
    }
    render() {
        if (!this.meeting) {
            return;
        }
        return (h(Host, null, h("div", { onMouseEnter: () => (this.paused = true), onFocusin: () => (this.paused = true), onMouseLeave: () => (this.paused = false), onFocusout: () => (this.paused = false) }, this.notifications.map((notification) => (h("rtk-notification", { size: this.size, key: notification.id, "data-id": notification.id, notification: notification, onRtkNotificationDismiss: (e) => this.handleDismiss(e), iconPack: this.iconPack, paused: this.paused, t: this.t }))))));
    }
    static get is() { return "rtk-notifications"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["rtk-notifications.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["rtk-notifications.css"]
        };
    }
    static get properties() {
        return {
            "meeting": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "Meeting",
                    "resolved": "Client",
                    "references": {
                        "Meeting": {
                            "location": "import",
                            "path": "../../types/rtk-client",
                            "id": "src/types/rtk-client.ts::Meeting"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Meeting object"
                },
                "getter": false,
                "setter": false
            },
            "states": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "States",
                    "resolved": "States",
                    "references": {
                        "States": {
                            "location": "import",
                            "path": "../../types/props",
                            "id": "src/types/props.ts::States"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "States object"
                },
                "getter": false,
                "setter": false
            },
            "config": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "UIConfig",
                    "resolved": "UIConfig",
                    "references": {
                        "UIConfig": {
                            "location": "import",
                            "path": "../../types/ui-config",
                            "id": "src/types/ui-config/index.ts::UIConfig"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Config object"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "createDefaultConfig()"
            },
            "t": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "RtkI18n",
                    "resolved": "(key: \"pin\" | \"unpin\" | \"kick\" | \"ended\" | \"disconnected\" | \"failed\" | \"type\" | \"end\" | \"joined\" | \"pinned\" | \"join\" | \"participants\" | \"logo\" | \"audio\" | \"search\" | \"video\" | \"image\" | \"chat\" | \"polls\" | \"leave\" | \"close\" | \"plugins\" | \"screenshare\" | \"(you)\" | (string & {}) | \"about_call\" | \"screen\" | \"camera\" | \"dismiss\" | \"page\" | \"more\" | \"page.prev\" | \"page.next\" | \"layout\" | \"layout.auto\" | \"settings\" | \"file\" | \"connection\" | \"leave_confirmation\" | \"cancel\" | \"yes\" | \"you\" | \"everyone\" | \"to\" | \"mute\" | \"accept\" | \"pip_on\" | \"pip_off\" | \"viewers\" | \"create\" | \"ask\" | \"activate\" | \"requests\" | \"mic_off\" | \"disable_mic\" | \"mic_on\" | \"enable_mic\" | \"test\" | \"minimize\" | \"maximize\" | \"mute_all\" | \"mute_all.description\" | \"mute_all.header\" | \"mute_all.allow_unmute\" | \"video_off\" | \"disable_video\" | \"video_on\" | \"enable_video\" | \"offline\" | \"offline.description\" | \"failed.description\" | \"disconnected.description\" | \"participants.errors.empty_results\" | \"participants.empty_list\" | \"participants.no_pending_requests\" | \"participants.turn_off_video\" | \"polls.by\" | \"polls.question\" | \"polls.question.placeholder\" | \"polls.answers\" | \"polls.option\" | \"polls.option.placeholder\" | \"polls.results.anon\" | \"polls.results.hide\" | \"polls.create\" | \"polls.cancel\" | \"polls.empty\" | \"polls.errors.question_required\" | \"polls.errors.empty_option\" | \"screenshare.min_preview\" | \"screenshare.max_preview\" | \"screenshare.shared\" | \"screenshare.start\" | \"screenshare.stop\" | \"screenshare.error.unknown\" | \"screenshare.error.max_count\" | \"plugins.empty\" | \"perm_denied\" | \"perm_denied.audio\" | \"perm_denied.video\" | \"perm_denied.screenshare\" | \"perm_denied.audio.chrome.message\" | \"perm_denied.video.chrome.message\" | \"perm_denied.screenshare.chrome.message\" | \"perm_denied.audio.safari.message\" | \"perm_denied.video.safari.message\" | \"perm_denied.screenshare.safari.message\" | \"perm_denied.audio.edge.message\" | \"perm_denied.video.edge.message\" | \"perm_denied.screenshare.edge.message\" | \"perm_denied.audio.microsoft edge.message\" | \"perm_denied.video.microsoft edge.message\" | \"perm_denied.screenshare.microsoft edge.message\" | \"perm_denied.audio.firefox.message\" | \"perm_denied.video.firefox.message\" | \"perm_denied.screenshare.firefox.message\" | \"perm_denied.audio.others.message\" | \"perm_denied.video.others.message\" | \"perm_denied.screenshare.others.message\" | \"perm_sys_denied\" | \"perm_sys_denied.audio\" | \"perm_sys_denied.video\" | \"perm_sys_denied.screenshare\" | \"perm_sys_denied.audio.macos.message\" | \"perm_sys_denied.video.macos.message\" | \"perm_sys_denied.screenshare.macos.message\" | \"perm_sys_denied.audio.ios.message\" | \"perm_sys_denied.video.ios.message\" | \"perm_sys_denied.screenshare.ios.message\" | \"perm_sys_denied.audio.windows.message\" | \"perm_sys_denied.video.windows.message\" | \"perm_sys_denied.screenshare.windows.message\" | \"perm_sys_denied.audio.android.message\" | \"perm_sys_denied.video.android.message\" | \"perm_sys_denied.screenshare.android.message\" | \"perm_sys_denied.audio.others.message\" | \"perm_sys_denied.video.others.message\" | \"perm_sys_denied.screenshare.others.message\" | \"perm_could_not_start\" | \"perm_could_not_start.audio\" | \"perm_could_not_start.video\" | \"perm_could_not_start.screenshare\" | \"perm_could_not_start.audio.message\" | \"perm_could_not_start.video.message\" | \"perm_could_not_start.screenshare.message\" | \"full_screen\" | \"full_screen.exit\" | \"waitlist.header_title\" | \"waitlist.body_text\" | \"waitlist.deny_request\" | \"waitlist.accept_request\" | \"waitlist.accept_all\" | \"stage_request.header_title\" | \"stage_request.deny_request\" | \"stage_request.accept_request\" | \"stage_request.accept_all\" | \"stage_request.deny_all\" | \"stage_request.approval_pending\" | \"stage_request.denied\" | \"stage_request.request\" | \"stage_request.requested\" | \"stage_request.cancel_request\" | \"stage_request.leave_stage\" | \"stage_request.request_tip\" | \"stage_request.leave_tip\" | \"stage_request.pending_tip\" | \"stage_request.denied_tip\" | \"stage.empty_host\" | \"stage.empty_host_summary\" | \"stage.empty_viewer\" | \"stage.remove_from_stage\" | \"stage.invited_notification\" | \"stage.add_to_stage\" | \"stage.join_title\" | \"stage.join_summary\" | \"stage.join_cancel\" | \"stage.join_confirm\" | \"setup_screen.join_in_as\" | \"setup_screen.your_name\" | \"stage.reconnecting\" | \"recording.label\" | \"recording.indicator\" | \"recording.started\" | \"recording.stopped\" | \"recording.paused\" | \"recording.error.start\" | \"recording.error.stop\" | \"recording.error.resume\" | \"recording.start\" | \"recording.stop\" | \"recording.resume\" | \"recording.starting\" | \"recording.stopping\" | \"recording.loading\" | \"recording.idle\" | \"audio_playback\" | \"audio_playback.title\" | \"audio_playback.description\" | \"breakout_rooms\" | \"breakout_rooms.room_config_header\" | \"breakout_rooms.join_breakout_header\" | \"breakout_rooms.empty\" | \"breakout_rooms.delete\" | \"breakout_rooms.switch\" | \"breakout_rooms.main_room\" | \"breakout_rooms.shuffle_participants\" | \"breakout_rooms.deselect\" | \"breakout_rooms.selected\" | \"breakout_rooms.num_of_rooms\" | \"breakout_rooms.approx\" | \"breakout_rooms.participants_per_room\" | \"breakout_rooms.division_text\" | \"breakout_rooms.start_breakout\" | \"breakout_rooms.close_breakout\" | \"breakout_rooms.update_breakout\" | \"breakout_rooms.discard_changes\" | \"breakout_rooms.room\" | \"breakout_rooms.rooms\" | \"breakout_rooms.room_name\" | \"breakout_rooms.edit_room_name\" | \"breakout_rooms.save_room_name\" | \"breakout_rooms.add_room\" | \"breakout_rooms.add_room_brief\" | \"breakout_rooms.select_all\" | \"breakout_rooms.unassign_all\" | \"breakout_rooms.assign\" | \"breakout_rooms.assign_participants\" | \"breakout_rooms.none_assigned\" | \"breakout_rooms.drag_drop_participants\" | \"breakout_rooms.click_drop_participants\" | \"breakout_rooms.status.assign_multiple\" | \"breakout_rooms.status.select_room\" | \"breakout_rooms.ephemeral_status.participants_assigned\" | \"breakout_rooms.ephemeral_status.participants_assigned_randomly\" | \"breakout_rooms.ephemeral_status.changes_discarded\" | \"breakout_rooms.confirm_modal.start_breakout.header\" | \"breakout_rooms.confirm_modal.start_breakout.content\" | \"breakout_rooms.confirm_modal.start_breakout.cancelText\" | \"breakout_rooms.confirm_modal.start_breakout.ctaText\" | \"breakout_rooms.confirm_modal.close_breakout.header\" | \"breakout_rooms.confirm_modal.close_breakout.content\" | \"breakout_rooms.confirm_modal.close_breakout.ctaText\" | \"breakout_rooms.move_reason.started_msg\" | \"breakout_rooms.move_reason.started_desc\" | \"breakout_rooms.move_reason.closed_msg\" | \"breakout_rooms.move_reason.closed_desc\" | \"breakout_rooms.move_reason.switch_room\" | \"breakout_rooms.move_reason.switch_main_room\" | \"breakout_rooms.all_assigned\" | \"breakout_rooms.empty_main_room\" | \"breakout_rooms.leave_confirmation\" | \"breakout_rooms.leave_confirmation.main_room_btn\" | \"ai\" | \"ai.meeting_ai\" | \"ai.home\" | \"ai.transcriptions\" | \"ai.personal\" | \"ai.caption_view\" | \"ai.chat.tooltip\" | \"ai.chat.summarize\" | \"ai.chat.agenda\" | \"ai.transcriptions.search_placeholder\" | \"ai.transcriptions.no_transcripts_found\" | \"ai.transcriptions.no_transcripts_yet\" | \"search.could_not_find\" | \"search.empty\" | \"end.all\" | \"ended.rejected\" | \"ended.left\" | \"ended.kicked\" | \"ended.disconnected\" | \"ended.network\" | \"ended.unauthorized\" | \"network\" | \"network.reconnecting\" | \"network.delay_extended\" | \"network.disconnected\" | \"network.leaving\" | \"network.restored\" | \"network.delay\" | \"network.lost\" | \"network.lost_extended\" | \"network.troubleshoot\" | \"join.network_error\" | \"join.media_error\" | \"join.media_firewall_error\" | \"join.default_error\" | \"join.error_code\" | \"livestream\" | \"livestream.indicator\" | \"livestream.skip\" | \"livestream.idle\" | \"livestream.starting\" | \"livestream.stopping\" | \"livestream.waiting_on_manual_ingestion\" | \"livestream.error.not_supported\" | \"livestream.error.not_found\" | \"livestream.error.unknown\" | \"livestream.error.sync\" | \"livestream.error.start\" | \"livestream.error.stop\" | \"livestream.go_live\" | \"livestream.end_live\" | \"livestream.error\" | \"cta.help\" | \"cta.continue\" | \"cta.reload\" | \"cta.confirmation\" | \"cta.system_settings\" | \"remote_access.empty\" | \"remote_access.requests\" | \"remote_access.allow\" | \"remote_access.grant\" | \"remote_access.indicator\" | \"chat.new\" | \"chat.max_limit_warning\" | \"chat.rate_limit_error\" | \"chat.member_name\" | \"chat.add_members\" | \"chat.delete_msg\" | \"chat.edit_msg\" | \"chat.send_msg\" | \"chat.send_attachment\" | \"chat.send_img\" | \"chat.send_file\" | \"chat.send_emoji\" | \"chat.update_msg\" | \"chat.img.loading\" | \"chat.error.img_not_found\" | \"chat.error.empty_results\" | \"chat.img.shared_by\" | \"chat.reply\" | \"chat.message_placeholder\" | \"chat.click_to_send\" | \"chat.search_msgs\" | \"chat.search_conversations\" | \"chat.start_conversation\" | \"chat.empty_search\" | \"chat.empty_chat\" | \"chat.cancel_upload\" | \"chat.view_chats\" | \"chat.everyone\" | \"chat.pinned_msgs\" | \"chat.toggle_pinned_msgs\" | \"date.today\" | \"date.yesterday\" | \"date.sunday\" | \"date.monday\" | \"date.tuesday\" | \"date.wednesday\" | \"date.thursday\" | \"date.friday\" | \"date.saturday\" | \"list.empty\" | \"grid.listening\" | \"transcript.off\" | \"transcript.on\" | \"settings.notification_sound\" | \"settings.microphone_input\" | \"settings.speaker_output\" | \"settings.mirror_video\" | \"settings.camera_off\" | \"dialog.close\" | \"notifications.joined\" | \"notifications.left\" | \"notifications.requesting_to_join_meeting\" | \"notifications.requested_to_join_stage\" | \"notifications.joined_stage\" | \"notifications.request_to_join_accepted\" | \"notifications.request_to_join_rejected\" | \"notifications.accept\" | \"notifications.new_poll_created_by\" | \"notifications.connected_to\" | \"notifications.plugin_switched_to\" | \"notifications.remote_control_requested\" | \"notifications.remote_control_request_sent\" | \"notifications.remote_control_request_accepted\" | \"notifications.remote_control_granted\" | \"notifications.remote_control_terminated\" | \"debugger.troubleshooting.label\" | \"debugger.quality.good\" | \"debugger.quality.average\" | \"debugger.quality.poor\" | \"debugger.stats.bitrate.label\" | \"debugger.stats.bitrate.description\" | \"debugger.stats.packet_loss.label\" | \"debugger.stats.packet_loss.description\" | \"debugger.stats.jitter.label\" | \"debugger.stats.jitter.description\" | \"debugger.stats.cpu_limitations.label\" | \"debugger.stats.cpu_limitations.description\" | \"debugger.stats.bandwidth_limitations.label\" | \"debugger.stats.bandwidth_limitations.description\" | \"debugger.audio.label\" | \"debugger.audio.troubleshooting.label\" | \"debugger.audio.messages.generating_report\" | \"debugger.audio.messages.enable_media\" | \"debugger.audio.sections.network_media\" | \"debugger.video.label\" | \"debugger.video.troubleshooting.label\" | \"debugger.video.messages.generating_report\" | \"debugger.video.messages.enable_media\" | \"debugger.video.sections.network_media\" | \"debugger.screenshare.label\" | \"debugger.screenshare.troubleshooting.label\" | \"debugger.screenshare.sections.network_media\" | \"debugger.screenshare.messages.generating_report\" | \"debugger.screenshare.messages.enable_media\" | \"debugger.system.label\" | \"debugger.system.troubleshooting.label\" | \"debugger.system.sections.battery\" | \"debugger.system.battery.level.label\" | \"debugger.system.battery.level.description\" | \"debugger.system.battery.charging.label\" | \"debugger.system.battery.charging.description\" | \"debugger.system.battery.charging.is_charging\" | \"debugger.system.battery.charging.is_not_charging\") => string",
                    "references": {
                        "RtkI18n": {
                            "location": "import",
                            "path": "../../lib/lang",
                            "id": "src/lib/lang/index.ts::RtkI18n"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Language"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "useLanguage()"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "Size",
                    "resolved": "\"lg\" | \"md\" | \"sm\" | \"xl\"",
                    "references": {
                        "Size": {
                            "location": "import",
                            "path": "../../types/props",
                            "id": "src/types/props.ts::Size"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Size"
                },
                "getter": false,
                "setter": false,
                "attribute": "size",
                "reflect": true
            },
            "iconPack": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IconPack",
                    "resolved": "{ people: string; people_checked: string; chat: string; poll: string; participants: string; rocket: string; call_end: string; share: string; mic_on: string; mic_off: string; video_on: string; video_off: string; share_screen_start: string; share_screen_stop: string; share_screen_person: string; clock: string; dismiss: string; send: string; search: string; more_vertical: string; chevron_down: string; chevron_up: string; chevron_left: string; chevron_right: string; settings: string; wifi: string; speaker: string; speaker_off: string; download: string; full_screen_maximize: string; full_screen_minimize: string; copy: string; attach: string; image: string; emoji_multiple: string; image_off: string; disconnected: string; wand: string; recording: string; subtract: string; stop_recording: string; warning: string; pin: string; pin_off: string; spinner: string; breakout_rooms: string; add: string; shuffle: string; edit: string; delete: string; back: string; save: string; web: string; checkmark: string; spotlight: string; join_stage: string; leave_stage: string; pip_off: string; pip_on: string; signal_1: string; signal_2: string; signal_3: string; signal_4: string; signal_5: string; start_livestream: string; stop_livestream: string; viewers: string; debug: string; info: string; devices: string; horizontal_dots: string; ai_sparkle: string; meeting_ai: string; captionsOn: string; captionsOff: string; play: string; pause: string; fastForward: string; minimize: string; maximize: string; }",
                    "references": {
                        "IconPack": {
                            "location": "import",
                            "path": "../../lib/icons",
                            "id": "src/lib/icons/index.ts::IconPack"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Icon pack"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "defaultIconPack"
            }
        };
    }
    static get states() {
        return {
            "notifications": {},
            "paused": {}
        };
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "meeting",
                "methodName": "meetingChanged"
            }, {
                "propName": "config",
                "methodName": "configChanged"
            }, {
                "propName": "states",
                "methodName": "statesChanged"
            }];
    }
    static get listeners() {
        return [{
                "name": "rtkApiError",
                "method": "apiErrorListener",
                "target": "window",
                "capture": false,
                "passive": false
            }, {
                "name": "rtkSendNotification",
                "method": "sendNotificationListener",
                "target": "window",
                "capture": false,
                "passive": false
            }];
    }
}
__decorate([
    SyncWithStore()
], RtkNotifications.prototype, "meeting", void 0);
__decorate([
    SyncWithStore()
], RtkNotifications.prototype, "states", void 0);
__decorate([
    SyncWithStore()
], RtkNotifications.prototype, "config", void 0);
__decorate([
    SyncWithStore()
], RtkNotifications.prototype, "t", void 0);
__decorate([
    SyncWithStore()
], RtkNotifications.prototype, "iconPack", void 0);
