${message}
+ + `; + + overlay.appendChild(dialog); + document.body.appendChild(overlay); + + const cancelBtn = dialog.querySelector(".cancel"); + const confirmBtn = dialog.querySelector(`.${confirmClass}`); + + const cleanup = () => { + overlay.remove(); + }; + + cancelBtn?.addEventListener("click", () => { + cleanup(); + onCancel(); + }); + + confirmBtn?.addEventListener("click", () => { + cleanup(); + onConfirm(); + }); + + overlay.addEventListener("click", (e) => { + if (e.target === overlay) { + cleanup(); + onCancel(); + } + }); +} + +/** + * Show alert message + */ +function showAlert(message: string, type: "error" | "success" | "info" = "info"): void { + // Remove existing alerts + document.querySelectorAll(".cal-noshow-alert").forEach((el) => el.remove()); + + const alert = document.createElement("div"); + alert.className = `cal-noshow-alert ${type}`; + alert.textContent = message; + document.body.appendChild(alert); + + setTimeout(() => { + alert.remove(); + }, 1200); +} + +/** + * Open the companion sidebar for login + */ +function openSidebarForLogin(): void { + // Dispatch custom event that content script listens for + window.dispatchEvent(new CustomEvent("cal-companion-open-sidebar")); +} + +/** + * Handle mark no-show button click + */ +async function handleMarkNoShow( + container: HTMLDivElement, + bookingUid: string, + attendeeEmail: string, + isCurrentlyMarked: boolean +): Promise