/*
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 { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries";
import { Array_$type, typeCast, runOn, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Polyline } from "igniteui-react-core/ES5/Polyline";
import { Polygon } from "igniteui-react-core/ES5/Polygon";
import { ScalerParams } from "./ScalerParams";
import { isNaN_ } from "igniteui-react-core/ES5/number";
import { RangeCategorySeriesView } from "./RangeCategorySeriesView";
var RangeAreaSeries = /** @class */ (function (_super) {
    tslib_1.__extends(RangeAreaSeries, _super);
    function RangeAreaSeries() {
        var _this = _super.call(this) || this;
        _this.ab = RangeAreaSeries.$;
        return _this;
    }
    RangeAreaSeries.prototype.bf = function () {
        return new RangeAreaSeriesView(this);
    };
    RangeAreaSeries.prototype.ii = function (a) {
        _super.prototype.ii.call(this, a);
        this.o8 = a;
    };
    RangeAreaSeries.prototype.get_cj = function () {
        return true;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "cj", {
        get: function () {
            return this.get_cj();
        },
        enumerable: true,
        configurable: true
    });
    RangeAreaSeries.prototype.o9 = 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.de = function (a, b) {
        if (this.dd(a, b)) {
            return true;
        }
        if (this.ls(a, b)) {
            return true;
        }
        return false;
    };
    RangeAreaSeries.prototype.preferredCategoryMode = function (a) {
        return 0;
    };
    RangeAreaSeries.prototype.hl = function (a, b) {
        _super.prototype.hl.call(this, a, b);
        var c = b;
        c.cx();
    };
    RangeAreaSeries.prototype.ob = function (a, b) {
        _super.prototype.ob.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.m2.x(this, this.nn(), this.xAxis, runOn(this, this.mo), this.nv(b), this.nw(b));
        var k = false;
        var l = this.m2.c;
        if (l != null) {
            k = true;
        }
        if (k) {
            var m = new ScalerParams(0, b.bq, b.bp, this.xAxis.b8, j);
            this.n7(d, -1, this.lowColumn.count, this.xAxis, m, b.n);
        }
        var n = i.c5;
        var o = i.c7;
        var p = i.c1;
        this.m2.ae(n, true, false, true, true);
        this.m2.ae(o, true, false, true, true);
        this.m2.ae(p, false, true, false, false);
        if (b.cp(a)) {
            i.cy(a.f.count, d, false);
            b.cs(a);
        }
        i.c1._opacity = this.m2.i * this.d1;
    };
    Object.defineProperty(RangeAreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.nq;
        },
        enumerable: true,
        configurable: true
    });
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
}(HorizontalRangeCategorySeries));
export { RangeAreaSeries };
var RangeAreaSeriesView = /** @class */ (function (_super) {
    tslib_1.__extends(RangeAreaSeriesView, _super);
    function RangeAreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.cw = null;
        _this.c4 = new Polyline();
        _this.c0 = new Polygon();
        _this.c6 = new Polyline();
        _this.c3 = new Polyline();
        _this.c2 = new Polyline();
        _this.cz = new Polygon();
        _this.cw = a;
        return _this;
    }
    RangeAreaSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 1;
        }
    };
    Object.defineProperty(RangeAreaSeriesView.prototype, "c5", {
        get: function () {
            return this.c4;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c1", {
        get: function () {
            return this.c0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RangeAreaSeriesView.prototype, "c7", {
        get: function () {
            return this.c6;
        },
        enumerable: true,
        configurable: true
    });
    RangeAreaSeriesView.prototype.cx = function () {
        this.c0.aj.clear();
        this.c4.aj.clear();
        this.c6.aj.clear();
    };
    RangeAreaSeriesView.prototype.cy = function (a, b, c) {
        this.cv(this.c4, this.c0, this.c6, a, b, c);
        this.an();
    };
    RangeAreaSeriesView.prototype.a9 = function () {
        _super.prototype.a9.call(this);
        this.c2.aj = this.c4.aj;
        this.c3.aj = this.c6.aj;
        this.cz.aj = this.c0.aj;
        var a = this.bk();
        this.c2._stroke = a;
        this.c2.ac = this.e.es + 3;
        this.c3._stroke = a;
        this.c3.ac = this.e.es + 3;
        this.cz._fill = a;
        this.cz._opacity = 1;
    };
    RangeAreaSeriesView.prototype.a3 = function (a, b) {
        _super.prototype.a3.call(this, a, b);
        if (a.d) {
            if (b) {
                a.t(this.cz);
                a.u(this.c2);
                a.u(this.c3);
            }
            else {
                a.t(this.c0);
                a.u(this.c4);
                a.u(this.c6);
            }
        }
    };
    RangeAreaSeriesView.prototype.ai = function (a) {
        _super.prototype.ai.call(this, a);
        this.e.a2.exportPolylineData(a, this.c4, "lowerShape", ["Lower"]);
        this.e.a2.exportPolylineData(a, this.c6, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPolygonData(a, this.c0, "fillShape", ["Fill"]);
    };
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
}(RangeCategorySeriesView));
export { RangeAreaSeriesView };
