@RequiresEdt
  public static void dragPopupByComponent(@NotNull JBPopup popup, @NotNull JComponent component) {
    var listener = new PopupDragListener(popup);
    component.addMouseListener(listener);
    component.addMouseMotionListener(listener);
    Disposer.register(popup, () -> {
      component.removeMouseMotionListener(listener);
      component.removeMouseListener(listener);
    });
  }
@RequiresEdt
  public static void dragPopupByComponent(@NotNull JBPopup popup, @NotNull JComponent component)