/*
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-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { Array_$type, Point_$type, runOn, enumGetBox, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { PropertyMetadata } from "igniteui-react-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let RadialAreaSeries = /*@__PURE__*/ (() => {
    class RadialAreaSeries extends AnchoredRadialSeries {
        get_df() {
            return true;
        }
        by() {
            return new RadialAreaSeriesView(this);
        }
        l4(a) {
            super.l4(a);
            this.uf = a;
        }
        constructor() {
            super();
            this.ab = RadialAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        k2(a, b) {
            super.k2(a, b);
            this.uf.c1();
        }
        sy(a, b) {
            super.sy(a, b);
            let c = b.bv;
            let d = b.bu;
            let e = b;
            if (b.o() && !c.isEmpty && !d.isEmpty && this.rt != null && this.r0 != null) {
                let f = a.f;
                let g = f.count;
                let h = new List$1(Array_$type, 2, g);
                let i = 0;
                for (let j = 0; j < g; j++) {
                    let k = new Array(4);
                    h.add(k);
                    k[0] = this.r1.d(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[1] = this.r1.e(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[2] = this.r1.d(a.f._inner[j][0], a.f._inner[j][2], c, d);
                    let l = a.f._inner[j][2];
                    k[3] = this.r1.e(a.f._inner[j][0], l, c, d);
                    if (l > i) {
                        i = l;
                    }
                }
                let m = ViewportUtils.c(0.5, c, d);
                let n = ViewportUtils.f(0.5, c, d);
                this.ue = { $type: Point_$type, x: m, y: n };
                let o = this.getEffectiveViewport1(e);
                this.r7.a2(this, this.sj(), runOn(this, this.rq), this.sl(b), this.sm(b));
                let p = false;
                let q = this.r7.b;
                if (q != null) {
                    p = true;
                }
                if (p) {
                    let r = new ScalerParams(0, b.bv, b.bu, this.rt.ch, o);
                    this.tx(f, -1, this.tc.count, this.rt, r, b.q);
                }
                let s = e.c9;
                let t = e.da;
                let u = e.c7;
                let v = e.c8;
                this.r7.ad(s, true, false, true, true);
                this.r7.ad(t, true, false, true, true);
                this.r7.ad(u, false, true, false, false);
                this.r7.ad(v, false, true, false, false);
                e.c2(a.f.count, h, false, this.uf.cs.b, this.fx, runOn(this, this.ty), this.ug);
                u._opacity = this.r7.j * this.fu;
                v._opacity = 0.5 * this.r7.j * this.fu;
            }
        }
        l9(a, b, c, d) {
            super.l9(a, b, c, d);
            switch (b) {
                case RadialAreaSeries.$$p[0]:
                    this.mn(false);
                    this.lu();
                    break;
            }
        }
        get_tf() {
            return true;
        }
    }
    RadialAreaSeries.$t = /*@__PURE__*/ markType(RadialAreaSeries, 'RadialAreaSeries', AnchoredRadialSeries.$);
    RadialAreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RadialAreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting:ug:ui', [UnknownValuePlotting_$type, /*@__PURE__*/ enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return RadialAreaSeries;
})();
/**
 * @hidden
 */
export let RadialAreaSeriesView = /*@__PURE__*/ (() => {
    class RadialAreaSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.c0 = null;
            this.c7 = new Path();
            this.c9 = new Path();
            this.c8 = new Path();
            this.da = new Path();
            this.c3 = new Path();
            this.c5 = new Path();
            this.c4 = new Path();
            this.c6 = new Path();
            this.c0 = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.c0.ql = Defaults.e;
            }
        }
        c1() {
            this.c7.an = null;
            this.c9.an = null;
            this.c8.an = null;
            this.da.an = null;
            this.c3.an = null;
            this.c5.an = null;
            this.c4.an = null;
            this.c6.an = null;
            this.aq();
        }
        c2(a, b, c, d, e, f, g) {
            this.cw.s7.i(this.c7, this.c9, this.c8, this.da, a, b, c, d, e, f, g);
            this.aq();
        }
        bb() {
            super.bb();
        }
        bc() {
            super.bc();
            let a = this.bo();
            this.c5.an = this.c9.an;
            this.c6.an = this.da.an;
            this.c3.an = this.c7.an;
            this.c4.an = this.c8.an;
            this.c5._stroke = a;
            this.c5.ad = this.e.fy + 3;
            this.c6._stroke = a;
            this.c6.ad = this.e.fy + 3;
            this.c3._fill = a;
            this.c3._opacity = 1;
            this.c4._fill = a;
            this.c4._opacity = 1;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c3);
                    a.t(this.c4);
                    a.t(this.c5);
                    a.t(this.c6);
                }
                else {
                    a.t(this.c7);
                    a.t(this.c8);
                    a.t(this.c9);
                    a.t(this.da);
                }
            }
        }
        al(a) {
            super.al(a);
            this.e.a9.exportPathData(a, this.c9, "lowerShape", ["Lower"]);
            this.e.a9.exportPathData(a, this.da, "upperShape", ["Upper", "Main"]);
            this.e.a9.exportPathData(a, this.c8, "translucentShape", ["Translucent"]);
            this.e.a9.exportPathData(a, this.c7, "fillShape", ["Fill"]);
        }
    }
    RadialAreaSeriesView.$t = /*@__PURE__*/ markType(RadialAreaSeriesView, 'RadialAreaSeriesView', AnchoredRadialSeriesView.$);
    return RadialAreaSeriesView;
})();
