/*
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 { CategoryAxisBase } from "./CategoryAxisBase";
import { IZoomableCategoryAxis_$type } from "./IZoomableCategoryAxis";
import { Base, typeCast, Number_$type, Array_$type, markType, markDep, TypeRegistrar } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-angular-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { NumericScaler } from "./NumericScaler";
import { LinearCategorySnapper } from "./LinearCategorySnapper";
import { NumericYAxis } from "./NumericYAxis";
import { LabelPosition } from "./LabelPosition";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { MathUtil } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
/**
 * @hidden
 */
var CategoryXAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryXAxis, _super);
    function CategoryXAxis() {
        var _this = _super.call(this) || this;
        _this.qn = 1;
        _this.qm = 1;
        _this.qq = null;
        _this.qb = 0;
        _this.qc = 0;
        _this.oo = new List$1(Number_$type, 0);
        _this.ab = CategoryXAxis.$;
        return _this;
    }
    CategoryXAxis.prototype.bm = function () {
        return new CategoryXAxisView(this);
    };
    CategoryXAxis.prototype.kb = function (a) {
        _super.prototype.kb.call(this, a);
        this.p8 = a;
    };
    CategoryXAxis.prototype.ak = function () {
        return new CategoryXAxis();
    };
    CategoryXAxis.prototype.jr = function (a) {
        _super.prototype.jr.call(this, a);
        this.ju(a, "ActualInterval");
        this.ju(a, "ActualMinorInterval");
        this.ju(a, "ZoomToItemSpan");
        this.ju(a, "ZoomToCategoryStart");
        this.ju(a, "ZoomToCategoryRange");
        this.ju(a, "ZoomMaximumItemSpan");
        this.ju(a, "ZoomMaximumCategoryRange");
    };
    CategoryXAxis.prototype.ju = function (a, b) {
        _super.prototype.ju.call(this, a, b);
        var c = typeCast(CategoryXAxis.$, a);
        if (c == null) {
            return;
        }
        var d = this;
        if (b == "ActualMinorInterval") {
            c.ql = Axis.gf(c.qg, d.qe);
        }
        if (b == "ActualInterval") {
            c.qk = Axis.gf(c.qf, d.qd);
        }
        if (b == "ZoomToItemSpan") {
            c.zoomToItemSpan = d.zoomToItemSpan;
        }
        if (b == "ZoomToCategoryStart") {
            c.zoomToCategoryStart = d.zoomToCategoryStart;
        }
        if (b == "ZoomToCategoryRange") {
            c.zoomToCategoryRange = d.zoomToCategoryRange;
        }
        if (b == "ZoomMaximumItemSpan") {
            c.zoomMaximumItemSpan = d.zoomMaximumItemSpan;
        }
        if (b == "ZoomMaximumCategoryRange") {
            c.zoomMaximumCategoryRange = d.zoomMaximumCategoryRange;
        }
    };
    Object.defineProperty(CategoryXAxis.prototype, "qp", {
        get: function () {
            return this.qn;
        },
        set: function (a) {
            this.qn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryXAxis.prototype, "qo", {
        get: function () {
            return this.qm;
        },
        set: function (a) {
            this.qm = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.az = function () {
        if (this.d7) {
            return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
        }
        else {
            return new HorizontalAxisLabelPanel();
        }
    };
    CategoryXAxis.prototype.getCategorySize = function (a, b, c) {
        var d = this.nz(b, c);
        return d.width / (this.o5 * a.width);
    };
    CategoryXAxis.prototype.ou = function (a, b, c) {
        var d = this.o1(a, b, c);
        var e = 0;
        if (!isNaN_(this.o0)) {
            e = Math.min(this.o0, 1);
        }
        else {
            e = 0;
        }
        ;
        var f = 1 - 0.5 * d;
        var g = this.o7 == 0 ? 1 : this.o7;
        var h = this.getCategorySize(a, b, c) * f / (g - (g - 1) * e);
        return h;
    };
    CategoryXAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.o7 > 1) {
            var f = this.o1(b, c, d);
            var g = 0;
            if (!isNaN_(this.o0)) {
                g = Math.min(this.o0, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.o7 - (this.o7 - 1) * g);
            var j = (h - i) / (this.o7 - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryXAxis.prototype.fe = function () {
        return this.qk;
    };
    CategoryXAxis.prototype.q2 = function (a) {
        var b = this.b0 != null ? this.b0.xm : Rect.empty;
        b = b.copy();
        var c = this.n1;
        var d = this.ny();
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, e, e, this.df, d);
        var g = !b.isEmpty && !c.isEmpty && this.oh != null ? this.oh.indexOf(a) : -1;
        var h = g > -1 ? this.ft(g, f) : NaN;
        if (!isNaN_(h) && this.b0.fx) {
            if (!isNaN_(h)) {
                if (h < b.left + 0.1 * b.width) {
                    h = h + 0.4 * b.width;
                    b.x = h - 0.5 * b.width;
                }
                if (h > b.right - 0.1 * b.width) {
                    h = h - 0.4 * b.width;
                    b.x = h - 0.5 * b.width;
                }
            }
            this.b0.ta(b, false, true);
        }
    };
    CategoryXAxis.prototype.ft = function (a, b) {
        if (!b.c.isEmpty) {
            var c = this.qj(a, NumericScaler.ac, b.c, this.categoryMode);
            c = (c - b.d.left) / b.d.width;
            c = b.d.left + b.d.width * (c - b.e.left) / b.e.width;
            return c;
        }
        return this.qj(a, b.e, b.d, this.categoryMode);
    };
    CategoryXAxis.prototype.p7 = function (a) {
        if (typeCast(List$1.$.specialize(Array_$type), a) !== null) {
            return a.asArray();
        }
        return null;
    };
    CategoryXAxis.prototype.j5 = function (a, b, c, d, e) {
        var f;
        var g = e.e;
        var h = e.d;
        var i = e.c;
        var j = e.a;
        var k = !i.isEmpty;
        var l = this.categoryMode == 0 ? this.o5 - 1 : this.o5;
        if (l < 0) {
            l = 0;
        }
        var m = i.left;
        var n = i.width;
        var o = g.left;
        var p = g.width;
        var q = h.left;
        var r = h.width;
        var s = 0;
        var t = 1;
        var u = this.p7(a);
        var v = false;
        if (u != null) {
            v = true;
        }
        var w;
        for (var x = 0; x < b.count; x++) {
            w = b.item(x);
            for (var y = c; y < d; y++) {
                if (v) {
                    f = u[y];
                }
                else {
                    f = a.item(y);
                }
                if (k) {
                    var z = l >= 1 ? (f[w]) / (l) : l == 0 ? 0.5 : NaN;
                    if (j) {
                        z = 1 - z;
                    }
                    z = m + n * (z - s) / t;
                    z = (z - q) / r;
                    var aa = q + r * (z - o) / p;
                    f[w] = aa;
                }
                else {
                    var ab = l >= 1 ? (f[w]) / (l) : l == 0 ? 0.5 : NaN;
                    if (j) {
                        ab = 1 - ab;
                    }
                    ab = q + r * (ab - o) / p;
                    f[w] = ab;
                }
            }
        }
    };
    CategoryXAxis.prototype.fu = function (a, b, c) {
        if (!b.c.isEmpty) {
            var d = this.qj(a, NumericScaler.ac, b.c, c);
            d = (d - b.d.left) / b.d.width;
            d = b.d.left + b.d.width * (d - b.e.left) / b.e.width;
            return d;
        }
        return this.qj(a, b.e, b.d, c);
    };
    CategoryXAxis.prototype.qj = function (a, b, c, d) {
        var e = d == 0 ? this.o5 - 1 : this.o5;
        if (e < 0) {
            e = 0;
        }
        var f = e >= 1 ? (a) / (e) : e == 0 ? 0.5 : NaN;
        if (this.dg) {
            f = 1 - f;
        }
        return c.left + c.width * (f - b.left) / b.width;
    };
    CategoryXAxis.prototype.fw = function (a, b) {
        if (!b.c.isEmpty) {
            var c = b.e.left + b.e.width * (a - b.d.left) / b.d.width;
            c = (c * b.d.width) + b.d.left;
            c = this.getUnscaledValue3(c, NumericScaler.ac, b.c, this.categoryMode);
            return c;
        }
        return this.getUnscaledValue3(a, b.e, b.d, this.categoryMode);
    };
    CategoryXAxis.prototype.fx = function (a, b, c) {
        if (!b.c.isEmpty) {
            var d = b.e.left + b.e.width * (a - b.d.left) / b.d.width;
            d = (d * b.d.width) + b.d.left;
            d = this.getUnscaledValue3(d, NumericScaler.ac, b.c, c);
            return d;
        }
        return this.getUnscaledValue3(a, b.e, b.d, c);
    };
    CategoryXAxis.prototype.getUnscaledValue3 = function (a, b, c, d) {
        var e = b.left + (a - c.left) * b.width / c.width;
        if (this.dg) {
            e = 1 - e;
        }
        var f = d == 0 ? this.o5 - 1 : this.o5;
        if (f < 0) {
            f = 0;
        }
        return e * f;
    };
    CategoryXAxis.prototype.q3 = function (a, b) {
        if (isNaN_(a) || isNaN_(b) || this.oh == null || this.oh.count == 0) {
            return;
        }
        var c = a / this.oh.count;
        var d = (b + 1) / this.oh.count;
        this.b0.x5 = new Rect(0, c, this.b0.x5.y, d - c, this.b0.x5.height);
    };
    CategoryXAxis.prototype.k4 = function (a) {
        _super.prototype.k4.call(this, a);
        var b = this.b0 != null ? this.b0.xm : Rect.empty;
        var c = this.n1;
        var d = this.nw();
        var e = this.nv();
        var f = new ScalerParams(0, b, c, this.df, d);
        var g = this.bn.a4();
        var h = this.bn.a7();
        var i = this.bn.a5();
        var j = this.bn.a6();
        var k = this.bn.e();
        var l = this.bn.f();
        var m = this.bn.g();
        var n = this.oh;
        var o = this.p9();
        this.lf();
        this.jp(g);
        this.jp(h);
        this.jp(i);
        this.jp(j);
        this.ef.clear();
        this.eg.clear();
        this.oo.clear();
        this.bn.az(this, b, c);
        if (b.isEmpty || c.isEmpty) {
            this.b9.count = 0;
            this.b8.count = 0;
            this.b7.count = 0;
        }
        if (this.b9.count == 0 && this.b8.count == 0 && this.bn.l()) {
            this.bn.ad();
        }
        if (this.a3 != null) {
            this.a3.registerAxis(this);
        }
        if (this.itemsSource == null || o == null || n.count == 0) {
            this.b9.count = 0;
            this.b8.count = 0;
            this.b7.count = 0;
            this.bn.ad();
            return;
        }
        if (!b.isEmpty && !c.isEmpty) {
            var p = this.fw(e.left, f);
            var q = this.fw(e.right, f);
            var r = 0;
            var s = false;
            if (this.d5) {
                var t = Math.abs(q - p);
                r = Math.ceil(t) + 1;
                if (this.df) {
                    if (Math.abs(q - Math.floor(q)) < Math.abs(p - Math.ceil(p))) {
                        s = true;
                    }
                }
                else {
                    if (Math.abs(q - Math.ceil(q)) < Math.abs(p - Math.floor(p))) {
                        s = true;
                    }
                }
            }
            if (this.df) {
                p = Math.ceil(p);
                q = Math.floor(q);
            }
            else {
                p = Math.floor(p);
                q = Math.ceil(q);
            }
            if (this.d5) {
                if (Math.abs(q - p) < r) {
                    if (this.df) {
                        if (s) {
                            q--;
                        }
                        else {
                            p++;
                        }
                    }
                    else {
                        if (s) {
                            q++;
                        }
                        else {
                            p--;
                        }
                    }
                }
            }
            var u = c.bottom;
            var v = u - c.top;
            if (this.am != null) {
                var w = typeCast(NumericYAxis.$, this.am);
                if (w != null) {
                    var x = this.k9(u, v, b, c, d, c.top, c.bottom);
                    u = x.p0;
                    v = x.p1;
                }
            }
            this.j9(g, u, c, k, true);
            this.bn.au(v);
            var y = Math.min(p, q);
            var z = Math.max(p, q);
            var aa = e.width;
            if (this.d5) {
                var ab = this.ft(y, f);
                var ac = this.ft(z, f);
                if (ab != ac) {
                    aa = Math.abs(ac - ab);
                }
            }
            var ad = new LinearCategorySnapper(1, y, z, aa, this.qk, this.categoryMode, this.f9());
            var ae = ad.g;
            ae = this.fb(ae, this.qa(), b, c, d);
            if (ad.g != ae) {
                ad = new LinearCategorySnapper(1, y, z, aa, ae, this.categoryMode, this.f9());
            }
            var af = Math.floor((y - 0) / ad.g);
            var ag = Math.ceil((z - 0) / ad.g);
            this.qd = ad.g;
            if (!isNaN_(af) && !isNaN_(ag)) {
                var ah = truncate(af);
                var ai = truncate(ag);
                var aj = this.qi(0 + ah * ad.g, f);
                var ak = this.ft(ad.g, f);
                var al = Math.abs(ak - this.ft(0, f));
                this.bn.av(ak);
                var am = truncate(Math.ceil(e.right));
                var an = truncate(Math.floor(e.left));
                var ao = this.ql;
                var ap = ao > 0 && ao < ad.g;
                var aq = c.right;
                var ar = this.oo;
                var as = ad.g;
                var at = truncate(as);
                var au = this.o7;
                var av = this.df;
                var aw = this.categoryMode;
                this.qq = null;
                for (var ax = ah; ax <= ai; ++ax) {
                    var ay = this.qi(0 + (ax + 1) * ad.g, f);
                    if (aj <= aq) {
                        if (ax % 2 == 0) {
                            this.lh(h, aj, ay, c);
                        }
                        this.lg(i, aj, c, l, false);
                        ar.add(aj);
                    }
                    if (this.categoryMode != 0 && this.o7 != 0 && this.dz) {
                        if (ap) {
                            var az = al * this.ql;
                            if (this.df) {
                                var a0 = aj;
                                while (a0 - az > ay) {
                                    a0 -= az;
                                    if (Math.abs(a0 - ay) < 0.0001) {
                                        break;
                                    }
                                    this.lg(j, a0, c, m, false);
                                }
                            }
                            else {
                                var a1 = aj;
                                while (a1 + az < ay) {
                                    a1 += az;
                                    if (Math.abs(a1 - ay) < 0.0001) {
                                        break;
                                    }
                                    this.lg(j, a1, c, m, false);
                                }
                            }
                            this.qe = this.ql;
                        }
                        else {
                            for (var a2 = 0; a2 < truncate(ad.g); a2++) {
                                for (var a3 = 0; a3 < this.o7; a3++) {
                                    var a4 = this.getGroupCenter(a3, b, c, d);
                                    if (this.df) {
                                        a4 = -a4;
                                    }
                                    var a5 = this.ft(a2 + ax * ad.g, f) + a4;
                                    this.lg(j, a5, c, m, false);
                                }
                            }
                            this.qe = 0.5;
                        }
                    }
                    var a6 = this.qh(ax * as, aj, aw == 0, f);
                    var a7 = truncate(Math.round(a6));
                    if (a7 >= an && a7 <= am) {
                        var a8 = 0;
                        if (as >= 1) {
                            a8 = ax * truncate(Math.floor(as));
                        }
                        else {
                            if ((ax * as) * 2 % 2 == 0) {
                                a8 = truncate(Math.floor(ax * as));
                            }
                            else {
                                a8 = -1;
                            }
                        }
                        if (o != null && a8 < n.count && a8 >= 0) {
                            var a9 = o.getItem(a8);
                            var ba = this.hf(a9);
                            this.qq = a9;
                            if (!isNaN_(a6) && !isInfinity(a6) && ba != null) {
                                if ((typeof ba === 'string') && Base.equalsStatic(ba, "")) {
                                }
                                else {
                                    this.ef.add1(ba);
                                    this.eg.add(new LabelPosition(a6));
                                }
                            }
                        }
                    }
                    aj = ay;
                }
            }
            this.qq = null;
            if ((this.a3 == null || this.a3.visibility == 0) && this.am != null) {
                if (this.a3 != null && (this.a3.location == 4 || this.a3.location == 5)) {
                    this.b0.o1();
                }
            }
            this.bn.a0(this.ef, this.eg);
            this.pv();
        }
    };
    CategoryXAxis.prototype.d4 = function () {
        if (this.dr && this.d5) {
            this.bu = this.bt();
        }
        if (this.oh == null) {
            return false;
        }
        var a = false;
        var b = this.oh.count;
        if (b != this.qo) {
            var c = new AxisRangeChangedEventArgs(0, 1, 1, this.qo, b);
            this.qo = b;
            this.ky(c);
            a = true;
        }
        this.q5();
        this.q4();
        return a;
    };
    CategoryXAxis.prototype.getWindowZoomFromCategories = function (a) {
        var b = MathUtil.a(a) && a > 0;
        var c = this.oh.count;
        if (c > 0 && b) {
            var d = this.b0.x4.width;
            var e = isNaN_(d) || isInfinity(d);
            if (e) {
                return NaN;
            }
            var f = new Rect(0, 0, 0, 1, 1);
            var g = this.b0.x4;
            var h = this.getCategorySize(f, g, g);
            var i = isNaN_(h) || isInfinity(h);
            if (i) {
                return NaN;
            }
            var j = h * a / d;
            if (j >= 0 && j <= 1) {
                return j;
            }
        }
        return NaN;
    };
    CategoryXAxis.prototype.getWindowZoomFromItemSpan = function (a) {
        var b = MathUtil.a(a) && a > 0;
        var c = this.oh.count;
        if (c > 0 && b) {
            var d = this.b0.x4.width;
            var e = isNaN_(d) || isInfinity(d);
            if (e) {
                return NaN;
            }
            var f = new Rect(0, 0, 0, 1, 1);
            var g = this.b0.x4;
            var h = this.ou(f, g, g);
            var i = a / h;
            var j = Math.min(1, 1 / i);
            if (j > 0 && j <= 1) {
                return j;
            }
        }
        return NaN;
    };
    CategoryXAxis.prototype.q5 = function () {
        if (this.oh == null || this.b0 == null) {
            return;
        }
        var a = !isNaN_(this.b0.jg) && !isNaN_(this.b0.ji);
        if (a) {
            return;
        }
        if (!isNaN_(this.zoomMaximumItemSpan) && !isInfinity(this.zoomMaximumItemSpan)) {
            var b = this.getWindowZoomFromItemSpan(this.zoomMaximumItemSpan);
            if (!isNaN_(b) && !isInfinity(b)) {
                this.b0.h6 = b;
            }
        }
        else if (!isNaN_(this.zoomMaximumCategoryRange) && !isInfinity(this.zoomMaximumCategoryRange)) {
            var c = this.getWindowZoomFromCategories(this.zoomMaximumCategoryRange);
            if (!isNaN_(c) && !isInfinity(c)) {
                this.b0.h6 = c;
            }
        }
    };
    CategoryXAxis.prototype.q4 = function () {
        if (this.oh == null || this.b0 == null) {
            return;
        }
        var a = NaN;
        var b = NaN;
        var c = this.b0.ic();
        var d = this.b0.id();
        var e = false;
        if (MathUtil.a(this.zoomToItemSpan) && this.zoomToItemSpan > 0) {
            e = true;
            c = this.getWindowZoomFromItemSpan(this.zoomToItemSpan);
            c = Math.max(c, this.b0.h6);
        }
        else if (MathUtil.a(this.zoomToCategoryRange) && this.zoomToCategoryRange > 0 && this.zoomToCategoryRange <= this.o6) {
            e = true;
            c = this.getWindowZoomFromCategories(this.zoomToCategoryRange);
            c = Math.max(c, this.b0.h6);
        }
        if (MathUtil.a(this.zoomToCategoryStart) && this.zoomToCategoryStart >= 0 && this.zoomToCategoryStart < this.o6) {
            e = true;
            a = this.getWindowZoomFromCategories(this.zoomToCategoryStart);
            var f = c + a - 1;
            var g = c - f;
            if (f > 0 && g > this.b0.h6) {
                c = g;
                c = Math.max(c, this.b0.h6);
            }
        }
        if (e) {
            this.b0.s8(a, b, c, d);
        }
    };
    CategoryXAxis.prototype.kf = function (a, b, c, d) {
        _super.prototype.kf.call(this, a, b, c, d);
        switch (b) {
            case CategoryXAxis.$$p[2]:
            case CategoryXAxis.$$p[3]:
                this.q5();
                break;
            case CategoryXAxis.$$p[4]:
            case CategoryXAxis.$$p[5]:
            case CategoryXAxis.$$p[6]:
                this.q4();
                break;
            case CategoryXAxis.$$p[0]:
            case CategoryXAxis.$$p[1]:
                this.j1(b);
                break;
        }
    };
    CategoryXAxis.prototype.j1 = function (a) {
        _super.prototype.j1.call(this, a);
        switch (a) {
            case CategoryXAxis.$$p[0]:
            case CategoryXAxis.$$p[1]:
                this.jw(a);
                break;
        }
    };
    Object.defineProperty(CategoryXAxis.prototype, "qk", {
        get: function () {
            return this.c(CategoryXAxis.q8);
        },
        set: function (a) {
            this.h(CategoryXAxis.q8, a);
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.qa = function () {
        return !isNaN_(this.qk);
    };
    Object.defineProperty(CategoryXAxis.prototype, "qd", {
        get: function () {
            return this.qb;
        },
        set: function (a) {
            if (this.qd != a) {
                var b = this.qb;
                this.qb = a;
                this.kx("ActualInterval", b, this.qd);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.f5 = function () {
        return this.qd;
    };
    Object.defineProperty(CategoryXAxis.prototype, "ql", {
        get: function () {
            return this.c(CategoryXAxis.q9);
        },
        set: function (a) {
            this.h(CategoryXAxis.q9, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryXAxis.prototype, "qe", {
        get: function () {
            return this.qc;
        },
        set: function (a) {
            if (this.qe != a) {
                var b = this.qc;
                this.qc = a;
                this.kx("ActualMinorInterval", b, this.qe);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.ok = function (a) {
        if (a == null) {
            return false;
        }
        var b = this.bw();
        if (b == null) {
            return false;
        }
        return b.synchronizeHorizontally;
    };
    CategoryXAxis.prototype.get_bk = function () {
        return 0;
    };
    Object.defineProperty(CategoryXAxis.prototype, "bk", {
        get: function () {
            return this.get_bk();
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.p9 = function () {
        return this.oh;
    };
    CategoryXAxis.prototype.qi = function (a, b) {
        return this.ft(a, b);
    };
    CategoryXAxis.prototype.qh = function (a, b, c, d) {
        if (!c) {
            var e = this.qi(a + 1, d);
            return (b + e) / 2;
        }
        return b;
    };
    Object.defineProperty(CategoryXAxis.prototype, "isVertical", {
        get: function () {
            return this.dq;
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.j$d = function (a, b) {
        return this.fw.apply(this, arguments);
    };
    CategoryXAxis.prototype.j$c = function (a, b) {
        return this.ft.apply(this, arguments);
    };
    CategoryXAxis.prototype.j$e = function (a, b, c, d, e) {
        this.j5.apply(this, arguments);
    };
    CategoryXAxis.prototype.j$f = function (a, b, c, d) {
        this.j6.apply(this, arguments);
    };
    CategoryXAxis.prototype.j$g = function (a, b, c, d) {
        this.j7.apply(this, arguments);
    };
    Object.defineProperty(CategoryXAxis.prototype, "j$b", {
        get: function () {
            return this.df;
        },
        enumerable: false,
        configurable: true
    });
    CategoryXAxis.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryXAxis.$t = markType(CategoryXAxis, 'CategoryXAxis', CategoryAxisBase.$, [IZoomableCategoryAxis_$type]);
    CategoryXAxis.q8 = DependencyProperty.i("Interval", Number_$type, CategoryXAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.kx("Interval", b.oldValue, b.newValue);
        a.k3(false);
    }));
    CategoryXAxis.q9 = DependencyProperty.i("MinorInterval", Number_$type, CategoryXAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryXAxis.$, a)).kx("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryXAxis.$, a)).k3(false);
    }));
    CategoryXAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryXAxis, 'kx', ['CompanionAxisInterval:qf:q6', [1, NaN], 'CompanionAxisMinorInterval:qg:q7', [1, NaN], 'ZoomMaximumCategoryRange::ra', [1, NaN], 'ZoomMaximumItemSpan::rb', [1, NaN], 'ZoomToCategoryRange::rc', [1, NaN], 'ZoomToCategoryStart::rd', [1, NaN], 'ZoomToItemSpan::re', [1, NaN]]);
    return CategoryXAxis;
}(CategoryAxisBase));
export { CategoryXAxis };
/**
 * @hidden
 */
var CategoryXAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryXAxisView, _super);
    function CategoryXAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    CategoryXAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.gt = AxisDefaults.categoryAxis_TickLength;
    };
    CategoryXAxisView.$t = markType(CategoryXAxisView, 'CategoryXAxisView', CategoryAxisBaseView.$);
    return CategoryXAxisView;
}(CategoryAxisBaseView));
export { CategoryXAxisView };
