/* ============================================================ lrg-portal.js — shared portal behaviors for all LRG apps v1.0.8 · 2026-07-26 · ship alongside lrg.css at /lrg-assets/ (v1.0.8: fix "Sign out" — the old /outpost.goauthentik.io/sign_out link crashes with a 502 on this Authentik instance (server-side bug, no log line even emitted); point it at the real global invalidation flow instead, which was confirmed working.) (v1.0.7: "My Contacts" universal search group — live FUB lookup for the signed-in agent's own book via the gated /api/search/contacts proxy; non-linked users just get no group. Opens in a new tab.) (v1.0.6: permanent "Getting started" link in the account sections) (v1.0.5: clicking the header logo returns to the Launchpad from any app page; no-op on the Launchpad itself) (v1.0.4: env-aware app links — team-hosted apps use host-relative hrefs on team./team-qa. so QA stays in QA; other hosts still link prod. Re-engagement deep-links /webhook/reengage, valid on both envs) (v1.0.1: group hierarchy — admins⊃all, team-lead/recruiting⊃staff) (v1.0.2: `accountLink` apps (My Profile) render in the account rows of the apps-launcher menu, not the tile grid — see LRG.apps + buildAppsMenu) (v1.0.3: P2 — auto-register live Docs/Agents search providers on team./team-qa. hosts against the gated /api/search/* proxy endpoints) Provides: theme init/toggle · identity (whoami) · app registry · apps-launcher menu · universal search (browse-on-focus, New badges, grouped results) · account links. Usage (backslashes only escape the tag for safe inlining):