import { curry, filter, map, pipe, sort } from 'ramda';
var filterItems = curry(function (filterText, items) {
    return filter(function (item) { return (item.label || item.name).toLowerCase().includes(filterText.toLowerCase()); })(items);
});
export var preparedGroupedItems = function (_a) {
    var attrTypes = _a.attrTypes, _b = _a.filter, filter = _b === void 0 ? '' : _b, sortingFn = _a.sortingFn;
    return pipe(filterItems(filter), sort(sortingFn), map(function (attrType) { return ({
        item: {
            id: attrType.uri,
            label: attrType.label || attrType.name,
            attrType: attrType
        }
    }); }))(attrTypes);
};
