/*
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-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 { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
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
 */
var HorizontalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.sr = null;
        _this.sn = null;
        _this.st = null;
        _this.sp = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "ss", {
        get: function () {
            var _this = this;
            if (this.sr == null) {
                this.sr = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.cg.n; });
            }
            return this.sr;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.ji = function () {
        _super.prototype.ji.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.bj = function () {
        if (this.bk == 0) {
            return 1;
        }
        else {
            return _super.prototype.bj.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.pu = function () {
        return this.sn;
    };
    HorizontalAnchoredCategorySeries.prototype.qe = function () {
        return this.st;
    };
    HorizontalAnchoredCategorySeries.prototype.n4 = function (a) {
        if (this.pv == null || this.pv.m.count == 0 || !this.hasMarkers || !this.ok()) {
            return Rect.empty;
        }
        return this.ss.d$d(this, this.pv.m, a, runOn(this, this.s5));
    };
    HorizontalAnchoredCategorySeries.prototype.s5 = function (a) {
        return this.rm.c9(a);
    };
    HorizontalAnchoredCategorySeries.prototype.sx = function (a, b, c) {
        return this.ss.d$c(this, this.qe(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.ah = function (a) {
        return this.ss.d$a(this, this.pv.f, this.qu(this.bs), this.qv(this.bs), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ai = function (a) {
        return this.ss.d$b(this, this.pv.f, this.qu(this.bs), this.qv(this.bs), a);
    };
    HorizontalAnchoredCategorySeries.prototype.dy = function (a, b) {
        if (this.dx(a, b)) {
            return true;
        }
        if (this.ol(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.pz.r(this.pu(), this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.bs);
        return this.pu().getCategorySize(this.bs.bv, this.bs.bu, a);
    };
    HorizontalAnchoredCategorySeries.prototype.fh = function (a, b, c) {
        if (this.b6 == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.pu();
        var f = new ScalerParams(0, this.b6.os, this.bs.bu, e.ca, d);
        var g = this.pz.r(e, this.b6.os, this.bs.bu, d);
        return this.fj(this.valueColumn, a, e, f, g, runOn(this, this.qs), b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.gf = function (a, b) {
        return this.gg(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.gd = function (a, b) {
        return this.ge(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.e2 = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.e3(a, b, this.pu(), d, e, this.valueColumn.count, runOn(this, this.qs));
    };
    HorizontalAnchoredCategorySeries.prototype.nt = function (a, b, c) {
        if (this.pu() == null || this.qe() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.nv(a, b, c, this.pz.r(this.pu(), this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.qe(), this.pu(), null, null, null);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.sn;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.st;
    };
    HorizontalAnchoredCategorySeries.prototype.r5 = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.r6 = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.qo = function () {
        return this.st != null && this.st.cn();
    };
    HorizontalAnchoredCategorySeries.prototype.s1 = function (a) {
        this.sn = a;
    };
    HorizontalAnchoredCategorySeries.prototype.s2 = function (a) {
        this.st = a;
    };
    HorizontalAnchoredCategorySeries.prototype.po = function (a, b) {
        return this.rj(a, b, this.sn);
    };
    HorizontalAnchoredCategorySeries.prototype.kp = function (a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.s1(this.xAxis);
                if (this.rm.c3) {
                    this.rm.c2 = CategoryTrendLineManagerFactory.a(this.rm.c2, this.sn, this.ls, this, this.cg);
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.rm.c2 = CategoryTrendLineManagerFactory.a(this.rm.c2, this.sn, this.ls, this, this.cg);
                }
                break;
        }
        _super.prototype.kp.call(this, a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.jp(typeCast(Axis.$, c));
                    this.ku(typeCast(Axis.$, d));
                    this.s1(this.xAxis);
                    this.p3.cr.g(this.fq);
                    this.k3(false);
                    this.ka();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.jp(typeCast(Axis.$, c));
                    this.ku(typeCast(Axis.$, d));
                    this.s2(this.yAxis);
                    this.p3.cr.g(this.fq);
                    this.qo();
                    this.k3(false);
                    this.ka();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kw(true);
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.jo = function (a, b, c, d) {
        _super.prototype.jo.call(this, a, b, c, d);
        if (this.sn != null && typeCast(ISortingAxis_$type, this.sn) !== null) {
            this.sn.i$i();
        }
        switch (a) {
            case 4:
                if (this.sn != null) {
                    this.sn.cn();
                }
                if (this.st != null && !this.st.cn()) {
                    this.k3(true);
                }
                break;
            case 1:
                if (this.sn != null) {
                    this.sn.cn();
                }
                if (this.st != null && !this.st.cn()) {
                    this.k3(true);
                }
                break;
            case 0:
                if (this.sn != null) {
                    this.sn.cn();
                }
                if (this.st != null && !this.st.cn()) {
                    this.k3(true);
                }
                break;
            case 2:
                if (this.ry != null && this.rm.cr.d > 0 && this.st != null && !this.st.cn()) {
                    this.k3(true);
                }
                break;
            case 3:
                if (d == this.ry) {
                    if (this.sn != null) {
                        this.sn.cn();
                    }
                    if (this.st != null && !this.st.cn()) {
                        this.k3(true);
                    }
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.sv = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.sw = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "sq", {
        get: function () {
            return this.sp;
        },
        set: function (a) {
            var b = this.sq;
            if (a != b) {
                this.sp = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.sq));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.qp;
        },
        enumerable: true,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::s3', [CategoryAxisBase.$, null], 'YAxis::s4', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map
