/*
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 { __extends } from "tslib";
import { RangeCategorySeries } from "./RangeCategorySeries";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { Axis } from "./Axis";
import { Point_$type, runOn, typeCast, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { RangeValueList } from "./RangeValueList";
import { ScalerParams } from "./ScalerParams";
import { CategoryXAxis } from "./CategoryXAxis";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
/**
 * @hidden
 */
var HorizontalRangeCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalRangeCategorySeries, _super);
    function HorizontalRangeCategorySeries() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HorizontalRangeCategorySeries.prototype.fetchXAxis = function () {
        return this.xAxis;
    };
    HorizontalRangeCategorySeries.prototype.fetchYAxis = function () {
        return this.yAxis;
    };
    HorizontalRangeCategorySeries.prototype.kx = function () {
        _super.prototype.kx.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalRangeCategorySeries.prototype.ah = function (a) {
        var b = this.aj(this.rs(), this.rt.f, this.st(this.b0), this.su(this.b0), this.pt(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[2] };
        f[1] = { $type: Point_$type, x: d[0], y: d[2] };
        e[0] = f;
        return e;
    };
    HorizontalRangeCategorySeries.prototype.ai = function (a) {
        var b = this.aj(this.rs(), this.rt.f, this.st(this.b0), this.su(this.b0), this.pt(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[1] };
        f[1] = { $type: Point_$type, x: d[0], y: d[1] };
        e[0] = f;
        return e;
    };
    HorizontalRangeCategorySeries.prototype.get_ec = function () {
        return true;
    };
    HorizontalRangeCategorySeries.prototype.bp = function () {
        if (this.bq == 0) {
            return 1;
        }
        else {
            return _super.prototype.bp.call(this);
        }
    };
    HorizontalRangeCategorySeries.prototype.getOffsetValue = function () {
        return this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    HorizontalRangeCategorySeries.prototype.getCategoryWidth = function () {
        return this.xAxis.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    HorizontalRangeCategorySeries.prototype.hj = function (a, b) {
        return this.hk(a, b, this.xAxis, runOn(this, this.sr), new RangeValueList(this.highColumn, this.lowColumn));
    };
    HorizontalRangeCategorySeries.prototype.hl = function (a, b) {
        return this.hm(a, b, this.xAxis, runOn(this, this.sr), new RangeValueList(this.highColumn, this.lowColumn));
    };
    HorizontalRangeCategorySeries.prototype.f5 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.xAxis.le;
        return this.f6(a, b, this.xAxis, d, e, f, runOn(this, this.sr));
    };
    HorizontalRangeCategorySeries.prototype.gl = function (a, b, c) {
        if (this.cd == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.b0);
        var e = new ScalerParams(0, this.cd.s9, this.b0.bu, this.xAxis.cg, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cd.s9, this.b0.bu, d);
        return this.gn(new RangeValueList(this.highColumn, this.lowColumn), a, this.xAxis, e, f, runOn(this, this.sr), b, c);
    };
    HorizontalRangeCategorySeries.prototype.gj = function (a, b, c) {
        if (this.cd == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.b0);
        var e = new ScalerParams(0, this.cd.s9, this.b0.bu, this.xAxis.cg, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cd.s9, this.b0.bu, d);
        return this.gn(this.lowColumn, a, this.xAxis, e, f, runOn(this, this.sr), b, c);
    };
    HorizontalRangeCategorySeries.prototype.gh = function (a, b, c) {
        if (this.cd == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.b0);
        var e = new ScalerParams(0, this.cd.s9, this.b0.bu, this.xAxis.cg, d);
        var f = this.RangeFramePreparer.r(this.xAxis, this.cd.s9, this.b0.bu, d);
        return this.gn(this.highColumn, a, this.xAxis, e, f, runOn(this, this.sr), b, c);
    };
    HorizontalRangeCategorySeries.prototype.pm = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, runOn(this, this.gh), function (d, e) { return _this.hm(d, e, _this.xAxis, runOn(_this, _this.sr), _this.highColumn); }, function (d, e) { return _this.hk(d, e, _this.xAxis, runOn(_this, _this.sr), _this.highColumn); });
    };
    HorizontalRangeCategorySeries.prototype.po = function (a, b, c) {
        var _this = this;
        return this.ps(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, runOn(this, this.gj), function (d, e) { return _this.hm(d, e, _this.xAxis, runOn(_this, _this.sr), _this.lowColumn); }, function (d, e) { return _this.hk(d, e, _this.xAxis, runOn(_this, _this.sr), _this.lowColumn); });
    };
    HorizontalRangeCategorySeries.prototype.pq = function (a, b, c) {
        return this.ps(a, b, c, this.RangeFramePreparer.r(this.xAxis, this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.yAxis, this.xAxis, null, null, null);
    };
    HorizontalRangeCategorySeries.prototype.sn = function () {
        return this.yAxis != null && this.yAxis.c0();
    };
    HorizontalRangeCategorySeries.prototype.l7 = function (a, b, c, d) {
        _super.prototype.l7.call(this, a, b, c, d);
        switch (b) {
            case HorizontalRangeCategorySeries.$$p[4]:
                this.k4(typeCast(Axis.$, c));
                this.mc(typeCast(Axis.$, d));
                this.r2.cr.g(this.fv);
                this.ml(false);
                this.ls();
                break;
            case HorizontalRangeCategorySeries.$$p[5]:
                this.k4(typeCast(Axis.$, c));
                this.mc(typeCast(Axis.$, d));
                this.r2.cr.g(this.fv);
                this.sn();
                this.ml(false);
                this.ls();
                break;
        }
    };
    HorizontalRangeCategorySeries.prototype.t1 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    HorizontalRangeCategorySeries.prototype.t0 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
            return true;
        }
        return false;
    };
    HorizontalRangeCategorySeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = { $type: Point_$type, x: a, y: b };
        var d = this.gj(c, false, false);
        var e = this.gh(c, false, false);
        var f = new DataLegendSeriesValueInfo();
        f.a = 1;
        f.l = e > d ? d : e;
        f.p = "Low";
        f.q = this.tt != null ? this.tt : "Low";
        f.r = this.t6 != null ? this.t6 : "L:";
        f.s = this.t8 != null ? this.t8 : "";
        var g = new DataLegendSeriesValueInfo();
        g.a = 2;
        g.l = e > d ? e : d;
        g.p = "High";
        g.q = this.tq != null ? this.tq : "High";
        g.r = this.t2 != null ? this.t2 : "H:";
        g.s = this.t4 != null ? this.t4 : "";
        var h = new DataLegendSeriesValueInfo();
        h.a = 7;
        h.l = Math.abs(g.l - f.l);
        h.p = "Range";
        h.q = "Range";
        h.r = "R:";
        h.k = true;
        var i = new DataLegendSeriesValueInfo();
        i.a = 6;
        i.l = f.l + (h.l / 2);
        i.p = "Average";
        i.q = "Average";
        i.r = "A:";
        i.k = true;
        var j = new DataLegendSeriesContext();
        j.f = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(g);
            $ret.add(f);
            $ret.add(h);
            $ret.add(i);
            return $ret;
        })());
        j.b = this.av();
        return j;
    };
    Object.defineProperty(HorizontalRangeCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.so;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalRangeCategorySeries.$t = markType(HorizontalRangeCategorySeries, 'HorizontalRangeCategorySeries', RangeCategorySeries.$);
    HorizontalRangeCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:t2:uc', [2, null], 'HighMemberAsLegendUnit:t4:ud', [2, null], 'LowMemberAsLegendLabel:t6:ue', [2, null], 'LowMemberAsLegendUnit:t8:uf', [2, null], 'XAxis::ug', [CategoryAxisBase.$, null], 'YAxis::uh', [NumericYAxis.$, null]]);
    return HorizontalRangeCategorySeries;
}(RangeCategorySeries));
export { HorizontalRangeCategorySeries };
