/**
 * DevExtreme (esm/__internal/grids/grid_core/focus/m_focus_utils.js)
 * Version: 24.1.7-build-24272-1937
 * Build date: Sat Sep 28 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import dateSerialization from "../../../../core/utils/date_serialization";
import {
    isDate,
    isFunction
} from "../../../../core/utils/type";
const getSortFilterValue = (sortInfo, rowData, _ref) => {
    let {
        isRemoteFiltering: isRemoteFiltering,
        dateSerializationFormat: dateSerializationFormat,
        getSelector: getSelector
    } = _ref;
    const {
        selector: selector
    } = sortInfo;
    const getter = isFunction(selector) ? selector : getSelector(selector);
    const rawValue = getter ? getter(rowData) : rowData[selector];
    const safeValue = isRemoteFiltering && isDate(rawValue) ? dateSerialization.serializeDate(rawValue, dateSerializationFormat) : rawValue;
    return {
        getter: getter,
        rawValue: rawValue,
        safeValue: safeValue
    }
};
export const UiGridCoreFocusUtils = {
    getSortFilterValue: getSortFilterValue
};
