/**
 * DevExtreme (esm/ui/grid_core/ui.grid_core.focus.utils.js)
 * Version: 22.2.6 (build 23123-0308)
 * Build date: Wed May 03 2023
 *
 * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import {
    isDate,
    isFunction
} from "../../core/utils/type";
import dateSerialization from "../../core/utils/date_serialization";
var getSortFilterValue = (sortInfo, rowData, _ref) => {
    var {
        isRemoteFiltering: isRemoteFiltering,
        dateSerializationFormat: dateSerializationFormat,
        getSelector: getSelector
    } = _ref;
    var {
        selector: selector
    } = sortInfo;
    var getter = isFunction(selector) ? selector : getSelector(selector);
    var rawValue = getter ? getter(rowData) : rowData[selector];
    var safeValue = isRemoteFiltering && isDate(rawValue) ? dateSerialization.serializeDate(rawValue, dateSerializationFormat) : rawValue;
    return {
        getter: getter,
        rawValue: rawValue,
        safeValue: safeValue
    }
};
export var UiGridCoreFocusUtils = {
    getSortFilterValue: getSortFilterValue
};
