/*
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, TypeRegistrar } from "igniteui-react-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler";
import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
var NumericXAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(NumericXAxis, _super);
    function NumericXAxis() {
        var _this = _super.call(this) || this;
        _this.ab = NumericXAxis.$;
        _this.jn = _this.jl();
        return _this;
    }
    NumericXAxis.prototype.a3 = function () {
        return new NumericXAxisView(this);
    };
    NumericXAxis.prototype.gx = function (a) {
        _super.prototype.gx.call(this, a);
        this.l3 = a;
    };
    NumericXAxis.prototype.au = function () {
        if (this.cr) {
            return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
        }
        else {
            return new HorizontalAxisLabelPanel();
        }
    };
    NumericXAxis.prototype.jl = function () {
        var _this = this;
        var a = _super.prototype.jl.call(this);
        a.b.c = function (b) {
            if ((_this.ay == null || _this.ay.visibility == 0) && _this.ai != null) {
                _this.av.a9 = b;
                if (_this.ay != null && (_this.ay.location == 4 || _this.ay.location == 5)) {
                    _this.bh.it();
                }
            }
        };
        a.k = function (b, c, d) { return _this.hl(c, d, b.z, b.b, false); };
        a.l = function (b, c, d, e) { return _this.hm(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.dy(c, e);
        };
        a.q = function (b, c) { return true; };
        a.j = function (b) { return _this.gv(b.t, b.n, b.z, b.a, true); };
        a.e = function (b) {
            b.n = b.z.bottom;
            if (_this.ai != null && _this.ai.bh != null) {
                var c = b.n;
                var d = b.r;
                var e = _this.hg(c, d, b.aa, b.z, b.y, b.z.top, b.z.bottom);
                c = e.p0;
                d = e.p1;
                b.n = c;
                b.r = d;
            }
        };
        a.p = function (b, c, d) {
            var e = Math.round(c);
            return e >= Math.floor(b.z.left) && e <= Math.ceil(b.z.right);
        };
        return a;
    };
    NumericXAxis.prototype.dy = function (a, b) {
        if (this.lm != null) {
            return this.lm.p(a, b);
        }
        return this.ll.p(a, b);
    };
    NumericXAxis.prototype.d1 = function (a, b) {
        if (this.lm != null) {
            return this.lm.q(a, b);
        }
        return this.ll.q(a, b);
    };
    NumericXAxis.prototype.gs = function (a, b, c, d) {
        if (this.lm != null) {
            this.lm.v(a, b, c, d);
            return;
        }
        this.ll.v(a, b, c, d);
    };
    NumericXAxis.prototype.gr = function (a, b, c, d, e) {
        if (this.lm != null) {
            this.lm.u(a, b, c, d, e);
            return;
        }
        this.ll.u(a, b, c, d, e);
    };
    NumericXAxis.prototype.gt = function (a, b, c, d) {
        if (this.lm != null) {
            this.lm.j(a, b, c, d);
            return;
        }
        this.ll.j(a, b, c, d);
    };
    NumericXAxis.prototype.l4 = function (a, b) {
        if (this.bh == null || a == NaN || b == NaN) {
            return;
        }
        var c = this.lr(a, this);
        var d = this.lr(b, this);
        if (c == NaN || d == NaN) {
            return;
        }
        this.bh.oi = new Rect(0, c, this.bh.oi.y, d - c, this.bh.oi.height);
    };
    NumericXAxis.prototype.jo = function (a, b, c, d) {
        var e = d;
        var f = _super.prototype.jo.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.right == 1) {
            i = this.kb;
        }
        else if (this.ca && b.left == 0) {
            h = this.kb;
        }
        if (isNaN_(h)) {
            h = this.d1(e.left, g);
        }
        if (isNaN_(i)) {
            i = this.d1(e.right, g);
        }
        var j = Math.min(h, i);
        var k = Math.max(h, i);
        this.kf = j;
        this.ke = k;
        f.k.add(((function () {
            var $ret = new RangeInfo();
            $ret.d = j;
            $ret.c = k;
            $ret.b = e.width;
            return $ret;
        })()));
        return f;
    };
    NumericXAxis.prototype.hc = function (a) {
        _super.prototype.hc.call(this, a);
        var b = this.bh != null ? this.bh.n2 : Rect.empty;
        var c = !b.isEmpty ? this.i9 : Rect.empty;
        var d = this.i4();
        var e = this.i3();
        var f = this.jn.c(a, c, b, d, e);
        if (f != null) {
            this.ka = f.f.m;
            this.kd = f.f.l;
        }
    };
    NumericXAxis.prototype.hn = function (a, b) {
        _super.prototype.hn.call(this, a, b);
        if (b.height != a.height) {
            this.cn();
        }
    };
    NumericXAxis.prototype.get_a1 = function () {
        return 0;
    };
    Object.defineProperty(NumericXAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: true,
        configurable: true
    });
    NumericXAxis.prototype.jq = function () {
        if (this.j1) {
            return new HorizontalLogarithmicScaler();
        }
        switch (this.lk) {
            case 0: return new FastHorizontalLinearScaler();
            case 1: return new HorizontalLogarithmicScaler();
        }
        return null;
    };
    NumericXAxis.prototype.j$c = function (a, b) {
        return this.d1.apply(this, arguments);
    };
    NumericXAxis.prototype.j$b = function (a, b) {
        return this.dy.apply(this, arguments);
    };
    NumericXAxis.prototype.j$d = function (a, b, c, d, e) {
        this.gr.apply(this, arguments);
    };
    NumericXAxis.prototype.j$e = function (a, b, c, d) {
        this.gs.apply(this, arguments);
    };
    NumericXAxis.prototype.j$f = function (a, b, c, d) {
        this.gt.apply(this, arguments);
    };
    Object.defineProperty(NumericXAxis.prototype, "j$a", {
        get: function () {
            return this.ca;
        },
        enumerable: true,
        configurable: true
    });
    NumericXAxis.$t = markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericXAxis;
}(StraightNumericAxisBase));
export { NumericXAxis };
/**
 * @hidden
 */
var NumericXAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(NumericXAxisView, _super);
    function NumericXAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bi = null;
        _this.bi = a;
        return _this;
    }
    NumericXAxisView.$t = markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$);
    return NumericXAxisView;
}(StraightNumericAxisBaseView));
export { NumericXAxisView };
//# sourceMappingURL=NumericXAxis_combined.js.map
