'use strict';

var index = require('./index-feA4skrY.js');
var bem = require('./bem-p0PWVN8n.js');

const balNoticesCss = ".bal-notices{position:fixed !important;display:-ms-flexbox !important;display:flex !important;top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;padding-top:1rem !important;padding-bottom:1rem !important;margin:0 !important;overflow:hidden !important;z-index:var(--bal-z-index-toast) !important;pointer-events:none !important;-ms-flex-direction:column !important;flex-direction:column !important}.bal-notices--container{-ms-flex-align:center !important;align-items:center !important}.bal-notices:not(.bal-notices--container){padding-left:1rem !important;padding-right:1rem !important}.bal-notices__inner{display:-ms-flexbox;display:flex;gap:.5rem}.bal-notices__inner--snackbar{height:100vh;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:end;align-items:flex-end;-ms-flex-direction:column;flex-direction:column;margin:.5em}.bal-notices__inner--snackbar .bal-snackbar{-ms-flex-pack:end;justify-content:flex-end;-ms-flex-item-align:end;align-self:flex-end;pointer-events:auto !important}.bal-notices__inner--toast{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;margin:.5em}.bal-notices__inner--toast .bal-toast{-ms-flex-pack:center;justify-content:center;-ms-flex-item-align:center;align-self:center;pointer-events:auto !important}.bal-notices__inner.container{--bal-toast-width:100%;--bal-toast-width-tablet:100%;--bal-toast-width-desktop:100%}.bal-notices--animated .bal-toast{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:slideInDown;animation-name:slideInDown}.bal-notices--animated .bal-snackbar{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:slideInUp;animation-name:slideInUp}@-webkit-keyframes slideInDown{from{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);visibility:visible}to{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}@keyframes slideInDown{from{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);visibility:visible}to{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}@-webkit-keyframes slideInUp{from{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);visibility:visible}to{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}@keyframes slideInUp{from{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);visibility:visible}to{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}";

const Notices = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        /**
         * @internal Tells if the notice is animated
         */
        this.animated = true;
        /**
         * @internal The interface tells the notice where to show the notice.
         */
        this.interface = 'toast';
        /**
         * @internal Sets the content content width with the regular container classes
         */
        this.container = undefined;
    }
    render() {
        const block = bem.BEM.block('notices');
        const innerEl = block.element('inner');
        const hasContainer = this.interface === 'toast' && this.container !== undefined;
        return (index.h(index.Host, { key: '83c73f66abe9dc3abf4181c43af09fc4ce7f3b7a', class: Object.assign(Object.assign(Object.assign({ 'bal-app': true }, block.class()), block.modifier('container').class(hasContainer)), block.modifier('animated').class(this.animated)) }, index.h("div", { key: 'f16cd17c52f0df45500e9be985fc099c5c134cf6', class: Object.assign(Object.assign(Object.assign({}, innerEl.class()), innerEl.modifier(this.interface).class()), { container: hasContainer, [`is-${this.container}`]: hasContainer && this.container !== '' }) }, index.h("slot", { key: 'bdf0fc55a2b9d63fed14821e8e83553394052ac2' }))));
    }
};
Notices.style = balNoticesCss;

