"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.printContextBanner = printContextBanner;
const chalk_1 = __importDefault(require("chalk"));
const profile_manager_1 = require("./profile-manager");
const config_storage_1 = require("./config-storage");
function printContextBanner(opts = {}) {
    const profile = profile_manager_1.ProfileManager.getActiveProfile();
    const apiUrl = opts.apiUrl ?? new config_storage_1.ConfigStorage().getApiUrl();
    const apiDisplay = apiUrl ? chalk_1.default.dim(apiUrl) : chalk_1.default.yellow('(not set)');
    const parts = [
        `${chalk_1.default.bold('context')} ${chalk_1.default.cyan(profile)}`,
        `${chalk_1.default.bold('api')} ${apiDisplay}`,
    ];
    if (opts.cluster?.provider) {
        const region = opts.cluster.region ? `/${opts.cluster.region}` : '';
        parts.push(`${chalk_1.default.bold('cluster')} ${chalk_1.default.cyan(opts.cluster.provider + region)}`);
    }
    console.log(chalk_1.default.dim('┌─ ') + parts.join(chalk_1.default.dim(' · ')));
    if (opts.trailingNewline !== false)
        console.log('');
}
