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

const BsTabPanel = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.activeTabId = undefined;
    this.tabId = undefined;
  }
  get isActive() {
    return this.activeTabId && this.activeTabId === this.tabId;
  }
  get panelId() {
    return this.hostEl.id || `${this.tabId}-panel`;
  }
  // avoid unnecessary re-renders
  componentShouldUpdate(newValue, oldValue, propName) {
    if (newValue === oldValue)
      return false;
    if (propName === 'activeTabId') {
      return newValue === this.tabId || oldValue === this.tabId;
    }
  }
  render() {
    return (h(Host, { id: this.panelId, "aria-labelledby": this.tabId, "data-active": this.isActive, role: "tabpanel" }, h("slot", null)));
  }
  get hostEl() { return getElement(this); }
};

export { BsTabPanel as bs_tab_panel };

//# sourceMappingURL=bs-tab-panel.entry.js.map