const balSnackbarCss = ":root{--bal-snackbar-font-size:var(--bal-text-size-small);--bal-snackbar-font-family:var(--bal-font-family-text);--bal-snackbar-title-font-size:var(--bal-text-size-medium);--bal-snackbar-title-font-family:var(--bal-font-family-title);--bal-snackbar-background:var(--bal-color-white);--bal-snackbar-background-primary:var(--bal-color-white);--bal-snackbar-background-info:var(--bal-color-info-2);--bal-snackbar-background-success:var(--bal-color-success-2);--bal-snackbar-background-warning:var(--bal-color-warning-2);--bal-snackbar-background-danger:var(--bal-color-danger-2);--bal-snackbar-radius:var(--bal-radius-large);--bal-snackbar-color:var(--bal-color-text-primary);--bal-snackbar-color-primary:var(--bal-color-text-primary);--bal-snackbar-color-info:var(--bal-color-text-primary);--bal-snackbar-color-success:var(--bal-color-text-primary);--bal-snackbar-color-warning:var(--bal-color-text-primary);--bal-snackbar-color-danger:var(--bal-color-text-primary)}.bal-snackbar{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-positive:0 !important;flex-grow:0 !important;gap:.5rem;padding:var(--bal-space-medium) var(--bal-space-normal);border-radius:var(--bal-snackbar-radius);background:var(--bal-snackbar-background);color:var(--bal-snackbar-color);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;min-height:3.5rem;width:18rem}@media screen and (min-width: 769px),print{.bal-snackbar{width:18rem}}@media screen and (min-width: 1024px){.bal-snackbar{width:27.5rem}}.bal-snackbar--color-primary{background:var(--bal-snackbar-background-primary);color:var(--bal-snackbar-color-primary)}.bal-snackbar--color-info{background:var(--bal-snackbar-background-info);color:var(--bal-snackbar-color-info)}.bal-snackbar--color-danger{background:var(--bal-snackbar-background-danger);color:var(--bal-snackbar-color-danger)}.bal-snackbar--color-warning{background:var(--bal-snackbar-background-warning);color:var(--bal-snackbar-color-warning)}.bal-snackbar--color-success{background:var(--bal-snackbar-background-success);color:var(--bal-snackbar-color-success)}.bal-snackbar__details{display:-ms-flexbox;display:flex;gap:1rem}.bal-snackbar__details__icon{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;width:1.5rem}.bal-snackbar__details__icon--masked{background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.bal-snackbar__details__icon--masked,.bal-snackbar__details__icon--color-primary{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>')}.bal-snackbar__details__icon--color-info{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M6.176 13.705c-0.65 0-1.176 0.514-1.176 1.147 0 0.635 0.526 1.149 1.176 1.149h2.824h2.824c0.65 0 1.176-0.514 1.176-1.149 0-0.633-0.526-1.147-1.176-1.147h-1.647V8.426c0-0.634-0.526-1.147-1.176-1.147H7.118C6.468 7.279 5.941 7.792 5.941 8.426c0 0.633 0.526 1.147 1.176 1.147h0.706v4.132H6.176zM10.882 3.836c0 1.014-0.843 1.836-1.882 1.836S7.118 4.85 7.118 3.836C7.118 2.822 7.96 2 9 2s1.882 0.822 1.882 1.836z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M6.176 13.705c-0.65 0-1.176 0.514-1.176 1.147 0 0.635 0.526 1.149 1.176 1.149h2.824h2.824c0.65 0 1.176-0.514 1.176-1.149 0-0.633-0.526-1.147-1.176-1.147h-1.647V8.426c0-0.634-0.526-1.147-1.176-1.147H7.118C6.468 7.279 5.941 7.792 5.941 8.426c0 0.633 0.526 1.147 1.176 1.147h0.706v4.132H6.176zM10.882 3.836c0 1.014-0.843 1.836-1.882 1.836S7.118 4.85 7.118 3.836C7.118 2.822 7.96 2 9 2s1.882 0.822 1.882 1.836z\" fill=\"black\"/></svg>')}.bal-snackbar__details__icon--color-success{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M15.637 3.247c0.426 0.379 0.486 1.059 0.134 1.518L7.73 15.251l-0.002 0.003c-0.183 0.237-0.413 0.426-0.672 0.555-0.26 0.13-0.543 0.195-0.829 0.191-0.291-0.004-0.577-0.08-0.837-0.219-0.259-0.14-0.485-0.341-0.662-0.588l-2.517-3.488c-0.339-0.47-0.261-1.147 0.175-1.512 0.436-0.365 1.064-0.28 1.403 0.19l2.463 3.414 7.976-10.403c0.352-0.459 0.982-0.524 1.408-0.144z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M15.637 3.247c0.426 0.379 0.486 1.059 0.134 1.518L7.73 15.251l-0.002 0.003c-0.183 0.237-0.413 0.426-0.672 0.555-0.26 0.13-0.543 0.195-0.829 0.191-0.291-0.004-0.577-0.08-0.837-0.219-0.259-0.14-0.485-0.341-0.662-0.588l-2.517-3.488c-0.339-0.47-0.261-1.147 0.175-1.512 0.436-0.365 1.064-0.28 1.403 0.19l2.463 3.414 7.976-10.403c0.352-0.459 0.982-0.524 1.408-0.144z\" fill=\"black\"/></svg>')}.bal-snackbar__details__icon--color-warning{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>')}.bal-snackbar__details__icon--color-danger{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>')}.bal-snackbar__details__close{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;width:2rem}.bal-snackbar__details__content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;gap:.125rem}.bal-snackbar__details__content h2{font-family:var(--bal-snackbar-title-font-family);font-size:var(--bal-snackbar-title-font-size);font-weight:var(--bal-font-weight-bold);line-height:var(--bal-text-line-height-title)}@media screen and (min-width: 769px),print{.bal-snackbar__details__content h2{font-size:var(--bal-text-size-medium-tablet)}}@media screen and (min-width: 1024px){.bal-snackbar__details__content h2{font-size:var(--bal-text-size-medium-desktop)}}.bal-snackbar__details__content span{font-family:var(--bal-snackbar-font-family);font-size:var(--bal-snackbar-font-size);font-weight:var(--bal-font-weight-regular);line-height:var(--bal-text-line-height-text)}.bal-snackbar__button-wrapper{display:-ms-flexbox;display:flex}.bal-snackbar__button-wrapper .bal-button{-webkit-margin-start:2.5rem;margin-inline-start:2.5rem;-webkit-margin-before:.5rem;margin-block-start:.5rem}";

