/*
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.vv = null;
            this.vv = new CategoryLineRasterizer();
            this.ab = SplineAreaSeries.$;
        }
        get_dd() {
            return true;
        }
        get_eh() {
            return true;
        }
        bx() {
            return new SplineAreaSeriesView(this);
        }
        r3() {
            return 1;
        }
        l2(a) {
            super.l2(a);
            this.vw = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        b3() {
            if (this.b4 == 0) {
                return 2;
            }
            return super.b3();
        }
        k0(a, b) {
            super.k0(a, b);
            let c = b;
            c.dd();
        }
        ex(a, b) {
            let c = this.pq(this.pt(a), true, false);
            if (this.u2(a, c, b)) {
                return true;
            }
            if (this.ew(a, b)) {
                return true;
            }
            if (this.qk(a, b)) {
                return true;
            }
            return false;
        }
        tb(a, b) {
            super.tb(a, b);
            let c = this.r2.cr.d;
            let d = typeCast(SplineAreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(b);
            this.r1.a0(this, this.sl(), runOn(this, this.rm), this.st(b), this.su(b));
            let g = false;
            let h = this.r1.b;
            if (h != null) {
                g = true;
            }
            if (g) {
                let i = new ScalerParams(0, b.bv, b.bu, this.us.cg, f);
                this.s7(e, -1, this.valueColumn.count, this.us, i, b.q);
            }
            let j = d.dp;
            let k = d.dq;
            let l = d.dr;
            let m = d.ds;
            this.r1.ad(j, true, false, true, true);
            this.r1.ad(k, true, false, true, true);
            this.r1.ad(l, false, true, false, false);
            this.r1.ad(m, false, true, false, false);
            l._opacity = this.r1.j * this.fs;
            m._opacity = 0.5 * this.r1.j * this.fs;
            if (b.cv(a)) {
                d.df(a.f.count, e, true, c, this.fv, (n, o, p, q, r) => this.ua(n, a.f.count, b), 1, a.f.count == 1 ? null : this.tk(e, e.count - 1, b.bu, b.bv, true));
                b.cy(a);
            }
            let n = this.fetchYAxis();
        }
        get useHighMarkerFidelity() {
            return this.so;
        }
    }
    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.qh = 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.vv.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.dc.vv.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.fw + 3;
            this.dj._stroke = a;
            this.dj.ac = this.e.fw + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (b) {
                a.t(this.dg);
                a.t(this.dh);
                a.t(this.di);
                a.t(this.dj);
            }
            else {
                a.t(this.dk);
                a.t(this.dl);
                a.t(this.dm);
                a.t(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.pf = a;
            this.e.gy = 5;
            this.e.gz = 1;
            this.e.g0 = -3;
        }
    }
    SplineAreaSeriesView.$t = markType(SplineAreaSeriesView, 'SplineAreaSeriesView', SplineSeriesBaseView.$);
    return SplineAreaSeriesView;
})();
