"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quickAnswearByQueueFiltered(queueIds, quickAnswers) {
    let auxQuickAnswear = [];
    let repet = [];
    const userQueues = queueIds.map((uq) => uq.queueId);
    for (const quickAnswer of quickAnswers) {
        const { queues, id } = quickAnswer;
        if (queues.length == 0) {
            auxQuickAnswear.push(quickAnswer);
            continue;
        }
        for (const q of queues) {
            if (userQueues.includes(q.id)) {
                if (repet.includes(id))
                    continue;
                repet.push(id);
                auxQuickAnswear.push(quickAnswer);
            }
        }
    }
    return auxQuickAnswear;
}
exports.default = quickAnswearByQueueFiltered;