const Snackbar = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.balClose = index.createEvent(this, "balClose");
        this.balAction = index.createEvent(this, "balAction");
        this.snackbarId = `bal-snackbar-${snackbarIds++}`;
        /**
         * The theme type of the snackbar.
         */
        this.color = '';
        /**
         * The duration of the snackbar
         */
        this.duration = 0;
        /**
         * The subject of the snackbar header
         */
        this.subject = '';
        /**
         * The message of the snackbar as html content
         */
        this.message = '';
        /**
         * The icon of the snackbar header
         */
        this.icon = '';
        /**
         * Label text for the action button
         */
        this.action = '';
        /**
         * @internal Handler for on close event
         */
        this.closeHandler = () => void 0;
        /**
         * @internal Handler for on action button click event
         */
        this.actionHandler = () => void 0;
        /**
         * Specifies where to display the linked URL.
         * Only applies when an `href` is provided.
         */
        this.target = '_self';
        this.onActionHandler = () => {
            this.balAction.emit(this.snackbarId);
            this.actionHandler();
        };
    }
    async componentWillLoad() {
        if (this.duration > 0) {
            await this.closeIn(this.duration);
        }
    }
    /**
     * Closes the snackbar after the given duration in ms
     */
    async closeIn(duration) {
        this.timer = setTimeout(() => this.close(), duration);
    }
    /**
     * Closes this snackbar
     */
    async close() {
        clearTimeout(this.timer);
        this.balClose.emit(this.snackbarId);
        this.element.remove();
        this.closeHandler();
    }
    // get colorType() {
    //   if (this.color === '') {
    //     return ''
    //   }
    //   return `bal-snackbar__inner--is-${this.color}`
    // }
    // get buttonType(): BalProps.BalButtonColor {
    //   if (this.color === '') {
    //     return 'info'
    //   }
    //   return this.color
    // }
    render() {
        const block = bem.BEM.block('snackbar');
        const detailsEl = block.element('details');
        const buttonWrapperEl = block.element('button-wrapper');
        const subjectId = this.snackbarId + '-subject';
        const messageAttributes = {};
        if (this.message !== undefined && this.message !== '') {
            messageAttributes.innerHTML = this.message;
        }
        const isIconDefined = this.icon !== undefined && this.icon !== null && this.icon !== '';
        const colorIcons = {
            info: 'info-circle',
            primary: 'info-circle',
            warning: 'alert-triangle',
            danger: 'alert-triangle',
            success: 'check-circle',
        };
        const icon = isIconDefined ? this.icon : colorIcons[this.color || 'info'];
        return (index.h(index.Host, { key: 'b3915c5a567dc89a8ec7145a7ab98498ca97b66d', id: this.snackbarId, role: "alertdialog", class: Object.assign(Object.assign({}, block.class()), block.modifier(`color-${this.color}`).class(!!this.color)), "aria-labelledby": subjectId }, index.h("div", { key: 'ae6759e051630b2c9fe51c7d24d931e30737376d', class: Object.assign({}, detailsEl.class()) }, index.h("div", { key: 'dfb41b163dfb1ec063576c487769102bd2c52c40', "aria-hidden": "true", class: Object.assign(Object.assign(Object.assign({}, detailsEl.element('icon').class()), detailsEl.element('icon').modifier('masked').class(!isIconDefined)), detailsEl.element('icon').modifier(`color-${this.color}`).class(!isIconDefined)) }, isIconDefined ? index.h("bal-icon", { name: icon, color: 'primary', size: "medium" }) : ''), index.h("div", { key: '75a34eb777fbf3c9d8ffdc431a155183888fe5ad', class: Object.assign({}, detailsEl.element('content').class()) }, index.h("h2", { key: '7aecaed230c536db0771eb4060a20f8d89b737fa', id: subjectId }, this.subject), index.h("span", Object.assign({ key: '660cdb87938ee2d5e48bb103dbdb573deafbf088' }, messageAttributes), index.h("slot", { key: '8a9a874dca0cfce2771f4af4a356e7783d2efada' }), index.h("span", { key: '988af9ec4c07a0a07f82f0036931cd1dad15a13c', class: "hidden" }))), index.h("div", { key: 'be82a69b4dc2f4e42ba9f55e7f7af403ce0136cd', class: Object.assign({}, detailsEl.element('close').class()) }, index.h("bal-close", { key: '9b999204c4f1fbdb215161ae08ebec3c8ae21658', class: "bal-snackbar__close", "data-testid": "bal-snackbar-close", onClick: () => this.close() }))), this.action ? (index.h("div", { class: Object.assign({}, buttonWrapperEl.class()) }, index.h("bal-button", { color: "info", size: "small", href: this.href, target: this.target, onClick: () => this.onActionHandler(), "data-testid": "bal-snackbar-action" }, this.action))) : ('')));
    }
    get element() { return index.getElement(this); }
};
let snackbarIds = 0;
Snackbar.style = balSnackbarCss;

