/*
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-react-core";
import { Path } from "igniteui-react-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 {
        get_fd() {
            return true;
        }
        cg() {
            return new SplineSeriesView(this);
        }
        wg() {
            return true;
        }
        o0(a) {
            super.o0(a);
            this.zz = a;
        }
        constructor() {
            super();
            this.zy = null;
            this.zy = new CategoryLineRasterizer();
            this.ab = SplineSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        nj(a, b) {
            super.nj(a, b);
            let c = b;
            c.dg();
        }
        w5(a, b) {
            super.w5(a, b);
            let c = b;
            let d = c.cu.d;
            let e = typeCast(SplineSeriesView.$, b);
            let f = a.f;
            let g = this.getEffectiveViewport1(b);
            this.vu.a2(this, this.we(), runOn(this, this.vf), this.wn(b), this.wo(b));
            let h = false;
            let i = this.vu.b;
            if (i != null) {
                h = true;
            }
            if (h) {
                let j = new ScalerParams(0, b.by, b.bx, this.yv.ch, g);
                this.w1(f, -1, this.valueColumn.count, this.yv, j, b.q);
            }
            let k = e.dm;
            let l = e.dn;
            let m = e.dl;
            this.vu.ad(k, true, false, true, false);
            this.vu.ad(l, true, false, true, false);
            this.vu.ad(m, false, true, false, false);
            m._opacity = 0.75 * this.vu.j;
            if (b.cy(a)) {
                e.dh(f.count, f, true, 1, this.xd(f, f.count - 1, b.bx, b.by), d, this.hj);
                b.c1(a);
            }
        }
        get useHighMarkerFidelity() {
            return this.wi;
        }
    }
    SplineSeries.$t = /*@__PURE__*/ markType(SplineSeries, 'SplineSeries', SplineSeriesBase.$);
    return SplineSeries;
})();
/**
 * @hidden
 */
export let SplineSeriesView = /*@__PURE__*/ (() => {
    class SplineSeriesView extends SplineSeriesBaseView {
        constructor(a) {
            super(a);
            this.df = null;
            this.dq = new Path();
            this.dp = new Path();
            this.dr = new Path();
            this.dk = new Path();
            this.dj = new Path();
            this.di = new Path();
            this.df = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.df.ua = Defaults.e;
            }
        }
        get dm() {
            return this.dq;
        }
        get dn() {
            return this.dr;
        }
        get dl() {
            return this.dp;
        }
        dg() {
            this.dp.an = null;
            this.dq.an = null;
            this.dr.an = null;
            this.as();
        }
        dh(a, b, c, d, e, f, g) {
            this.df.zy.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
            this.df.zy.m(this.dq, this.dp, this.dr, a, b, c, d, e, f, g);
            this.as();
        }
        be() {
            super.be();
            this.dj.an = this.dq.an;
            this.dk.an = this.dr.an;
            this.di.an = this.dp.an;
            let a = this.br();
            this.dj._stroke = a;
            this.dj.ad = this.e.hk + 3;
            this.dk._stroke = a;
            this.dk.ad = this.e.hk + 3;
            this.di._fill = a;
            this.di._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.di);
                    a.t(this.dj);
                    a.t(this.dk);
                }
                else {
                    a.t(this.dp);
                    a.t(this.dq);
                    a.t(this.dr);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.a9.exportPathData(a, this.dq, "lowerShape", ["Lower", "Main"]);
            this.e.a9.exportPathData(a, this.dr, "upperShape", ["Upper"]);
            this.e.a9.exportPathData(a, this.dp, "translucentShape", ["Translucent"]);
        }
    }
    SplineSeriesView.$t = /*@__PURE__*/ markType(SplineSeriesView, 'SplineSeriesView', SplineSeriesBaseView.$);
    return SplineSeriesView;
})();
