/*
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.u7 = null;
            this.u7 = new CategoryLineRasterizer();
            this.ab = AreaSeries.$;
            this.uq = 0;
        }
        bx() {
            return new AreaSeriesView(this);
        }
        ry() {
            return 1;
        }
        b3() {
            if (this.b4 == 0) {
                return 2;
            }
            return super.b3();
        }
        ly(a) {
            super.ly(a);
            this.u6 = a;
        }
        get_de() {
            return true;
        }
        get_dd() {
            return true;
        }
        preferredCategoryMode(a) {
            return this.uq;
        }
        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;
        }
        kx(a, b) {
            super.kx(a, b);
            let c = b;
            c.db();
        }
        s6(a, b) {
            super.s6(a, b);
            let c = b.cr.d;
            let d = typeCast(AreaSeriesView.$, b);
            let e = a.f;
            let f = this.getEffectiveViewport1(d);
            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.dm;
            let k = d.dn;
            let l = d.dp;
            let m = d.dq;
            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);
            if (b.cv(a)) {
                d.dd(e.count, e, true, c, this.ft, (n, o, p, q, r) => this.t5(n, a.f.count, b), this.unknownValuePlotting, e.count == 1 ? null : this.tf(e, e.count - 1, b.bu, b.bv, true));
                b.cy(a);
            }
            let n = this.fetchYAxis();
            l._opacity = this.rw.j * this.fq;
            m._opacity = 0.5 * this.rw.j * this.fq;
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            switch (b) {
                case AreaSeries.$$p[0]:
                    this.rt.m = this.unknownValuePlotting == 0;
                    this.mh(false);
                    this.lo();
                    break;
            }
        }
        get useHighMarkerFidelity() {
            return this.sj;
        }
    }
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::u9', [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.qc = 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.u7.a = typeCast(ISortingAxis_$type, this.ct.fetchXAxis()) !== null ? true : false;
            this.da.u7.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.fu + 3;
            this.dh._stroke = a;
            this.dh.ac = this.e.fu + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (b) {
                a.s(this.de);
                a.s(this.df);
                a.s(this.dg);
                a.s(this.dh);
            }
            else {
                a.s(this.di);
                a.s(this.dj);
                a.s(this.dk);
                a.s(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.pa = a;
            this.e.gw = 5;
            this.e.gx = 1;
            this.e.gy = -3;
        }
    }
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
})();
