/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Polyline } from "igniteui-angular-core";
import { Polygon } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { isNaN_ } from "igniteui-angular-core";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
/**
 * @hidden
 */
var RangeAreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeries, _super);
    function RangeAreaSeries() {
        var _this = _super.call(this) || this;
        _this.ab = RangeAreaSeries.$;
        return _this;
    }
    RangeAreaSeries.prototype.bj = function () {
        return new RangeAreaSeries();
    };
    RangeAreaSeries.prototype.cs = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.q1 = function (a) {
        _super.prototype.q1.call(this, a);
        this.ab0 = a;
    };
    RangeAreaSeries.prototype.get_ev = function () {
        return true;
    };
    RangeAreaSeries.prototype.get_eu = function () {
        return true;
    };
    RangeAreaSeries.prototype.ab1 = function (a, b, c, d) {
        if (isNaN_(b.x) || isNaN_(b.y)) {
            return false;
        }
        if (isNaN_(c.x) || isNaN_(c.y)) {
            return false;
        }
        if ((a.y <= b.y && a.y >= c.y)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.gw = function (a, b) {
        if (this.gv(a, b)) {
            return true;
        }
        if (this.xh(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.o5 = function (a, b) {
        _super.prototype.o5.call(this, a, b);
        var c = b;
        c.c8();
    };
    RangeAreaSeries.prototype.aak = function (a, b) {
        _super.prototype.aak.call(this, a, b);
        var c = a.f.count;
        var d = new List$1(Array_$type, 2, c);
        for (var e = 0; e < c; e++) {
            var f = a.f._inner[e];
            var g = new Array(4);
            g[0] = f[0];
            g[1] = f[1];
            var h = a.f._inner[a.f.count - 1 - e];
            g[2] = h[0];
            g[3] = h[2];
            d.add(g);
        }
        var i = typeCast(RangeAreaSeriesView.$, b);
        var j = this.getEffectiveViewport1(i);
        this.y2.a2(this, this.zm(), runOn(this, this.ym), this.zv(b), this.zw(b));
        var k = false;
        var l = this.y2.b;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.by, b.bx, this.xAxis.ch, j);
            this.aag(d, -1, this.lowColumn.count, this.xAxis, m, b.q, -1);
        }
        var n = i.dh;
        var o = i.di;
        var p = i.dc;
        this.y2.ad(n, true, false, true, true);
        this.y2.ad(o, true, false, true, true);
        this.y2.ad(p, false, true, false, false);
        if (b.c0(a)) {
            i.c9(a.f.count, d, false);
            b.c3(a);
        }
        i.dc._opacity = this.y2.j * this.h9;
    };
    RangeAreaSeries.prototype.p4 = function (a, b, c) {
        this.aac(a, b, c, this.yt, 1);
    };
    RangeAreaSeries.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.p4(a, c, b);
        return c.toArray();
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.zq;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
}(HorizontalRangeCategorySeries));
export { RangeAreaSeries };
/**
 * @hidden
 */
var RangeAreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RangeAreaSeriesView, _super);
    function RangeAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c7 = null;
        _this.df = new Polyline();
        _this.db = new Polygon();
        _this.dg = new Polyline();
        _this.de = new Polyline();
        _this.dd = new Polyline();
        _this.da = new Polygon();
        _this.c7 = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.c7.xa = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "dh", {
        get: function () {
            return this.df;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dc", {
        get: function () {
            return this.db;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "di", {
        get: function () {
            return this.dg;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeriesView.prototype.c8 = function () {
        this.db.an.clear();
        this.df.an.clear();
        this.dg.an.clear();
    };
    RangeAreaSeriesView.prototype.c9 = function (a, b, c) {
        this.c6(this.df, this.db, this.dg, a, b, c);
        this.as();
    };
    RangeAreaSeriesView.prototype.be = function () {
        _super.prototype.be.call(this);
        this.dd.an = this.df.an;
        this.de.an = this.dg.an;
        this.da.an = this.db.an;
        var a = this.br();
        this.dd._stroke = a;
        this.dd.ad = this.e.ie + 3;
        this.de._stroke = a;
        this.de.ad = this.e.ie + 3;
        this.da._fill = a;
        this.da._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a8 = function (a, b) {
        _super.prototype.a8.call(this, a, b);
        if (a.d) {
            if (b) {
                a.u(this.da);
                a.v(this.dd);
                a.v(this.de);
            }
            else {
                a.u(this.db);
                a.v(this.df);
                a.v(this.dg);
            }
        }
    };
    RangeAreaSeriesView.prototype.an = function (a) {
        _super.prototype.an.call(this, a);
        this.e.bc.exportPolylineData(a, this.df, "lowerShape", ["Lower"]);
        this.e.bc.exportPolylineData(a, this.dg, "upperShape", ["Upper", "Main"]);
        this.e.bc.exportPolygonData(a, this.db, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
