/*
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 { XYChart } from "./XYChart";
import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar, getInstanceType } from "igniteui-angular-core";
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-angular-core";
import { DataSeriesType_$type } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { IDataSeriesAdapterRule_$type } from "igniteui-angular-core";
import { SimpleCategorySeriesRule } from "igniteui-angular-core";
import { SubCollectionsRule } from "igniteui-angular-core";
import { Series } from "./Series";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { ArrayExtension } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
export class CategoryChart extends XYChart {
    constructor() {
        super();
        this.p3 = 1000;
        this.o7 = null;
        this.or = 9;
        this.ot = 1;
        this.pb = false;
        this.ov = 0;
        this.o5 = 0;
        this.pk = 0;
        this.pl = 0;
        this.pj = 0;
        this.pm = 0;
        this.pn = NaN;
        this.pd = false;
        this.p4 = 10;
        this.pp = NaN;
        this.po = NaN;
        this.pq = 0;
        this.on = null;
        this.oo = null;
        this.pc = true;
        this.o9 = false;
        this.pa = false;
        this.f6();
    }
    gj() {
        super.gj();
        if (this.dataChart == null) {
            return;
        }
        let a = this.dataChart.bn.i.e();
        this.op = a.d;
        this.oq = a.e;
        if (this.nz == null) {
            this.nz = a.k;
        }
        if (this.n6 == null) {
            this.n6 = a.k;
        }
    }
    gl(a, b) {
        super.gl(a, b);
        a.fj = this.p5;
        a.bv = this.o8;
    }
    g4(a, b, c) {
        super.g4(a, b, c);
        switch (a) {
            case "TransitionInDuration":
                this.qu((d) => d.fj = this.p5);
                break;
            case "TransitionInEasingFunction":
                this.qu((d) => d.bv = this.o8);
                break;
        }
    }
    get p5() {
        return this.p3;
    }
    set p5(a) {
        let b = this.p5;
        if (a != b) {
            this.p3 = a;
            this.g3("TransitionInDuration", b, this.p5);
        }
    }
    get o8() {
        return this.o7;
    }
    set o8(a) {
        let b = this.o8;
        if (a != b) {
            this.o7 = a;
            this.g3("TransitionInEasingFunction", b, this.o8);
        }
    }
    p8() {
        let cvd_ = this.dj();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    }
    ge(a) {
        super.ge(a);
        a.cd = this.bg;
    }
    gk(a, b) {
        super.gk(a, b);
        let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c == null) {
            return;
        }
        c.o0 = this.ou;
        c.ny = this.pg;
        c.nh = this.ow;
        c.bp = this.o6;
        c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
        c.trendLineType = this.av;
        c.trendLineThickness = this.c6;
        c.l1 = this.ai(a, b);
        if (a.cz) {
            a.ji(ArrayExtension.getModulus$1(Brush.$, this.op, b), ArrayExtension.getModulus$1(Brush.$, this.oq, b));
        }
    }
    ox() {
        return new CategoryXAxis();
    }
    o1() {
        return new NumericYAxis();
    }
    f3() {
        this.xAxis = this.ox();
        this.xAxis.name = "xAxis";
        let a = this.xAxis;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.qw));
        this.yAxis = this.o1();
        this.yAxis.name = "yAxis";
        let b = this.yAxis;
        b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.qx));
        if (this.xAxis.aw == null) {
            this.xAxis.aw = new AxisLabelSettings();
        }
        if (this.yAxis.aw == null) {
            this.yAxis.aw = new AxisLabelSettings();
        }
    }
    m5(a) {
        super.m5(a);
        a.jo = this.ph;
    }
    get os() {
        return this.or;
    }
    set os(a) {
        if (a != this.or) {
            let b = this.os;
            this.or = a;
            this.g3("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.os));
        }
    }
    get ou() {
        return this.ot;
    }
    set ou(a) {
        let b = this.ou;
        if (a != b) {
            this.ot = a;
            this.g3("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.ou));
        }
    }
    get pg() {
        return this.pb;
    }
    set pg(a) {
        let b = this.pg;
        if (a != b) {
            this.pb = a;
            this.g3("IsTransitionInEnabled", b, this.pg);
        }
    }
    get ow() {
        return this.ov;
    }
    set ow(a) {
        let b = this.ow;
        if (a != b) {
            this.ov = a;
            this.g3("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.ow));
        }
    }
    get o6() {
        return this.o5;
    }
    set o6(a) {
        let b = this.o6;
        if (a != b) {
            this.o5 = a;
            this.g3("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.o6));
        }
    }
    get pu() {
        return this.pk;
    }
    set pu(a) {
        let b = this.pu;
        if (a != b) {
            this.pk = a;
            this.g3("XAxisInterval", b, this.pu);
        }
    }
    get pv() {
        return this.pl;
    }
    set pv(a) {
        let b = this.pv;
        if (a != b) {
            this.pl = a;
            this.g3("XAxisMinorInterval", b, this.pv);
        }
    }
    get pt() {
        return this.pj;
    }
    set pt(a) {
        let b = this.pt;
        if (a != b) {
            this.pj = a;
            this.g3("XAxisGap", b, this.pt);
        }
    }
    get pw() {
        return this.pm;
    }
    set pw(a) {
        let b = this.pw;
        if (a != b) {
            this.pm = a;
            this.g3("XAxisOverlap", b, this.pw);
        }
    }
    get pz() {
        return this.pn;
    }
    set pz(a) {
        let b = this.pz;
        if (a != b) {
            this.pn = a;
            this.g3("YAxisInterval", b, this.pz);
        }
    }
    get pi() {
        return this.pd;
    }
    set pi(a) {
        let b = this.pi;
        if (a != b) {
            this.pd = a;
            this.g3("YAxisIsLogarithmic", b, this.pi);
        }
    }
    get p6() {
        return this.p4;
    }
    set p6(a) {
        let b = this.p6;
        if (a != b) {
            this.p4 = a;
            this.g3("YAxisLogarithmBase", b, this.p6);
        }
    }
    get p1() {
        return this.pp;
    }
    set p1(a) {
        let b = this.p1;
        if (a != b) {
            this.pp = a;
            this.g3("YAxisMinimumValue", b, this.p1);
        }
    }
    get p0() {
        return this.po;
    }
    set p0(a) {
        let b = this.p0;
        if (a != b) {
            this.po = a;
            this.g3("YAxisMaximumValue", b, this.p0);
        }
    }
    get p2() {
        return this.pq;
    }
    set p2(a) {
        let b = this.p2;
        if (a != b) {
            this.pq = a;
            this.g3("YAxisMinorInterval", b, this.p2);
        }
    }
    get ps() {
        return this.xAxis.lb;
    }
    get pr() {
        return this.xAxis.la;
    }
    get py() {
        return this.yAxis.j4;
    }
    get px() {
        return this.yAxis.j3;
    }
    get op() {
        return this.on;
    }
    set op(a) {
        let b = this.op;
        if (a != b) {
            this.on = a;
            this.g3("NegativeBrushes", b, this.op);
        }
    }
    get oq() {
        return this.oo;
    }
    set oq(a) {
        let b = this.oq;
        if (a != b) {
            this.oo = a;
            this.g3("NegativeOutlines", b, this.oq);
        }
    }
    get ph() {
        return this.pc;
    }
    set ph(a) {
        let b = this.ph;
        if (a != b) {
            this.pc = a;
            this.g3("YAxisAbbreviateLargeNumbers", b, this.ph);
        }
    }
    get pe() {
        return this.o9;
    }
    set pe(a) {
        let b = this.pe;
        if (a != b) {
            this.o9 = a;
            this.g3("IsCategoryHighlightingEnabled", b, this.pe);
        }
    }
    get pf() {
        return this.pa;
    }
    set pf(a) {
        let b = this.pf;
        if (a != b) {
            this.pa = a;
            this.g3("IsItemHighlightingEnabled", b, this.pf);
        }
    }
    get_b5() {
        let 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;
    }
    get b5() {
        return this.get_b5();
    }
    qw(a, b) {
        switch (b.propertyName) {
            case "ActualMinimum":
                this.ha("XAxisActualMinimum");
                break;
            case "ActualMaximum":
                this.ha("XAxisActualMaximum");
                break;
        }
    }
    qx(a, b) {
        switch (b.propertyName) {
            case "ActualMinimumValue":
                this.ha("YAxisActualMinimum");
                break;
            case "ActualMaximumValue":
                this.ha("YAxisActualMaximum");
                break;
        }
    }
    hl() {
        super.hl();
        this.xAxis.e7 = this.kp == null ? XYChart.kx(this.xAxis, this.v.dataSeries) : this.kp;
        this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null;
    }
    get xAxis() {
        return this._xAxis;
    }
    set xAxis(a) {
        this._xAxis = a;
    }
    get yAxis() {
        return this._yAxis;
    }
    set yAxis(a) {
        this._yAxis = a;
    }
    o0(a, b) {
        switch (a) {
            case 2: return this.ar(1);
            case 3: return this.ar(10);
            case 0: return this.ar(0);
            case 1: return this.ar(2);
            case 6: return this.ar(6);
            case 7: return this.ar(7);
            case 4: return this.ar(4);
            case 5: return this.ar(5);
            case 8: return this.ar(8);
            case 9: return this.oz(b);
            default: return this.ar(1);
        }
    }
    oz(a) {
        return this.ar(a);
    }
    u(a) {
        switch (this.os) {
            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;
        }
    }
    aq(a, b) {
        let c = this.o0(this.os, a.suggestedSeries);
        c.pd = a.findMatchingHint(0).path;
        c.xAxis = this.xAxis;
        c.yAxis = this.yAxis;
        return c;
    }
    hj(a) {
        if (a.suggestedSecondaryAxis == 2) {
            this.yAxis.jt = true;
            this.yAxis.kg = 10;
        }
    }
    hm() {
        this.yAxis.jt = this.pi;
        this.yAxis.kg = this.p6;
    }
    get_b4() {
        return ((() => {
            let $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
            $ret.add(new SimpleCategorySeriesRule());
            $ret.add(new SubCollectionsRule());
            return $ret;
        })());
    }
    get b4() {
        return this.get_b4();
    }
    f1(a, b) {
        let c = typeCast(HorizontalAnchoredCategorySeries.$, a);
        if (c != null) {
            c.o0 = this.ou;
            c.l1 = this.ai(a, b);
        }
    }
    qu(a) {
        this.qv((b, c) => a(b));
    }
    qv(a) {
        if (this.dataChart == null) {
            return;
        }
        for (let b = 0; b < this.dataChart.series.count; b++) {
            let c = typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]);
            if (c == null) {
                continue;
            }
            a(c, b);
        }
    }
    h9() {
        return this.xAxis;
    }
    ia() {
        return this.yAxis;
    }
    o3() {
        return this.ar(30);
    }
    o4() {
        return this.ar(31);
    }
    b1(a, b) {
        let c = super.b1(a, b);
        if (c != null) {
            let d = new List$1(Series.$, 0);
            if (this.o9) {
                d.add(this.o3());
            }
            if (this.pa) {
                d.add(this.o4());
            }
            for (let e = 0; e < d.count; e++) {
                let f = d._inner[e];
                f.name = a + getInstanceType(f).typeName;
                c.add(f);
            }
        }
        return c;
    }
    hq(a, b, c) {
        super.hq(a, b, c);
        if (this.v.dataSeries.count > 0) {
            if (stringIsNullOrEmpty(this.ea)) {
                this.ac.setXMemberPath(a, c.getMemberPathFor(16));
            }
            if (stringIsNullOrEmpty(this.ec)) {
                this.ac.setYMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d6)) {
                this.ac.setLabelMemberPath(a, c.getMemberPathFor(0));
            }
            if (stringIsNullOrEmpty(this.d3)) {
                this.ac.setContentMemberPath(a, c.getMemberPathFor(0));
            }
        }
    }
    g3(a, b, c) {
        super.g3(a, b, c);
        switch (a) {
            case "ChartType":
                this.hl();
                break;
            case "MarkerCollisionAvoidance":
                this.qu((d) => d.o0 = this.ou);
                break;
            case "IsTransitionInEnabled":
                this.qu((d) => d.ny = this.pg);
                break;
            case "TransitionInMode":
                this.qu((d) => d.nh = this.ow);
                break;
            case "TransitionInSpeedType":
                this.qu((d) => d.bp = this.o6);
                break;
            case "XAxisInterval":
                this.xAxis.k6 = this.pu;
                break;
            case "XAxisMinorInterval":
                this.xAxis.k7 = this.pv;
                break;
            case "XAxisGap":
                this.xAxis.jo = this.pt;
                break;
            case "XAxisOverlap":
                this.xAxis.jv = this.pw;
                break;
            case "YAxisInterval":
                this.yAxis.j8 = this.pz;
                break;
            case "YAxisIsLogarithmic":
                this.yAxis.jt = this.pi;
                break;
            case "YAxisLogarithmBase":
                this.yAxis.kg = this.p6;
                break;
            case "YAxisMinimumValue":
                this.yAxis.kc = this.p1;
                break;
            case "YAxisMaximumValue":
                this.yAxis.kb = this.p0;
                break;
            case "YAxisMinorInterval":
                this.yAxis.kd = this.p2;
                break;
            case "NegativeBrushes":
            case "NegativeOutlines":
                this.qv((d, e) => {
                    if (d.cz) {
                        d.ji(ArrayExtension.getModulus$1(Brush.$, this.op, e), ArrayExtension.getModulus$1(Brush.$, this.oq, e));
                    }
                });
                break;
            case "YAxisAbbreviateLargeNumbers":
                this.nb((d) => d.jo = this.ph);
                break;
            case "IsCategoryHighlightingEnabled":
            case "IsItemHighlightingEnabled":
                this.hl();
                break;
        }
    }
}
CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$);
//# sourceMappingURL=CategoryChart.js.map