import { h } from "@stencil/core";
import deepMerge from "lodash-es/merge";
import { getSize } from "../../utils/size";
import { useLanguage } from "../../lib/lang";
import { defaultIconPack } from "../../lib/icons";
import { createDefaultConfig } from "../../lib/default-ui-config";
import { Render } from "../../lib/render";
import { provideRtkDesignSystem } from "../../index";
import { generateConfig } from "../../utils/config";
import ResizeObserver from "resize-observer-polyfill";
import { createPeerStore, uiStore as legacyGlobalUIStore, } from "../../utils/sync-with-store/ui-store";
import { defaultOverrides } from "../../lib/overrides";
import { getJoinErrorInfo } from "../../utils/join-error";
/**
 * A single component which renders an entire meeting UI.
 *
 * It loads your preset and renders the UI based on it.
 * With this component, you don't have to handle all the states,
 * dialogs and other smaller bits of managing the application.
 */
export class RtkMeeting {
    constructor() {
        /** Since RtkMeeting by design works as a provider for component, to be in sync with other providers, added provider id */
        this.providerId = 'provider-' + Math.floor(Math.random() * 100);
        this.roomJoinedListener = () => {
            this.updateStates({ meeting: 'joined', joinError: undefined, joinErrorCode: undefined });
        };
        this.waitlistedListener = () => {
            this.updateStates({ meeting: 'waiting' });
        };
        this.roomLeftListener = ({ state }) => {
            // Let socketConnectionUpdate listener handle this case.
            if (state === 'disconnected' || state === 'failed')
                return;
            this.updateStates({ meeting: 'ended', roomLeftState: state });
        };
        this.mediaPermissionUpdateListener = ({ kind, message }) => {
            if (['audio', 'video'].includes(kind)) {
                if ((message === 'DENIED' || message === 'SYSTEM_DENIED') &&
                    (this.peerStore || legacyGlobalUIStore).state.states.activeDebugger !== true) {
                    const permissionModalSettings = {
                        enabled: true,
                        kind,
                    };
                    this.updateStates({ activePermissionsMessage: permissionModalSettings });
                }
            }
        };
        this.socketConnectionUpdateListener = ({ state }) => {
            if (state === 'failed') {
                setTimeout(() => {
                    this.meeting.leave('disconnected');
                }, this.leaveRoomTimer);
            }
        };
        this.peerStore = null; // peer specific store for this meeting peer instance
        /** Whether to load config from preset */
        this.loadConfigFromPreset = false;
        /** Whether to apply the design system on the document root from config */
        this.applyDesignSystem = false;
        /** Fill type */
        this.mode = 'fixed';
        /** Whether participant should leave when this component gets unmounted */
        this.leaveOnUnmount = false;
        /** Language */
        this.t = useLanguage();
        /** UI Config */
        this.config = createDefaultConfig();
        /** Grid layout */
        this.gridLayout = 'row';
        /** Icon pack */
        this.iconPack = defaultIconPack;
        /** UI Kit Overrides */
        this.overrides = defaultOverrides;
        this.handleChangingMeeting = (destinationMeetingId) => {
            const currentStates = (this.peerStore || legacyGlobalUIStore).state.states;
            this.updateStates({
                activeBreakoutRoomsManager: Object.assign(Object.assign({}, currentStates.activeBreakoutRoomsManager), { destinationMeetingId }),
            });
        };
    }
    connectedCallback() {
        var _a;
        if (typeof window !== 'undefined') {
            this.authErrorListener = (ev) => {
                if (ev.detail.message.includes('401')) {
                    this.updateStates({ meeting: 'ended', roomLeftState: 'unauthorized' });
                }
            };
            window.addEventListener('rtkError', this.authErrorListener);
        }
        // Initialize default values
        this.leaveRoomTimer = 10000;
        this.loadConfigFromPreset = true;
        this.applyDesignSystem = true;
        // Setup event listeners
        this.setupStoreRequestListener();
        this.setupStateUpdateListener();
        this.meetingChanged(this.meeting);
        this.iconPackChanged(this.iconPack);
        this.tChanged(this.t);
        this.configChanged(this.config);
        this.overridesChanged(this.overrides);
        this.resizeObserver = new ResizeObserver(() => this.handleResize());
        this.resizeObserver.observe(this.host);
        if (this.applyDesignSystem &&
            ((_a = this.config) === null || _a === void 0 ? void 0 : _a.designTokens) != null &&
            typeof document !== 'undefined' &&
            (this.peerStore || legacyGlobalUIStore).state.states.activeDebugger !== true) {
            provideRtkDesignSystem(document.documentElement, this.config.designTokens);
        }
    }
    disconnectedCallback() {
        var _a;
        if (this.leaveOnUnmount) {
            (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.leave();
        }
        this.resizeObserver.disconnect();
        window.removeEventListener('rtkError', this.authErrorListener);
        // Remove event listeners
        if (this.storeRequestListener) {
            this.host.removeEventListener('rtkRequestStore', this.storeRequestListener);
            this.storeRequestListener = null;
        }
        if (this.stateUpdateListener) {
            this.host.removeEventListener('rtkStateUpdate', this.stateUpdateListener);
            this.stateUpdateListener = null;
        }
        // Clear meeting listeners
        if (this.meeting) {
            this.clearListeners(this.meeting);
        }
    }
    setupStoreRequestListener() {
        // Remove existing listener if any
        if (this.storeRequestListener) {
            this.host.removeEventListener('rtkRequestStore', this.storeRequestListener);
        }
        // Listen for store requests from child components
        this.storeRequestListener = (event) => {
            // Provide peer specific store if available, otherwise fall back to global store
            if (!this.peerStore)
                return;
            const storeToProvide = this.peerStore;
            const responseEvent = new CustomEvent('rtkProvideStore', {
                detail: { store: storeToProvide, requestId: event.detail.requestId },
            });
            document.dispatchEvent(responseEvent);
            // Stop the event from bubbling further to prevent other meetings from handling it
            event.stopPropagation();
        };
        this.host.addEventListener('rtkRequestStore', this.storeRequestListener);
    }
    setupStateUpdateListener() {
        if (this.stateUpdateListener) {
            this.host.removeEventListener('rtkStateUpdate', this.stateUpdateListener);
        }
        this.stateUpdateListener = (event) => {
            const eventTarget = event.target;
            if (!this.host.contains(eventTarget)) {
                return;
            }
            this.updateStates(event.detail);
        };
        this.host.addEventListener('rtkStateUpdate', this.stateUpdateListener);
    }
    clearListeners(meeting) {
        if (!meeting)
            return;
        meeting.self.removeListener('roomLeft', this.roomLeftListener);
        meeting.self.removeListener('roomJoined', this.roomJoinedListener);
        meeting.self.removeListener('waitlisted', this.waitlistedListener);
        meeting.self.removeListener('mediaPermissionUpdate', this.mediaPermissionUpdateListener);
        meeting.meta.removeListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
    }
    meetingChanged(meeting, oldMeeting) {
        var _a, _b;
        if (!meeting)
            return;
        // Create peer specific store for this meeting peer instance
        if (meeting) {
            this.peerStore = createPeerStore({
                meeting,
                config: this.config,
                iconPack: this.iconPack,
                t: this.t,
                providerId: this.providerId,
                overrides: deepMerge(Object.assign({}, defaultOverrides), this.overrides),
            });
            // Notify components that peer specific store is now available
            document.dispatchEvent(new CustomEvent('rtkPeerStoreReady', {
                detail: {
                    peerId: meeting.self.id,
                },
            }));
        }
        else {
            this.peerStore = null;
        }
        const targetStore = this.peerStore || legacyGlobalUIStore;
        /** Honor user's explicit choice for captions, but respect preset default if no explicit choice */
        const desiredActiveCaptionsState = !oldMeeting
            ? !!meeting.self.permissions.transcriptionEnabled
            : !!targetStore.state.states.activeCaptions;
        this.updateStates({
            viewType: meeting.meta.viewType,
            activeCaptions: desiredActiveCaptionsState,
        });
        if (this.loadConfigFromPreset && meeting.self.config != null) {
            const theme = meeting.self.config;
            const { config, data } = generateConfig(theme, meeting);
            this.config = config;
            if (this.showSetupScreen == null) {
                this.showSetupScreen = data.showSetupScreen;
            }
            if ((_a = targetStore.state.states.activeBreakoutRoomsManager) === null || _a === void 0 ? void 0 : _a.destinationMeetingId) {
                this.showSetupScreen = false;
            }
        }
        if (this.applyDesignSystem &&
            ((_b = this.config) === null || _b === void 0 ? void 0 : _b.designTokens) != null &&
            typeof document !== 'undefined' &&
            targetStore.state.states.activeDebugger !== true) {
            provideRtkDesignSystem(document.documentElement, this.config.designTokens);
        }
        meeting.self.addListener('roomJoined', this.roomJoinedListener);
        meeting.self.addListener('waitlisted', this.waitlistedListener);
        meeting.self.addListener('roomLeft', this.roomLeftListener);
        meeting.self.addListener('mediaPermissionUpdate', this.mediaPermissionUpdateListener);
        meeting.meta.addListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
        meeting.connectedMeetings.once('changingMeeting', this.handleChangingMeeting);
        if (meeting.self.roomJoined) {
            this.updateStates({ meeting: 'joined' });
        }
        else {
            if (this.showSetupScreen) {
                this.updateStates({ meeting: 'setup' });
            }
            else {
                meeting
                    .join()
                    .then(() => {
                    this.updateStates({ joinError: undefined, joinErrorCode: undefined });
                })
                    .catch((err) => {
                    const { message, code } = getJoinErrorInfo(this.t, err);
                    this.updateStates({ joinError: message, joinErrorCode: code });
                });
            }
        }
        window.removeEventListener('rtkError', this.authErrorListener);
    }
    iconPackChanged(newIconPack) {
        if (this.peerStore) {
            this.peerStore.state.iconPack = newIconPack;
        }
    }
    tChanged(newT) {
        if (this.peerStore) {
            this.peerStore.state.t = newT;
        }
    }
    configChanged(config) {
        if (this.peerStore) {
            this.peerStore.state.config = config;
        }
        if ((config === null || config === void 0 ? void 0 : config.designTokens) &&
            typeof document !== 'undefined' &&
            (this.peerStore || legacyGlobalUIStore).state.states.activeDebugger !== true) {
            provideRtkDesignSystem(document.documentElement, config.designTokens);
        }
    }
    overridesChanged(overrides) {
        if (this.peerStore) {
            this.peerStore.state.overrides = deepMerge(Object.assign({}, defaultOverrides), overrides);
        }
    }
    handleResize() {
        this.size = getSize(this.host.clientWidth);
    }
    updateStates(states) {
        // Use peer specific store if available, otherwise fall back to global store
        const targetStore = this.peerStore || legacyGlobalUIStore;
        const newStates = Object.assign({}, targetStore.state.states);
        targetStore.state.states = deepMerge(newStates, states);
        // Emit unscoped event for backward compatibility
        this.statesUpdate.emit(targetStore.state.states);
        // Also emit a scoped event that only this meeting's components should listen to
        const scopedEvent = new CustomEvent('rtkStatesUpdate', {
            detail: targetStore.state.states,
            bubbles: true,
            composed: true,
        });
        this.host.dispatchEvent(scopedEvent);
    }
    render() {
        const defaults = {
            meeting: this.meeting,
            size: this.size,
            states: (this.peerStore || legacyGlobalUIStore).state.states,
            config: this.config || createDefaultConfig(),
            iconPack: this.iconPack,
            t: this.t,
        };
        if ((this.peerStore || legacyGlobalUIStore).state.states.viewType === 'CHAT') {
            return h("rtk-chat", Object.assign({}, defaults));
        }
        const elementProps = {
            'rtk-grid': {
                layout: this.gridLayout,
            },
        };
        return h(Render, { element: "rtk-meeting", defaults: defaults, asHost: true, elementProps: elementProps });
    }
    static get is() { return "rtk-meeting"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["rtk-meeting.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["rtk-meeting.css"]
        };
    }
    static get properties() {
        return {
            "loadConfigFromPreset": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether to load config from preset"
                },
                "getter": false,
                "setter": false,
                "attribute": "load-config-from-preset",
                "reflect": false,
                "defaultValue": "false"
            },
            "applyDesignSystem": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether to apply the design system on the document root from config"
                },
                "getter": false,
                "setter": false,
                "attribute": "apply-design-system",
                "reflect": false,
                "defaultValue": "false"
            },
            "mode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "MeetingMode",
                    "resolved": "\"fill\" | \"fixed\"",
                    "references": {
                        "MeetingMode": {
                            "location": "local",
                            "path": "/home/runner/work/realtimekit-ui/realtimekit-ui/packages/core/src/components/rtk-meeting/rtk-meeting.tsx",
                            "id": "src/components/rtk-meeting/rtk-meeting.tsx::MeetingMode"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Fill type"
                },
                "getter": false,
                "setter": false,
                "attribute": "mode",
                "reflect": true,
                "defaultValue": "'fixed'"
            },
            "leaveOnUnmount": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether participant should leave when this component gets unmounted"
                },
                "getter": false,
                "setter": false,
                "attribute": "leave-on-unmount",
                "reflect": false,
                "defaultValue": "false"
            },
            "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
            },
            "showSetupScreen": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether to show setup screen or not"
                },
                "getter": false,
                "setter": false,
                "attribute": "show-setup-screen",
                "reflect": false
            },
            "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()"
            },
            "config": {
                "type": "unknown",
                "mutable": true,
                "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": "UI Config"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "createDefaultConfig()"
            },
            "size": {
                "type": "string",
                "mutable": true,
                "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
            },
            "gridLayout": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "GridLayout",
                    "resolved": "\"column\" | \"row\"",
                    "references": {
                        "GridLayout": {
                            "location": "import",
                            "path": "../rtk-grid/rtk-grid",
                            "id": "src/components/rtk-grid/rtk-grid.tsx::GridLayout"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Grid layout"
                },
                "getter": false,
                "setter": false,
                "attribute": "grid-layout",
                "reflect": false,
                "defaultValue": "'row'"
            },
            "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"
            },
            "overrides": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "Overrides",
                    "resolved": "Overrides",
                    "references": {
                        "Overrides": {
                            "location": "import",
                            "path": "../../lib/overrides",
                            "id": "src/lib/overrides.ts::Overrides"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "UI Kit Overrides"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "defaultOverrides"
            }
        };
    }
    static get events() {
        return [{
                "method": "statesUpdate",
                "name": "rtkStatesUpdate",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emits `rtkStatesUpdate` so that developers can listen to onRtkStatesUpdate and update their own stores\nDo not confuse this with `rtkStateUpdate` that other components emit"
                },
                "complexType": {
                    "original": "States",
                    "resolved": "States",
                    "references": {
                        "States": {
                            "location": "import",
                            "path": "../../types/props",
                            "id": "src/types/props.ts::States"
                        }
                    }
                }
            }];
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "meeting",
                "methodName": "meetingChanged"
            }, {
                "propName": "iconPack",
                "methodName": "iconPackChanged"
            }, {
                "propName": "t",
                "methodName": "tChanged"
            }, {
                "propName": "config",
                "methodName": "configChanged"
            }, {
                "propName": "overrides",
                "methodName": "overridesChanged"
            }];
    }
}
