/*
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/ES5/DVContainer";
import { Type, runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType } from "igniteui-angular-core/ES5/type";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core/ES5/DependencyProperty";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-angular-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-angular-core/ES5/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core/ES5/PropertyMetadata";
/**
 * @hidden
 */
var HorizontalAnchoredCategorySeries = /** @class */ (function (_super) {
    tslib_1.__extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p1 = null;
        _this.px = null;
        _this.p3 = null;
        _this.pz = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "p2", {
        get: function () {
            var _this = this;
            if (this.p1 == null) {
                this.p1 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.b2.n; });
            }
            return this.p1;
        },
        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.m5 = function () {
        return this.px;
    };
    HorizontalAnchoredCategorySeries.prototype.np = function () {
        return this.p3;
    };
    HorizontalAnchoredCategorySeries.prototype.lv = function (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));
    };
    HorizontalAnchoredCategorySeries.prototype.qf = function (a) {
        return this.ox.c5(a);
    };
    HorizontalAnchoredCategorySeries.prototype.p7 = function (a, b, c) {
        return this.p2.d$c(this, this.np(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.ah = function (a) {
        return this.p2.d$a(this, this.m6.f, this.n6(this.bi), this.n7(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ai = function (a) {
        return this.p2.d$b(this, this.m6.f, this.n6(this.bi), this.n7(this.bi), a);
    };
    HorizontalAnchoredCategorySeries.prototype.dh = function (a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l3(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.na.r(this.m5(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.bi);
        return this.m5().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.m5();
        var f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        var 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);
    };
    HorizontalAnchoredCategorySeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.m5(), runOn(this, this.n4), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.m5(), runOn(this, this.n4), 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.m5(), d, e, this.valueColumn.count, runOn(this, this.n4));
    };
    HorizontalAnchoredCategorySeries.prototype.lk = function (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);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.px;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.p3;
    };
    HorizontalAnchoredCategorySeries.prototype.pf = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.pg = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.n0 = function () {
        return this.p3 != null && this.p3.ck();
    };
    HorizontalAnchoredCategorySeries.prototype.qb = function (a) {
        this.px = a;
    };
    HorizontalAnchoredCategorySeries.prototype.qc = function (a) {
        this.p3 = a;
    };
    HorizontalAnchoredCategorySeries.prototype.mz = function (a, b) {
        return this.ou(a, b, this.px);
    };
    HorizontalAnchoredCategorySeries.prototype.iy = function (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":
                var 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.prototype.iy.call(this, 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;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.hy = function (a, b, c, d) {
        _super.prototype.hy.call(this, 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;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.p5 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.p6 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "p0", {
        get: function () {
            return this.pz;
        },
        set: function (a) {
            var b = this.p0;
            if (a != b) {
                this.pz = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.p0));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.n1;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
Type.dep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::qd', [CategoryAxisBase.$, null], 'YAxis::qe', [NumericYAxis.$, null]]);
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map