/*
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 { SplineSeriesBase } from "./SplineSeriesBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, runOn, markType } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let SplineAreaSeries = /*@__PURE__*/ (() => {
    class SplineAreaSeries extends SplineSeriesBase {
        constructor() {
            super();
            this.vq = null;
            this.vq = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        get_dd() {
            return true;
        }
        get_eg() {
            return true;
        }
        bx() {
            return new SplineAreaSeriesView(this);
        }
        ry() {
            return 1;
        }
        ly(a) {
            super.ly(a);
            this.vr = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        b3() {
            if (this.b4 == 0) {
                return 2;
            }
            return super.b3();
        }
        kx(a, b) {
            super.kx(a, b);
            let c = b;
            c.dd();
        }
        ev(a, b) {
            let c = this.pl(this.po(a), true, false);
            if (this.ux(a, c, b)) {
                return true;
            }
            if (this.eu(a, b)) {
                return true;
            }
            if (this.qf(a, b)) {
                return true;
            }
            return false;
        }
        s6(a, b) {
            super.s6(a, b);
            let c = this.rx.cr.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.rw.a0(this, this.sg(), runOn(this, this.rh), this.so(b), this.sp(b));
            let g = false;
            let h = this.rw.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.bv, b.bu, this.un.cg, f);
                this.s2(e, -1, this.valueColumn.count, this.un, i, b.q);
            }
            let j = d.dp;
            let k = d.dq;
            let l = d.dr;
            let m = d.ds;
            this.rw.ad(j, true, false, true, true);
            this.rw.ad(k, true, false, true, true);
            this.rw.ad(l, false, true, false, false);
            this.rw.ad(m, false, true, false, false);
            l._opacity = this.rw.j * this.fq;
            m._opacity = 0.5 * this.rw.j * this.fq;
            if (b.cv(a)) {
                d.df(a.f.count, e, true, c, this.ft, (n, o, p, q, r) => this.t5(n, a.f.count, b), 1, a.f.count == 1 ? null : this.tf(e, e.count - 1, b.bu, b.bv, true));
                b.cy(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.sj;
        }
    }
    SplineAreaSeries.$t = markType(SplineAreaSeries, 'SplineAreaSeries', SplineSeriesBase.$);
    return SplineAreaSeries;
})();
/**
 * @hidden
 */
export let SplineAreaSeriesView = /*@__PURE__*/ (() => {
    class SplineAreaSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dc = null;
            this.dk = new Path();
            this.dm = new Path();
            this.dl = new Path();
            this.dn = new Path();
            this.dg = new Path();
            this.di = new Path();
            this.dh = new Path();
            this.dj = new Path();
            this.dc = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.dc.qc = Defaults.e;
            }
        }
        get dp() {
            return this.dm;
        }
        get dq() {
            return this.dn;
        }
        get dr() {
            return this.dk;
        }
        get ds() {
            return this.dl;
        }
        dd() {
            this.dk.ak = null;
            this.dl.ak = null;
            this.dm.ak = null;
            this.dn.ak = null;
            this.aq();
        }
        de(a, b, c, d, e, f, g) {
            this.df(a, b, c, d, e, f, g, null);
        }
        df(a, b, c, d, e, f, g, h) {
            this.dc.vq.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.dc.vq.j(this.dk, this.dm, this.dl, this.dn, a, b, c, d, e, f, g, h);
            this.aq();
        }
        bc() {
            super.bc();
            this.dg.ak = this.dk.ak;
            this.di.ak = this.dm.ak;
            this.dh.ak = this.dl.ak;
            this.dj.ak = this.dn.ak;
            let a = this.bo();
            this.dg._fill = a;
            this.dg._opacity = 1;
            this.dh._fill = a;
            this.dh._opacity = 1;
            this.di._stroke = a;
            this.di.ac = this.e.fu + 3;
            this.dj._stroke = a;
            this.dj.ac = this.e.fu + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (b) {
                a.s(this.dg);
                a.s(this.dh);
                a.s(this.di);
                a.s(this.dj);
            }
            else {
                a.s(this.dk);
                a.s(this.dl);
                a.s(this.dm);
                a.s(this.dn);
            }
        }
        al(a) {
            super.al(a);
            this.e.a8.exportPathData(a, this.dm, "lowerShape", ["Lower"]);
            this.e.a8.exportPathData(a, this.dn, "upperShape", ["Upper", "Main"]);
            this.e.a8.exportPathData(a, this.dl, "translucentShape", ["Translucent"]);
            this.e.a8.exportPathData(a, this.dk, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.pa = a;
            this.e.gw = 5;
            this.e.gx = 1;
            this.e.gy = -3;
        }
    }
    SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