const balToastCss = ":root{--bal-toast-font-size:var(--bal-text-size-small);--bal-toast-title-font-size:var(--bal-text-size-normal);--bal-toast-font-family:var(--bal-font-family-text);--bal-toast-title-font-family:var(--bal-font-family-title);--bal-toast-background:var(--bal-color-white);--bal-toast-background-primary:var(--bal-color-white);--bal-toast-background-info:var(--bal-color-info-2);--bal-toast-background-success:var(--bal-color-success-2);--bal-toast-background-warning:var(--bal-color-warning-2);--bal-toast-background-danger:var(--bal-color-danger-2);--bal-toast-radius:var(--bal-radius-large);--bal-toast-color:var(--bal-color-text-primary);--bal-toast-color-primary:var(--bal-color-text-primary);--bal-toast-color-info:var(--bal-color-text-primary);--bal-toast-color-success:var(--bal-color-text-primary);--bal-toast-color-warning:var(--bal-color-text-primary);--bal-toast-color-danger:var(--bal-color-text-primary);--bal-toast-width:100%;--bal-toast-width-tablet:28.75rem;--bal-toast-width-desktop:30rem}.bal-toast{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;position:relative;-ms-flex-positive:0 !important;flex-grow:0 !important;width:100%}.bal-toast__inner{min-height:3.5rem;border-radius:var(--bal-toast-radius);background:var(--bal-toast-background);color:var(--bal-toast-color);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-positive:1;flex-grow:1;-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);padding:var(--bal-space-normal);max-width:var(--bal-toast-width);width:var(--bal-toast-width)}@media screen and (min-width: 769px),print{.bal-toast__inner{padding:var(--bal-space-normal-tablet)}}@media screen and (min-width: 1024px){.bal-toast__inner{padding:var(--bal-space-normal-desktop)}}@media screen and (min-width: 769px),print{.bal-toast__inner{max-width:var(--bal-toast-width-tablet);width:var(--bal-toast-width-tablet)}}@media screen and (min-width: 1024px){.bal-toast__inner{max-width:var(--bal-toast-width-desktop);width:var(--bal-toast-width-desktop)}}.bal-toast__inner--color-primary{background:var(--bal-toast-background-primary);color:var(--bal-toast-color-primary)}.bal-toast__inner--color-info{background:var(--bal-toast-background-info);color:var(--bal-toast-color-info)}.bal-toast__inner--color-danger{background:var(--bal-toast-background-danger);color:var(--bal-toast-color-danger)}.bal-toast__inner--color-warning{background:var(--bal-toast-background-warning);color:var(--bal-toast-color-warning)}.bal-toast__inner--color-success{background:var(--bal-toast-background-success);color:var(--bal-toast-color-success)}.bal-toast__label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;gap:.125rem;margin-left:2rem;margin-right:2.5rem;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;font-size:var(--bal-toast-title-font-size);font-family:var(--bal-toast-font-family)}.bal-toast__label>strong,.bal-toast__label>b,.bal-toast__label>h2{font-family:var(--bal-toast-title-font-family);font-size:var(--bal-toast-title-font-size);line-height:var(--bal-text-line-height-title)}.bal-toast__label>span,.bal-toast__label>p{font-family:var(--bal-toast-font-family);font-size:var(--bal-toast-font-size);line-height:var(--bal-text-line-height-text)}.bal-toast__close.bal-close{position:absolute;top:1.8rem;right:1rem;margin-top:-0.75rem}.bal-toast__inner:before{background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;position:absolute;height:1.5rem;width:1.5rem;left:.825rem;top:1rem;content:\"\";display:block;background-color:var(--bal-color-primary);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>')}.bal-toast__inner--color-primary:before{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M5.52 3.448C6.452 2.521 7.716 2 9.033 2s2.562 0.521 3.493 1.448C13.478 4.374 14.001 5.632 14.001 6.942v4.413c0 0.31 0.124 0.605 0.344 0.824 0.249 0.248 0.445 0.342 0.719 0.342 0.278 0 0.503 0.224 0.503 0.501 0 0.277-0.225 0.501-0.503 0.501H3.003c-0.278 0-0.503-0.224-0.503-0.501 0-0.277 0.225-0.501 0.503-0.501 0.275 0 0.47-0.094 0.719-0.342 0.219-0.219 0.344-0.514 0.344-0.824V6.942c0-1.311 0.523-2.569 1.456-3.494zM7.274 15.25c0-0.414 0.338-0.75 0.754-0.75h2.01c0.416 0 0.754 0.336 0.754 0.75s-0.338 0.75-0.754 0.75h-2.01c-0.416 0-0.754-0.336-0.754-0.75z\" fill=\"black\"/></svg>')}.bal-toast__inner--color-info:before{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M6.176 13.705c-0.65 0-1.176 0.514-1.176 1.147 0 0.635 0.526 1.149 1.176 1.149h2.824h2.824c0.65 0 1.176-0.514 1.176-1.149 0-0.633-0.526-1.147-1.176-1.147h-1.647V8.426c0-0.634-0.526-1.147-1.176-1.147H7.118C6.468 7.279 5.941 7.792 5.941 8.426c0 0.633 0.526 1.147 1.176 1.147h0.706v4.132H6.176zM10.882 3.836c0 1.014-0.843 1.836-1.882 1.836S7.118 4.85 7.118 3.836C7.118 2.822 7.96 2 9 2s1.882 0.822 1.882 1.836z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M6.176 13.705c-0.65 0-1.176 0.514-1.176 1.147 0 0.635 0.526 1.149 1.176 1.149h2.824h2.824c0.65 0 1.176-0.514 1.176-1.149 0-0.633-0.526-1.147-1.176-1.147h-1.647V8.426c0-0.634-0.526-1.147-1.176-1.147H7.118C6.468 7.279 5.941 7.792 5.941 8.426c0 0.633 0.526 1.147 1.176 1.147h0.706v4.132H6.176zM10.882 3.836c0 1.014-0.843 1.836-1.882 1.836S7.118 4.85 7.118 3.836C7.118 2.822 7.96 2 9 2s1.882 0.822 1.882 1.836z\" fill=\"black\"/></svg>')}.bal-toast__inner--color-success:before{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M15.637 3.247c0.426 0.379 0.486 1.059 0.134 1.518L7.73 15.251l-0.002 0.003c-0.183 0.237-0.413 0.426-0.672 0.555-0.26 0.13-0.543 0.195-0.829 0.191-0.291-0.004-0.577-0.08-0.837-0.219-0.259-0.14-0.485-0.341-0.662-0.588l-2.517-3.488c-0.339-0.47-0.261-1.147 0.175-1.512 0.436-0.365 1.064-0.28 1.403 0.19l2.463 3.414 7.976-10.403c0.352-0.459 0.982-0.524 1.408-0.144z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M15.637 3.247c0.426 0.379 0.486 1.059 0.134 1.518L7.73 15.251l-0.002 0.003c-0.183 0.237-0.413 0.426-0.672 0.555-0.26 0.13-0.543 0.195-0.829 0.191-0.291-0.004-0.577-0.08-0.837-0.219-0.259-0.14-0.485-0.341-0.662-0.588l-2.517-3.488c-0.339-0.47-0.261-1.147 0.175-1.512 0.436-0.365 1.064-0.28 1.403 0.19l2.463 3.414 7.976-10.403c0.352-0.459 0.982-0.524 1.408-0.144z\" fill=\"black\"/></svg>')}.bal-toast__inner--color-warning:before{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>')}.bal-toast__inner--color-danger:before{mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>');-webkit-mask-image:url('data:image/svg+xml;charset=UTF-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 18\"><path d=\"M9.333 2c0.805 0 1.458 0.514 1.458 1.148v5.508c0 0.634-0.653 1.148-1.458 1.148s-1.458-0.514-1.458-1.148V3.148C7.875 2.514 8.528 2 9.333 2zM9.333 16c1.289 0 2.334-0.822 2.334-1.836s-1.045-1.836-2.334-1.836S7 13.15 7 14.164 8.044 16 9.333 16z\" fill=\"black\"/></svg>')}";

