import { html } from "../util.js"; class PxmeHero extends HTMLElement { connectedCallback() { this.render(); } render() { const title = this.getAttribute("title") || "A private home for the moments that matter."; const message = this.getAttribute("message") || "PixMe keeps your photo library personal, searchable, and easy to explore with AI-powered descriptions, people tagging, and a clean gallery built for everyday use."; const mode = this.getAttribute("mode") || "default"; const signInLabel = this.getAttribute("sign-in-label") || "Sign in to continue"; const status = this.getAttribute("status") || ""; const isPopupMode = mode === "popup"; // UAT only: the server exposes a non-Google test login. When the flag is // off (including all of production) this endpoint 404s and no link shows. const testLoginAvailable = this.getAttribute("test-login") === "true"; this.innerHTML = html`

Private photo gallery

${title}

${message}

${isPopupMode ? `` : `${signInLabel}`} Browse API docs
${testLoginAvailable ? `Test login (UAT)` : ""} ${status ? `

${status}

` : ""}
`; if (isPopupMode) { const btn = this.querySelector('[data-action="popup-signin"]'); if (btn) { btn.addEventListener("click", () => { this.dispatchEvent( new CustomEvent("hero-signin", { bubbles: true, composed: true, }), ); }); } } } } customElements.define("pxme-hero", PxmeHero);