// The few things every part of the popup needs: element lookup, the tone // glyphs, and the memory of which remote images have already failed. /** Elements are declared in popup.html; a missing id is a packaging bug. */ export const $ = (id: string) => document.getElementById(id) as T /** * Blob URLs that already failed to load, so a redraw does not retry them and * flash a broken image on every render. Shared: a publication icon and an * avatar can be the same kind of miss on the same PDS. */ export const failedIconUrls = new Set() /** * Shape-coded tone icons (triangle = warn, diamond = alert, circle = error) so * a pill's severity survives without color vision — alert and error are both * red, which is exactly where the shapes have to carry it. Three shapes that * stay apart at 14px: an octagon reads as a circle that small. Static markup, * no user data. Moderation labels use the same two loud shapes: an alert label * gets the diamond, anything milder the triangle. */ export const TONE_ICONS = { warn: '', alert: '', error: '', } as const