/*
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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core/ES2015/DVContainer";
import { Type, runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType } from "igniteui-angular-core/ES2015/type";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-angular-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-angular-core/ES2015/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
/**
 * @hidden
 */
export class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.p1 = null;
        this.px = null;
        this.p3 = null;
        this.pz = 0;
    }
    get p2() {
        if (this.p1 == null) {
            this.p1 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.p1;
    }
    ht() {
        super.ht();
        this.xAxis = null;
        this.yAxis = null;
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    m5() {
        return this.px;
    }
    np() {
        return this.p3;
    }
    lv(a) {
        if (this.m6 == null || this.m6.m.count == 0 || !this.hasMarkers || !this.l2()) {
            return Rect.empty;
        }
        return this.p2.d$d(this, this.m6.m, a, runOn(this, this.qf));
    }
    qf(a) {
        return this.ox.c5(a);
    }
    p7(a, b, c) {
        return this.p2.d$c(this, this.np(), a, b, c);
    }
    ah(a) {
        return this.p2.d$a(this, this.m6.f, this.n6(this.bi), this.n7(this.bi), a);
    }
    ai(a) {
        return this.p2.d$b(this, this.m6.f, this.n6(this.bi), this.n7(this.bi), a);
    }
    dh(a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l3(a, b)) {
            return true;
        }
        return false;
    }
    getOffsetValue() {
        return this.na.r(this.m5(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        let a = this.getEffectiveViewport1(this.bi);
        return this.m5().getCategorySize(this.bi.bs, this.bi.br, a);
    }
    en(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.m5();
        let f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        let g = this.na.r(e, this.bs.mq, this.bi.br, d);
        return this.ep(this.valueColumn, a, e, f, g, runOn(this, this.n4), b, c);
    }
    fe(a, b) {
        return this.ff(a, b, this.m5(), runOn(this, this.n4), this.valueColumn);
    }
    fc(a, b) {
        return this.fd(a, b, this.m5(), runOn(this, this.n4), this.valueColumn);
    }
    d9(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.ea(a, b, this.m5(), d, e, this.valueColumn.count, runOn(this, this.n4));
    }
    lk(a, b, c) {
        if (this.m5() == null || this.np() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.lm(a, b, c, this.na.r(this.m5(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.np(), this.m5(), null, null, null);
    }
    fetchXAxis() {
        return this.px;
    }
    fetchYAxis() {
        return this.p3;
    }
    pf(a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    }
    pg(a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    }
    n0() {
        return this.p3 != null && this.p3.ck();
    }
    qb(a) {
        this.px = a;
    }
    qc(a) {
        this.p3 = a;
    }
    mz(a, b) {
        return this.ou(a, b, this.px);
    }
    iy(a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.qb(this.xAxis);
                if (this.ox.cz) {
                    this.ox.cy = CategoryTrendLineManagerFactory.a(this.ox.cy, this.px, this.jw, this, this.b2);
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.ox.cy = CategoryTrendLineManagerFactory.a(this.ox.cy, this.px, this.jw, this, this.b2);
                }
                break;
        }
        super.iy(a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i3(typeCast(Axis.$, d));
                    this.qb(this.xAxis);
                    this.ne.cn.g(this.eu);
                    this.jc(false);
                    this.ij();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i3(typeCast(Axis.$, d));
                    this.qc(this.yAxis);
                    this.ne.cn.g(this.eu);
                    this.n0();
                    this.jc(false);
                    this.ij();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.km(true);
                }
                break;
        }
    }
    hy(a, b, c, d) {
        super.hy(a, b, c, d);
        if (this.px != null && typeCast(ISortingAxis_$type, this.px) !== null) {
            this.px.i$i();
        }
        switch (a) {
            case 4:
                if (this.px != null) {
                    this.px.ck();
                }
                if (this.p3 != null && !this.p3.ck()) {
                    this.jc(true);
                }
                break;
            case 1:
                if (this.px != null) {
                    this.px.ck();
                }
                if (this.p3 != null && !this.p3.ck()) {
                    this.jc(true);
                }
                break;
            case 0:
                if (this.px != null) {
                    this.px.ck();
                }
                if (this.p3 != null && !this.p3.ck()) {
                    this.jc(true);
                }
                break;
            case 2:
                if (this.o8 != null && this.ox.cn.d > 0 && this.p3 != null && !this.p3.ck()) {
                    this.jc(true);
                }
                break;
            case 3:
                if (d == this.o8) {
                    if (this.px != null) {
                        this.px.ck();
                    }
                    if (this.p3 != null && !this.p3.ck()) {
                        this.jc(true);
                    }
                }
                break;
        }
    }
    p5(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    p6(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get p0() {
        return this.pz;
    }
    set p0(a) {
        let b = this.p0;
        if (a != b) {
            this.pz = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.p0));
        }
    }
    get useHighMarkerFidelity() {
        return this.n1;
    }
}
HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::qd', [CategoryAxisBase.$, null], 'YAxis::qe', [NumericYAxis.$, null]]);
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map