/*
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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-angular-core";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let AreaSeries = /*@__PURE__*/ (() => {
    class AreaSeries extends HorizontalAnchoredCategorySeries {
        constructor() {
            super();
            this.vc = null;
            this.vc = new CategoryLineRasterizer();
            this.ab = AreaSeries.$;
            this.uv = 0;
        }
        bx() {
            return new AreaSeriesView(this);
        }
        r3() {
            return 1;
        }
        b3() {
            if (this.b4 == 0) {
                return 2;
            }
            return super.b3();
        }
        l2(a) {
            super.l2(a);
            this.vb = a;
        }
        get_de() {
            return true;
        }
        get_dd() {
            return true;
        }
        preferredCategoryMode(a) {
            return this.uv;
        }
        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;
        }
        k0(a, b) {
            super.k0(a, b);
            let c = b;
            c.db();
        }
        tb(a, b) {
            super.tb(a, b);
            let c = b.cr.d;
            let d = typeCast(AreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(d);
            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.dm;
            let k = d.dn;
            let l = d.dp;
            let m = d.dq;
            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);
            if (b.cv(a)) {
                d.dd(e.count, e, true, c, this.fv, (n, o, p, q, r) => this.ua(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.tk(e, e.count - 1, b.bu, b.bv, true));
                b.cy(a);
            }
            let n = this.fetchYAxis();
            l._opacity = this.r1.j * this.fs;
            m._opacity = 0.5 * this.r1.j * this.fs;
        }
        l7(a, b, c, d) {
            super.l7(a, b, c, d);
            switch (b) {
                case AreaSeries.$$p[0]:
                    this.ry.m = this.unknownValuePlotting == 0;
                    this.ml(false);
                    this.ls();
                    break;
            }
        }
        get useHighMarkerFidelity() {
            return this.so;
        }
    }
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::ve', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
})();
/**
 * @hidden
 */
export let AreaSeriesView = /*@__PURE__*/ (() => {
    class AreaSeriesView extends AnchoredCategorySeriesView {
        constructor(a) {
            super(a);
            this.da = null;
            this.di = new Path();
            this.dk = new Path();
            this.dj = new Path();
            this.dl = new Path();
            this.de = new Path();
            this.dg = new Path();
            this.df = new Path();
            this.dh = new Path();
            this.da = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.da.qh = Defaults.e;
            }
        }
        get dm() {
            return this.dk;
        }
        get dn() {
            return this.dl;
        }
        get dp() {
            return this.di;
        }
        get dq() {
            return this.dj;
        }
        db() {
            this.di.ak = null;
            this.dj.ak = null;
            this.dk.ak = null;
            this.dl.ak = null;
            this.aq();
        }
        dc(a, b, c, d, e, f, g) {
            this.dd(a, b, c, d, e, f, g, null);
        }
        dd(a, b, c, d, e, f, g, h) {
            this.da.vc.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.da.vc.j(this.di, this.dk, this.dj, this.dl, a, b, c, d, e, f, g, h);
            this.aq();
        }
        bc() {
            super.bc();
            this.de.ak = this.di.ak;
            this.dg.ak = this.dk.ak;
            this.df.ak = this.dj.ak;
            this.dh.ak = this.dl.ak;
            let a = this.bo();
            this.de._fill = a;
            this.de._opacity = 1;
            this.df._fill = a;
            this.df._opacity = 1;
            this.dg._stroke = a;
            this.dg.ac = this.e.fw + 3;
            this.dh._stroke = a;
            this.dh.ac = this.e.fw + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (b) {
                a.t(this.de);
                a.t(this.df);
                a.t(this.dg);
                a.t(this.dh);
            }
            else {
                a.t(this.di);
                a.t(this.dj);
                a.t(this.dk);
                a.t(this.dl);
            }
        }
        al(a) {
            super.al(a);
            this.e.a8.exportPathData(a, this.dk, "lowerShape", ["Lower"]);
            this.e.a8.exportPathData(a, this.dl, "upperShape", ["Upper", "Main"]);
            this.e.a8.exportPathData(a, this.dj, "translucentShape", ["Translucent"]);
            this.e.a8.exportPathData(a, this.di, "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;
        }
    }
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
})();
