"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.useBrandingThemeColors = void 0; const react_1 = __importDefault(require("react")); const core_plugin_api_1 = require("@backstage/core-plugin-api"); const useBrandingThemeColors = (themeName) => { let configApi = undefined; try { configApi = (0, core_plugin_api_1.useApi)(core_plugin_api_1.configApiRef); } catch (err) { // useApi won't be initialized initially in createApp theme provider, and will get updated later } return react_1.default.useMemo(() => { const brandingThemeColors = {}; if (configApi) { brandingThemeColors.primaryColor = configApi.getOptionalString(`app.branding.theme.${themeName}.primaryColor`); brandingThemeColors.headerColor1 = configApi.getOptionalString(`app.branding.theme.${themeName}.headerColor1`); brandingThemeColors.headerColor2 = configApi.getOptionalString(`app.branding.theme.${themeName}.headerColor2`); brandingThemeColors.navigationIndicatorColor = configApi.getOptionalString(`app.branding.theme.${themeName}.navigationIndicatorColor`); } return brandingThemeColors; }, [configApi]); }; exports.useBrandingThemeColors = useBrandingThemeColors;