/*
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, __values } from "tslib";
import { MarkerSeries } from "./MarkerSeries";
import { Base, runOn, delegateCombine, Number_$type, enumGetBox, fromEnum, Point_$type, typeCast, markType, markDep } from "igniteui-angular-core";
import { PolarAxisInfoCache } from "./PolarAxisInfoCache";
import { SeriesRenderer$2 } from "./SeriesRenderer$2";
import { PolarFrame } from "./PolarFrame";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericAngleAxis } from "./NumericAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { TrendLineType_$type } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { PenLineCap_$type } from "igniteui-angular-core";
import { DoubleCollection } from "igniteui-angular-core";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { HighlightingInfo } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { PolarAxes } from "./PolarAxes";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { SeriesRenderingArguments } from "./SeriesRenderingArguments";
import { AxisRange } from "./AxisRange";
import { Dictionary$2 } from "igniteui-angular-core";
import { OwnedPoint } from "./OwnedPoint";
import { GeometryUtil } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { Clipper } from "igniteui-angular-core";
import { PolarTrendLineManager } from "./PolarTrendLineManager";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { AssigningPolarStyleEventArgs } from "./AssigningPolarStyleEventArgs";
import { AssigningPolarMarkerStyleEventArgs } from "./AssigningPolarMarkerStyleEventArgs";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { CollisionRect } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { GeometryGroup } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var PolarBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarBase, _super);
    function PolarBase() {
        var _this = _super.call(this) || this;
        _this.y8 = null;
        _this.yz = null;
        _this.y6 = null;
        _this.acp = null;
        _this.aco = null;
        _this.acn = null;
        _this.zk = null;
        _this.zr = null;
        _this.zs = null;
        _this.zc = new PolarFrame();
        _this.ze = new PolarFrame();
        _this.za = new PolarFrame();
        _this.y5 = null;
        _this.aaa = null;
        _this.zg = 1;
        _this.zw = false;
        _this.zv = false;
        _this.zp = null;
        _this.zq = null;
        _this.assigningPolarStyle = null;
        _this.assigningPolarMarkerStyle = null;
        _this.zf = null;
        _this.zd = null;
        _this.y9 = null;
        _this.zf = new PolarSeriesRenderManager();
        _this.zh = _this.zi();
        _this.zd = new PolarFrame();
        _this.ze.y = runOn(_this, _this.acm);
        _this.zc.y = runOn(_this, _this.acm);
        _this.za.y = runOn(_this, _this.acm);
        _this.zk = new SeriesRenderer$2(PolarFrame.$, PolarBaseView.$, 0, runOn(_this, _this.abn), runOn(_this, _this.abr), runOn(_this, _this.d4), runOn(_this, _this.sf), runOn(_this, _this.abg));
        return _this;
    }
    PolarBase.prototype.ct = function () {
        return new PolarBaseView(this);
    };
    PolarBase.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.y7 = a;
    };
    PolarBase.prototype.o8 = function () {
        _super.prototype.o8.call(this);
        this.y3 = null;
        this.y4 = null;
    };
    PolarBase.prototype.get_fq = function () {
        return true;
    };
    PolarBase.prototype.ed = function (a, b, c, d, e) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var f = this.y3;
        var g = new ScalerParams(1, this.dc.xm, this.w2, f.df);
        g.c = this.getEffectiveViewport1(this.cw);
        var h = this.y4;
        var i = new ScalerParams(1, this.dc.xm, this.w2, h.df);
        i.c = this.getEffectiveViewport1(this.cw);
        a.clear();
        this.xg.cw(function (j) {
            if (j._visibility == 0) {
                var k = new SeriesPointOfInterest();
                var l = j.n;
                var m = j.o;
                if (!e && (l < _this.w2.left || l > _this.w2.right || m < _this.w2.top || m > _this.w2.bottom)) {
                    return;
                }
                var n = void 0;
                var o = void 0;
                var p = _this.y5.f(l, m, _this.cw.ca, _this.cw.b9, _this.cw.getEffectiveViewport(), n, o);
                n = p.p5;
                o = p.p6;
                k.d = n;
                k.e = o;
                k.b = j.content;
                k.g = _this.vq;
                k.c = j.ak;
                if (_this.ha) {
                    k.g = _this.vx(j.ak);
                }
                a.add(k);
            }
        });
        return true;
    };
    PolarBase.prototype.abg = function () {
        if (this.dd.g) {
            this.dd.t();
        }
    };
    PolarBase.prototype.abi = function () {
        this.y5.e(this.y8.x, this.zt, this.zu, this.acp, this.aco, this.acn, function (a, b) { return Math.cos(b); }, function (a, b) { return Math.sin(b); }, true);
    };
    PolarBase.prototype.gc = function () {
        return this.highlightedItemsSource != null || (this.aay != null && this.aaw != null);
    };
    PolarBase.prototype.z8 = function () {
        return false;
    };
    PolarBase.prototype.hu = function () {
        var a = _super.prototype.hu.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "AngleMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedAngleMemberPath";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.abj));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "RadiusMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedRadiusMemberPath";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.abk));
            a.add(c);
        }
        if (this.z8()) {
            var d = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "DashArray";
                $ret.p = true;
                $ret.x = ((function () {
                    var $ret = new DoubleCollection();
                    $ret.add(5);
                    $ret.add(5);
                    return $ret;
                })());
                $ret.q = true;
                return $ret;
            })());
            a.add(d);
        }
        if (!this.z8()) {
            var e = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Brush";
                $ret.p = true;
                $ret.y = "ActualBrush";
                $ret.q = true;
                return $ret;
            })());
            e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.r8));
            a.add(e);
        }
        if (!this.z8()) {
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Outline";
                $ret.p = true;
                $ret.y = "ActualOutline";
                $ret.q = true;
                return $ret;
            })());
            f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.r8));
            a.add(f);
        }
        return a;
    };
    PolarBase.prototype.abk = function (a, b) {
        if (this.aay != null) {
            b.value = this.aay;
            return;
        }
        b.value = this.abb;
    };
    PolarBase.prototype.abj = function (a, b) {
        if (this.aaw != null) {
            b.value = this.aaw;
            return;
        }
        b.value = this.aat;
    };
    Object.defineProperty(PolarBase.prototype, "zt", {
        get: function () {
            return this.zr;
        },
        set: function (a) {
            if (this.zr != a) {
                var b = this.zt;
                this.zr = a;
                this.raisePropertyChanged("AngleColumn", b, this.zt);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PolarBase.prototype, "zu", {
        get: function () {
            return this.zs;
        },
        set: function (a) {
            if (this.zs != a) {
                var b = this.zu;
                this.zs = a;
                this.raisePropertyChanged("RadiusColumn", b, this.zu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PolarBase.prototype, "ach", {
        get: function () {
            return this.c(PolarBase.abs);
        },
        set: function (a) {
            this.h(PolarBase.abs, a);
        },
        enumerable: false,
        configurable: true
    });
    PolarBase.prototype.zb = function () {
        var a = this.za;
        if (this.d4()) {
            if (this.dd.g) {
                this.dd.t();
            }
            a = this.ze;
        }
        return a;
    };
    PolarBase.prototype.qh = function () {
        _super.prototype.qh.call(this);
        if (this.y4 != null) {
            this.y4.k3(false);
        }
        if (this.y3 != null) {
            this.y3.k3(false);
        }
    };
    PolarBase.prototype.ph = function (a, b, c, d) {
        var e_1, _a;
        var e = false;
        this.y7.dd.g$i(a, b, c, d);
        if (this.y7.aa.count > 0) {
            try {
                for (var _b = __values(fromEnum(this.y7.aa)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var f = _c.value;
                    f.g$i(a, b, c, d);
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
        if (this.y3 != null && !this.y3.d2()) {
            e = true;
        }
        if (this.y4 != null && !this.y4.d2()) {
            e = true;
        }
        if (e) {
            this.ry(true);
        }
    };
    PolarBase.prototype.sy = function (a, b) {
        this.ry(false);
    };
    PolarBase.prototype.sz = function (a, b) {
        this.ry(false);
    };
    PolarBase.prototype.hf = function (a, b, c) {
        var d = true;
        if (!_super.prototype.hf.call(this, a, b, c) || !c.r() || b.isEmpty || a.isEmpty || this.y3 == null || this.y4 == null || this.zt == null || this.zu == null || this.zt.count == 0 || this.zu.count == 0 || this.dp == null || this.dp.count != this.zt.count || this.dp.count != this.zu.count || this.y5 == null || this.y3.b0 == null || this.y4.b0 == null || this.y3.pr == this.y3.pq || this.y4.pr == this.y4.pq) {
            d = false;
        }
        return d;
    };
    PolarBase.prototype.rz = function (a) {
        _super.prototype.rz.call(this, a);
        var b;
        var c;
        var d = this.getViewInfo(c, b);
        c = d.p0;
        b = d.p1;
        if (!this.hf(c, b, this.cw)) {
            this.pb(true, this.cw);
            return;
        }
        this.acp = b;
        this.aco = c;
        this.acn = this.cw.getEffectiveViewport();
        this.y6 = new PolarAxisInfoCache(this.y3, this.y4, this.dp);
        var e = new SeriesRenderingArguments(this, c, b, a, this.gs);
        var f = this.zk.g(e, this.zc, this.za, this.ze, this.y7);
        this.zc = f.p1;
        this.za = f.p2;
        this.ze = f.p3;
    };
    PolarBase.prototype.acm = function (a) {
        var b = this.y5.h(a.x, a.y, this.acp, this.aco, this.acn, this.y6.e, this.y6.d, this.y6.g, this.y6.f, this.y6.i, this.y6.h);
        return b;
    };
    PolarBase.prototype.ay = function (a) {
        if (a != null && a == this.y3 && this.zt != null) {
            return new AxisRange(this.zt.minimum, this.zt.maximum);
        }
        if (a != null && a == this.y4 && this.zu != null) {
            return new AxisRange(this.zu.minimum, this.zu.maximum);
        }
        return null;
    };
    PolarBase.prototype.ge = function (a) {
        var b = this.cw.ca;
        b = b.copy();
        var c = this.cw.b9;
        var d = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
        if (this.y3 == null || this.zt == null || this.y4 == null || this.zu == null) {
            return false;
        }
        if (d < 0 || d > this.zt.count - 1 || d > this.zu.count - 1) {
            return false;
        }
        var e = this.y3.getScaledAngle(this.zt.item(d));
        var f = this.y4.sh(this.zu.item(d));
        var g = 0.5 + (Math.cos(e) * f);
        var h = 0.5 + (Math.sin(e) * f);
        if (!isNaN_(g)) {
            if (g < b.left + 0.1 * b.width) {
                g = g + 0.4 * b.width;
                b.x = g - 0.5 * b.width;
            }
            if (g > b.right - 0.1 * b.width) {
                g = g - 0.4 * b.width;
                b.x = g - 0.5 * b.width;
            }
        }
        if (!isNaN_(h)) {
            if (h < b.top + 0.1 * b.height) {
                h = h + 0.4 * b.height;
                b.y = h - 0.5 * b.height;
            }
            if (h > b.bottom - 0.1 * b.height) {
                h = h - 0.4 * b.height;
                b.y = h - 0.5 * b.height;
            }
        }
        if (this.c4 != null) {
            this.c4.au(this.dc, b, true);
        }
        return d >= 0;
    };
    PolarBase.prototype.kr = function (a) {
        var b = this.j7(a);
        if (this.dp != null && b >= 0 && b < this.dp.count) {
            return this.dp.item(b);
        }
        return null;
    };
    PolarBase.prototype.j7 = function (a) {
        var b = truncate(Math.round(this.it(a)));
        return b;
    };
    PolarBase.prototype.it = function (a) {
        switch (this.zh) {
            case 1: return this.aae(a);
            case 3: return this.aaf(a);
            case 2: return this.aac(a);
            case 4: return this.aad(a);
        }
        return -1;
    };
    PolarBase.prototype.aad = function (a) {
        return this.aag(a, false);
    };
    PolarBase.prototype.aac = function (a) {
        var b = this.wh(a);
        var c = b.x;
        var d = b.y;
        if (this.dp == null || this.y3 == null || this.y4 == null || this.zt == null || this.zu == null) {
            return -1;
        }
        if (this.dp.count > this.aai) {
            return -1;
        }
        if (!this.z0()) {
            return -1;
        }
        var e = this.aaa;
        var f = 1.7976931348623157E+308;
        var g = -1;
        for (var h = 0; h < this.zt.count; h++) {
            var i = e._inner[h].x;
            var j = e._inner[h].y;
            var k = (c - i) * (c - i) + (d - j) * (d - j);
            if (k < f) {
                f = k;
                g = h;
            }
        }
        return g;
    };
    PolarBase.prototype.z0 = function () {
        var a = this.za;
        if (this.d4()) {
            a = this.ze;
        }
        if (a == null || a.x.count == 0) {
            return false;
        }
        this.aaa = a.x;
        return true;
    };
    PolarBase.prototype.aag = function (a, b) {
        if (!this.z3) {
            return -1;
        }
        var c = { $type: Point_$type, x: 0, y: 0 };
        var d = true;
        var e = this.za;
        if (this.d4()) {
            e = this.ze;
        }
        if (e == null) {
            return -1;
        }
        if (e.n == null) {
            return -1;
        }
        if (this.dp == null || this.dp.count > this.aai) {
            return -1;
        }
        if (!this.z0()) {
            return -1;
        }
        var f = this.aaa;
        var g = this.wh(a);
        var h = 1.7976931348623157E+308;
        var i = -1;
        for (var j = 0; j < f.count; j++) {
            var k = f._inner[j];
            if (j > 0) {
                if (isNaN_(k.x) || isNaN_(k.y) || isNaN_(c.x) || isNaN_(c.y)) {
                    c = k;
                    continue;
                }
                if (!b || e.j.containsKey(this.dp.item(j)) || e.j.containsKey(this.dp.item(j - 1))) {
                    var l = GeometryUtil.h(g, c, k);
                    if (l < h) {
                        h = l;
                        i = j;
                    }
                }
            }
            c = k;
        }
        if (i >= 0) {
            var m = f._inner[i];
            var n = f._inner[i - 1];
            if (!b || (e.j.containsKey(this.dp.item(i)) && e.j.containsKey(this.dp.item(i - 1)))) {
                var o = GeometryUtil.m(g, n, m);
                return (i - 1) + o;
            }
            else if (e.j.containsKey(this.dp.item(i))) {
                return i;
            }
            else {
                return i - 1;
            }
        }
        return -1;
    };
    PolarBase.prototype.aaf = function (a) {
        return this.aag(a, true);
    };
    PolarBase.prototype.aae = function (a) {
        var _this = this;
        var b = null;
        var c = 1.7976931348623157E+308;
        var d = this.wh(a);
        var e = d.x;
        var f = d.y;
        if (this.y7.de.e > this.aai) {
            return -1;
        }
        this.y7.dh(function (g) {
            if (g._visibility == 0) {
                var h = _this.y7.c7(g);
                var i = h.left + h.width / 2;
                var j = h.top + h.height / 2;
                var k = (e - i) * (e - i) + (f - j) * (f - j);
                if (k < c) {
                    c = k;
                    b = g;
                }
            }
        });
        if (b != null) {
            return b.ak;
        }
        return -1;
    };
    PolarBase.prototype.wm = function (a, b, c) {
        var _this = this;
        if (this.y3 == null || this.y4 == null || this.zt == null || this.zu == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        var d = this.cw.ca;
        var e = this.cw.b9;
        var f = this.getEffectiveViewport();
        var g = new ScalerParams(0, d, e, this.y3.df, f);
        var h = ((function () {
            var $ret = new ScalerParams(0, d, e, _this.y4.df, f);
            $ret.b = _this.i0();
            return $ret;
        })());
        if (b) {
            var i = this.it(a);
            if (i == -1) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            var j = truncate(Math.floor(i));
            var k = truncate(Math.ceil(i));
            if (j < 0) {
                j = 0;
            }
            if (k < 0) {
                k = 0;
            }
            if (k > this.dp.count - 1) {
                k = this.dp.count - 1;
            }
            if (j > this.dp.count - 1) {
                j = this.dp.count - 1;
            }
            if (k == j) {
                return this.y5.h(this.zt.item(j), this.zu.item(j), d, e, f, this.y6.e, this.y6.d, this.y6.g, this.y6.f, this.y6.i, this.y6.h);
            }
            var l = i - Math.floor(i);
            var m = this.y5.h(this.zt.item(j), this.zu.item(j), d, e, f, this.y6.e, this.y6.d, this.y6.g, this.y6.f, this.y6.i, this.y6.h);
            var n = this.y5.h(this.zt.item(k), this.zu.item(k), d, e, f, this.y6.e, this.y6.d, this.y6.g, this.y6.f, this.y6.i, this.y6.h);
            var o = m.x;
            var p = m.y;
            var q = n.x;
            var r = n.y;
            var s = q - o;
            var t = r - p;
            return { $type: Point_$type, x: o + s * l, y: p + t * l };
        }
        else {
            var u = this.j7(a);
            if (u == -1) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.y5.h(this.zt.item(u), this.zu.item(u), d, e, f, this.y6.e, this.y6.d, this.y6.g, this.y6.f, this.y6.i, this.y6.h);
        }
    };
    PolarBase.prototype.ai = function () {
        return [this.y3, this.y4];
    };
    PolarBase.prototype.ku = function (a, b) {
        var c = this.ni(b);
        if (c == PolarBase.$$p[3]) {
            return this.kv(a, b, this.aat);
        }
        if (c == PolarBase.$$p[15]) {
            return this.kv(a, b, this.abb);
        }
        if (c == PolarBase.$$p[5]) {
            return this.kv(a, b, this.aaw);
        }
        if (c == PolarBase.$$p[6]) {
            return this.kv(a, b, this.aay);
        }
        return _super.prototype.ku.call(this, a, b);
    };
    PolarBase.prototype.mi = function (a) {
        var b = this.ni(a);
        if (b == PolarBase.$$p[3]) {
            return this.aat;
        }
        if (b == PolarBase.$$p[15]) {
            return this.abb;
        }
        if (b == PolarBase.$$p[5]) {
            return this.aaw;
        }
        if (b == PolarBase.$$p[6]) {
            return this.aay;
        }
        return _super.prototype.mi.call(this, a);
    };
    PolarBase.prototype.rg = function (a, b, c, d) {
        _super.prototype.rg.call(this, a, b, c, d);
        if (this.y7.dd.g$e(a, b, c, d)) {
            this.ry(false);
            this.qr();
        }
        switch (b) {
            case PolarBase.$$p[1]:
            case PolarBase.$$p[2]:
            case PolarBase.$$p[13]:
            case PolarBase.$$p[14]:
                this.ql();
                break;
            case "FastItemsSource":
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.zt);
                    c.deregisterColumn(this.zu);
                    this.zt = null;
                    this.zu = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.zt = this.dl(this.aat);
                    this.zu = this.dl(this.abb);
                }
                if ((this.y4 != null && !this.y4.d2()) || (this.y3 != null && !this.y3.d2())) {
                    this.ry(this.gh && c != null);
                }
                break;
            case PolarBase.$$p[0]:
                if (this.y3 != null && this.y4 != null) {
                    this.y5 = new PolarAxes(this.y4, this.y3);
                }
                if (c != null) {
                    c.cq(this);
                }
                if (d != null) {
                    d.du(this);
                }
                if (this.y3 != null && !this.y3.d2()) {
                    this.ry(false);
                }
                else if (c != null && d == null) {
                    this.pb(true, this.cw);
                }
                break;
            case PolarBase.$$p[12]:
                if (this.y3 != null && this.y4 != null) {
                    this.y5 = new PolarAxes(this.y4, this.y3);
                }
                if (c != null) {
                    c.cq(this);
                }
                if (d != null) {
                    d.du(this);
                }
                if (this.y4 != null && !this.y4.d2()) {
                    this.ry(false);
                }
                else if (c != null && d == null) {
                    this.pb(true, this.cw);
                }
                if (this.y3 != null && !this.y3.d2()) {
                    this.y3.kz();
                }
                break;
            case PolarBase.$$p[3]:
                if (this.dp != null) {
                    this.dp.deregisterColumn(this.zt);
                    this.zt = this.dl(this.aat);
                }
                break;
            case "AngleColumn":
                this.y7.dd.g$m();
                if (this.y3 != null && !this.y3.d2()) {
                    this.ry(this.gh && this.d9);
                }
                break;
            case PolarBase.$$p[15]:
                if (this.dp != null) {
                    this.dp.deregisterColumn(this.zu);
                    this.zu = this.dl(this.abb);
                }
                break;
            case "RadiusColumn":
                this.y7.dd.g$m();
                if (this.y4 != null && !this.y4.d2()) {
                    this.ry(this.gh && this.d9);
                }
                break;
            case PolarBase.$$p[16]:
                this.ry(false);
                this.qr();
                break;
            case PolarBase.$$p[11]:
                this.ry(false);
                this.qr();
                break;
            case "TransitionProgress":
                this.y6 = new PolarAxisInfoCache(this.y3, this.y4, this.dp);
                this.acp = this.cw.ca;
                this.aco = this.cw.b9;
                this.acn = this.cw.getEffectiveViewport();
                this.ze.w = this.z9;
                this.ze.c(this.ju, this.zc, this.za);
                if (this.d7(this.cw)) {
                    return;
                }
                if (this.ju == 1) {
                    this.abr(this.za, this.y7);
                    this.qu();
                }
                else {
                    this.abr(this.ze, this.y7);
                }
                if (this.dc != null) {
                    this.dc.rz(this);
                }
                break;
            case "TrendLineBrush":
                this.rm(b);
                break;
            case PolarBase.$$p[4]:
                this.ry(false);
                this.qr();
                break;
            case "TrendLineType":
                this.qr();
                break;
            case PolarBase.$$p[8]:
                this.zw = this.z5();
                this.ry(false);
                break;
            case PolarBase.$$p[7]:
                this.zv = this.z4();
                this.ry(false);
                break;
            case PolarBase.$$p[9]:
                this.zh = this.zi();
                break;
        }
    };
    Object.defineProperty(PolarBase.prototype, "zh", {
        get: function () {
            return this.zg;
        },
        set: function (a) {
            var b = this.zg;
            this.zg = a;
            if (b != this.zg) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.zg));
            }
        },
        enumerable: false,
        configurable: true
    });
    PolarBase.prototype.zi = function () {
        if (this.zj != 0) {
            return this.zj;
        }
        return this.z3 ? 4 : 1;
    };
    PolarBase.prototype.get_z3 = function () {
        return false;
    };
    Object.defineProperty(PolarBase.prototype, "z3", {
        get: function () {
            return this.get_z3();
        },
        enumerable: false,
        configurable: true
    });
    PolarBase.prototype.z5 = function () {
        return this.z2;
    };
    PolarBase.prototype.z4 = function () {
        return this.z1;
    };
    PolarBase.prototype.zy = function (a) {
        if (typeCast(NumericRadiusAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    PolarBase.prototype.zx = function (a) {
        if (typeCast(NumericAngleAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    PolarBase.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        var c = b;
        if (a) {
            c.de.clear();
        }
        c.dd.g$h();
    };
    PolarBase.prototype.y0 = function (a, b) {
        var c = a.top - 10;
        var d = a.bottom + 10;
        var e = a.left - 10;
        var f = a.right + 10;
        var g = ((function () {
            var $ret = new Clipper(1, e, d, f, c, false);
            $ret.i = b;
            return $ret;
        })());
        return g;
    };
    PolarBase.prototype.abf = function (a, b, c, d) {
        a.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, b);
        var e = this.dp;
        var _loop_1 = function (f) {
            var g = a.x._inner[f];
            if (!isInfinity(g.x) && !isInfinity(g.y)) {
                var h_1 = { $type: Point_$type, x: this_1.zt.item(f), y: this_1.zu.item(f) };
                var i_1 = { $type: Point_$type, x: g.x, y: g.y };
                a.g.addItem(e.item(f), ((function () {
                    var $ret = new OwnedPoint();
                    $ret.a = e.item(f);
                    $ret.b = h_1;
                    $ret.c = i_1;
                    return $ret;
                })()));
            }
        };
        var this_1 = this;
        for (var f = 0; f < b; f++) {
            _loop_1(f);
        }
    };
    PolarBase.prototype.abn = function (a, b) {
        var _this = this;
        var c = b.ca;
        var d = b.b9;
        var e = b.getEffectiveViewport();
        a.j.clear();
        a.o.clear();
        var f = Math.min(this.zt != null ? this.zt.count : 0, this.zu != null ? this.zu.count : 0);
        if (f < 1) {
            return;
        }
        this.y6 = new PolarAxisInfoCache(this.y3, this.y4, this.dp);
        this.y8 = a;
        this.aco = d;
        this.acp = c;
        this.acn = b.getEffectiveViewport();
        b.db.l(a.j, this.aaj, c, d, this.ie);
        if (f <= this.aaj) {
            this.abf(a, f, c, d);
        }
        var g = this.y0(d, a.o);
        var h = Math.min(this.y3.pr, this.y3.pq);
        var i = Math.max(this.y3.pq, this.y3.pr);
        b.dd.k = this.z9;
        b.dd.j = 0;
        b.dd.m = this.y4.sb;
        b.dd.l = this.y4.sa;
        b.dd.n = function (j, k) { return _this.y5.c(j, k, c, d, e, Math.cos); };
        b.dd.o = function (j, k) { return _this.y5.d(j, k, c, d, e, Math.sin); };
        var j = new List$1(Number_$type, 0);
        for (var k = 0; k < this.zt.count; k++) {
            if (this.zt.item(k) >= h && this.zt.item(k) <= i) {
                j.add(this.zt.item(k));
            }
        }
        var l = this.zu;
        if (j.count != this.zt.count) {
            l = new List$1(Number_$type, 0);
            for (var m = 0; m < this.zt.count; m++) {
                if (this.zt.item(m) >= h && this.zt.item(m) <= i) {
                    l.add(this.zu.item(m));
                }
            }
        }
        b.dd.p(a.o, this.zl, j, l, this.aak, runOn(this.y3, this.y3.getScaledAngle), runOn(this.y4, this.y4.sh), ((function () {
            var $ret = new TrendResolutionParams();
            $ret.d = _this.ie;
            $ret.i = d;
            $ret.h = e;
            $ret.j = c;
            return $ret;
        })()), g, h, i);
        if (b.aa.count > 0) {
            a.m.clear();
            for (var n = 0; n < b.aa.count; n++) {
                a.m.add(new List$1(Point_$type, 0));
                var o = b.aa._inner[n];
                o.k = this.z9;
                o.j = 0;
                o.m = this.y4.sb;
                o.l = this.y4.sa;
                o.n = function (p, q) { return _this.y5.c(p, q, c, d, e, Math.cos); };
                o.o = function (p, q) { return _this.y5.d(p, q, c, d, e, Math.sin); };
                o.p(a.m._inner[n], o.g$b, j, l, o.g$f, runOn(this.y3, this.y3.getScaledAngle), runOn(this.y4, this.y4.sh), ((function () {
                    var $ret = new TrendResolutionParams();
                    $ret.d = _this.ie;
                    $ret.i = d;
                    $ret.h = e;
                    $ret.j = c;
                    return $ret;
                })()), g, h, i);
            }
        }
    };
    PolarBase.prototype.get_ff = function () {
        return true;
    };
    PolarBase.prototype.zn = function (a, b, c) {
        return null;
    };
    PolarBase.prototype.zo = function (a, b, c) {
        if (this.dp == null) {
            return null;
        }
        var d = this.zb();
        var e = this.y7.ce(this.wh(b));
        var f = -1;
        if (e == null) {
            if (a != null) {
                f = this.dp.indexOf(a);
            }
            else {
                return null;
            }
        }
        else {
            f = e.ak;
        }
        if (f == -1) {
            return null;
        }
        var g = new HighlightingInfo();
        g.i = this;
        g.g = f;
        g.f = f;
        g.c = false;
        g.d = true;
        if (c != null && c.g == g.g && c.f == g.f) {
            return c;
        }
        return g;
    };
    PolarBase.prototype.zm = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dp.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    PolarBase.prototype.dh = function (a, b, c) {
        if (this.ef && this.f0(this.by) && !c) {
            var d = this.zn(a, b, this.zp);
            this.zp = d;
            return d;
        }
        else {
            var e = this.zm(a, b, this.zp);
            this.zp = e;
            return e;
        }
    };
    PolarBase.prototype.di = function (a, b, c) {
        if (this.f0(this.by) && !c) {
            var d = this.zo(a, b, this.zq);
            this.zq = d;
            return d;
        }
        else {
            var e = this.zm(a, b, this.zq);
            e.d = true;
            this.zq = e;
            return e;
        }
    };
    PolarBase.prototype.z7 = function () {
        return (this.assigningPolarStyle != null && this.zw) || (this.by != 1) || this.d3 || (this.cq != 1) || (this.cp != 1);
    };
    PolarBase.prototype.z6 = function () {
        return (this.assigningPolarMarkerStyle != null && this.zv) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
    };
    PolarBase.prototype.abr = function (a, b) {
        this.q3();
        var c = b.ca;
        var d = b.b9;
        var e = this.getEffectiveViewport1(b);
        var f = this.wt(b);
        this.y6 = new PolarAxisInfoCache(this.y3, this.y4, this.dp);
        if (this.xq()) {
            b.db.j(a.j, this.xs);
            if (this.z6()) {
                this.abh(b, a);
            }
        }
        b.c4();
        var g = this.y0(d, b.dd.g$n.an);
        b.dd.g$l(a.o, g);
        if (b.aa.count > 0) {
            for (var h = 0; h < b.aa.count; h++) {
                var i = b.aa._inner[h];
                i.g$l(a.m._inner[h], g);
            }
        }
        this.abe(d, c, e, f, b);
    };
    PolarBase.prototype.yx = function (a, b) {
        return this.yy(a, b);
    };
    PolarBase.prototype.yy = function (a, b) {
        if (b < a || a < 0 || a > this.zt.count || b < 0 || b > this.zt.count) {
            return null;
        }
        var c = new Array((b - a) + 1);
        for (var d = a; d <= b; d++) {
            var e = d;
            c[d - a] = this.dp.item(d);
        }
        return c;
    };
    PolarBase.prototype.abh = function (a, b) {
        var _this = this;
        a.ck = true;
        this.zf.ay(this, this.z6(), runOn(this, this.yx));
        var c = this.zf.d;
        var d = c != null;
        var e = this.getEffectiveViewport1(a);
        var f = this.dp == null ? 0 : this.dp.count;
        this.y7.cw(function (g) {
            if (g._visibility == 0) {
                var h = g.ak;
                var i = g.content;
                if (i == null) {
                    i = new DataContext();
                    g.content = i;
                }
                if (d) {
                    _this.abl(h, f, a.t);
                }
                _this.zf.ac(g, i);
            }
        });
    };
    PolarBase.prototype.abm = function (a, b, c) {
        var d = this.by != 1;
        var e = this.cq != 1;
        var f = this.cp != 1;
        this.zf.a0(this.zf.b, a, b, false);
        this.zf.ab(this.ic);
        var g = this.zf.ax;
        var h = null;
        var i = null;
        var j = null;
        var k = this.dp;
        if (d && this.dc != null) {
            h = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, false);
            g.c = h;
        }
        if (e && this.dc != null) {
            i = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, false);
            if (i == null && this.bo != null) {
                i = this.dc.d1.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, false);
            }
            g.d = i;
        }
        if (f && this.dc != null) {
            j = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, false);
            g.b = j;
        }
        g.h = c;
        this.abp(g);
        this.zf.z(this, h, i, j, c, d, e, f, a < 0);
    };
    PolarBase.prototype.abl = function (a, b, c) {
        var d = this.by != 1;
        var e = this.cq != 1;
        var f = this.cp != 1;
        this.zf.a0(this.zf.d, a, b, true);
        this.zf.aa(this.ic);
        var g = this.zf.aw;
        var h = null;
        var i = null;
        var j = null;
        var k = this.dp;
        var l = null;
        var m = null;
        var n = null;
        if (d && this.dc != null) {
            h = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, true);
            if (this.dc.d0.isCrossContextHighlight(this)) {
                l = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, true);
            }
            g.c = h;
        }
        if (e && this.dc != null) {
            i = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, true);
            if (i == null && this.bo != null) {
                i = this.dc.d1.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true);
            }
            if (this.dc.d1.isCrossContextHighlight(this)) {
                m = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, true);
            }
            g.d = i;
        }
        if (f && this.dc != null) {
            j = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, true);
            if (this.dc.dz.isCrossContextHighlight(this)) {
                n = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, true);
            }
            g.d = i;
        }
        g.h = c;
        this.abo(g);
        this.zf.y(this, h, i, j, c, d, e, f, g.v, this.dc.d0.totalHighWaterMark, g.x, this.dc.d1.totalHighWaterMark, g.t, this.dc.dz.totalHighWaterMark);
    };
    PolarBase.prototype.abp = function (a) {
        if (this.assigningPolarStyle != null && this.zw) {
            this.assigningPolarStyle(this, a);
        }
    };
    PolarBase.prototype.abo = function (a) {
        if (this.assigningPolarMarkerStyle != null && this.zv) {
            this.assigningPolarMarkerStyle(this, a);
        }
    };
    PolarBase.prototype.abe = function (a, b, c, d, e) {
        e.dg(a, b, c, d);
    };
    PolarBase.prototype.sp = function () {
        _super.prototype.sp.call(this);
        if (this.index < 0) {
            return;
        }
        this.y7.dj();
    };
    PolarBase.prototype.r0 = function (a, b) {
        _super.prototype.r0.call(this, a, b);
        if (!this.g1) {
            this.cw.be(b);
            return;
        }
        this.cw.be(b);
        if (this.d7(this.cv)) {
            return;
        }
        this.r1();
        this.g1 = false;
    };
    PolarBase.prototype.r1 = function () {
        _super.prototype.r1.call(this);
        var a = this.cv;
        if (!this.gt) {
            this.zd = new PolarFrame();
            this.abn(this.zd, a);
        }
        this.gt = false;
        this.abr(this.zd, a);
    };
    PolarBase.prototype.rx = function (a, b, c, d, e) {
        _super.prototype.rx.call(this, a, b, c, d, e);
        var f = this.ba.a$j.item(d);
        var g = f;
        f.bd(c);
        if (this.d7(g)) {
            return;
        }
        if (this.y9 == null) {
            this.y9 = new PolarFrame();
        }
        this.abn(this.y9, g);
        this.abr(this.y9, g);
    };
    PolarBase.prototype.abq = function (a, b) {
        var e_2, _a, e_3, _b;
        var c = new List$1(Base.$, 0);
        try {
            for (var _c = __values(fromEnum(b.c)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var d = _d.value;
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var e = _f.value;
                b.h(e);
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
    };
    PolarBase.prototype.yw = function (a, b, c) {
        this.abi();
        return this.y8.x.toArray();
    };
    PolarBase.prototype.aab = function (a) {
        var e_4, _a;
        var b = new List$1(Number_$type, 0);
        var c = this.dp;
        try {
            for (var _b = __values(fromEnum(this.y7.de.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                b.add(c.indexOf(d));
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        return b;
    };
    PolarBase.prototype.acl = function (a) {
        return { $type: Point_$type, x: this.zt.item(a), y: this.zu.item(a) };
    };
    PolarBase.prototype.p5 = function (a) {
        _super.prototype.p5.call(this, a);
        this.bc.exportTrendlineData(this, a, this.y7.dd.g$n);
    };
    PolarBase.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = { $type: Point_$type, x: a, y: b };
        var d = this.kr(c);
        var e = d == null ? NaN : this.iz(d, "RadiusMemberPath");
        var f = d == null ? NaN : this.iz(d, "AngleMemberPath");
        var g = new DataLegendSeriesValueInfo();
        g.l = e;
        g.a = 11;
        g.r = this.abb != null ? this.abb : "Radius";
        g.q = "Radius";
        g.s = this.aa7 != null ? this.aa7 : "R:";
        g.t = this.aa9 != null ? this.aa9 : "";
        var h = new DataLegendSeriesValueInfo();
        h.l = f;
        h.a = 10;
        h.r = this.aat != null ? this.aat : "Angle";
        h.q = "Angle";
        h.s = this.aap != null ? this.aap : "A:";
        h.t = this.aar != null ? this.aar : "";
        var i = new DataLegendSeriesContext();
        i.e = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(g);
            $ret.add(h);
            return $ret;
        })());
        i.h = this.mh();
        return i;
    };
    PolarBase.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.qa(a, c, b);
        return c.toArray();
    };
    PolarBase.prototype.qa = function (a, b, c) {
        var _this = this;
        var d = this.cw.ca;
        var e = this.cw.b9;
        var f = this.getEffectiveViewport1(this.cw);
        var g = this.dc.xu(this.w2, this.getEffectiveViewport(), d);
        var h = new CollisionRect(0, this.dc.xr(a));
        var i = this.y4.or(e, d, f, g);
        var _loop_2 = function (j) {
            var k = this_2.y3.getScaledAngle(this_2.zt.item(j));
            var l = this_2.y4.sh(this_2.zu.item(j));
            var m = this_2.y5.c(k, l, d, e, f, Math.cos);
            var n = this_2.y5.d(k, l, d, e, f, Math.sin);
            if (h.containsLocation(m, n)) {
                if (c == 7 || c == 6) {
                    b.add(((function () {
                        var $ret = new ChartSelection();
                        $ret.series = _this;
                        return $ret;
                    })()));
                    return { value: void 0 };
                }
                else if (c == 2 || c == 1) {
                    b.add(((function () {
                        var $ret = new ChartSelection();
                        $ret.item = _this.dp.item(j);
                        return $ret;
                    })()));
                }
                else {
                    b.add(((function () {
                        var $ret = new ChartSelection();
                        $ret.item = _this.dp.item(j);
                        $ret.series = _this;
                        return $ret;
                    })()));
                }
            }
        };
        var this_2 = this;
        for (var j = 0; j < this.dp.count; j++) {
            var state_1 = _loop_2(j);
            if (typeof state_1 === "object")
                return state_1.value;
        }
    };
    PolarBase.prototype.bd = function () {
        return new PolarTrendLineManager();
    };
    PolarBase.$t = markType(PolarBase, 'PolarBase', MarkerSeries.$);
    PolarBase.abs = DependencyProperty.i("ActualTrendLineBrush", Brush.$, PolarBase.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue); }));
    PolarBase.$$p = markDep(DependencyProperty, PropertyMetadata, PolarBase, 'raisePropertyChanged', ['AngleAxis:y3:abt', [NumericAngleAxis.$, null], 'AngleMemberAsLegendLabel:aap:abu', [2, null], 'AngleMemberAsLegendUnit:aar:abv', [2, null], 'AngleMemberPath:aat:abw', [2], 'ClipSeriesToBounds:zz:abx', [0, false], 'HighlightedAngleMemberPath:aaw:aby', [2, null], 'HighlightedRadiusMemberPath:aay:abz', [2, null], 'IsCustomPolarMarkerStyleAllowed:z1:ab0', [0, false], 'IsCustomPolarStyleAllowed:z2:ab1', [0, false], 'ItemSearchMode:zj:ab2', [ScatterItemSearchMode_$type, enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:aai:ab3', [1, 10000], 'MaximumMarkers:aaj:ab4', [1, 400], 'RadiusAxis:y4:ab5', [NumericRadiusAxis.$, null], 'RadiusMemberAsLegendLabel:aa7:ab6', [2, null], 'RadiusMemberAsLegendUnit:aa9:ab7', [2, null], 'RadiusMemberPath:abb:ab8', [2], 'UseCartesianInterpolation:z9:acg', [0, true], 'TrendLineType:zl:ace', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:aah:acd', [1, 1.5], 'TrendLinePeriod:aak:acc', [1, 7], 'TrendLineZIndex:aal:acf', [1, 1], 'TrendLineBrush:aci:ab9', [Brush.$, null], 'TrendLineDashArray:acj:aca', [DoubleCollection.$], 'TrendLineDashCap:ack:acb', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)]]);
    return PolarBase;
}(MarkerSeries));
export { PolarBase };
/**
 * @hidden
 */
var PolarSeriesRenderManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarSeriesRenderManager, _super);
    function PolarSeriesRenderManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.aw = null;
        _this.ax = null;
        return _this;
    }
    PolarSeriesRenderManager.prototype.c = function () {
        this.aw = new AssigningPolarMarkerStyleEventArgs();
        return this.aw;
    };
    PolarSeriesRenderManager.prototype.a = function () {
        this.ax = new AssigningPolarStyleEventArgs();
        return this.ax;
    };
    PolarSeriesRenderManager.prototype.ay = function (a, b, c) {
        this.w(a, b, c);
    };
    PolarSeriesRenderManager.prototype.az = function (a, b, c) {
        this.x(a, b, c);
    };
    PolarSeriesRenderManager.prototype.a0 = function (a, b, c, d) {
        if (b == -1) {
            a.e = false;
            a.z = 0;
            a.y = c - 1;
        }
        else {
            if (d) {
                a.z = b;
                a.y = b;
            }
            else {
                a.e = false;
                a.z = b;
                a.y = b;
            }
        }
    };
    PolarSeriesRenderManager.$t = markType(PolarSeriesRenderManager, 'PolarSeriesRenderManager', SeriesRenderManager.$);
    return PolarSeriesRenderManager;
}(SeriesRenderManager));
export { PolarSeriesRenderManager };
/**
 * @hidden
 */
var PolarBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PolarBaseView, _super);
    function PolarBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.dc = null;
        _this.db = null;
        _this.dd = null;
        _this.de = null;
        _this.dc = a;
        _this.de = new HashPool$2(Base.$, Marker.$);
        _this.cz(_this.de);
        _this.dd = new PolarTrendLineManager();
        return _this;
    }
    PolarBaseView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        this.db = this.da();
        if (!this.t) {
            this.dc.aaj = 1000;
            this.ch.xk = Defaults.e;
        }
    };
    PolarBaseView.prototype.dh = function (a) {
        this.de.g(a);
    };
    PolarBaseView.prototype.da = function () {
        var _this = this;
        var a = new NumericMarkerManager(0, function (b) { return _this.de.item(b); }, function (b) { return _this.dc.y6.c.item(b); }, runOn(this, this.di), runOn(this, this.c9), runOn(this, this.df));
        a.n = true;
        a.p = runOn(this.dc, this.dc.acl);
        return a;
    };
    PolarBaseView.prototype.di = function (a) {
        this.dc.abq(a, this.de);
    };
    PolarBaseView.prototype.c9 = function () {
        return this.dc.yw(this.de, this.ca, this.b9);
    };
    PolarBaseView.prototype.df = function () {
        return this.dc.aab(this.de);
    };
    PolarBaseView.prototype.dg = function (a, b, c, d) {
        if (this.dc.zz) {
            var e = new GeometryGroup();
            this.dc.y4.sp(e, a, b, c, d);
        }
        else {
        }
    };
    PolarBaseView.prototype.dj = function () {
        if (this.dc.aci != null) {
            this.dc.ach = this.dc.aci;
        }
        else {
            this.dc.ach = this.dc.vj;
        }
    };
    PolarBaseView.prototype.cw = function (a) {
        this.de.f(a);
    };
    PolarBaseView.prototype.bi = function (a, b) {
        if (a.d) {
            if (this.dc.zl != 0 && !b) {
                var c = this.dd.g$n;
                c.ad = this.dc.aah;
                c._stroke = this.dc.ach;
                c.aj = this.dc.ack;
                c.ai = this.dc.acj;
                a.v(c);
            }
        }
        _super.prototype.bi.call(this, a, b);
    };
    PolarBaseView.prototype.dk = function () {
        return Rect.empty;
    };
    PolarBaseView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span>" + "${item." + this.dc.aat + "}" + "</span><br/><span";
        var b = this.f.ba.a$u(this.f);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.dc.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.dc.abb + "}</span></div>";
        return a;
    };
    PolarBaseView.$t = markType(PolarBaseView, 'PolarBaseView', MarkerSeriesView.$);
    return PolarBaseView;
}(MarkerSeriesView));
export { PolarBaseView };
