/*
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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core";
/**
 * @hidden
 */
var HorizontalAnchoredCategorySeries = /** @class */ (function (_super) {
    tslib_1.__extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p2 = null;
        _this.py = null;
        _this.p4 = null;
        _this.p0 = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "p3", {
        get: function () {
            var _this = this;
            if (this.p2 == null) {
                this.p2 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.b2.n; });
            }
            return this.p2;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.ht = function () {
        _super.prototype.ht.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.bd = function () {
        if (this.be == 0) {
            return 1;
        }
        else {
            return _super.prototype.bd.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.m6 = function () {
        return this.py;
    };
    HorizontalAnchoredCategorySeries.prototype.nq = function () {
        return this.p4;
    };
    HorizontalAnchoredCategorySeries.prototype.lw = function (a) {
        if (this.m7 == null || this.m7.m.count == 0 || !this.hasMarkers || !this.l3()) {
            return Rect.empty;
        }
        return this.p3.d$d(this, this.m7.m, a, runOn(this, this.qg));
    };
    HorizontalAnchoredCategorySeries.prototype.qg = function (a) {
        return this.oy.c5(a);
    };
    HorizontalAnchoredCategorySeries.prototype.p8 = function (a, b, c) {
        return this.p3.d$c(this, this.nq(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.ah = function (a) {
        return this.p3.d$a(this, this.m7.f, this.n7(this.bi), this.n8(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ai = function (a) {
        return this.p3.d$b(this, this.m7.f, this.n7(this.bi), this.n8(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.dh = function (a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l4(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.nb.r(this.m6(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.bi);
        return this.m6().getCategorySize(this.bi.bs, this.bi.br, a);
    };
    HorizontalAnchoredCategorySeries.prototype.en = function (a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.m6();
        var f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        var g = this.nb.r(e, this.bs.mq, this.bi.br, d);
        return this.ep(this.valueColumn, a, e, f, g, runOn(this, this.n5), b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.m6(), runOn(this, this.n5), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.m6(), runOn(this, this.n5), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.d9 = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.ea(a, b, this.m6(), d, e, this.valueColumn.count, runOn(this, this.n5));
    };
    HorizontalAnchoredCategorySeries.prototype.ll = function (a, b, c) {
        if (this.m6() == null || this.nq() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.ln(a, b, c, this.nb.r(this.m6(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.nq(), this.m6(), null, null, null);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.py;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.p4;
    };
    HorizontalAnchoredCategorySeries.prototype.pg = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.ph = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.n1 = function () {
        return this.p4 != null && this.p4.cl();
    };
    HorizontalAnchoredCategorySeries.prototype.qc = function (a) {
        this.py = a;
    };
    HorizontalAnchoredCategorySeries.prototype.qd = function (a) {
        this.p4 = a;
    };
    HorizontalAnchoredCategorySeries.prototype.m0 = function (a, b) {
        return this.ov(a, b, this.py);
    };
    HorizontalAnchoredCategorySeries.prototype.iz = function (a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.qc(this.xAxis);
                if (this.oy.cz) {
                    this.oy.cy = CategoryTrendLineManagerFactory.a(this.oy.cy, this.py, this.jx, this, this.b2);
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.oy.cy = CategoryTrendLineManagerFactory.a(this.oy.cy, this.py, this.jx, this, this.b2);
                }
                break;
        }
        _super.prototype.iz.call(this, a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i4(typeCast(Axis.$, d));
                    this.qc(this.xAxis);
                    this.nf.cn.g(this.eu);
                    this.jd(false);
                    this.ik();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i4(typeCast(Axis.$, d));
                    this.qd(this.yAxis);
                    this.nf.cn.g(this.eu);
                    this.n1();
                    this.jd(false);
                    this.ik();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kn(true);
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.hy = function (a, b, c, d) {
        _super.prototype.hy.call(this, a, b, c, d);
        if (this.py != null && typeCast(ISortingAxis_$type, this.py) !== null) {
            this.py.i$i();
        }
        switch (a) {
            case 4:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 1:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 0:
                if (this.py != null) {
                    this.py.cl();
                }
                if (this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 2:
                if (this.o9 != null && this.oy.cn.d > 0 && this.p4 != null && !this.p4.cl()) {
                    this.jd(true);
                }
                break;
            case 3:
                if (d == this.o9) {
                    if (this.py != null) {
                        this.py.cl();
                    }
                    if (this.p4 != null && !this.p4.cl()) {
                        this.jd(true);
                    }
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.p6 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.p7 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "p1", {
        get: function () {
            return this.p0;
        },
        set: function (a) {
            var b = this.p1;
            if (a != b) {
                this.p0 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.p1));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.n2;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::qe', [CategoryAxisBase.$, null], 'YAxis::qf', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map