/** * @typedef {"light" | "dark"} EmbedThemeMode */ /** * Map external theme names to the two themes supported by iframe surfaces. * * @param {string | null | undefined} rawTheme * @returns {EmbedThemeMode} */ export function resolveEmbedThemeMode(rawTheme) { const theme = (rawTheme ?? "").trim().toLowerCase(); return theme === "dark" || theme === "dark-blue" || theme === "深色" || theme === "深蓝" ? "dark" : "light"; }