/*
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 { 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
 */
export let RangeAreaSeries = /*@__PURE__*/ (() => {
    class RangeAreaSeries extends HorizontalRangeCategorySeries {
        constructor() {
            super();
            this.ab = RangeAreaSeries.$;
        }
        bx() {
            return new RangeAreaSeriesView(this);
        }
        ly(a) {
            super.ly(a);
            this.ud = a;
        }
        get_de() {
            return true;
        }
        get_dd() {
            return true;
        }
        ue(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;
        }
        ev(a, b) {
            if (this.eu(a, b)) {
                return true;
            }
            if (this.qf(a, b)) {
                return true;
            }
            return false;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        kx(a, b) {
            super.kx(a, b);
            let c = b;
            c.c3();
        }
        s6(a, b) {
            super.s6(a, b);
            let c = a.f.count;
            let d = new List$1(Array_$type, 2, c);
            for (let e = 0; e < c; e++) {
                let f = a.f._inner[e];
                let g = new Array(4);
                g[0] = f[0];
                g[1] = f[1];
                let h = a.f._inner[a.f.count - 1 - e];
                g[2] = h[0];
                g[3] = h[2];
                d.add(g);
            }
            let i = typeCast(RangeAreaSeriesView.$, b);
            let j = this.getEffectiveViewport1(i);
            this.rw.a0(this, this.sg(), runOn(this, this.rh), this.so(b), this.sp(b));
            let k = false;
            let l = this.rw.b;
            if (l != null) {
                k = true;
            }
            if (k) {
                let m = new ScalerParams(0, b.bv, b.bu, this.xAxis.cg, j);
                this.s2(d, -1, this.lowColumn.count, this.xAxis, m, b.q);
            }
            let n = i.dc;
            let o = i.dd;
            let p = i.c7;
            this.rw.ad(n, true, false, true, true);
            this.rw.ad(o, true, false, true, true);
            this.rw.ad(p, false, true, false, false);
            if (b.cv(a)) {
                i.c4(a.f.count, d, false);
                b.cy(a);
            }
            i.c7._opacity = this.rw.j * this.fq;
        }
        get useHighMarkerFidelity() {
            return this.sj;
        }
    }
    RangeAreaSeries.$t = markType(RangeAreaSeries, 'RangeAreaSeries', HorizontalRangeCategorySeries.$);
    return RangeAreaSeries;
})();
/**
 * @hidden
 */
export let RangeAreaSeriesView = /*@__PURE__*/ (() => {
    class RangeAreaSeriesView extends RangeCategorySeriesView {
        constructor(a) {
            super(a);
            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;
        }
        as() {
            super.as();
            if (!this.q) {
                this.c2.qc = 1;
            }
        }
        get dc() {
            return this.da;
        }
        get c7() {
            return this.c6;
        }
        get dd() {
            return this.db;
        }
        c3() {
            this.c6.ak.clear();
            this.da.ak.clear();
            this.db.ak.clear();
        }
        c4(a, b, c) {
            this.c1(this.da, this.c6, this.db, a, b, c);
            this.aq();
        }
        bc() {
            super.bc();
            this.c8.ak = this.da.ak;
            this.c9.ak = this.db.ak;
            this.c5.ak = this.c6.ak;
            let a = this.bo();
            this.c8._stroke = a;
            this.c8.ac = this.e.fu + 3;
            this.c9._stroke = a;
            this.c9.ac = this.e.fu + 3;
            this.c5._fill = a;
            this.c5._opacity = 1;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c5);
                    a.u(this.c8);
                    a.u(this.c9);
                }
                else {
                    a.t(this.c6);
                    a.u(this.da);
                    a.u(this.db);
                }
            }
        }
        al(a) {
            super.al(a);
            this.e.a8.exportPolylineData(a, this.da, "lowerShape", ["Lower"]);
            this.e.a8.exportPolylineData(a, this.db, "upperShape", ["Upper", "Main"]);
            this.e.a8.exportPolygonData(a, this.c6, "fillShape", ["Fill"]);
        }
    }
    RangeAreaSeriesView.$t = markType(RangeAreaSeriesView, 'RangeAreaSeriesView', RangeCategorySeriesView.$);
    return RangeAreaSeriesView;
})();
