/*
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 * as tslib_1 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-react-core/ES5/type";
import { PolarLinePlanner } from "./PolarLinePlanner";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { isNaN_ } from "igniteui-react-core/ES5/number";
import { Color } from "igniteui-react-core/ES5/Color";
/**
 * @hidden
 */
var PolarLineSeriesBase = /** @class */ (function (_super) {
    tslib_1.__extends(PolarLineSeriesBase, _super);
    function PolarLineSeriesBase() {
        var _this = _super.call(this) || this;
        _this.os = null;
        _this.ou = null;
        _this.ot = null;
        _this.os = new PathRenderer(1, new DefaultFlattener());
        _this.ou = new PathRenderer(0);
        return _this;
    }
    PolarLineSeriesBase.prototype.bf = function () {
        return new PolarLineSeriesBaseView(this);
    };
    PolarLineSeriesBase.prototype.im = function (a) {
        _super.prototype.im.call(this, a);
        this.ov = a;
    };
    PolarLineSeriesBase.prototype.ow = function () {
        return 1;
    };
    PolarLineSeriesBase.prototype.get_oz = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "oz", {
        get: function () {
            return this.get_oz();
        },
        enumerable: true,
        configurable: true
    });
    PolarLineSeriesBase.prototype.get_o1 = function () {
        return false;
    };
    Object.defineProperty(PolarLineSeriesBase.prototype, "o1", {
        get: function () {
            return this.get_o1();
        },
        enumerable: true,
        configurable: true
    });
    PolarLineSeriesBase.prototype.n2 = function (a, b) {
        var _this = this;
        _super.prototype.n2.call(this, a, b);
        a.m.clear();
        var c = b.bs;
        var d = b.br;
        var e = this.nb != null ? this.nb.count : 0;
        var f = this.nc != null ? this.nc.count : 0;
        var g = Math.min(e, f);
        var h = ((function () {
            var $ret = new PolarLinePlanner();
            $ret.m = function (i) { return _this.mz.a.getScaledAngle1(_this.nb.item(i), _this.mz.e, _this.mz.d); };
            $ret.q = g;
            $ret.n = function (i) { return _this.mx.lj(_this.nc.item(i), _this.mz.g, _this.mz.f, _this.mz.i, _this.mz.h); };
            $ret.l = _this.er;
            $ret.f = _this.nh;
            $ret.b = _this.ow();
            $ret.o = function (i) { return _this.o2(a, i); };
            $ret.p = function (i) { return _this.o3(a, i); };
            $ret.ab = d;
            $ret.ac = c;
            $ret.d = _this.o1;
            $ret.c = _this.oz;
            return $ret;
        })());
        var i = new List$1(Number_$type, 0);
        for (var j = 0; j < g; j++) {
            if (this.o0(j)) {
                i.add(j);
            }
        }
        if (this.o1 && i.count > 0) {
            i.add(i._inner[0]);
        }
        h.x(a.m, i);
    };
    PolarLineSeriesBase.prototype.o2 = function (a, b) {
        return a.w._inner[b].x;
    };
    PolarLineSeriesBase.prototype.o3 = function (a, b) {
        return a.w._inner[b].y;
    };
    PolarLineSeriesBase.prototype.oy = function () {
        return !this.ox();
    };
    PolarLineSeriesBase.prototype.ox = function () {
        var a = this.bs.mq;
        return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
    };
    PolarLineSeriesBase.prototype.o0 = function (a) {
        return (this.nb.item(a) >= this.mz.a.jx && this.nb.item(a) <= this.mz.a.jw && this.nc.item(a) >= this.mz.b.jx && this.nc.item(a) <= this.mz.b.jw) || (isNaN_(this.nb.item(a)) || isNaN_(this.nc.item(a)));
    };
    PolarLineSeriesBase.prototype.hp = function (a, b) {
        _super.prototype.hp.call(this, a, b);
        this.o4(b);
    };
    PolarLineSeriesBase.prototype.n4 = function (a, b) {
        _super.prototype.n4.call(this, a, b);
        if (this.nh) {
            this.ot = this.os;
        }
        else {
            this.ot = this.ou;
        }
        this.ot.b = this.ow();
        this.o4(b);
        this.o5(a, b);
    };
    PolarLineSeriesBase.$t = markType(PolarLineSeriesBase, 'PolarLineSeriesBase', PolarBase.$);
    return PolarLineSeriesBase;
}(PolarBase));
export { PolarLineSeriesBase };
/**
 * @hidden
 */
var PolarLineSeriesBaseView = /** @class */ (function (_super) {
    tslib_1.__extends(PolarLineSeriesBaseView, _super);
    function PolarLineSeriesBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.cy = null;
        _this.cy = a;
        return _this;
    }
    PolarLineSeriesBaseView.prototype.ac = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k3 = a;
        this.e.es = 3;
        this.e.et = 1;
        this.e.eu = 4;
        this.e.dt = false;
    };
    PolarLineSeriesBaseView.$t = markType(PolarLineSeriesBaseView, 'PolarLineSeriesBaseView', PolarBaseView.$);
    return PolarLineSeriesBaseView;
}(PolarBaseView));
export { PolarLineSeriesBaseView };
