/*
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 { AnchoredRadialSeries } from "./AnchoredRadialSeries";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Array_$type, Point_$type, runOn, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let RadialAreaSeries = /*@__PURE__*/ (() => {
    class RadialAreaSeries extends AnchoredRadialSeries {
        constructor() {
            super();
            this.ab = RadialAreaSeries.$;
        }
        bj() {
            return new RadialAreaSeries();
        }
        get_eu() {
            return true;
        }
        cs() {
            return new RadialAreaSeriesView(this);
        }
        qz(a) {
            super.qz(a);
            this.adn = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        o5(a, b) {
            super.o5(a, b);
            this.adn.c6();
        }
        aba(a, b) {
            super.aba(a, b);
            let c = b.by;
            let d = b.bx;
            let e = b.getEffectiveViewport();
            let f = b;
            if (b.o() && !c.isEmpty && !d.isEmpty && this.yx != null && this.y3 != null) {
                let g = a.f;
                let h = g.count;
                let i = new List$1(Array_$type, 2, h);
                let j = 0;
                for (let k = 0; k < h; k++) {
                    let l = new Array(4);
                    i.add(l);
                    l[0] = this.y6.d(a.f._inner[k][0], a.f._inner[k][1], c, d, e);
                    l[1] = this.y6.e(a.f._inner[k][0], a.f._inner[k][1], c, d, e);
                    l[2] = this.y6.d(a.f._inner[k][0], a.f._inner[k][2], c, d, e);
                    let m = a.f._inner[k][2];
                    l[3] = this.y6.e(a.f._inner[k][0], m, c, d, e);
                    if (m > j) {
                        j = m;
                    }
                }
                let n = ViewportUtils.e(0.5, c, d, e);
                let o = ViewportUtils.i(0.5, c, d, e);
                this.adm = { $type: Point_$type, x: n, y: o };
                let p = this.getEffectiveViewport1(f);
                this.ze.a2(this, this.zv(), runOn(this, this.yl), this.z4(b), this.z5(b));
                let q = false;
                let r = this.ze.b;
                if (r != null) {
                    q = true;
                }
                if (q) {
                    let s = new ScalerParams(0, b.by, b.bx, this.yx.ch, p);
                    this.ac3(g, -1, this.ab6.count, this.yx, s, b.q);
                }
                let t = f.de;
                let u = f.df;
                let v = f.dc;
                let w = f.dd;
                this.ze.ad(t, true, false, true, true);
                this.ze.ad(u, true, false, true, true);
                this.ze.ad(v, false, true, false, false);
                this.ze.ad(w, false, true, false, false);
                f.c7(a.f.count, i, false, this.adn.cx.b, this.id, runOn(this, this.ac4), this.ado);
                v._opacity = this.ze.j * this.h9;
                w._opacity = 0.5 * this.ze.j * this.h9;
            }
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.p2(a, c, b);
            return c.toArray();
        }
        p2(a, b, c) {
            this.ac0(a, b, c, this.yy);
        }
        q7(a, b, c, d) {
            super.q7(a, b, c, d);
            switch (b) {
                case RadialAreaSeries.$$p[0]:
                    this.rp(false);
                    this.qj();
                    break;
            }
        }
        get_acc() {
            return true;
        }
    }
    RadialAreaSeries.$t = markType(RadialAreaSeries, 'RadialAreaSeries', AnchoredRadialSeries.$);
    RadialAreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RadialAreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting:ado:adq', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return RadialAreaSeries;
})();
/**
 * @hidden
 */
export let RadialAreaSeriesView = /*@__PURE__*/ (() => {
    class RadialAreaSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.c5 = null;
            this.dc = new Path();
            this.de = new Path();
            this.dd = new Path();
            this.df = new Path();
            this.c8 = new Path();
            this.da = new Path();
            this.c9 = new Path();
            this.db = new Path();
            this.c5 = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.c5.w8 = Defaults.e;
            }
        }
        c6() {
            this.dc.an = null;
            this.de.an = null;
            this.dd.an = null;
            this.df.an = null;
            this.c8.an = null;
            this.da.an = null;
            this.c9.an = null;
            this.db.an = null;
            this.as();
        }
        c7(a, b, c, d, e, f, g) {
            this.c1.ab1.i(this.dc, this.de, this.dd, this.df, a, b, c, d, e, f, g);
            this.as();
        }
        bd() {
            super.bd();
        }
        be() {
            super.be();
            let a = this.br();
            this.da.an = this.de.an;
            this.db.an = this.df.an;
            this.c8.an = this.dc.an;
            this.c9.an = this.dd.an;
            this.da._stroke = a;
            this.da.ad = this.e.ie + 3;
            this.db._stroke = a;
            this.db.ad = this.e.ie + 3;
            this.c8._fill = a;
            this.c8._opacity = 1;
            this.c9._fill = a;
            this.c9._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c8);
                    a.t(this.c9);
                    a.t(this.da);
                    a.t(this.db);
                }
                else {
                    a.t(this.dc);
                    a.t(this.dd);
                    a.t(this.de);
                    a.t(this.df);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.bc.exportPathData(a, this.de, "lowerShape", ["Lower"]);
            this.e.bc.exportPathData(a, this.df, "upperShape", ["Upper", "Main"]);
            this.e.bc.exportPathData(a, this.dd, "translucentShape", ["Translucent"]);
            this.e.bc.exportPathData(a, this.dc, "fillShape", ["Fill"]);
        }
    }
    RadialAreaSeriesView.$t = markType(RadialAreaSeriesView, 'RadialAreaSeriesView', AnchoredRadialSeriesView.$);
    return RadialAreaSeriesView;
})();
