/*
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 { 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.by = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.l4 = function (a) {
        _super.prototype.l4.call(this, a);
        this.um = a;
    };
    RangeAreaSeries.prototype.get_dg = function () {
        return true;
    };
    RangeAreaSeries.prototype.get_df = function () {
        return true;
    };
    RangeAreaSeries.prototype.un = 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.ez = function (a, b) {
        if (this.ey(a, b)) {
            return true;
        }
        if (this.qo(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.k2 = function (a, b) {
        _super.prototype.k2.call(this, a, b);
        var c = b;
        c.c3();
    };
    RangeAreaSeries.prototype.tf = function (a, b) {
        _super.prototype.tf.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.r5.a2(this, this.sp(), runOn(this, this.rq), this.sx(b), this.sy(b));
        var k = false;
        var l = this.r5.b;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.bv, b.bu, this.xAxis.cg, j);
            this.tb(d, -1, this.lowColumn.count, this.xAxis, m, b.q);
        }
        var n = i.dc;
        var o = i.dd;
        var p = i.c7;
        this.r5.ad(n, true, false, true, true);
        this.r5.ad(o, true, false, true, true);
        this.r5.ad(p, false, true, false, false);
        if (b.cv(a)) {
            i.c4(a.f.count, d, false);
            b.cy(a);
        }
        i.c7._opacity = this.r5.j * this.fu;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.ss;
        },
        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.c2 = null;
        _this.da = new Polyline();
        _this.c6 = new Polygon();
        _this.db = new Polyline();
        _this.c9 = new Polyline();
        _this.c8 = new Polyline();
        _this.c5 = new Polygon();
        _this.c2 = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.c2.ql = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "dc", {
        get: function () {
            return this.da;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c7", {
        get: function () {
            return this.c6;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "dd", {
        get: function () {
            return this.db;
        },
        enumerable: false,
        configurable: true
    });
    RangeAreaSeriesView.prototype.c3 = function () {
        this.c6.an.clear();
        this.da.an.clear();
        this.db.an.clear();
    };
    RangeAreaSeriesView.prototype.c4 = function (a, b, c) {
        this.c1(this.da, this.c6, this.db, a, b, c);
        this.aq();
    };
    RangeAreaSeriesView.prototype.bc = function () {
        _super.prototype.bc.call(this);
        this.c8.an = this.da.an;
        this.c9.an = this.db.an;
        this.c5.an = this.c6.an;
        var a = this.bo();
        this.c8._stroke = a;
        this.c8.ad = this.e.fy + 3;
        this.c9._stroke = a;
        this.c9.ad = this.e.fy + 3;
        this.c5._fill = a;
        this.c5._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a6 = function (a, b) {
        _super.prototype.a6.call(this, a, b);
        if (a.d) {
            if (b) {
                a.u(this.c5);
                a.v(this.c8);
                a.v(this.c9);
            }
            else {
                a.u(this.c6);
                a.v(this.da);
                a.v(this.db);
            }
        }
    };
    RangeAreaSeriesView.prototype.al = function (a) {
        _super.prototype.al.call(this, a);
        this.e.a9.exportPolylineData(a, this.da, "lowerShape", ["Lower"]);
        this.e.a9.exportPolylineData(a, this.db, "upperShape", ["Upper", "Main"]);
        this.e.a9.exportPolygonData(a, this.c6, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
