import { r as registerInstance, c as createEvent, h, H as Host } from './index-92f6d7ee.js';

const bsToastActionsCss = "bs-toast-actions{display:block}";

const BsToastActions = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.defaultDismiss = createEvent(this, "defaultDismiss", 7);
    this.isStacked = false;
    this.showDefault = false;
  }
  componentDidLoad() {
    if (this.actionsEl.childElementCount == 0) {
      this.showDefault = true;
    }
  }
  /** Stacks the actions when there are more than two (mobile only) */
  componentDidRender() {
    // Note: the default <slot> is counted as a child, so we're actually looking for 3 or more children
    if (this.actionsEl.childElementCount > 2) {
      this.isStacked = true;
    }
  }
  render() {
    return (h(Host, null, h("div", { ref: (el) => this.actionsEl = el, class: "bs-toast-actions", "data-stacked": this.isStacked }, this.showDefault && (h("bs-button", { size: "sm", "text-btn": true, onClick: () => this.defaultDismiss.emit() }, "Dismiss")), h("slot", null))));
  }
};
BsToastActions.style = bsToastActionsCss;

export { BsToastActions as bs_toast_actions };

//# sourceMappingURL=bs-toast-actions.entry.js.map