type Menu = { element: HTMLElement; close: () => void; order: number; previous?: HTMLElement }; const menus = new Set