/*
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 { XYChart } from "./XYChart";
import { CategoryChartType_$type } from "./CategoryChartType";
import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { CategoryXAxis } from "./CategoryXAxis";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { DataSeriesType_$type } from "igniteui-react-core/ES5/DataSeriesType";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-react-core/ES5/IDataSeriesAdapterRule";
import { SimpleCategorySeriesRule } from "igniteui-react-core/ES5/SimpleCategorySeriesRule";
import { SubCollectionsRule } from "igniteui-react-core/ES5/SubCollectionsRule";
import { Brush } from "igniteui-react-core/ES5/Brush";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-react-core/ES5/ArrayExtension";
import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar } from "igniteui-react-core/ES5/type";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { ScalerParams } from "./ScalerParams";
var CategoryChart = /** @class */ (function (_super) {
    tslib_1.__extends(CategoryChart, _super);
    function CategoryChart() {
        var _this = _super.call(this) || this;
        _this.of = 1000;
        _this.nh = null;
        _this.m2 = 9;
        _this.m4 = 1;
        _this.nk = false;
        _this.m6 = 0;
        _this.nf = 0;
        _this.ns = 0;
        _this.nt = 0;
        _this.nr = 0;
        _this.nu = 0;
        _this.nv = NaN;
        _this.nm = false;
        _this.og = 10;
        _this.nx = NaN;
        _this.nw = NaN;
        _this.ny = 0;
        _this.my = null;
        _this.mz = null;
        _this.nj = false;
        _this.nl = true;
        _this.eo();
        return _this;
    }
    CategoryChart.prototype.e1 = function () {
        _super.prototype.e1.call(this);
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.bk.i.e();
        this.m0 = a.d;
        this.m1 = a.e;
        this.mh = this.ma = a.k;
    };
    CategoryChart.prototype.e3 = function (a, b) {
        _super.prototype.e3.call(this, a, b);
        a.fd = this.oh;
        a.bv = this.ni;
    };
    CategoryChart.prototype.fk = function (a, b, c) {
        var _this = this;
        _super.prototype.fk.call(this, a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.o5(function (d) { return d.fd = _this.oh; });
                break;
            case "TransitionInEasingFunction":
                this.o5(function (d) { return d.bv = _this.ni; });
                break;
        }
    };
    Object.defineProperty(CategoryChart.prototype, "oh", {
        get: function () {
            return this.of;
        },
        set: function (a) {
            var b = this.oh;
            if (a != b) {
                this.of = a;
                this.fj("TransitionInDuration", b, this.oh);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ni", {
        get: function () {
            return this.nh;
        },
        set: function (a) {
            var b = this.ni;
            if (a != b) {
                this.nh = a;
                this.fj("TransitionInEasingFunction", b, this.ni);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.ol = function () {
        var cvd_ = this.cn();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    CategoryChart.prototype.ew = function (a) {
        _super.prototype.ew.call(this, a);
        a.ca = this.nn;
    };
    CategoryChart.prototype.e2 = function (a, b) {
        _super.prototype.e2.call(this, a, b);
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.op = this.m5;
        c.nm = this.no;
        c.m5 = this.m7;
        c.bp = this.ng;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.ai;
        c.trendLineThickness = this.ca;
        c.lp = this.ad(a, b);
        if (a.cy) {
            a.i6(ArrayExtension.getModulus$1(Brush.$, this.m0, b), ArrayExtension.getModulus$1(Brush.$, this.m1, b));
        }
    };
    CategoryChart.prototype.m8 = function () {
        return new CategoryXAxis();
    };
    CategoryChart.prototype.nd = function () {
        return new NumericYAxis();
    };
    CategoryChart.prototype.em = function () {
        this.xAxis = this.m8();
        this.xAxis.name = "xAxis";
        var a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.o7));
        this.yAxis = this.nd();
        this.yAxis.name = "yAxis";
        var b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.o8));
        if (this.xAxis.aw == null) {
            this.xAxis.aw = new AxisLabelSettings();
        }
        if (this.yAxis.aw == null) {
            this.yAxis.aw = new AxisLabelSettings();
        }
    };
    CategoryChart.prototype.lg = function (a) {
        _super.prototype.lg.call(this, a);
        a.jg = this.np;
    };
    Object.defineProperty(CategoryChart.prototype, "m3", {
        get: function () {
            return this.m2;
        },
        set: function (a) {
            if (a != this.m2) {
                var b = this.m3;
                this.m2 = a;
                this.fj("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.m3));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "m5", {
        get: function () {
            return this.m4;
        },
        set: function (a) {
            var b = this.m5;
            if (a != b) {
                this.m4 = a;
                this.fj("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.m5));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "no", {
        get: function () {
            return this.nk;
        },
        set: function (a) {
            var b = this.no;
            if (a != b) {
                this.nk = a;
                this.fj("IsTransitionInEnabled", b, this.no);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "m7", {
        get: function () {
            return this.m6;
        },
        set: function (a) {
            var b = this.m7;
            if (a != b) {
                this.m6 = a;
                this.fj("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.m7));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ng", {
        get: function () {
            return this.nf;
        },
        set: function (a) {
            var b = this.ng;
            if (a != b) {
                this.nf = a;
                this.fj("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.ng));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n6", {
        get: function () {
            return this.ns;
        },
        set: function (a) {
            var b = this.n6;
            if (a != b) {
                this.ns = a;
                this.fj("XAxisInterval", b, this.n6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n7", {
        get: function () {
            return this.nt;
        },
        set: function (a) {
            var b = this.n7;
            if (a != b) {
                this.nt = a;
                this.fj("XAxisMinorInterval", b, this.n7);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n5", {
        get: function () {
            return this.nr;
        },
        set: function (a) {
            var b = this.n5;
            if (a != b) {
                this.nr = a;
                this.fj("XAxisGap", b, this.n5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n8", {
        get: function () {
            return this.nu;
        },
        set: function (a) {
            var b = this.n8;
            if (a != b) {
                this.nu = a;
                this.fj("XAxisOverlap", b, this.n8);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "ob", {
        get: function () {
            return this.nv;
        },
        set: function (a) {
            var b = this.ob;
            if (a != b) {
                this.nv = a;
                this.fj("YAxisInterval", b, this.ob);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "nq", {
        get: function () {
            return this.nm;
        },
        set: function (a) {
            var b = this.nq;
            if (a != b) {
                this.nm = a;
                this.fj("YAxisIsLogarithmic", b, this.nq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "oi", {
        get: function () {
            return this.og;
        },
        set: function (a) {
            var b = this.oi;
            if (a != b) {
                this.og = a;
                this.fj("YAxisLogarithmBase", b, this.oi);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "od", {
        get: function () {
            return this.nx;
        },
        set: function (a) {
            var b = this.od;
            if (a != b) {
                this.nx = a;
                this.fj("YAxisMinimumValue", b, this.od);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "oc", {
        get: function () {
            return this.nw;
        },
        set: function (a) {
            var b = this.oc;
            if (a != b) {
                this.nw = a;
                this.fj("YAxisMaximumValue", b, this.oc);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "oe", {
        get: function () {
            return this.ny;
        },
        set: function (a) {
            var b = this.oe;
            if (a != b) {
                this.ny = a;
                this.fj("YAxisMinorInterval", b, this.oe);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n4", {
        get: function () {
            return this.xAxis.k3;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n3", {
        get: function () {
            return this.xAxis.k2;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "oa", {
        get: function () {
            return this.yAxis.jw;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "n9", {
        get: function () {
            return this.yAxis.jv;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "m0", {
        get: function () {
            return this.my;
        },
        set: function (a) {
            var b = this.m0;
            if (a != b) {
                this.my = a;
                this.fj("NegativeBrushes", b, this.m0);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "m1", {
        get: function () {
            return this.mz;
        },
        set: function (a) {
            var b = this.m1;
            if (a != b) {
                this.mz = a;
                this.fj("NegativeOutlines", b, this.m1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "nn", {
        get: function () {
            return this.nj;
        },
        set: function (a) {
            var b = this.nn;
            if (a != b) {
                this.nj = a;
                this.fj("AnimateSeriesWhenAxisRangeChanges", b, this.nn);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "np", {
        get: function () {
            return this.nl;
        },
        set: function (a) {
            var b = this.np;
            if (a != b) {
                this.nl = a;
                this.fj("YAxisAbbreviateLargeNumbers", b, this.np);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.get_ba = function () {
        var a = new List$1(DataSeriesType_$type, 0);
        if (TypeRegistrar.isRegistered("AreaSeries")) {
            a.add(2);
        }
        if (TypeRegistrar.isRegistered("ColumnSeries")) {
            a.add(1);
        }
        if (TypeRegistrar.isRegistered("LineSeries")) {
            a.add(0);
        }
        if (TypeRegistrar.isRegistered("PointSeries")) {
            a.add(10);
        }
        if (TypeRegistrar.isRegistered("SplineSeries")) {
            a.add(6);
        }
        if (TypeRegistrar.isRegistered("SplineAreaSeries")) {
            a.add(7);
        }
        if (TypeRegistrar.isRegistered("StepAreaSeries")) {
            a.add(5);
        }
        if (TypeRegistrar.isRegistered("StepLineSeries")) {
            a.add(4);
        }
        if (TypeRegistrar.isRegistered("WaterfallSeries")) {
            a.add(8);
        }
        return a;
    };
    Object.defineProperty(CategoryChart.prototype, "ba", {
        get: function () {
            return this.get_ba();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.o7 = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.fo("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.fo("XAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.o8 = function (a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.fo("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.fo("YAxisActualMaximum");
                break;
        }
    };
    CategoryChart.prototype.fz = function () {
        _super.prototype.fz.call(this);
        this.xAxis.e1 = XYChart.i8(this.xAxis, this.s.dataSeries);
        this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null;
    };
    Object.defineProperty(CategoryChart.prototype, "xAxis", {
        get: function () {
            return this._xAxis;
        },
        set: function (a) {
            this._xAxis = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryChart.prototype, "yAxis", {
        get: function () {
            return this._yAxis;
        },
        set: function (a) {
            this._yAxis = a;
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.na = function (seriesType_) {
        return (this.externalObject.createSeries(seriesType_).i);
    };
    CategoryChart.prototype.nc = function (a, b) {
        switch (a) {
            case 2: return this.na(1);
            case 3: return this.na(10);
            case 0: return this.na(0);
            case 1: return this.na(2);
            case 6: return this.na(6);
            case 7: return this.na(7);
            case 4: return this.na(4);
            case 5: return this.na(5);
            case 8: return this.na(8);
            case 9: return this.nb(b);
            default: return this.na(1);
        }
    };
    CategoryChart.prototype.nb = function (a) {
        return this.na(a);
    };
    CategoryChart.prototype.nz = function (a) {
        return this.xAxis.dt(a, new ScalerParams(1, this.gj, this.gi, this.xAxis.b8));
    };
    CategoryChart.prototype.n1 = function (a) {
        return this.xAxis.dw(a, new ScalerParams(1, this.gj, this.gi, this.xAxis.b8));
    };
    CategoryChart.prototype.n0 = function (a) {
        return this.yAxis.dt(a, new ScalerParams(1, this.gj, this.gi, this.yAxis.b8));
    };
    CategoryChart.prototype.n2 = function (a) {
        return this.yAxis.dw(a, new ScalerParams(1, this.gj, this.gi, this.yAxis.b8));
    };
    CategoryChart.prototype.r = function (a) {
        switch (this.m3) {
            case 1: return 2;
            case 0: return 0;
            case 3: return 10;
            case 6: return 6;
            case 7: return 7;
            case 5: return 5;
            case 4: return 4;
            case 8: return 8;
            case 9: return a.suggestedSeries;
            default:
            case 2: return 1;
        }
    };
    CategoryChart.prototype.ag = function (a, b) {
        var c = this.nc(this.m3, a.suggestedSeries);
        c.o2 = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    };
    CategoryChart.prototype.fx = function (a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.jl = true;
            this.yAxis.j8 = 10;
        }
    };
    CategoryChart.prototype.f0 = function () {
        this.yAxis.jl = this.nq;
        this.yAxis.j8 = this.oi;
    };
    CategoryChart.prototype.f2 = function (a) {
        _super.prototype.f2.call(this, a);
        var b = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (b == null) {
            return;
        }
        b.xAxis = null;
        b.yAxis = null;
    };
    CategoryChart.prototype.get_a9 = function () {
        return ((function () {
            var $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
            $ret.add(new SimpleCategorySeriesRule());
            $ret.add(new SubCollectionsRule());
            return $ret;
        })());
    };
    Object.defineProperty(CategoryChart.prototype, "a9", {
        get: function () {
            return this.get_a9();
        },
        enumerable: true,
        configurable: true
    });
    CategoryChart.prototype.ek = function (a, b) {
        var c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.op = this.m5;
            c.lp = this.ad(a, b);
        }
    };
    CategoryChart.prototype.o5 = function (a) {
        this.o6(function (b, c) { return a(b); });
    };
    CategoryChart.prototype.o6 = function (a) {
        if (this.dataChart == null) {
            return;
        }
        for (var b = 0; b < this.dataChart.series.count; b++) {
            a(typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]), b);
        }
    };
    CategoryChart.prototype.gk = function () {
        return this.xAxis;
    };
    CategoryChart.prototype.gl = function () {
        return this.yAxis;
    };
    CategoryChart.prototype.fj = function (a, b, c) {
        var _this = this;
        _super.prototype.fj.call(this, a, b, c);
        switch (a) {
            case "ChartType":
                this.fz();
                break;
            case "MarkerCollisionAvoidance":
                this.o5(function (d) { return d.op = _this.m5; });
                break;
            case "IsTransitionInEnabled":
                this.o5(function (d) { return d.nm = _this.no; });
                break;
            case "TransitionInMode":
                this.o5(function (d) { return d.m5 = _this.m7; });
                break;
            case "TransitionInSpeedType":
                this.o5(function (d) { return d.bp = _this.ng; });
                break;
            case "XAxisInterval":
                this.xAxis.ky = this.n6;
                break;
            case "XAxisMinorInterval":
                this.xAxis.kz = this.n7;
                break;
            case "XAxisGap":
                this.xAxis.jg = this.n5;
                break;
            case "XAxisOverlap":
                this.xAxis.jn = this.n8;
                break;
            case "YAxisInterval":
                this.yAxis.j0 = this.ob;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.jl = this.nq;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.j8 = this.oi;
                break;
            case "YAxisMinimumValue":
                this.yAxis.j4 = this.od;
                break;
            case "YAxisMaximumValue":
                this.yAxis.j3 = this.oc;
                break;
            case "YAxisMinorInterval":
                this.yAxis.j5 = this.oe;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.o6(function (d, e) {
                    if (d.cy) {
                        d.i6(ArrayExtension.getModulus$1(Brush.$, _this.m0, e), ArrayExtension.getModulus$1(Brush.$, _this.m1, e));
                    }
                });
                break;
            case "AnimateSeriesWhenAxisRangeChanges":
                if (this.dataChart != null) {
                    this.dataChart.ca = this.nn;
                }
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.lm(function (d) { return d.jg = _this.np; });
                break;
        }
    };
    CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
    return CategoryChart;
}(XYChart));
export { CategoryChart };
