/*
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 { 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
 */
export let NumericYAxis = /*@__PURE__*/ (() => {
    class NumericYAxis extends StraightNumericAxisBase {
        constructor() {
            super();
            this.ab = NumericYAxis.$;
            this.jn = this.jl();
        }
        a3() {
            return new NumericYAxisView(this);
        }
        au() {
            return new VerticalAxisLabelPanel();
        }
        get_ch() {
            return true;
        }
        dx() {
            return this.i9.height;
        }
        dy(a, b) {
            if (this.lm != null) {
                return this.lm.p(a, b);
            }
            return this.ll.p(a, b);
        }
        gs(a, b, c, d) {
            if (this.lm != null) {
                this.lm.v(a, b, c, d);
                return;
            }
            this.ll.v(a, b, c, d);
        }
        gr(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);
        }
        d1(a, b) {
            if (this.lm != null) {
                return this.lm.q(a, b);
            }
            return this.ll.q(a, b);
        }
        gt(a, b, c, d) {
            if (this.lm != null) {
                this.lm.j(a, b, c, d);
                return;
            }
            this.ll.j(a, b, c, d);
        }
        l3(a, b) {
            if (this.bh == null || a == NaN || b == NaN) {
                return;
            }
            let c = this.lr(a, this);
            let d = this.lr(b, this);
            if (c == NaN || d == NaN) {
                return;
            }
            this.bh.oi = new Rect(0, this.bh.oi.x, d, this.bh.oi.width, c - d);
        }
        jl() {
            let a = super.jl();
            a.b.c = (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.it();
                    }
                }
            };
            a.k = (b, c, d) => this.gv(c, d, b.z, b.b, false);
            a.l = (b, c, d, e) => this.gw(c, d, e, b.z);
            a.m = (b, c) => {
                let d = b.y;
                let e = new ScalerParams(0, b.aa, b.z, this.cb, d);
                return this.dy(c, e);
            };
            a.q = (b, c) => true;
            a.j = (b) => this.hl(b.t, b.n, b.z, b.a, true);
            a.e = (b) => {
                b.n = this.ay != null && (this.ay.location == 7 || this.ay.location == 3) ? b.z.right : b.z.left;
                let c = b.y;
                let d = new ScalerParams(0, b.aa, b.z, this.cb, c);
                if (this.ai != null && this.ai.bh != null) {
                    let e = b.n;
                    let f = b.r;
                    let g = this.hg(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 = (b, c, d) => {
                let e = Math.round(c);
                return e >= Math.floor(b.z.top) && e <= Math.ceil(b.z.bottom);
            };
            return a;
        }
        jo(a, b, c, d) {
            let e = d;
            let f = super.jo(a, b, c, d);
            let g = new ScalerParams(0, b, a, this.ca, c);
            let h = NaN;
            let i = NaN;
            if (!this.ca && b.top == 0) {
                i = this.kb;
            }
            else if (this.ca && b.bottom == 1) {
                h = this.kb;
            }
            if (isNaN_(h)) {
                h = this.d1(e.bottom, g);
            }
            if (isNaN_(i)) {
                i = this.d1(e.top, g);
            }
            let j = Math.min(h, i);
            let k = Math.max(h, i);
            this.kf = j;
            this.ke = k;
            let l = ((() => {
                let $ret = new RangeInfo();
                $ret.d = j;
                $ret.c = k;
                $ret.b = e.height;
                return $ret;
            })());
            f.k.add(l);
            return f;
        }
        hc(a) {
            super.hc(a);
            let b = this.bh != null ? this.bh.n2 : Rect.empty;
            let c = this.i9;
            let d = this.i4();
            let e = this.i3();
            let f = this.jn.c(a, c, b, d, e);
            if (f != null) {
                this.ka = f.f.m;
                this.kd = f.f.l;
            }
        }
        hn(a, b) {
            super.hn(a, b);
            if (b.height != a.height) {
                this.cn();
            }
        }
        get_a1() {
            return 1;
        }
        get a1() {
            return this.get_a1();
        }
        jq() {
            if (this.j1) {
                return new VerticalLogarithmicScaler();
            }
            switch (this.lk) {
                case 0: return new FastVerticalLinearScaler();
                case 1: return new VerticalLogarithmicScaler();
            }
            return null;
        }
        j$c(a, b) {
            return this.d1.apply(this, arguments);
        }
        j$b(a, b) {
            return this.dy.apply(this, arguments);
        }
        j$d(a, b, c, d, e) {
            this.gr.apply(this, arguments);
        }
        j$e(a, b, c, d) {
            this.gs.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.gt.apply(this, arguments);
        }
        get j$a() {
            return this.ca;
        }
    }
    NumericYAxis.$t = /*@__PURE__*/ markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericYAxis;
})();
/**
 * @hidden
 */
export let NumericYAxisView = /*@__PURE__*/ (() => {
    class NumericYAxisView extends StraightNumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bi = null;
            this.bi = a;
        }
    }
    NumericYAxisView.$t = /*@__PURE__*/ markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$);
    return NumericYAxisView;
})();
//# sourceMappingURL=NumericYAxis_combined.js.map
