/*
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 { PolarLineSeriesBase } from "./PolarLineSeriesBase";
import { DependencyProperty } from "igniteui-angular-core";
import { runOn, markType, markDep } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { PolarLineSeriesBaseView } from "./PolarLineSeriesBaseView";
import { PathGeometry } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { Extensions } from "igniteui-angular-core";
import { Numeric } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let PolarSplineAreaSeries = /*@__PURE__*/ (() => {
    class PolarSplineAreaSeries extends PolarLineSeriesBase {
        constructor() {
            super();
            this.ab = PolarSplineAreaSeries.$;
        }
        get_df() {
            return true;
        }
        get_ej() {
            return true;
        }
        by() {
            return new PolarSplineAreaSeriesView(this);
        }
        l4(a) {
            super.l4(a);
            this.vo = a;
        }
        vm(a) {
            let b = a;
            b.c5();
        }
        vn(a, b) {
            this.vm(b);
            if (a.m.count < 1) {
                return;
            }
            let c = b;
            c.c6(a.m, this.vp);
            this.se.az(this, this.s1(), runOn(this, this.rr));
            let d = false;
            let e = this.se.b;
            if (e != null) {
                d = true;
            }
            if (d) {
                this.t9(-1, this.sn.count, b.q);
            }
            let f = c.dc;
            let g = c.db;
            this.se.ad(f, true, false, true, true);
            this.se.ad(g, false, true, false, false);
            g._opacity = this.se.j * this.fu;
        }
        get_vj() {
            return true;
        }
        l9(a, b, c, d) {
            super.l9(a, b, c, d);
            switch (b) {
                case PolarSplineAreaSeries.$$p[0]:
                    this.mn(false);
                    break;
            }
        }
    }
    PolarSplineAreaSeries.$t = markType(PolarSplineAreaSeries, 'PolarSplineAreaSeries', PolarLineSeriesBase.$);
    PolarSplineAreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, PolarSplineAreaSeries, 'raisePropertyChanged', ['Stiffness:vp:vr', [1, 0.5]]);
    return PolarSplineAreaSeries;
})();
/**
 * @hidden
 */
export let PolarSplineAreaSeriesView = /*@__PURE__*/ (() => {
    class PolarSplineAreaSeriesView extends PolarLineSeriesBaseView {
        constructor(a) {
            super(a);
            this.c4 = null;
            this.da = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.c9 = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.c8 = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.c7 = ((() => {
                let $ret = new Path();
                $ret.an = new PathGeometry();
                return $ret;
            })());
            this.c4 = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.c4.ql = Defaults.e;
            }
        }
        get db() {
            return this.c9;
        }
        get dc() {
            return this.da;
        }
        c5() {
            Extensions.e(this.c9.an);
            Extensions.e(this.da.an);
            Extensions.e(this.c7.an);
            Extensions.e(this.c8.an);
            this.aq();
        }
        c6(a, b) {
            this.da.an.c = Numeric.h(a.count + 1, (c) => c < a.count ? a._inner[c].x : a._inner[c - a.count].x, (c) => c < a.count ? a._inner[c].y : a._inner[c - a.count].y, b);
            this.c9.an.c = Numeric.h(a.count + 1, (c) => c < a.count ? a._inner[c].x : a._inner[c - a.count].x, (c) => c < a.count ? a._inner[c].y : a._inner[c - a.count].y, b);
            this.aq();
        }
        bb() {
            super.bb();
        }
        bc() {
            super.bc();
            let a = this.bo();
            this.c7.an = this.c9.an;
            this.c8.an = this.da.an;
            this.c7._fill = a;
            this.c7._opacity = 1;
            this.c8._stroke = a;
            this.c8.ad = this.e.fy + 3;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c7);
                    a.t(this.c8);
                }
                else {
                    a.t(this.c9);
                    a.t(this.da);
                }
            }
        }
        al(a) {
            super.al(a);
            this.e.a9.exportPathData(a, this.da, "polarShape", ["Main"]);
            this.e.a9.exportPathData(a, this.c9, "fillShape", ["Fill"]);
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.ph = a;
            this.e.g1 = 5;
            this.e.g2 = 5;
            this.e.g3 = 5;
        }
    }
    PolarSplineAreaSeriesView.$t = markType(PolarSplineAreaSeriesView, 'PolarSplineAreaSeriesView', PolarLineSeriesBaseView.$);
    return PolarSplineAreaSeriesView;
})();
