/*
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 { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-react-core";
import { runOn, typeCast, EnumUtil, markType, markDep } from "igniteui-react-core";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { TrendLineType_$type } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate } from "igniteui-react-core";
/**
 * @hidden
 */
var VerticalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(VerticalAnchoredCategorySeries, _super);
    function VerticalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.so = null;
        return _this;
    }
    VerticalAnchoredCategorySeries.prototype.ji = function () {
        _super.prototype.ji.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    Object.defineProperty(VerticalAnchoredCategorySeries.prototype, "sp", {
        get: function () {
            var _this = this;
            if (this.so == null) {
                this.so = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.cg.n; });
            }
            return this.so;
        },
        enumerable: true,
        configurable: true
    });
    VerticalAnchoredCategorySeries.prototype.get_isVertical = function () {
        return true;
    };
    VerticalAnchoredCategorySeries.prototype.pu = function () {
        return this.yAxis;
    };
    VerticalAnchoredCategorySeries.prototype.qe = function () {
        return this.xAxis;
    };
    VerticalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.pz.r(this.pu(), this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
    };
    VerticalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        return this.yAxis.getCategorySize(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
    };
    VerticalAnchoredCategorySeries.prototype.gd = function (a, b) {
        return this.ge(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
    };
    VerticalAnchoredCategorySeries.prototype.gf = function (a, b) {
        return this.gg(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
    };
    VerticalAnchoredCategorySeries.prototype.e2 = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.e3(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.qs));
    };
    VerticalAnchoredCategorySeries.prototype.bj = function () {
        if (this.bk == 0) {
            return 1;
        }
        else {
            return _super.prototype.bj.call(this);
        }
    };
    VerticalAnchoredCategorySeries.prototype.n4 = function (a) {
        if (!this.hasMarkers || !this.ok()) {
            return Rect.empty;
        }
        return this.sp.e$b(this, this.pv.m, a, runOn(this, this.sx));
    };
    VerticalAnchoredCategorySeries.prototype.sx = function (a) {
        return this.rm.c9(a);
    };
    VerticalAnchoredCategorySeries.prototype.dy = function (a, b) {
        if (this.dx(a, b)) {
            return true;
        }
        if (this.ol(a, b)) {
            return true;
        }
        return false;
    };
    VerticalAnchoredCategorySeries.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);
    };
    VerticalAnchoredCategorySeries.prototype.nt = function (a, b, c) {
        var d = this.pu();
        return this.nv(a, b, c, this.pz.r(d, this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.qe(), d, null, null, null);
    };
    VerticalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.xAxis;
    };
    VerticalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.yAxis;
    };
    VerticalAnchoredCategorySeries.prototype.r5 = function (a) {
        this.xAxis = typeCast(NumericXAxis.$, a);
    };
    VerticalAnchoredCategorySeries.prototype.r6 = function (a) {
        this.yAxis = typeCast(CategoryYAxis.$, a);
    };
    VerticalAnchoredCategorySeries.prototype.qo = function () {
        return this.xAxis != null && this.xAxis.cn();
    };
    VerticalAnchoredCategorySeries.prototype.po = function (a, b) {
        return this.rj(a, b, this.yAxis);
    };
    VerticalAnchoredCategorySeries.prototype.e4 = function (a) {
        return this.sp.e$a(this, a);
    };
    VerticalAnchoredCategorySeries.prototype.qs = function (a) {
        return this.e6(a, this.pu());
    };
    VerticalAnchoredCategorySeries.prototype.f9 = function (a) {
        return truncate(Math.round(this.e4(a)));
    };
    VerticalAnchoredCategorySeries.prototype.gq = function (a) {
        var b = this.f9(a);
        return b >= 0 && this.cd != null && b < this.cd.count ? this.cd.item(b) : null;
    };
    VerticalAnchoredCategorySeries.prototype.kp = function (a, b, c, d) {
        _super.prototype.kp.call(this, a, b, c, d);
        switch (b) {
            case VerticalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.jp(typeCast(Axis.$, c));
                    this.ku(typeCast(Axis.$, d));
                    this.p3.cr.g(this.fq);
                    this.k3(false);
                    this.ka();
                }
                break;
            case VerticalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.jp(typeCast(Axis.$, c));
                    this.ku(typeCast(Axis.$, d));
                    this.p3.cr.g(this.fq);
                    this.qo();
                    this.k3(false);
                    this.ka();
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.rm.c2 = CategoryTrendLineManagerFactory.a(this.rm.c2, this.yAxis, this.ls, this, this.cg);
                }
                break;
        }
    };
    VerticalAnchoredCategorySeries.prototype.ss = function (a) {
        if (typeCast(CategoryYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    VerticalAnchoredCategorySeries.prototype.sr = function (a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(VerticalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.qp;
        },
        enumerable: true,
        configurable: true
    });
    VerticalAnchoredCategorySeries.$t = markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
    VerticalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::sv', [NumericXAxis.$, null], 'YAxis::sw', [CategoryYAxis.$, null]]);
    return VerticalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { VerticalAnchoredCategorySeries };
//# sourceMappingURL=VerticalAnchoredCategorySeries.js.map
