/*
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";
/**
 * @hidden
 */
export let SplineSeries = /*@__PURE__*/ (() => {
    class SplineSeries extends SplineSeriesBase {
        constructor() {
            super();
            this.vv = null;
            this.vv = new CategoryLineRasterizer();
            this.ab = SplineSeries.$;
        }
        get_eh() {
            return true;
        }
        bx() {
            return new SplineSeriesView(this);
        }
        l2(a) {
            super.l2(a);
            this.vw = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        k0(a, b) {
            super.k0(a, b);
            let c = b;
            c.dd();
        }
        tb(a, b) {
            super.tb(a, b);
            let c = b;
            let d = c.cr.d;
            let e = typeCast(SplineSeriesView.$, b);
            let f = a.f;
            let g = this.getEffectiveViewport1(b);
            this.r1.a0(this, this.sl(), runOn(this, this.rm), this.st(b), this.su(b));
            let h = false;
            let i = this.r1.b;
            if (i != null) {
                h = true;
            }
            if (h) {
                let j = new ScalerParams(0, b.bv, b.bu, this.us.cg, g);
                this.s7(f, -1, this.valueColumn.count, this.us, j, b.q);
            }
            let k = e.dj;
            let l = e.dk;
            let m = e.di;
            this.r1.ad(k, true, false, true, false);
            this.r1.ad(l, true, false, true, false);
            this.r1.ad(m, false, true, false, false);
            m._opacity = 0.75 * this.r1.j;
            if (b.cv(a)) {
                e.de(f.count, f, true, 1, this.tj(f, f.count - 1, b.bu, b.bv), d, this.fv);
                b.cy(a);
            }
        }
        get useHighMarkerFidelity() {
            return this.so;
        }
    }
    SplineSeries.$t = markType(SplineSeries, 'SplineSeries', SplineSeriesBase.$);
    return SplineSeries;
})();
/**
 * @hidden
 */
export let SplineSeriesView = /*@__PURE__*/ (() => {
    class SplineSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.dc = null;
            this.dm = new Path();
            this.dl = new Path();
            this.dn = new Path();
            this.dh = new Path();
            this.dg = new Path();
            this.df = new Path();
            this.dc = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.dc.qh = Defaults.e;
            }
        }
        get dj() {
            return this.dm;
        }
        get dk() {
            return this.dn;
        }
        get di() {
            return this.dl;
        }
        dd() {
            this.dl.ak = null;
            this.dm.ak = null;
            this.dn.ak = null;
            this.aq();
        }
        de(a, b, c, d, e, f, g) {
            this.dc.vv.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.dc.vv.m(this.dm, this.dl, this.dn, a, b, c, d, e, f, g);
            this.aq();
        }
        bc() {
            super.bc();
            this.dg.ak = this.dm.ak;
            this.dh.ak = this.dn.ak;
            this.df.ak = this.dl.ak;
            let a = this.bo();
            this.dg._stroke = a;
            this.dg.ac = this.e.fw + 3;
            this.dh._stroke = a;
            this.dh.ac = this.e.fw + 3;
            this.df._fill = a;
            this.df._opacity = 1;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.df);
                    a.t(this.dg);
                    a.t(this.dh);
                }
                else {
                    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", "Main"]);
            this.e.a8.exportPathData(a, this.dn, "upperShape", ["Upper"]);
            this.e.a8.exportPathData(a, this.dl, "translucentShape", ["Translucent"]);
        }
    }
    SplineSeriesView.$t = markType(SplineSeriesView, 'SplineSeriesView', SplineSeriesBaseView.$);
    return SplineSeriesView;
})();
