import { Adt, Arr, Fun } from '@ephox/katamari';
import { SugarPosition } from '@ephox/sugar';
const adt = Adt.generate([
    { screen: ['point'] },
    { absolute: ['point', 'scrollLeft', 'scrollTop'] }
]);
const toFixed = (pos) => 
// TODO: Use new ADT methods
pos.fold(Fun.identity, (point, scrollLeft, scrollTop) => point.translate(-scrollLeft, -scrollTop));
const toAbsolute = (pos) => pos.fold(Fun.identity, Fun.identity);
const sum = (points) => Arr.foldl(points, (b, a) => b.translate(a.left, a.top), SugarPosition(0, 0));
const sumAsFixed = (positions) => {
    const points = Arr.map(positions, toFixed);
    return sum(points);
};
const sumAsAbsolute = (positions) => {
    const points = Arr.map(positions, toAbsolute);
    return sum(points);
};
const screen = adt.screen;
const absolute = adt.absolute;
export { sumAsFixed, sumAsAbsolute, screen, absolute };
//# sourceMappingURL=CssPosition.js.map