"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMatcherFieldsNeeds = exports.allConditionsMatcherList = void 0;
const browser_1 = __importDefault(require("./browser"));
const campaign_1 = __importDefault(require("./campaign"));
const cookie_1 = __importDefault(require("./cookie"));
const device_1 = __importDefault(require("./device"));
const ip_1 = __importDefault(require("./ip"));
const language_1 = __importDefault(require("./language"));
const location_1 = __importDefault(require("./location"));
const platform_1 = __importDefault(require("./platform"));
const query_1 = __importDefault(require("./query"));
const referrer_1 = __importDefault(require("./referrer"));
const source_type_1 = __importDefault(require("./source_type"));
const time_and_day_1 = __importDefault(require("./time_and_day"));
const url_1 = __importDefault(require("./url"));
exports.allConditionsMatcherList = {
    browser: browser_1.default,
    campaign: campaign_1.default,
    cookie: cookie_1.default,
    device: device_1.default,
    ip: ip_1.default,
    language: language_1.default,
    location: location_1.default,
    query: query_1.default,
    platform: platform_1.default,
    referrer: referrer_1.default,
    source_type: source_type_1.default,
    time_and_day: time_and_day_1.default,
    url: url_1.default,
};
function getMatcherFieldsNeeds(matchersNeeded) {
    if (!matchersNeeded || matchersNeeded.length === 0) {
        return [];
    }
    return Object.entries(exports.allConditionsMatcherList)
        .filter(([key]) => matchersNeeded.includes(key))
        .map(([_, value]) => {
        if (value.fieldsNeeded) {
            return value.fieldsNeeded;
        }
        return;
    })
        .flat(Infinity);
}
exports.getMatcherFieldsNeeds = getMatcherFieldsNeeds;
