/*
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 * as tslib_1 from "tslib";
import { StraightNumericAxisBase } from "./StraightNumericAxisBase";
import { IScaler_$type } from "./IScaler";
import { markType } from "igniteui-angular-core";
import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { RangeInfo } from "./RangeInfo";
import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler";
import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler";
import { isNaN_ } from "igniteui-angular-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
var NumericYAxis = /** @class */ (function (_super) {
    tslib_1.__extends(NumericYAxis, _super);
    function NumericYAxis() {
        var _this = _super.call(this) || this;
        _this.ab = NumericYAxis.$;
        _this.jf = _this.jd();
        return _this;
    }
    NumericYAxis.prototype.a1 = function () {
        return new NumericYAxisView(this);
    };
    NumericYAxis.prototype.as = function () {
        return new VerticalAxisLabelPanel();
    };
    NumericYAxis.prototype.get_cf = function () {
        return true;
    };
    NumericYAxis.prototype.dv = function () {
        return this.i1.height;
    };
    NumericYAxis.prototype.dw = function (a, b) {
        if (this.le != null) {
            return this.le.p(a, b);
        }
        return this.ld.p(a, b);
    };
    NumericYAxis.prototype.gn = function (a, b, c, d) {
        if (this.le != null) {
            this.le.v(a, b, c, d);
            return;
        }
        this.ld.v(a, b, c, d);
    };
    NumericYAxis.prototype.gm = function (a, b, c, d, e) {
        if (this.le != null) {
            this.le.u(a, b, c, d, e);
            return;
        }
        this.ld.u(a, b, c, d, e);
    };
    NumericYAxis.prototype.dz = function (a, b) {
        if (this.le != null) {
            return this.le.q(a, b);
        }
        return this.ld.q(a, b);
    };
    NumericYAxis.prototype.go = function (a, b, c, d) {
        if (this.le != null) {
            this.le.j(a, b, c, d);
            return;
        }
        this.ld.j(a, b, c, d);
    };
    NumericYAxis.prototype.lv = function (a, b) {
        if (this.bf == null || a == NaN || b == NaN) {
            return;
        }
        var c = this.lj(a, this);
        var d = this.lj(b, this);
        if (c == NaN || d == NaN) {
            return;
        }
        this.bf.m4 = new Rect(0, this.bf.m4.x, d, this.bf.m4.width, c - d);
    };
    NumericYAxis.prototype.jd = function () {
        var _this = this;
        var a = _super.prototype.jd.call(this);
        a.b.c = function (b) {
            if (_this.aw == null || _this.aw.visibility == 0) {
                _this.at.a8 = b;
                if (_this.aw != null && (_this.aw.location == 7 || _this.aw.location == 6)) {
                    _this.bf.ht();
                }
            }
        };
        a.k = function (b, c, d) { return _this.gq(c, d, b.z, b.b, false); };
        a.l = function (b, c, d, e) { return _this.gr(c, d, e, b.z); };
        a.m = function (b, c) {
            var d = b.y;
            var e = new ScalerParams(0, b.aa, b.z, _this.b9, d);
            return _this.dw(c, e);
        };
        a.q = function (b, c) { return true; };
        a.j = function (b) { return _this.hf(b.t, b.n, b.z, b.a, true); };
        a.e = function (b) {
            b.n = _this.aw != null && (_this.aw.location == 7 || _this.aw.location == 3) ? b.z.right : b.z.left;
            var c = b.y;
            var d = new ScalerParams(0, b.aa, b.z, _this.b9, c);
            if (_this.ag != null && _this.ag.bf != null) {
                var e = b.n;
                var f = b.r;
                var g = _this.ha(e, f, b.aa, b.z, b.y, b.z.left, b.z.right);
                e = g.p0;
                f = g.p1;
                b.n = e;
                b.r = f;
            }
        };
        a.p = function (b, c, d) {
            var e = Math.round(c);
            return e >= Math.floor(b.z.top) && e <= Math.ceil(b.z.bottom);
        };
        return a;
    };
    NumericYAxis.prototype.jg = function (a, b, c, d) {
        var e = d;
        var f = _super.prototype.jg.call(this, a, b, c, d);
        var g = new ScalerParams(0, b, a, this.b8, c);
        var h = NaN;
        var i = NaN;
        if (!this.b8 && b.top == 0) {
            i = this.j3;
        }
        else if (this.b8 && b.bottom == 1) {
            h = this.j3;
        }
        if (isNaN_(h)) {
            h = this.dz(e.bottom, g);
        }
        if (isNaN_(i)) {
            i = this.dz(e.top, g);
        }
        var j = Math.min(h, i);
        var k = Math.max(h, i);
        this.j7 = j;
        this.j6 = k;
        var l = ((function () {
            var $ret = new RangeInfo();
            $ret.d = j;
            $ret.c = k;
            $ret.b = e.height;
            return $ret;
        })());
        f.k.add(l);
        return f;
    };
    NumericYAxis.prototype.g7 = function (a) {
        _super.prototype.g7.call(this, a);
        var b = this.bf != null ? this.bf.mq : Rect.empty;
        var c = this.i1;
        var d = this.iw();
        var e = this.iv();
        var f = this.jf.c(a, c, b, d, e);
        if (f != null) {
            this.j2 = f.f.m;
            this.j5 = f.f.l;
        }
    };
    NumericYAxis.prototype.hh = function (a, b) {
        _super.prototype.hh.call(this, a, b);
        if (b.height != a.height) {
            this.cl();
        }
    };
    NumericYAxis.prototype.get_az = function () {
        return 1;
    };
    Object.defineProperty(NumericYAxis.prototype, "az", {
        get: function () {
            return this.get_az();
        },
        enumerable: true,
        configurable: true
    });
    NumericYAxis.prototype.ji = function () {
        if (this.jt) {
            return new VerticalLogarithmicScaler();
        }
        switch (this.lc) {
            case 0: return new FastVerticalLinearScaler();
            case 1: return new VerticalLogarithmicScaler();
        }
        return null;
    };
    NumericYAxis.prototype.j$c = function (a, b) {
        return this.dz.apply(this, arguments);
    };
    NumericYAxis.prototype.j$b = function (a, b) {
        return this.dw.apply(this, arguments);
    };
    NumericYAxis.prototype.j$d = function (a, b, c, d, e) {
        this.gm.apply(this, arguments);
    };
    NumericYAxis.prototype.j$e = function (a, b, c, d) {
        this.gn.apply(this, arguments);
    };
    NumericYAxis.prototype.j$f = function (a, b, c, d) {
        this.go.apply(this, arguments);
    };
    Object.defineProperty(NumericYAxis.prototype, "j$a", {
        get: function () {
            return this.b8;
        },
        enumerable: true,
        configurable: true
    });
    NumericYAxis.$t = markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericYAxis;
}(StraightNumericAxisBase));
export { NumericYAxis };
/**
 * @hidden
 */
var NumericYAxisView = /** @class */ (function (_super) {
    tslib_1.__extends(NumericYAxisView, _super);
    function NumericYAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bi = null;
        _this.bi = a;
        return _this;
    }
    NumericYAxisView.$t = markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$);
    return NumericYAxisView;
}(StraightNumericAxisBaseView));
export { NumericYAxisView };
//# sourceMappingURL=NumericYAxis_combined.js.map