/*
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-react-core";
import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { RangeInfo } from "./RangeInfo";
import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler";
import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
var NumericYAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(NumericYAxis, _super);
    function NumericYAxis() {
        var _this = _super.call(this) || this;
        _this.ab = NumericYAxis.$;
        _this.jo = _this.jm();
        return _this;
    }
    NumericYAxis.prototype.a3 = function () {
        return new NumericYAxisView(this);
    };
    NumericYAxis.prototype.au = function () {
        return new VerticalAxisLabelPanel();
    };
    NumericYAxis.prototype.get_ch = function () {
        return true;
    };
    NumericYAxis.prototype.dy = function () {
        return this.ja.height;
    };
    NumericYAxis.prototype.dz = function (a, b) {
        if (this.ln != null) {
            return this.ln.p(a, b);
        }
        return this.lm.p(a, b);
    };
    NumericYAxis.prototype.gt = function (a, b, c, d) {
        if (this.ln != null) {
            this.ln.v(a, b, c, d);
            return;
        }
        this.lm.v(a, b, c, d);
    };
    NumericYAxis.prototype.gs = function (a, b, c, d, e) {
        if (this.ln != null) {
            this.ln.u(a, b, c, d, e);
            return;
        }
        this.lm.u(a, b, c, d, e);
    };
    NumericYAxis.prototype.d2 = function (a, b) {
        if (this.ln != null) {
            return this.ln.q(a, b);
        }
        return this.lm.q(a, b);
    };
    NumericYAxis.prototype.gu = function (a, b, c, d) {
        if (this.ln != null) {
            this.ln.j(a, b, c, d);
            return;
        }
        this.lm.j(a, b, c, d);
    };
    NumericYAxis.prototype.l4 = function (a, b) {
        if (this.bh == null || a == NaN || b == NaN) {
            return;
        }
        var c = this.ls(a, this);
        var d = this.ls(b, this);
        if (c == NaN || d == NaN) {
            return;
        }
        this.bh.o8 = new Rect(0, this.bh.o8.x, d, this.bh.o8.width, c - d);
    };
    NumericYAxis.prototype.jm = function () {
        var _this = this;
        var a = _super.prototype.jm.call(this);
        a.b.c = function (b) {
            if (_this.ay == null || _this.ay.visibility == 0) {
                _this.av.a9 = b;
                if (_this.ay != null && (_this.ay.location == 7 || _this.ay.location == 6)) {
                    _this.bh.ja();
                }
            }
        };
        a.k = function (b, c, d) { return _this.gw(c, d, b.z, b.b, false); };
        a.l = function (b, c, d, e) { return _this.gx(c, d, e, b.z); };
        a.m = function (b, c) {
            var d = b.y;
            var e = new ScalerParams(0, b.aa, b.z, _this.cb, d);
            return _this.dz(c, e);
        };
        a.q = function (b, c) { return true; };
        a.j = function (b) { return _this.hm(b.t, b.n, b.z, b.a, true); };
        a.e = function (b) {
            b.n = _this.ay != null && (_this.ay.location == 7 || _this.ay.location == 3) ? b.z.right : b.z.left;
            var c = b.y;
            var d = new ScalerParams(0, b.aa, b.z, _this.cb, c);
            if (_this.ai != null && _this.ai.bh != null) {
                var e = b.n;
                var f = b.r;
                var g = _this.hh(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.jp = function (a, b, c, d) {
        var e = d;
        var f = _super.prototype.jp.call(this, a, b, c, d);
        var g = new ScalerParams(0, b, a, this.ca, c);
        var h = NaN;
        var i = NaN;
        if (!this.ca && b.top == 0) {
            i = this.kc;
        }
        else if (this.ca && b.bottom == 1) {
            h = this.kc;
        }
        if (isNaN_(h)) {
            h = this.d2(e.bottom, g);
        }
        if (isNaN_(i)) {
            i = this.d2(e.top, g);
        }
        var j = Math.min(h, i);
        var k = Math.max(h, i);
        this.kg = j;
        this.kf = 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.hd = function (a) {
        _super.prototype.hd.call(this, a);
        var b = this.bh != null ? this.bh.os : Rect.empty;
        var c = this.ja;
        var d = this.i5();
        var e = this.i4();
        var f = this.jo.c(a, c, b, d, e);
        if (f != null) {
            this.kb = f.f.m;
            this.ke = f.f.l;
        }
    };
    NumericYAxis.prototype.ho = function (a, b) {
        _super.prototype.ho.call(this, a, b);
        if (b.height != a.height) {
            this.cn();
        }
    };
    NumericYAxis.prototype.get_a1 = function () {
        return 1;
    };
    Object.defineProperty(NumericYAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: true,
        configurable: true
    });
    NumericYAxis.prototype.jr = function () {
        if (this.j2) {
            return new VerticalLogarithmicScaler();
        }
        switch (this.ll) {
            case 0: return new FastVerticalLinearScaler();
            case 1: return new VerticalLogarithmicScaler();
        }
        return null;
    };
    NumericYAxis.prototype.j$c = function (a, b) {
        return this.d2.apply(this, arguments);
    };
    NumericYAxis.prototype.j$b = function (a, b) {
        return this.dz.apply(this, arguments);
    };
    NumericYAxis.prototype.j$d = function (a, b, c, d, e) {
        this.gs.apply(this, arguments);
    };
    NumericYAxis.prototype.j$e = function (a, b, c, d) {
        this.gt.apply(this, arguments);
    };
    NumericYAxis.prototype.j$f = function (a, b, c, d) {
        this.gu.apply(this, arguments);
    };
    Object.defineProperty(NumericYAxis.prototype, "j$a", {
        get: function () {
            return this.ca;
        },
        enumerable: true,
        configurable: true
    });
    NumericYAxis.$t = markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericYAxis;
}(StraightNumericAxisBase));
export { NumericYAxis };
/**
 * @hidden
 */
var NumericYAxisView = /** @class */ /*@__PURE__*/ (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
