import { createDomElement, isNumber } from '@slickgrid-universal/utils';
import {} from '../core/index.js';
import { sumTotalsCurrencyFormatter } from './sumTotalsCurrencyFormatter.js';
export const sumTotalsCurrencyColoredFormatter = (totals, columnDef, grid) => {
    const field = columnDef.field ?? '';
    const val = totals.sum?.[field];
    if (isNumber(val)) {
        const color = val >= 0 ? 'green' : 'red';
        const textContent = sumTotalsCurrencyFormatter(totals, columnDef, grid);
        return createDomElement('span', {
            style: { color },
            textContent,
        });
    }
    return '';
};
//# sourceMappingURL=sumTotalsCurrencyColoredFormatter.js.map