/**
 * Filters a grid selection to only include rows from the given source ("pending" or "ignored").
 * Rows from the other category are unselected.
 *
 * @param {SourceType} gridSource - The source category of the selection.
 * @param {string[]} selectedRowsIds - The currently selected row IDs.
 * @returns {string[]} Filtered row IDs belonging to the specified source.
 */
const clearGridSelection = (gridSource, selectedRowsIds, pendingIdsSet, ignoredIdsSet, gridReference) => {
    let filteredSelectedRowsIds = [];
    if (selectedRowsIds.length > 1 && gridSource === "pending") {
        selectedRowsIds.forEach(async (selectedRowId) => {
            if (ignoredIdsSet.has(selectedRowId)) {
                await gridReference.selectRow(selectedRowId, false);
            }
            else {
                filteredSelectedRowsIds.push(selectedRowId);
            }
        });
    }
    else if (selectedRowsIds.length > 1 && gridSource === "ignored") {
        selectedRowsIds.forEach(async (selectedRowId) => {
            if (pendingIdsSet.has(selectedRowId)) {
                await gridReference.selectRow(selectedRowId, false);
            }
            else {
                filteredSelectedRowsIds.push(selectedRowId);
            }
        });
    }
    else {
        filteredSelectedRowsIds = selectedRowsIds;
    }
    return filteredSelectedRowsIds;
};
export default clearGridSelection;
//# sourceMappingURL=clear-grid-selection.js.map
