/*
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-react-core";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Axis } from "./Axis";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { TrendLineType_$type } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-react-core";
/**
 * @hidden
 */
export let HorizontalAnchoredCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
        constructor() {
            super(...arguments);
            this.abx = null;
            this.abt = null;
            this.abz = null;
            this.abv = 0;
        }
        get aby() {
            if (this.abx == null) {
                this.abx = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.dp.n);
            }
            return this.abx;
        }
        oz() {
            super.oz();
            this.xAxis = null;
            this.yAxis = null;
        }
        ci() {
            return 1;
        }
        cj() {
            if (this.yAxis != null && this.yAxis.ch) {
                return 4;
            }
            return 3;
        }
        b0() {
            if (this.b1 == 0) {
                return 1;
            }
            else {
                return super.b0();
            }
        }
        yj() {
            return this.abt;
        }
        yz() {
            return this.abz;
        }
        wi(a) {
            if (this.yk == null || this.yk.n.count == 0 || !this.hasMarkers || !this.w7()) {
                return Rect.empty;
            }
            return this.aby.d$d(this, this.yk.n, a, runOn(this, this.acb));
        }
        acb(a) {
            return this.aad.de(a);
        }
        ab3(a, b, c) {
            return this.aby.d$c(this, this.yz(), a, b, c);
        }
        aj(a) {
            return this.aby.d$a(this, this.yk.f, this.zl(this.ct), this.zm(this.ct), a);
        }
        ak(a) {
            return this.aby.d$b(this, this.yk.f, this.zl(this.ct), this.zm(this.ct), a);
        }
        gu(a, b) {
            if (this.gt(a, b)) {
                return true;
            }
            if (this.w8(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.yp.r(this.yj(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.ct);
            return this.yj().getCategorySize(this.ct.by, this.ct.bx, a);
        }
        i3(a, b, c) {
            if (this.c9 == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yj();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.c9.vl, this.ct.bx, e.ch, d);
            let g = this.yp.r(e, this.c9.vl, this.ct.bx, d);
            return this.i5(this.valueColumn, a, e, f, g, runOn(this, this.zj), b, c);
        }
        j8(a, b) {
            return this.j9(a, b, this.yj(), runOn(this, this.zj), this.valueColumn);
        }
        j6(a, b) {
            return this.j7(a, b, this.yj(), runOn(this, this.zj), this.valueColumn);
        }
        im(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.io(a, b, this.yj(), d, e, this.valueColumn.count, runOn(this, this.zj));
        }
        v5(a, b, c) {
            if (this.yj() == null || this.yz() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.v7(a, b, c, this.yp.r(this.yj(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.yz(), this.yj(), null, null, null);
        }
        fetchXAxis() {
            return this.abt;
        }
        fetchYAxis() {
            return this.abz;
        }
        aa7(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        aa8(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        zf() {
            return this.abz != null && this.abz.c1();
        }
        ab7(a) {
            this.abt = a;
        }
        ab8(a) {
            this.abz = a;
        }
        yd(a, b) {
            return this.aaa(a, b, this.abt);
        }
        q4(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.ab7(this.xAxis);
                    if (this.aad.c8) {
                        this.aad.c7 = CategoryTrendLineManagerFactory.a(this.aad.c7, this.abt, this.so, this, this.dp);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.aad.c7 = CategoryTrendLineManagerFactory.a(this.aad.c7, this.abt, this.so, this, this.dp);
                    }
                    break;
            }
            super.q4(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.o9(typeCast(Axis.$, c));
                        this.rc(typeCast(Axis.$, d));
                        this.ab7(this.xAxis);
                        this.yt.cw.g(this.ib);
                        this.rm(false);
                        this.qg();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.o9(typeCast(Axis.$, c));
                        this.rc(typeCast(Axis.$, d));
                        this.ab8(this.yAxis);
                        if (this.c9 != null) {
                            this.c9.nq();
                        }
                        this.yt.cw.g(this.ib);
                        this.zf();
                        this.rm(false);
                        this.qg();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.l7(true);
                    }
                    break;
            }
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            if (this.abt != null && typeCast(ISortingAxis_$type, this.abt) !== null) {
                this.abt.i$i();
            }
            switch (a) {
                case 4:
                    if (this.abt != null) {
                        this.abt.c1();
                    }
                    if (this.abz != null && !this.abz.c1()) {
                        this.rm(true);
                    }
                    break;
                case 1:
                    if (this.abt != null) {
                        this.abt.c1();
                    }
                    if (this.abz != null && !this.abz.c1()) {
                        this.rm(true);
                    }
                    break;
                case 0:
                    if (this.abt != null) {
                        this.abt.c1();
                    }
                    if (this.abz != null && !this.abz.c1()) {
                        this.rm(true);
                    }
                    break;
                case 2:
                    if (this.aat != null && this.aad.cw.d > 0 && this.abz != null && !this.abz.c1()) {
                        this.rm(true);
                    }
                    break;
                case 3:
                    if (d == this.aat) {
                        if (this.abt != null) {
                            this.abt.c1();
                        }
                        if (this.abz != null && !this.abz.c1()) {
                            this.rm(true);
                        }
                    }
                    break;
            }
        }
        ab1(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        ab2(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get abw() {
            return this.abv;
        }
        set abw(a) {
            let b = this.abw;
            if (a != b) {
                this.abv = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.abw));
            }
        }
        get useHighMarkerFidelity() {
            return this.zg;
        }
    }
    HorizontalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::ab9', [CategoryAxisBase.$, null], 'YAxis::aca', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
