import { p as proxyCustomElement, H, h, c as Host } from './p-ae373651.js';
import { i as useLanguage, e as defaultIconPack } from './p-5b3a7f00.js';
import { S as SyncWithStore } from './p-070aa695.js';
import { d as defineCustomElement$2 } from './p-3e0452c4.js';

const rtkRecordingIndicatorCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}:host[size='sm']{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);animation:blink 4s linear infinite}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([size='sm']) .indicator span{display:none}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";
const RtkRecordingIndicatorStyle0 = rtkRecordingIndicatorCss;

var __decorate = (undefined && undefined.__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;
};
const RtkRecordingIndicator$1 = /*@__PURE__*/ proxyCustomElement(class RtkRecordingIndicator extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        /** Language */
        this.t = useLanguage();
        /** Icon pack */
        this.iconPack = defaultIconPack;
        this.setIsRecording = (recordingState) => {
            this.isRecording = recordingState === 'RECORDING';
        };
    }
    connectedCallback() {
        this.meetingChanged(this.meeting);
    }
    disconnectedCallback() {
        var _a;
        (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.recording.removeListener('recordingUpdate', this.updateRecordingStatus);
    }
    meetingChanged(meeting) {
        if (meeting != null) {
            this.setIsRecording(meeting.recording.recordingState);
            this.updateRecordingStatus = (recordingState) => {
                this.setIsRecording(recordingState);
            };
            meeting.recording.addListener('recordingUpdate', this.updateRecordingStatus);
        }
    }
    render() {
        return (h(Host, { key: 'c4246e4721b0ca5fbc689a90688f1239df60ecad', "data-hidden": !this.isRecording }, this.isRecording && (h("div", { key: 'ce19b3649bba8a91cd22770534762c932b934557', class: "indicator", "aria-label": this.t('recording.indicator'), part: "indicator" }, h("rtk-icon", { key: '9d2ae89fef0d4e1e0d3546f765f48be8a6da6b5a', icon: this.iconPack.recording, "aria-hidden": true, tabIndex: -1, part: "icon" }), h("span", { key: 'cedf044a1a96c164022d734be2baf7e568fb849e' }, this.t('recording.label'))))));
    }
    static get watchers() { return {
        "meeting": ["meetingChanged"]
    }; }
    static get style() { return RtkRecordingIndicatorStyle0; }
}, [1, "rtk-recording-indicator", {
        "meeting": [16],
        "size": [513],
        "t": [16],
        "iconPack": [16],
        "isRecording": [32]
    }, undefined, {
        "meeting": ["meetingChanged"]
    }]);
__decorate([
    SyncWithStore()
], RtkRecordingIndicator$1.prototype, "meeting", void 0);
__decorate([
    SyncWithStore()
], RtkRecordingIndicator$1.prototype, "t", void 0);
__decorate([
    SyncWithStore()
], RtkRecordingIndicator$1.prototype, "iconPack", void 0);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["rtk-recording-indicator", "rtk-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "rtk-recording-indicator":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, RtkRecordingIndicator$1);
            }
            break;
        case "rtk-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const RtkRecordingIndicator = RtkRecordingIndicator$1;
const defineCustomElement = defineCustomElement$1;

export { RtkRecordingIndicator, defineCustomElement };
