/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { Base, markType, PointUtil } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
/**
 * @hidden
 */
var ErrorBarsHelper = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ErrorBarsHelper, _super);
    function ErrorBarsHelper(a, b) {
        var _this = _super.call(this) || this;
        _this.b = null;
        _this.a = null;
        _this.b = a;
        _this.a = b;
        return _this;
    }
    ErrorBarsHelper.prototype.c = function (a) {
        var b = a.getCalculatorType();
        if (b == 1 || b == 2) {
            return false;
        }
        else {
            return true;
        }
    };
    ErrorBarsHelper.prototype.i = function (a, b) {
        if (a.hasConstantPosition()) {
            b = a.getPosition();
        }
        return {
            p1: b
        };
    };
    ErrorBarsHelper.prototype.k = function (a, b, c, d, e) {
        var f;
        var g;
        var h;
        var i = this.a.getViewInfo(g, f);
        g = i.p0;
        f = i.p1;
        h = this.a.getEffectiveViewport();
        var j = new ScalerParams(0, f, g, c.ch, h);
        var k = c.el(a, j);
        var l = b.getIndependentValue();
        d = Math.abs(Math.round(c.el(a + l, j) - k));
        e = Math.abs(Math.round(c.el(a - l, j) - k));
        return {
            p3: d,
            p4: e
        };
    };
    ErrorBarsHelper.prototype.j = function (a, b, c, d, e) {
        var f;
        var g;
        var h = this.a.getViewInfo(g, f);
        g = h.p0;
        f = h.p1;
        var i = new ScalerParams(1, f, g, c.ch);
        var j = c.eo(a, i);
        var k = b.getIndependentValue();
        d = Math.abs(Math.round(c.el(j + k, i) - a));
        e = Math.abs(Math.round(c.el(j - k, i) - a));
        return {
            p3: d,
            p4: e
        };
    };
    ErrorBarsHelper.prototype.g = function (a, b, c, d, e) {
        var f;
        var g;
        var h = this.a.getViewInfo(g, f);
        g = h.p0;
        f = h.p1;
        var i = new ScalerParams(1, f, g, c.ch);
        var j = c.eo(a, i);
        var k = b.getDependentValue(j);
        d = Math.abs(Math.round(c.el(j + k, i) - a));
        e = Math.abs(Math.round(c.el(j - k, i) - a));
        return {
            p3: d,
            p4: e
        };
    };
    ErrorBarsHelper.prototype.f = function (a, b, c, d, e, f) {
        var g;
        var h;
        var i = this.a.getViewInfo(h, g);
        h = i.p0;
        g = i.p1;
        var j = new ScalerParams(1, g, h, c.ch);
        var k = new ScalerParams(1, g, h, d.ch);
        var l = c.eo(a, j);
        var m = b.getDependentValue(l);
        e = Math.abs(Math.round(c.el(l + m, k) - a));
        f = Math.abs(Math.round(c.el(l - m, k) - a));
        return {
            p4: e,
            p5: f
        };
    };
    ErrorBarsHelper.prototype.h = function (a, b, c, d, e) {
        var f;
        var g;
        var h = this.a.getViewInfo(g, f);
        g = h.p0;
        f = h.p1;
        var i = new ScalerParams(1, f, g, c.ch);
        var j = c.eo(a, i);
        d = Math.abs(Math.round(c.el(j + b, i) - a));
        e = Math.abs(Math.round(c.el(j - b, i) - a));
        return {
            p3: d,
            p4: e
        };
    };
    ErrorBarsHelper.prototype.e = function (a, b, c, d) {
    };
    ErrorBarsHelper.prototype.d = function (a, b, c, d) {
    };
    ErrorBarsHelper.prototype.l = function (a, b, c, d) {
        var e = PointUtil.create();
        if (a.getCalculatorType() == 3) {
            var f = void 0;
            var g = void 0;
            var h = void 0;
            var i = this.a.getViewInfo(g, f);
            g = i.p0;
            f = i.p1;
            h = this.a.getEffectiveViewport();
            var j = new ScalerParams(0, f, g, b.ch, h);
            e.x = Math.round(b.el(d, j));
            e.y = Math.round(c.y);
        }
        else {
            e.x = Math.round(c.x);
            e.y = Math.round(c.y);
        }
        return e;
    };
    ErrorBarsHelper.prototype.m = function (a, b, c, d) {
        var e = PointUtil.create();
        if (a.getCalculatorType() == 3) {
            var f = void 0;
            var g = void 0;
            var h = void 0;
            var i = this.a.getViewInfo(g, f);
            g = i.p0;
            f = i.p1;
            h = this.a.getEffectiveViewport();
            var j = new ScalerParams(0, f, g, b.ch, h);
            e.x = Math.round(c.x);
            e.y = Math.round(b.el(d, j));
        }
        else {
            e.x = Math.round(c.x);
            e.y = Math.round(c.y);
        }
        return e;
    };
    ErrorBarsHelper.$t = markType(ErrorBarsHelper, 'ErrorBarsHelper');
    return ErrorBarsHelper;
}(Base));
export { ErrorBarsHelper };