const Toast = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.balClose = index.createEvent(this, "balClose");
        this.toastId = `bal-toast-${toastIds++}`;
        /**
         * The theme type of the toast.
         * Color type primary is deprecated, please use info instead.
         */
        this.color = '';
        /**
         * The duration of the toast in milliseconds.
         */
        this.duration = 0;
        /**
         * If `true` the toast has a cross icon to close the toast.
         */
        this.closable = true;
        /**
         * Content message
         */
        this.message = '';
        /**
         * @internal Handler for on close event
         */
        this.closeHandler = () => void 0;
    }
    async componentWillLoad() {
        if (this.duration > 0) {
            await this.closeIn(this.duration);
        }
    }
    /**
     * Closes the toast after the given duration in ms
     */
    async closeIn(duration) {
        this.timer = setTimeout(() => this.close(), duration);
    }
    /**
     * Closes this toast
     */
    async close() {
        this.element.remove();
        clearTimeout(this.timer);
        this.balClose.emit(this.toastId);
        this.closeHandler();
    }
    render() {
        const block = bem.BEM.block('toast');
        const innerEl = block.element('inner');
        const labelEl = block.element('label');
        const closeEl = block.element('close');
        return (index.h(index.Host, { key: '46ad818112b1002e1a48a627eb714dec23aba2a5', id: this.toastId, class: Object.assign({}, block.class()) }, index.h("div", { key: 'e2db452a14a302ba7ed9ebbeb8a78e801a175998', role: "status", class: Object.assign(Object.assign({}, innerEl.class()), innerEl.modifier(`color-${this.color}`).class(!!this.color)) }, index.h("span", { key: '41331cb2609ece86bb59951cab9ec61b76b27c33', class: Object.assign({}, labelEl.class()), "data-testid": "bal-toast-label", innerHTML: this.message }, index.h("slot", { key: '09572e31b7d8bcc5ec8f31e33df31cdca13a7355' })), this.closable !== false ? (index.h("bal-close", { class: Object.assign({}, closeEl.class()), onClick: () => this.close(), inverted: false, "data-testid": "bal-toast-close" })) : (''))));
    }
    get element() { return index.getElement(this); }
};
let toastIds = 0;
Toast.style = balToastCss;

exports.bal_notices = Notices;
exports.bal_snackbar = Snackbar;
exports.bal_toast = Toast;
