"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.changeIsSuspendInList = changeIsSuspendInList;
exports.suspendAllInList = suspendAllInList;
exports.unsuspendAllInList = unsuspendAllInList;
/**
 * Updates IsSuspended in a list of adaptable objects
 *
 * @param abObjectToChange object to suspend
 * @param list list of ab objects
 */
function changeIsSuspendInList(abObjectToChange, list, IsSuspended) {
    return list.map((abObject) => {
        if (!abObject.IsReadOnly && abObject?.Uuid === abObjectToChange?.Uuid) {
            return {
                ...abObject,
                IsSuspended: IsSuspended,
            };
        }
        return abObject;
    });
}
function suspendAllInList(list) {
    return list.map((abObject) => {
        if (!abObject.IsReadOnly) {
            return {
                ...abObject,
                IsSuspended: true,
            };
        }
        return abObject;
    });
}
function unsuspendAllInList(list) {
    return list.map((abObject) => {
        if (!abObject.IsReadOnly) {
            return {
                ...abObject,
                IsSuspended: false,
            };
        }
        return abObject;
    });
}
