"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCustomHeaders = createCustomHeaders;
const constants_1 = require("../lib/constants");
/**
 * Builds a list of custom headers for ANTHROPIC_CUSTOM_HEADERS.
 */
function createCustomHeaders() {
    const entries = [];
    return {
        add(key, value) {
            const name = key.startsWith('x-') || key.startsWith('X-') ? key : `X-${key}`;
            entries.push({ key: name, value });
        },
        addFlag(flagKey, variant) {
            const headerName = constants_1.AMPLITUDE_FLAG_HEADER_PREFIX + flagKey.toUpperCase();
            entries.push({ key: headerName, value: variant });
        },
        encode() {
            return entries.map(({ key, value }) => `${key}: ${value}`).join('\n');
        },
    };
}
