import "../../chunks/chunk.QU3DSPNU.js";
const Focusable = (superClass) => {
  class HighlightableElement extends superClass {
    focus(options) {
      this.setAttribute("tabindex", "0");
      super.focus(options);
    }
    connectedCallback() {
      super.connectedCallback();
      this.addEventListener("blur", (e) => {
        this.setAttribute("tabindex", "-1");
        this.dispatchEvent(
          new FocusEvent("gds-blur", {
            bubbles: false,
            composed: true,
            relatedTarget: e.relatedTarget
          })
        );
      });
      this.addEventListener("focus", (e) => {
        this.dispatchEvent(
          new FocusEvent("gds-focus", {
            bubbles: false,
            composed: true,
            relatedTarget: e.relatedTarget
          })
        );
      });
    }
  }
  return HighlightableElement;
};
export {
  Focusable
};
