/*
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_d8() {
            return true;
        }
        cg() {
            return new RadialAreaSeriesView(this);
        }
        o0(a) {
            super.o0(a);
            this.x9 = a;
        }
        constructor() {
            super();
            this.ab = RadialAreaSeries.$;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        nj(a, b) {
            super.nj(a, b);
            this.x9.c4();
        }
        wo(a, b) {
            super.wo(a, b);
            let c = b.by;
            let d = b.bx;
            let e = b;
            if (b.o() && !c.isEmpty && !d.isEmpty && this.vi != null && this.vp != 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.vq.d(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[1] = this.vq.e(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[2] = this.vq.d(a.f._inner[j][0], a.f._inner[j][2], c, d);
                    let l = a.f._inner[j][2];
                    k[3] = this.vq.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.x8 = { $type: Point_$type, x: m, y: n };
                let o = this.getEffectiveViewport1(e);
                this.vw.a2(this, this.v8(), runOn(this, this.vf), this.wb(b), this.wc(b));
                let p = false;
                let q = this.vw.b;
                if (q != null) {
                    p = true;
                }
                if (p) {
                    let r = new ScalerParams(0, b.by, b.bx, this.vi.ch, o);
                    this.xq(f, -1, this.w2.count, this.vi, r, b.q);
                }
                let s = e.dc;
                let t = e.dd;
                let u = e.da;
                let v = e.db;
                this.vw.ad(s, true, false, true, true);
                this.vw.ad(t, true, false, true, true);
                this.vw.ad(u, false, true, false, false);
                this.vw.ad(v, false, true, false, false);
                e.c5(a.f.count, h, false, this.x9.cv.b, this.hj, runOn(this, this.xr), this.ya);
                u._opacity = this.vw.j * this.hf;
                v._opacity = 0.5 * this.vw.j * this.hf;
            }
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case RadialAreaSeries.$$p[0]:
                    this.pp(false);
                    this.ol();
                    break;
            }
        }
        get_w5() {
            return true;
        }
    }
    RadialAreaSeries.$t = /*@__PURE__*/ markType(RadialAreaSeries, 'RadialAreaSeries', AnchoredRadialSeries.$);
    RadialAreaSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RadialAreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting:ya:yc', [UnknownValuePlotting_$type, /*@__PURE__*/ enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return RadialAreaSeries;
})();
/**
 * @hidden
 */
export let RadialAreaSeriesView = /*@__PURE__*/ (() => {
    class RadialAreaSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.c3 = null;
            this.da = new Path();
            this.dc = new Path();
            this.db = new Path();
            this.dd = new Path();
            this.c6 = new Path();
            this.c8 = new Path();
            this.c7 = new Path();
            this.c9 = new Path();
            this.c3 = a;
        }
        au() {
            super.au();
            if (!this.q) {
                this.c3.ua = Defaults.e;
            }
        }
        c4() {
            this.da.an = null;
            this.dc.an = null;
            this.db.an = null;
            this.dd.an = null;
            this.c6.an = null;
            this.c8.an = null;
            this.c7.an = null;
            this.c9.an = null;
            this.as();
        }
        c5(a, b, c, d, e, f, g) {
            this.cz.wx.i(this.da, this.dc, this.db, this.dd, a, b, c, d, e, f, g);
            this.as();
        }
        bd() {
            super.bd();
        }
        be() {
            super.be();
            let a = this.br();
            this.c8.an = this.dc.an;
            this.c9.an = this.dd.an;
            this.c6.an = this.da.an;
            this.c7.an = this.db.an;
            this.c8._stroke = a;
            this.c8.ad = this.e.hk + 3;
            this.c9._stroke = a;
            this.c9.ad = this.e.hk + 3;
            this.c6._fill = a;
            this.c6._opacity = 1;
            this.c7._fill = a;
            this.c7._opacity = 1;
        }
        a8(a, b) {
            super.a8(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c6);
                    a.t(this.c7);
                    a.t(this.c8);
                    a.t(this.c9);
                }
                else {
                    a.t(this.da);
                    a.t(this.db);
                    a.t(this.dc);
                    a.t(this.dd);
                }
            }
        }
        an(a) {
            super.an(a);
            this.e.a9.exportPathData(a, this.dc, "lowerShape", ["Lower"]);
            this.e.a9.exportPathData(a, this.dd, "upperShape", ["Upper", "Main"]);
            this.e.a9.exportPathData(a, this.db, "translucentShape", ["Translucent"]);
            this.e.a9.exportPathData(a, this.da, "fillShape", ["Fill"]);
        }
    }
    RadialAreaSeriesView.$t = /*@__PURE__*/ markType(RadialAreaSeriesView, 'RadialAreaSeriesView', AnchoredRadialSeriesView.$);
    return RadialAreaSeriesView;
})();
