/*
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 { PolarBase } from "./PolarBase";
import { PathRenderer } from "./PathRenderer";
import { DefaultFlattener } from "./DefaultFlattener";
import { PolarBaseView } from "./PolarBaseView";
import { Number_$type, Point_$type, markType } from "igniteui-angular-core";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
export let PolarLineSeriesBase = /*@__PURE__*/ (() => {
    class PolarLineSeriesBase extends PolarBase {
        constructor() {
            super();
            this.acq = null;
            this.acs = null;
            this.acr = null;
            this.acq = new PathRenderer(1, new DefaultFlattener());
            this.acs = new PathRenderer(0);
        }
        get_z3() {
            return true;
        }
        z8() {
            return true;
        }
        ct() {
            return new PolarLineSeriesBaseView(this);
        }
        q7(a) {
            super.q7(a);
            this.act = a;
        }
        acu() {
            return 1;
        }
        get_acx() {
            return false;
        }
        get acx() {
            return this.get_acx();
        }
        get_acz() {
            return false;
        }
        get acz() {
            return this.get_acz();
        }
        abn(a, b) {
            super.abn(a, b);
            a.n.clear();
            let c = b.ca;
            let d = b.b9;
            let e = b.getEffectiveViewport();
            let f = this.zt != null ? this.zt.count : 0;
            let g = this.zu != null ? this.zu.count : 0;
            let h = Math.min(f, g);
            let i = ((() => {
                let $ret = new PolarLinePlanner();
                $ret.m = (j) => this.y6.a.getScaledAngle1(this.zt.item(j), this.y6.e, this.y6.d);
                $ret.q = h;
                $ret.n = (j) => this.y4.si(this.zu.item(j), this.y6.g, this.y6.f, this.y6.i, this.y6.h);
                $ret.l = this.ie;
                $ret.f = this.z9;
                $ret.b = this.acu();
                $ret.o = (j) => this.ac0(a, j);
                $ret.p = (j) => this.ac1(a, j);
                $ret.ad = d;
                $ret.ac = e;
                $ret.ae = c;
                $ret.d = this.acz;
                $ret.c = this.acx;
                return $ret;
            })());
            let j = new List$1(Number_$type, 0);
            for (let k = 0; k < h; k++) {
                if (this.acy(k)) {
                    j.add(k);
                }
            }
            if (this.acz && j.count > 0) {
                j.add(j._inner[0]);
            }
            i.x(a.n, j);
        }
        ac0(a, b) {
            return a.x._inner[b].x;
        }
        ac1(a, b) {
            return a.x._inner[b].y;
        }
        acw() {
            return !this.acv();
        }
        acv() {
            let a = this.dc.xm;
            return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
        }
        acy(a) {
            return (this.zt.item(a) >= this.y6.a.pr && this.zt.item(a) <= this.y6.a.pq && this.zu.item(a) >= this.y6.b.pr && this.zu.item(a) <= this.y6.b.pq) || (isNaN_(this.zt.item(a)) || isNaN_(this.zu.item(a)));
        }
        pb(a, b) {
            super.pb(a, b);
            this.ac2(b);
        }
        abr(a, b) {
            super.abr(a, b);
            if (this.z9) {
                this.acr = this.acq;
            }
            else {
                this.acr = this.acs;
            }
            this.acr.b = this.acu();
            this.ac2(b);
            this.ac3(a, b);
        }
    }
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
})();
/**
 * @hidden
 */
export let PolarLineSeriesBaseView = /*@__PURE__*/ (() => {
    class PolarLineSeriesBaseView extends PolarBaseView {
        constructor(a) {
            super(a);
            this.dl = null;
            this.dl = a;
        }
        an() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.f.wb = a;
            this.f.jq = 3;
            this.f.jr = 1;
            this.f.js = 4;
            this.f.hd = false;
        }
    }
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
})();
