'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ceff47a0.js');

const bpSdkNotificationCss = "";
const BpSdkNotificationStyle0 = bpSdkNotificationCss;

const BpSdkNotification = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.notification = undefined;
        this.removeNotification = undefined;
        this.text = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-notification');
        customElements.whenDefined('bp-sdk-external-notification').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-notification", { notification: this.notification, text: this.text, removeNotification: this.removeNotification });
    }
    renderInternal() {
        var _a;
        return (index.h("div", { class: "bp-sdk-notification__container" }, index.h("div", { class: "bp-sdk-notification_button__container" }, index.h("button", { type: "button", onClick: () => this.removeNotification(this.notification) }, !!this.text ? this.text : 'Close')), index.h("div", { innerHTML: (_a = this.notification) === null || _a === void 0 ? void 0 : _a.notification })));
    }
};
BpSdkNotification.style = BpSdkNotificationStyle0;

exports.bp_sdk_notification = BpSdkNotification;
