/*
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 { __extends } from "tslib";
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
 */
var PolarLineSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBase, _super);
    function PolarLineSeriesBase() {
        var _this = _super.call(this) || this;
        _this.acg = null;
        _this.aci = null;
        _this.ach = null;
        _this.acg = new PathRenderer(1, new DefaultFlattener());
        _this.aci = new PathRenderer(0);
        return _this;
    }
    PolarLineSeriesBase.prototype.get_zt = function () {
        return true;
    };
    PolarLineSeriesBase.prototype.zy = function () {
        return true;
    };
    PolarLineSeriesBase.prototype.cs = function () {
        return new PolarLineSeriesBaseView(this);
    };
    PolarLineSeriesBase.prototype.q1 = function (a) {
        _super.prototype.q1.call(this, a);
        this.acj = a;
    };
    PolarLineSeriesBase.prototype.ack = function () {
        return 1;
    };
    PolarLineSeriesBase.prototype.get_acn = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "acn", {
        get: function () {
            return this.get_acn();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.get_acp = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "acp", {
        get: function () {
            return this.get_acp();
        },
        enumerable: false,
        configurable: true
    });
    PolarLineSeriesBase.prototype.abd = function (a, b) {
        var _this = this;
        _super.prototype.abd.call(this, a, b);
        a.m.clear();
        var c = b.by;
        var d = b.bx;
        var e = b.getEffectiveViewport();
        var f = this.zj != null ? this.zj.count : 0;
        var g = this.zk != null ? this.zk.count : 0;
        var h = Math.min(f, g);
        var i = ((function () {
            var $ret = new PolarLinePlanner();
            $ret.m = function (j) { return _this.yw.a.getScaledAngle1(_this.zj.item(j), _this.yw.e, _this.yw.d); };
            $ret.q = h;
            $ret.n = function (j) { return _this.yu.oe(_this.zk.item(j), _this.yw.g, _this.yw.f, _this.yw.i, _this.yw.h); };
            $ret.l = _this.id;
            $ret.f = _this.zz;
            $ret.b = _this.ack();
            $ret.o = function (j) { return _this.acq(a, j); };
            $ret.p = function (j) { return _this.acr(a, j); };
            $ret.ad = d;
            $ret.ac = e;
            $ret.ae = c;
            $ret.d = _this.acp;
            $ret.c = _this.acn;
            return $ret;
        })());
        var j = new List$1(Number_$type, 0);
        for (var k = 0; k < h; k++) {
            if (this.aco(k)) {
                j.add(k);
            }
        }
        if (this.acp && j.count > 0) {
            j.add(j._inner[0]);
        }
        i.x(a.m, j);
    };
    PolarLineSeriesBase.prototype.acq = function (a, b) {
        return a.w._inner[b].x;
    };
    PolarLineSeriesBase.prototype.acr = function (a, b) {
        return a.w._inner[b].y;
    };
    PolarLineSeriesBase.prototype.acm = function () {
        return !this.acl();
    };
    PolarLineSeriesBase.prototype.acl = function () {
        var a = this.db.v4;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    PolarLineSeriesBase.prototype.aco = function (a) {
        return (this.zj.item(a) >= this.yw.a.l4 && this.zj.item(a) <= this.yw.a.l3 && this.zk.item(a) >= this.yw.b.l4 && this.zk.item(a) <= this.yw.b.l3) || (isNaN_(this.zj.item(a)) || isNaN_(this.zk.item(a)));
    };
    PolarLineSeriesBase.prototype.o5 = function (a, b) {
        _super.prototype.o5.call(this, a, b);
        this.acs(b);
    };
    PolarLineSeriesBase.prototype.abh = function (a, b) {
        _super.prototype.abh.call(this, a, b);
        if (this.zz) {
            this.ach = this.acg;
        }
        else {
            this.ach = this.aci;
        }
        this.ach.b = this.ack();
        this.acs(b);
        this.act(a, b);
    };
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
}(PolarBase));
export { PolarLineSeriesBase };
/**
 * @hidden
 */
var PolarLineSeriesBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarLineSeriesBaseView, _super);
    function PolarLineSeriesBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.c8 = null;
        _this.c8 = a;
        return _this;
    }
    PolarLineSeriesBaseView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.v1 = a;
        this.e.jm = 3;
        this.e.jn = 1;
        this.e.jo = 4;
        this.e.hc = false;
    };
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
}(PolarBaseView));
export { PolarLineSeriesBaseView };
