/**
 * DevExtreme (esm/renovation/ui/grids/data_grid_next/plugins.js)
 * Version: 22.1.3 (build 22180-0310)
 * Build date: Wed Jun 29 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import {
    createValue,
    createGetter,
    createSelector
} from "../../../utils/plugin/context";
export var LocalData = createValue();
export var LocalVisibleItems = createGetter([]);
export var VisibleRows = createGetter([]);
export var RemoteOperations = createValue();
export var LoadOptionsValue = createGetter({});
export var DataStateValue = createValue();
export var Columns = createValue();
export var VisibleColumns = createGetter([]);
export var LocalDataState = createGetter(void 0);
export var KeyExprPlugin = createValue();
export var TotalCount = createSelector([DataStateValue], dataState => {
    var _dataState$totalCount;
    return null !== (_dataState$totalCount = dataState.totalCount) && void 0 !== _dataState$totalCount ? _dataState$totalCount : dataState.data.length
});
export var VisibleDataRows = createSelector([DataStateValue, KeyExprPlugin], (dataStateValue, keyExpr) => {
    var rows = dataStateValue.data.map(data => ({
        key: keyExpr ? data[keyExpr] : data,
        data: data,
        rowType: "data"
    }));
    return rows
});
export var CalculateLocalDataState = createSelector([LocalVisibleItems, LocalData], (visibleItems, localData) => Array.isArray(localData) ? {
    data: null !== visibleItems && void 0 !== visibleItems ? visibleItems : [],
    totalCount: localData.length
} : void 0);
