mented, we should really
    // use that.
    trapFocus(panel, dfn);
  }

  /**
   * @param {HTMLElement} panel
   * @param {HTMLElement} dfn
   * @returns
   */
  function trapFocus(panel, dfn) {
    /** @type NodeListOf<HTMLAnchorElement> elements */
    const anchors = panel.querySelectorAll("a[href]");
    // No need to trap focus
    if (!anchors.length) return;

    // Move focus to first anchor element
    const first = anchors.item(0);
    first.focus();

    const trapListener = createTrapListener(