ase "hide": {
          hidePanel(panel);
          panel = null;
          break;
        }
      }
    };
  }

  /**
   * @param {MouseEvent|KeyboardEvent} event
   */
  function deriveCoordinates(event) {
    const target = /** @type HTMLElement */ (event.target);

    // We prevent synthetic AT clicks from putting
    // the dialog in a weird place. The AT events sometimes
    // lack coordinates, so they have clientX/Y = 0
    const rect = target.getBoundingClientRect();
    if (
      event instanceof