/*
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 { Base, markType, enumGetBox, EnumUtil, Array_$type, runOn, delegateCombine, typeCast, fromEnum, markDep } from "igniteui-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { NotImplementedException } from "igniteui-angular-core";
import { CategoryAngleAxis } from "./CategoryAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { truncate, intDivide, isNaN_ } from "igniteui-angular-core";
import { MarkerSeries } from "./MarkerSeries";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { DependencyProperty } from "igniteui-angular-core";
import { RadialLabelMode_$type } from "igniteui-angular-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { HighlightingInfo } from "igniteui-angular-core";
import { BindingFormatter } from "igniteui-angular-core";
import { OthersCategoryContext } from "./OthersCategoryContext";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { RadialFrame } from "./RadialFrame";
import { RadialSeriesRenderManager } from "./RadialSeriesRenderManager";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { ProportionalRadialLabelContext } from "./ProportionalRadialLabelContext";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { DoubleCollection } from "igniteui-angular-core";
import { RadialAxes } from "./RadialAxes";
import { Visibility_$type } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-angular-core";
import { round10N } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
/**
 * @hidden
 */
var RadialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBucketCalculator, _super);
    function RadialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.c = 0;
        _this.d = 0;
        _this.b = 0;
        _this.a = a;
        return _this;
    }
    RadialBucketCalculator.prototype.getBucket = function (a) {
        throw new NotImplementedException(0);
    };
    RadialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    RadialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    RadialBucketCalculator.prototype.getBucketInfo = function (a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.cw.id;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    RadialBucketCalculator.prototype.e = function (a) {
        var b = this.a.by;
        var c = this.a.bx;
        var d = this.a.getEffectiveViewport();
        var e = this.a.cw.yz;
        if (b.isEmpty || c.isEmpty || e == null || this.a.cw.dn == null || this.a.cw.dn.count == 0) {
            this.b = 0;
            return;
        }
        var f = Math.floor(e.m9(c, d, b));
        var g = Math.ceil(e.m8(c, d, b));
        if (e.ch) {
            g = Math.ceil(e.m9(c, d, b));
            f = Math.floor(e.m8(c, d, b));
        }
        if (g < f) {
            g = e.lj + g;
        }
        var h = this.a.cw.y5;
        var i = h != null ? h.n7 : 0.75;
        var j = Math.min(c.width, c.height) * 0.5 * (i) * 2 * Math.PI;
        var k = Math.floor((g - f + 1) * a / j);
        this.b = truncate(Math.max(1, k));
        this.c = truncate(Math.max(0, Math.floor(f / this.b) - 1));
        this.d = truncate(Math.ceil(g / this.b));
        if (e.cl) {
            this.b = 1;
            this.c = truncate(Math.max(0, Math.floor(f / this.b) - 1));
            this.d = truncate(Math.ceil(g / this.b));
        }
    };
    RadialBucketCalculator.prototype.cacheValues = function () {
    };
    RadialBucketCalculator.prototype.unCacheValues = function () {
    };
    RadialBucketCalculator.$t = markType(RadialBucketCalculator, 'RadialBucketCalculator', Base.$, [IBucketizer_$type]);
    return RadialBucketCalculator;
}(Base));
export { RadialBucketCalculator };
/**
 * @hidden
 */
var RadialBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBase, _super);
    function RadialBase() {
        var _this = _super.call(this) || this;
        _this.zg = null;
        _this.zn = false;
        _this.zm = false;
        _this.zk = null;
        _this.zl = null;
        _this.assigningRadialStyle = null;
        _this.assigningRadialMarkerStyle = null;
        _this.ys = null;
        _this.yw = null;
        _this.yt = null;
        _this.yv = null;
        _this.yu = null;
        _this.y6 = new OthersCategoryContext();
        _this.zc = new RadialFrame(4);
        _this.zd = new RadialFrame(4);
        _this.za = new RadialFrame(4);
        _this.y8 = null;
        _this.y4 = null;
        _this.y4 = new CategoryTransitionSourceFramePreparer();
        _this.zg = new RadialSeriesRenderManager();
        return _this;
    }
    RadialBase.prototype.q1 = function (a) {
        _super.prototype.q1.call(this, a);
        this.y9 = a;
    };
    RadialBase.prototype.aa8 = function () {
        if (this.dc.g) {
            this.dc.t();
        }
    };
    Object.defineProperty(RadialBase.prototype, "categoryAxis", {
        get: function () {
            return this.yz;
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.a0 = function () {
        return this.yz;
    };
    RadialBase.prototype.yn = function (a, b) {
        return null;
    };
    RadialBase.prototype.ps = function (a) {
        if (a == this.y7) {
            if (this.fi) {
                this.ba.a$x(this, a, this.yz.lk - 1);
            }
            return;
        }
        _super.prototype.ps.call(this, a);
    };
    RadialBase.prototype.ee = function (a) {
        if (a == this.y7 && this.yz != null && this.yz.cl && this.yz.hasOthersCategory) {
            return true;
        }
        return _super.prototype.ee.call(this, a);
    };
    RadialBase.prototype.pq = function (a) {
        if (a == this.y7) {
            if (this.fi) {
                this.ba.a$an(this, a, this.dn.count - 1);
            }
            return;
        }
        _super.prototype.pq.call(this, a);
    };
    RadialBase.prototype.eb = function (a, b, c, d, e) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var f = this.yz;
        var g = new ScalerParams(1, this.db.v4, this.ws, f.ch);
        g.c = this.getEffectiveViewport1(this.cv);
        var h = this.y5;
        var i = new ScalerParams(1, this.db.v4, this.ws, h.ch);
        i.c = this.getEffectiveViewport1(this.cv);
        var j = this.z5;
        a.clear();
        this.w6.cj(function (k) {
            if (k._visibility == 0) {
                var l = new SeriesPointOfInterest();
                var m = k.n;
                var n = k.o;
                if (m < _this.ws.left || m > _this.ws.right || n < _this.ws.top || n > _this.ws.bottom) {
                    return;
                }
                var o = null;
                if (k.content != null) {
                    o = k.content.item;
                }
                var p = void 0;
                var q = void 0;
                var r = _this.y8.h(m, n, _this.cv.by, _this.cv.bx, _this.cv.getEffectiveViewport(), p, q);
                p = r.p5;
                q = r.p6;
                l.d = p;
                l.e = q;
                var s = l.e;
                var t = k.ak;
                l.f = _this.aa5(s, o, t, d, j, c, b, false);
                l.b = k.content;
                l.g = _this.vg;
                l.c = k.ak;
                if (_this.g9) {
                    l.g = _this.vn(k.ak);
                }
                l.a = _this.ar(k.ak, k.al);
                a.add(l);
            }
        });
        return true;
    };
    RadialBase.prototype.ks = function (a, b) {
        var c = null;
        if (this.dn != null) {
            if (a >= 0 && a < this.dn.count) {
                c = this.dn.item(a);
            }
            if (this.yz != null && this.yz.cl && a == this.yz.othersIndex) {
                c = this.y7;
            }
        }
        var d = NaN;
        if (c != null) {
            d = this.jc(c);
        }
        var e = this.aa5(d, c, a, this.z4 >= 0 ? this.z4 : 5, this.z5, false, false, b);
        if (e != null) {
            return e;
        }
        return _super.prototype.ks.call(this, a, b);
    };
    RadialBase.prototype.aa5 = function (a, b, c, d, e, f, g, h) {
        var i = null;
        var j = (b == this.y7);
        var k = this.ze;
        if (h) {
            k = this.zf;
        }
        if (k == 0) {
            if (h) {
                k = 5;
            }
            else {
                k = 6;
            }
        }
        if ((h && ((this.yt != null) || (j && this.yu != null))) || (!h && ((this.yw != null) || (j && this.yv != null)))) {
            var l_1 = this.z1(a, b, c, d, f);
            var m_1 = this.z2(a, b, c, e, f);
            var n_1 = this.aam(c);
            var o = ((function () {
                var $ret = new ProportionalRadialLabelContext();
                $ret.value = l_1;
                $ret.percent = m_1;
                $ret.label = n_1;
                $ret.item = b;
                return $ret;
            })());
            var p = null;
            if (j) {
                if (h) {
                    p = this.yu;
                }
                else {
                    p = this.yv;
                }
                if (p == null) {
                    if (h) {
                        p = this.yt;
                    }
                    else {
                        p = this.yw;
                    }
                }
            }
            else {
                if (h) {
                    p = this.yt;
                }
                else {
                    p = this.yw;
                }
            }
            i = p.i(o);
        }
        else if (k != 1) {
            switch (k) {
                case 2:
                    i = this.aan(a, b, c, d, f);
                    break;
                case 3:
                    i = this.aao(a, b, c, e, f);
                    break;
                case 4:
                    {
                        var q = this.aan(a, b, c, d, f);
                        var r = this.aao(a, b, c, e, f);
                        i = q + this.aad + r;
                    }
                    break;
                case 5:
                    i = this.aam(c);
                    break;
                case 6:
                    {
                        var s = this.aan(a, b, c, d, f);
                        var t = this.aam(c);
                        i = t + this.aad + s;
                    }
                    break;
                case 7:
                    {
                        var u = this.aao(a, b, c, e, f);
                        var v = this.aam(c);
                        i = v + this.aad + u;
                    }
                    break;
                case 8:
                    {
                        var w = this.aan(a, b, c, d, f);
                        var x = this.aao(a, b, c, e, f);
                        var y = this.aam(c);
                        i = y + this.aad + w + this.aad + x;
                    }
                    break;
            }
        }
        else {
            if (g) {
                i = this.aan(a, b, c, d, f);
            }
            else {
                i = this.aam(c);
            }
        }
        return i;
    };
    RadialBase.prototype.aam = function (a) {
        var b = this.yz;
        var c = this.au(true);
        if (this.yz != null && this.yz.cl && this.yz.hasOthersCategory && a == this.yz.othersIndex) {
            if (this.ys != null) {
                c = this.ys;
            }
        }
        if (c != null) {
            var d = _super.prototype.ks.call(this, a, false);
            if (d != null) {
                return c.i(d);
            }
            else {
                return null;
            }
        }
        else {
            return b.gf(a);
        }
    };
    RadialBase.prototype.aan = function (a, b, c, d, e) {
        var f = a;
        f = this.z9(c, f);
        if (e) {
            return this.aab(f, d);
        }
        else {
            a = this.jc(b);
            if (!isNaN_(a)) {
                return this.aab(a, d);
            }
            else {
                return this.aab(f, d);
            }
        }
    };
    RadialBase.prototype.z1 = function (a, b, c, d, e) {
        var f = a;
        f = this.z9(c, f);
        if (e) {
            return f;
        }
        else {
            a = this.jc(b);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.aao = function (a, b, c, d, e) {
        if (this.yz == null || !this.yz.cl) {
            return this.aan(a, b, c, d, e);
        }
        var f = this.yz.oa(c);
        if (e) {
            return this.aab(f, d) + "%";
        }
        else {
            a = this.yz.oa(c);
            if (!isNaN_(a)) {
                return this.aab(a, d) + "%";
            }
            else {
                return this.aab(f, d) + "%";
            }
        }
    };
    RadialBase.prototype.z2 = function (a, b, c, d, e) {
        if (this.yz == null || !this.yz.cl) {
            return this.z1(a, b, c, d, e);
        }
        var f = this.yz.oa(c);
        if (e) {
            return f;
        }
        else {
            a = this.yz.oa(c);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.z9 = function (a, b) {
        return b;
    };
    RadialBase.prototype.aab = function (a, b) {
        var c;
        if (b >= 0) {
            c = round10N(a, b);
        }
        else {
            c = a;
        }
        var d = this.au(false);
        if (d != null) {
            var e = d;
            return e.i(c);
        }
        else {
            return c.toString();
        }
    };
    RadialBase.prototype.get_ft = function () {
        return true;
    };
    RadialBase.prototype.get_fe = function () {
        return true;
    };
    RadialBase.prototype.zh = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dn.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    RadialBase.prototype.zy = function () {
        return false;
    };
    RadialBase.prototype.ht = function () {
        var a = _super.prototype.ht.call(this);
        if (this.zy()) {
            var b = ((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(b);
        }
        if (!this.zy()) {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Brush";
                $ret.p = true;
                $ret.y = "ActualBrush";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.r0));
            a.add(c);
        }
        if (!this.zy()) {
            var d = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Outline";
                $ret.p = true;
                $ret.y = "ActualOutline";
                $ret.q = true;
                return $ret;
            })());
            d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.r0));
            a.add(d);
        }
        var e = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "IsTransitionInEnabled";
            $ret.x = true;
            $ret.q = true;
            return $ret;
        })());
        a.add(e);
        var f = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "TransitionInMode";
            $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
            $ret.q = true;
            return $ret;
        })());
        a.add(f);
        return a;
    };
    RadialBase.prototype.kv = function () {
        if (this.d3()) {
            return this.bn.zd;
        }
        else {
            return this.bn.za;
        }
    };
    RadialBase.prototype.zi = function (a, b, c) {
        if (this.dn == null) {
            return null;
        }
        var d = this.y9.cx.c;
        var e = this.y9.cx.d;
        var f = this.y9.cx.b;
        var g = this.zb();
        var h = this.dn.count;
        var i = this.yz;
        var j = -1;
        var k = -1;
        var l = this.j3(b);
        if (isNaN_(b.x) || isNaN_(b.y)) {
            if (a != null && this.dn != null) {
                if (a == this.y7) {
                    l = this.yz.othersIndex;
                }
                else {
                    l = this.dn.indexOf(a);
                }
            }
        }
        j = truncate(Math.floor((intDivide(l, f)))) * f;
        k = j + (f - 1);
        if (c != null && c.g == j && c.f == k) {
            return c;
        }
        var m = new HighlightingInfo();
        m.i = this;
        m.g = j;
        m.f = k;
        return m;
    };
    RadialBase.prototype.zj = function (a, b, c) {
        if (this.dn == null) {
            return null;
        }
        var d = this.y9.cx.c;
        var e = this.y9.cx.d;
        var f = this.y9.cx.b;
        var g = this.zb();
        var h = this.dn.count;
        var i = this.yz;
        var j = -1;
        var k = -1;
        var l = this.j3(b);
        if (isNaN_(b.x) || isNaN_(b.y)) {
            if (a != null && this.dn != null) {
                if (a == this.y7) {
                    l = this.yz.othersIndex;
                }
                else {
                    l = this.dn.indexOf(a);
                }
            }
        }
        j = truncate(Math.floor((intDivide(l, f)))) * f;
        k = j + (f - 1);
        if (c != null && c.g == j && c.f == k) {
            return c;
        }
        var m = new HighlightingInfo();
        m.d = true;
        m.i = this;
        m.g = j;
        m.f = k;
        return m;
    };
    RadialBase.prototype.dg = function (a, b, c) {
        if (this.ed && this.fz(this.bx) && !c) {
            var d = this.zi(a, b, this.zk);
            this.zk = d;
            return d;
        }
        else {
            var e = this.zh(a, b, this.zk);
            this.zk = e;
            return e;
        }
    };
    RadialBase.prototype.dh = function (a, b, c) {
        if (this.fz(this.bx) && !c) {
            var d = this.zj(a, b, this.zl);
            this.zl = d;
            return d;
        }
        else {
            var e = this.zh(a, b, this.zl);
            e.d = true;
            this.zl = e;
            return e;
        }
    };
    RadialBase.prototype.zx = function () {
        return (this.assigningRadialStyle != null && this.zn) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
    };
    RadialBase.prototype.zw = function () {
        return (this.assigningRadialMarkerStyle != null && this.zm) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
    };
    RadialBase.prototype.abb = function (a) {
        if (this.assigningRadialStyle != null && this.zn) {
            this.assigningRadialStyle(this, a);
        }
    };
    RadialBase.prototype.aba = function (a) {
        if (this.assigningRadialMarkerStyle != null && this.zm) {
            this.assigningRadialMarkerStyle(this, a);
        }
    };
    RadialBase.prototype.z6 = function (a) {
        return a.cx.b;
    };
    RadialBase.prototype.z7 = function (a) {
        return a.cx.c;
    };
    RadialBase.prototype.ai = function () {
        return [this.yz, this.y5];
    };
    RadialBase.prototype.sr = function (a, b) {
        this.y9.cx.e(this.id);
        this.rr(false);
    };
    RadialBase.prototype.sq = function (a, b) {
        if (this.g1 && this.jq < 0.05 && (this.db == null || !this.db.fn())) {
            this.g2 = true;
            this.g5 = false;
            this.gk = false;
        }
        this.y9.cx.e(this.id);
        this.rr(false);
    };
    RadialBase.prototype.q9 = function (a, b, c, d) {
        _super.prototype.q9.call(this, a, b, c, d);
        switch (b) {
            case RadialBase.$$p[6]:
                this.rr(false);
                break;
            case RadialBase.$$p[14]:
                this.pe();
                this.rr(false);
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.yz != null) {
                        this.yz.b0(this);
                    }
                    if (this.y5 != null) {
                        this.y5.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.yz != null) {
                        this.yz.ct(this);
                    }
                    if (this.y5 != null) {
                        this.y5.ct(this);
                    }
                }
                this.y9.cx.e(this.id);
                this.rr(false);
                break;
            case RadialBase.$$p[0]:
                if (this.yz != null && this.y5 != null) {
                    this.y8 = new RadialAxes(this.y5, this.yz);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y9.cx.e(this.id);
                this.rr(false);
                break;
            case RadialBase.$$p[22]:
                if (this.yz != null && this.y5 != null) {
                    this.y8 = new RadialAxes(this.y5, this.yz);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y9.cx.e(this.id);
                if (this.y5 == null || !this.y5.c1()) {
                    this.rr(false);
                }
                break;
            case RadialBase.$$p[3]:
            case RadialBase.$$p[4]:
                if (this.aaf != null) {
                    this.ys = new BindingFormatter();
                    this.ys.j = this.aaf;
                    this.ys.d = this.ym;
                }
                else {
                    this.ys = null;
                }
                break;
            case RadialBase.$$p[19]:
            case RadialBase.$$p[20]:
                if (this.aa2 != null) {
                    this.yw = new BindingFormatter();
                    this.yw.j = this.aa2;
                    this.yw.d = this.yr;
                }
                else {
                    this.yw = null;
                }
                break;
            case RadialBase.$$p[12]:
            case RadialBase.$$p[13]:
                if (this.aas != null) {
                    this.yt = new BindingFormatter();
                    this.yt.j = this.aas;
                    this.yt.d = this.yo;
                }
                else {
                    this.yt = null;
                }
                break;
            case RadialBase.$$p[17]:
            case RadialBase.$$p[18]:
                if (this.aa2 != null) {
                    this.yv = new BindingFormatter();
                    this.yv.j = this.aaz;
                    this.yv.d = this.yq;
                }
                else {
                    this.yv = null;
                }
                break;
            case RadialBase.$$p[15]:
            case RadialBase.$$p[16]:
                if (this.aas != null) {
                    this.yu = new BindingFormatter();
                    this.yu.j = this.aaw;
                    this.yu.d = this.yp;
                }
                else {
                    this.yu = null;
                }
                break;
            case "SyncLink":
                if (this.c3 != null && this.db != null) {
                    this.y9.cx.e(this.id);
                    this.rr(false);
                }
                break;
            case "TransitionProgress":
                this.zd.c(this.jq, this.zc, this.za);
                if (this.d5(this.cv)) {
                    return;
                }
                if (this.jq == 1) {
                    this.za.w();
                    this.abc(this.za, this.y9);
                    if (this.g1) {
                        this.g1 = false;
                        this.o6();
                        this.dc.r = truncate(this.i9());
                        this.dc.b = this.dd;
                    }
                    if (this.g4) {
                        this.g4 = false;
                        this.o6();
                        this.dc.r = truncate(this.i9());
                        this.dc.b = this.dd;
                        this.q0();
                    }
                    this.qo();
                }
                else {
                    this.abc(this.zd, this.y9);
                }
                if (this.db != null) {
                    this.db.qo(this);
                }
                break;
            case RadialBase.$$p[8]:
                this.rr(false);
                this.ql();
                break;
            case "VisibilityProxy":
                if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                    this.y9.cx.e(this.id);
                }
                break;
            case RadialBase.$$p[10]:
                this.zn = this.zv();
                this.rr(false);
                break;
            case RadialBase.$$p[9]:
                this.zm = this.zu();
                this.rr(false);
                break;
        }
    };
    RadialBase.prototype.zv = function () {
        return this.zs;
    };
    RadialBase.prototype.zu = function () {
        return this.zr;
    };
    RadialBase.prototype.zp = function (a) {
        if (typeCast(NumericRadiusAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.zo = function (a) {
        if (typeCast(CategoryAngleAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.get_y7 = function () {
        return this.y6;
    };
    Object.defineProperty(RadialBase.prototype, "y7", {
        get: function () {
            return this.get_y7();
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.kn = function (a) {
        var b = this.j3(a);
        var c = false;
        if (this.yz != null && this.yz.cl) {
            var d = this.yz;
            var e = d.hasOthersCategory && b == this.yz.lj - 1;
            c = e;
        }
        if (c) {
            var f = this.yz;
            return this.y7;
        }
        return b >= 0 && this.dn != null && b < this.dn.count ? this.dn.item(b) : null;
    };
    RadialBase.prototype.zz = function (a) {
        var b = this.cv.by;
        var c = this.cv.bx;
        var d = this.cv.getEffectiveViewport();
        if (this.yz != null && !b.isEmpty && !c.isEmpty && this.y8 != null) {
            var e = this.y8.c(a, b, c, d);
            if (e < 0) {
                e += Math.PI * 2;
            }
            if (e > Math.PI * 2) {
                e -= Math.PI * 2;
            }
            return e;
        }
        return NaN;
    };
    RadialBase.prototype.ir = function (a) {
        var b = this.cv.by;
        var c = this.cv.bx;
        var d = this.getEffectiveViewport1(this.cv);
        var e = -1;
        if (this.yz != null && !b.isEmpty && !c.isEmpty && this.y8 != null) {
            var f = this.y8.c(a, b, c, d);
            if (f < 0) {
                f += Math.PI * 2;
            }
            if (f > Math.PI * 2) {
                f -= Math.PI * 2;
            }
            var g = this.yz.getUnscaledAngle(f);
            if (this.yz.categoryMode != 0) {
                g -= 0.5;
            }
            e = g;
        }
        return e;
    };
    RadialBase.prototype.z0 = function (a, b, c, d) {
        return this.yz.m7(a, b, c, d);
    };
    RadialBase.prototype.j3 = function (a) {
        var b = truncate(Math.round(this.ir(a)));
        var c = false;
        if (this.yz != null && this.yz.cl) {
            var d = this.yz;
            var e = d.hasOthersCategory && b == this.yz.lj - 1;
            c = e;
        }
        if (c) {
            var f = this.yz;
            return this.yz.lj - 1;
        }
        if (this.dn != null && b == this.dn.count) {
            b = 0;
        }
        return b;
    };
    RadialBase.prototype.gd = function (a) {
        return false;
    };
    RadialBase.prototype.zb = function () {
        var a = this.za;
        if (this.d3()) {
            if (this.dc.g) {
                this.dc.t();
            }
            a = this.zd;
        }
        return a;
    };
    RadialBase.prototype.qb = function () {
        _super.prototype.qb.call(this);
        if (this.yz != null) {
            this.yz.ib(false);
        }
        if (this.y5 != null) {
            this.y5.ib(false);
        }
    };
    RadialBase.prototype.he = function (a, b, c) {
        var d = true;
        var e = c;
        if (!_super.prototype.he.call(this, a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yz == null || this.yz.itemsSource == null || this.y5 == null || this.y8 == null || this.dn == null || this.yz.bi == null || this.y5.bi == null || this.y5.l4 == this.y5.l3) {
            e.cx.b = 0;
            d = false;
        }
        return d;
    };
    RadialBase.prototype.y2 = function () {
        return 1;
    };
    RadialBase.prototype.z3 = function () {
        return Math.max(0, 0.5 * this.y5.n6);
    };
    RadialBase.prototype.gn = function () {
        return this.zt;
    };
    RadialBase.prototype.go = function () {
        return true;
    };
    RadialBase.prototype.rs = function (a) {
        _super.prototype.rs.call(this, a);
        this.y9.cx.e(this.id);
        if (this.d5(this.cv)) {
            this.za.z();
            this.zd.z();
            this.zc.z();
            return;
        }
        if (this.gr) {
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                this.abc(this.zd, this.y9);
            }
            else {
                this.abc(this.za, this.y9);
            }
            return;
        }
        if (this.gf(a)) {
            var b = this.zc;
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                this.zc = this.zd;
                this.zd = b;
            }
            else {
                this.zc = this.za;
                this.za = b;
            }
            var c = false;
            this.aa9(this.za, this.y9);
            if (this.g3) {
                this.dc.w();
                this.dc.r = truncate(this.ja());
                this.dc.b = this.de != null ? this.de : this.dd;
                if (this.g4) {
                    var d = this.zd;
                    this.zd = this.zc;
                    this.zc = d;
                    c = true;
                }
                this.y4.s(this, this.zc, this.za, this.isVertical, this.yz, this.y5, this.y3, this.y2(), this.c5, this.c4(), runOn(this, this.z3), this.y9.bx);
                if (this.g4) {
                    var e = this.zd;
                    this.zd = this.zc;
                    this.zc = e;
                }
                this.g4 = false;
            }
            if (this.g6) {
                this.dc.w();
                this.dc.r = truncate(this.jb());
                this.dc.b = this.df != null ? this.df : this.dd;
                if (this.g1) {
                    var f = this.zd;
                    this.zd = this.zc;
                    this.zc = f;
                    c = true;
                }
                this.y4.s(this, this.zc, this.za, this.isVertical, this.yz, this.y5, this.y3, this.y2(), this.c5, this.c4(), runOn(this, this.z3), this.y9.bx);
                var g = this.za;
                this.za = this.zc;
                this.zc = g;
                if (this.g1) {
                    var h = this.zd;
                    this.zd = this.zc;
                    this.zc = h;
                }
                this.g1 = false;
            }
            this.d9 = false;
            if (!c) {
                this.o1();
            }
            this.r7();
            if (this.g3) {
                this.g2 = false;
                this.g1 = true;
            }
            if (this.g6) {
                this.g5 = false;
                this.g4 = true;
            }
        }
        else {
            this.aa9(this.za, this.y9);
            this.abc(this.za, this.y9);
        }
    };
    RadialBase.prototype.z8 = function () {
        var e_1, _a;
        if (this.bn != null) {
            var a = this.bn;
            return a.z8();
        }
        var b = 0;
        try {
            for (var _b = __values(fromEnum(this.db.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                if (c == this || this.bn == c) {
                    return b;
                }
                var d = typeCast(RadialBase.$, c);
                if (d != null && d.yz == this.yz && d.preferredCategoryMode(d.yz) == 2) {
                    b++;
                }
            }
        }
        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;
            }
        }
        return -1;
    };
    RadialBase.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.p4(a, c, b);
        return c.toArray();
    };
    RadialBase.prototype.p4 = function (a, b, c) {
        var _this = this;
        var d = this.cv.by;
        var e = this.cv.bx;
        var f = this.cv.getEffectiveViewport();
        var g, h;
        var i = this.y8.f(a, d, e, f, g, h);
        g = i.p4;
        h = i.p5;
        if (g == -1 || h == -1) {
            return;
        }
        var j = h - g + 1;
        if (g > h) {
            j = this.yz.lk - g + h + 1;
        }
        if (j > 0 && (c == 7 || c == 6)) {
            b.add(((function () {
                var $ret = new ChartSelection();
                $ret.series = _this;
                return $ret;
            })()));
            return;
        }
        var _loop_1 = function (k) {
            var l = (k + g) % (this_1.yz.lk);
            if (c == 2 || c == 1) {
                b.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = _this.yz.kv.item(l);
                    return $ret;
                })()));
            }
            else {
                b.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = _this.yz.kv.item(l);
                    $ret.series = _this;
                    return $ret;
                })()));
            }
        };
        var this_1 = this;
        for (var k = 0; k < j; k++) {
            _loop_1(k);
        }
    };
    RadialBase.$t = markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = markDep(DependencyProperty, PropertyMetadata, RadialBase, 'raisePropertyChanged', ['AngleAxis:yz:abd', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:z4:abe', [1, -1], 'AutoCalloutLabelValueSeparator:aad:abf', [2, " - "], 'AutoCalloutOthersLabelFormat:aaf:abg', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:ym:abh', [Array_$type, null], 'AutoCalloutPercentagePrecision:z5:abi', [1, 2], 'AutoCalloutRadialLabelMode:ze:abj', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'CategoryCollisionMode:y0:abk', [CategoryCollisionMode_$type, enumGetBox(CategoryCollisionMode_$type, 1)], 'ClipSeriesToBounds:zq:abl', [0, false], 'IsCustomRadialMarkerStyleAllowed:zr:abm', [0, false], 'IsCustomRadialStyleAllowed:zs:abn', [0, false], 'IsTransitionInEnabled:zt:abo', [0, false], 'LegendProportionalRadialLabelFormat:aas:abp', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:yo:abq', [Array_$type, null], 'LegendRadialLabelMode:zf:abr', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aaw:abs', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yp:abt', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aaz:abu', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:yq:abv', [Array_$type, null], 'ProportionalRadialLabelFormat:aa2:abw', [2, null], 'ProportionalRadialLabelFormatSpecifiers:yr:abx', [Array_$type, null], 'TransitionInMode:y3:aby', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:y5:abz', [NumericRadiusAxis.$, null]]);
    return RadialBase;
}(MarkerSeries));
export { RadialBase };
/**
 * @hidden
 */
var RadialBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(RadialBaseView, _super);
    function RadialBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.cx = null;
        _this.cw = null;
        _this.cy = null;
        _this.cz = 0;
        _this.c0 = null;
        _this.cw = a;
        _this.cy = new Pool$1(Marker.$);
        _this.cn(_this.cy);
        return _this;
    }
    RadialBaseView.prototype.cj = function (a) {
        this.cy.c(a);
    };
    RadialBaseView.$t = markType(RadialBaseView, 'RadialBaseView', MarkerSeriesView.$);
    return RadialBaseView;
}(MarkerSeriesView));
export { RadialBaseView };
