/*
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-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { NotImplementedException } from "igniteui-react-core";
import { CategoryAngleAxis } from "./CategoryAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { truncate, intDivide, isNaN_ } from "igniteui-react-core";
import { MarkerSeries } from "./MarkerSeries";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { DependencyProperty } from "igniteui-react-core";
import { RadialLabelMode_$type } from "igniteui-react-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { HighlightingInfo } from "igniteui-react-core";
import { BindingFormatter } from "igniteui-react-core";
import { OthersCategoryContext } from "./OthersCategoryContext";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { RadialFrame } from "./RadialFrame";
import { RadialSeriesRenderManager } from "./RadialSeriesRenderManager";
import { List$1 } from "igniteui-react-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-react-core";
import { RadialAxes } from "./RadialAxes";
import { Visibility_$type } from "igniteui-react-core";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-react-core";
import { round10N } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-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.yx;
        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.y3;
        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.ze = null;
        _this.zl = false;
        _this.zk = false;
        _this.zi = null;
        _this.zj = null;
        _this.assigningRadialStyle = null;
        _this.assigningRadialMarkerStyle = null;
        _this.yq = null;
        _this.yu = null;
        _this.yr = null;
        _this.yt = null;
        _this.ys = null;
        _this.y4 = new OthersCategoryContext();
        _this.za = new RadialFrame(4);
        _this.zb = new RadialFrame(4);
        _this.y8 = new RadialFrame(4);
        _this.y6 = null;
        _this.y2 = null;
        _this.y2 = new CategoryTransitionSourceFramePreparer();
        _this.ze = new RadialSeriesRenderManager();
        return _this;
    }
    RadialBase.prototype.qz = function (a) {
        _super.prototype.qz.call(this, a);
        this.y7 = a;
    };
    RadialBase.prototype.aa6 = function () {
        if (this.dc.g) {
            this.dc.t();
        }
    };
    Object.defineProperty(RadialBase.prototype, "categoryAxis", {
        get: function () {
            return this.yx;
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.a0 = function () {
        return this.yx;
    };
    RadialBase.prototype.yl = function (a, b) {
        return null;
    };
    RadialBase.prototype.pr = function (a) {
        if (a == this.y5) {
            if (this.fi) {
                this.ba.a$x(this, a, this.yx.lk - 1);
            }
            return;
        }
        _super.prototype.pr.call(this, a);
    };
    RadialBase.prototype.ee = function (a) {
        if (a == this.y5 && this.yx != null && this.yx.cl && this.yx.hasOthersCategory) {
            return true;
        }
        return _super.prototype.ee.call(this, a);
    };
    RadialBase.prototype.pp = function (a) {
        if (a == this.y5) {
            if (this.fi) {
                this.ba.a$an(this, a, this.dn.count - 1);
            }
            return;
        }
        _super.prototype.pp.call(this, a);
    };
    RadialBase.prototype.eb = function (a, b, c, d, e) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var f = this.yx;
        var g = new ScalerParams(1, this.db.v4, this.wq, f.ch);
        g.c = this.getEffectiveViewport1(this.cv);
        var h = this.y3;
        var i = new ScalerParams(1, this.db.v4, this.wq, h.ch);
        i.c = this.getEffectiveViewport1(this.cv);
        var j = this.z3;
        a.clear();
        this.w4.cj(function (k) {
            if (k._visibility == 0) {
                var l = new SeriesPointOfInterest();
                var m = k.n;
                var n = k.o;
                if (m < _this.wq.left || m > _this.wq.right || n < _this.wq.top || n > _this.wq.bottom) {
                    return;
                }
                var o = null;
                if (k.content != null) {
                    o = k.content.item;
                }
                var p = void 0;
                var q = void 0;
                var r = _this.y6.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.aa3(s, o, t, d, j, c, b, false);
                l.b = k.content;
                l.g = _this.ve;
                l.c = k.ak;
                if (_this.g9) {
                    l.g = _this.vl(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.yx != null && this.yx.cl && a == this.yx.othersIndex) {
                c = this.y5;
            }
        }
        var d = NaN;
        if (c != null) {
            d = this.jc(c);
        }
        var e = this.aa3(d, c, a, this.z2 >= 0 ? this.z2 : 5, this.z3, false, false, b);
        if (e != null) {
            return e;
        }
        return _super.prototype.ks.call(this, a, b);
    };
    RadialBase.prototype.aa3 = function (a, b, c, d, e, f, g, h) {
        var i = null;
        var j = (b == this.y5);
        var k = this.zc;
        if (h) {
            k = this.zd;
        }
        if (k == 0) {
            if (h) {
                k = 5;
            }
            else {
                k = 6;
            }
        }
        if ((h && ((this.yr != null) || (j && this.ys != null))) || (!h && ((this.yu != null) || (j && this.yt != null)))) {
            var l_1 = this.zz(a, b, c, d, f);
            var m_1 = this.z0(a, b, c, e, f);
            var n_1 = this.aak(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.ys;
                }
                else {
                    p = this.yt;
                }
                if (p == null) {
                    if (h) {
                        p = this.yr;
                    }
                    else {
                        p = this.yu;
                    }
                }
            }
            else {
                if (h) {
                    p = this.yr;
                }
                else {
                    p = this.yu;
                }
            }
            i = p.i(o);
        }
        else if (k != 1) {
            switch (k) {
                case 2:
                    i = this.aal(a, b, c, d, f);
                    break;
                case 3:
                    i = this.aam(a, b, c, e, f);
                    break;
                case 4:
                    {
                        var q = this.aal(a, b, c, d, f);
                        var r = this.aam(a, b, c, e, f);
                        i = q + this.aab + r;
                    }
                    break;
                case 5:
                    i = this.aak(c);
                    break;
                case 6:
                    {
                        var s = this.aal(a, b, c, d, f);
                        var t = this.aak(c);
                        i = t + this.aab + s;
                    }
                    break;
                case 7:
                    {
                        var u = this.aam(a, b, c, e, f);
                        var v = this.aak(c);
                        i = v + this.aab + u;
                    }
                    break;
                case 8:
                    {
                        var w = this.aal(a, b, c, d, f);
                        var x = this.aam(a, b, c, e, f);
                        var y = this.aak(c);
                        i = y + this.aab + w + this.aab + x;
                    }
                    break;
            }
        }
        else {
            if (g) {
                i = this.aal(a, b, c, d, f);
            }
            else {
                i = this.aak(c);
            }
        }
        return i;
    };
    RadialBase.prototype.aak = function (a) {
        var b = this.yx;
        var c = this.au(true);
        if (this.yx != null && this.yx.cl && this.yx.hasOthersCategory && a == this.yx.othersIndex) {
            if (this.yq != null) {
                c = this.yq;
            }
        }
        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.aal = function (a, b, c, d, e) {
        var f = a;
        f = this.z7(c, f);
        if (e) {
            return this.z9(f, d);
        }
        else {
            a = this.jc(b);
            if (!isNaN_(a)) {
                return this.z9(a, d);
            }
            else {
                return this.z9(f, d);
            }
        }
    };
    RadialBase.prototype.zz = function (a, b, c, d, e) {
        var f = a;
        f = this.z7(c, f);
        if (e) {
            return f;
        }
        else {
            a = this.jc(b);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.aam = function (a, b, c, d, e) {
        if (this.yx == null || !this.yx.cl) {
            return this.aal(a, b, c, d, e);
        }
        var f = this.yx.oa(c);
        if (e) {
            return this.z9(f, d) + "%";
        }
        else {
            a = this.yx.oa(c);
            if (!isNaN_(a)) {
                return this.z9(a, d) + "%";
            }
            else {
                return this.z9(f, d) + "%";
            }
        }
    };
    RadialBase.prototype.z0 = function (a, b, c, d, e) {
        if (this.yx == null || !this.yx.cl) {
            return this.zz(a, b, c, d, e);
        }
        var f = this.yx.oa(c);
        if (e) {
            return f;
        }
        else {
            a = this.yx.oa(c);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.z7 = function (a, b) {
        return b;
    };
    RadialBase.prototype.z9 = 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.zf = 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.zw = function () {
        return false;
    };
    RadialBase.prototype.ht = function () {
        var a = _super.prototype.ht.call(this);
        if (this.zw()) {
            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.zw()) {
            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.ry));
            a.add(c);
        }
        if (!this.zw()) {
            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.ry));
            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.zb;
        }
        else {
            return this.bn.y8;
        }
    };
    RadialBase.prototype.zg = function (a, b, c) {
        if (this.dn == null) {
            return null;
        }
        var d = this.y7.cx.c;
        var e = this.y7.cx.d;
        var f = this.y7.cx.b;
        var g = this.y9();
        var h = this.dn.count;
        var i = this.yx;
        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.y5) {
                    l = this.yx.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.zh = function (a, b, c) {
        if (this.dn == null) {
            return null;
        }
        var d = this.y7.cx.c;
        var e = this.y7.cx.d;
        var f = this.y7.cx.b;
        var g = this.y9();
        var h = this.dn.count;
        var i = this.yx;
        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.y5) {
                    l = this.yx.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.zg(a, b, this.zi);
            this.zi = d;
            return d;
        }
        else {
            var e = this.zf(a, b, this.zi);
            this.zi = e;
            return e;
        }
    };
    RadialBase.prototype.dh = function (a, b, c) {
        if (this.fz(this.bx) && !c) {
            var d = this.zh(a, b, this.zj);
            this.zj = d;
            return d;
        }
        else {
            var e = this.zf(a, b, this.zj);
            e.d = true;
            this.zj = e;
            return e;
        }
    };
    RadialBase.prototype.zv = function () {
        return (this.assigningRadialStyle != null && this.zl) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
    };
    RadialBase.prototype.zu = function () {
        return (this.assigningRadialMarkerStyle != null && this.zk) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
    };
    RadialBase.prototype.aa9 = function (a) {
        if (this.assigningRadialStyle != null && this.zl) {
            this.assigningRadialStyle(this, a);
        }
    };
    RadialBase.prototype.aa8 = function (a) {
        if (this.assigningRadialMarkerStyle != null && this.zk) {
            this.assigningRadialMarkerStyle(this, a);
        }
    };
    RadialBase.prototype.z4 = function (a) {
        return a.cx.b;
    };
    RadialBase.prototype.z5 = function (a) {
        return a.cx.c;
    };
    RadialBase.prototype.ai = function () {
        return [this.yx, this.y3];
    };
    RadialBase.prototype.sp = function (a, b) {
        this.y7.cx.e(this.id);
        this.rp(false);
    };
    RadialBase.prototype.so = 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.y7.cx.e(this.id);
        this.rp(false);
    };
    RadialBase.prototype.q7 = function (a, b, c, d) {
        _super.prototype.q7.call(this, a, b, c, d);
        switch (b) {
            case RadialBase.$$p[6]:
                this.rp(false);
                break;
            case RadialBase.$$p[14]:
                this.pe();
                this.rp(false);
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.yx != null) {
                        this.yx.b0(this);
                    }
                    if (this.y3 != null) {
                        this.y3.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.yx != null) {
                        this.yx.ct(this);
                    }
                    if (this.y3 != null) {
                        this.y3.ct(this);
                    }
                }
                this.y7.cx.e(this.id);
                this.rp(false);
                break;
            case RadialBase.$$p[0]:
                if (this.yx != null && this.y3 != null) {
                    this.y6 = new RadialAxes(this.y3, this.yx);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y7.cx.e(this.id);
                this.rp(false);
                break;
            case RadialBase.$$p[22]:
                if (this.yx != null && this.y3 != null) {
                    this.y6 = new RadialAxes(this.y3, this.yx);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y7.cx.e(this.id);
                if (this.y3 == null || !this.y3.c1()) {
                    this.rp(false);
                }
                break;
            case RadialBase.$$p[3]:
            case RadialBase.$$p[4]:
                if (this.aad != null) {
                    this.yq = new BindingFormatter();
                    this.yq.j = this.aad;
                    this.yq.d = this.yk;
                }
                else {
                    this.yq = null;
                }
                break;
            case RadialBase.$$p[19]:
            case RadialBase.$$p[20]:
                if (this.aa0 != null) {
                    this.yu = new BindingFormatter();
                    this.yu.j = this.aa0;
                    this.yu.d = this.yp;
                }
                else {
                    this.yu = null;
                }
                break;
            case RadialBase.$$p[12]:
            case RadialBase.$$p[13]:
                if (this.aaq != null) {
                    this.yr = new BindingFormatter();
                    this.yr.j = this.aaq;
                    this.yr.d = this.ym;
                }
                else {
                    this.yr = null;
                }
                break;
            case RadialBase.$$p[17]:
            case RadialBase.$$p[18]:
                if (this.aa0 != null) {
                    this.yt = new BindingFormatter();
                    this.yt.j = this.aax;
                    this.yt.d = this.yo;
                }
                else {
                    this.yt = null;
                }
                break;
            case RadialBase.$$p[15]:
            case RadialBase.$$p[16]:
                if (this.aaq != null) {
                    this.ys = new BindingFormatter();
                    this.ys.j = this.aau;
                    this.ys.d = this.yn;
                }
                else {
                    this.ys = null;
                }
                break;
            case "SyncLink":
                if (this.c3 != null && this.db != null) {
                    this.y7.cx.e(this.id);
                    this.rp(false);
                }
                break;
            case "TransitionProgress":
                this.zb.c(this.jq, this.za, this.y8);
                if (this.d5(this.cv)) {
                    return;
                }
                if (this.jq == 1) {
                    this.y8.w();
                    this.aba(this.y8, this.y7);
                    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.qy();
                    }
                    this.qm();
                }
                else {
                    this.aba(this.zb, this.y7);
                }
                if (this.db != null) {
                    this.db.qo(this);
                }
                break;
            case RadialBase.$$p[8]:
                this.rp(false);
                this.qj();
                break;
            case "VisibilityProxy":
                if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                    this.y7.cx.e(this.id);
                }
                break;
            case RadialBase.$$p[10]:
                this.zl = this.zt();
                this.rp(false);
                break;
            case RadialBase.$$p[9]:
                this.zk = this.zs();
                this.rp(false);
                break;
        }
    };
    RadialBase.prototype.zt = function () {
        return this.zq;
    };
    RadialBase.prototype.zs = function () {
        return this.zp;
    };
    RadialBase.prototype.zn = function (a) {
        if (typeCast(NumericRadiusAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.zm = function (a) {
        if (typeCast(CategoryAngleAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.get_y5 = function () {
        return this.y4;
    };
    Object.defineProperty(RadialBase.prototype, "y5", {
        get: function () {
            return this.get_y5();
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.kn = function (a) {
        var b = this.j3(a);
        var c = false;
        if (this.yx != null && this.yx.cl) {
            var d = this.yx;
            var e = d.hasOthersCategory && b == this.yx.lj - 1;
            c = e;
        }
        if (c) {
            var f = this.yx;
            return this.y5;
        }
        return b >= 0 && this.dn != null && b < this.dn.count ? this.dn.item(b) : null;
    };
    RadialBase.prototype.zx = function (a) {
        var b = this.cv.by;
        var c = this.cv.bx;
        var d = this.cv.getEffectiveViewport();
        if (this.yx != null && !b.isEmpty && !c.isEmpty && this.y6 != null) {
            var e = this.y6.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.yx != null && !b.isEmpty && !c.isEmpty && this.y6 != null) {
            var f = this.y6.c(a, b, c, d);
            if (f < 0) {
                f += Math.PI * 2;
            }
            if (f > Math.PI * 2) {
                f -= Math.PI * 2;
            }
            var g = this.yx.getUnscaledAngle(f);
            if (this.yx.categoryMode != 0) {
                g -= 0.5;
            }
            e = g;
        }
        return e;
    };
    RadialBase.prototype.zy = function (a, b, c, d) {
        return this.yx.m7(a, b, c, d);
    };
    RadialBase.prototype.j3 = function (a) {
        var b = truncate(Math.round(this.ir(a)));
        var c = false;
        if (this.yx != null && this.yx.cl) {
            var d = this.yx;
            var e = d.hasOthersCategory && b == this.yx.lj - 1;
            c = e;
        }
        if (c) {
            var f = this.yx;
            return this.yx.lj - 1;
        }
        if (this.dn != null && b == this.dn.count) {
            b = 0;
        }
        return b;
    };
    RadialBase.prototype.gd = function (a) {
        return false;
    };
    RadialBase.prototype.y9 = function () {
        var a = this.y8;
        if (this.d3()) {
            if (this.dc.g) {
                this.dc.t();
            }
            a = this.zb;
        }
        return a;
    };
    RadialBase.prototype.p9 = function () {
        _super.prototype.p9.call(this);
        if (this.yx != null) {
            this.yx.ib(false);
        }
        if (this.y3 != null) {
            this.y3.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.yx == null || this.yx.itemsSource == null || this.y3 == null || this.y6 == null || this.dn == null || this.yx.bi == null || this.y3.bi == null || this.y3.l4 == this.y3.l3) {
            e.cx.b = 0;
            d = false;
        }
        return d;
    };
    RadialBase.prototype.y0 = function () {
        return 1;
    };
    RadialBase.prototype.z1 = function () {
        return Math.max(0, 0.5 * this.y3.n6);
    };
    RadialBase.prototype.gn = function () {
        return this.zr;
    };
    RadialBase.prototype.go = function () {
        return true;
    };
    RadialBase.prototype.rq = function (a) {
        _super.prototype.rq.call(this, a);
        this.y7.cx.e(this.id);
        if (this.d5(this.cv)) {
            this.y8.z();
            this.zb.z();
            this.za.z();
            return;
        }
        if (this.gr) {
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                this.aba(this.zb, this.y7);
            }
            else {
                this.aba(this.y8, this.y7);
            }
            return;
        }
        if (this.gf(a)) {
            var b = this.za;
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                this.za = this.zb;
                this.zb = b;
            }
            else {
                this.za = this.y8;
                this.y8 = b;
            }
            var c = false;
            this.aa7(this.y8, this.y7);
            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.zb;
                    this.zb = this.za;
                    this.za = d;
                    c = true;
                }
                this.y2.s(this, this.za, this.y8, this.isVertical, this.yx, this.y3, this.y1, this.y0(), this.c5, this.c4(), runOn(this, this.z1), this.y7.bx);
                if (this.g4) {
                    var e = this.zb;
                    this.zb = this.za;
                    this.za = 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.zb;
                    this.zb = this.za;
                    this.za = f;
                    c = true;
                }
                this.y2.s(this, this.za, this.y8, this.isVertical, this.yx, this.y3, this.y1, this.y0(), this.c5, this.c4(), runOn(this, this.z1), this.y7.bx);
                var g = this.y8;
                this.y8 = this.za;
                this.za = g;
                if (this.g1) {
                    var h = this.zb;
                    this.zb = this.za;
                    this.za = h;
                }
                this.g1 = false;
            }
            this.d9 = false;
            if (!c) {
                this.o1();
            }
            this.r5();
            if (this.g3) {
                this.g2 = false;
                this.g1 = true;
            }
            if (this.g6) {
                this.g5 = false;
                this.g4 = true;
            }
        }
        else {
            this.aa7(this.y8, this.y7);
            this.aba(this.y8, this.y7);
        }
    };
    RadialBase.prototype.z6 = function () {
        var e_1, _a;
        if (this.bn != null) {
            var a = this.bn;
            return a.z6();
        }
        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.yx == this.yx && d.preferredCategoryMode(d.yx) == 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.p2(a, c, b);
        return c.toArray();
    };
    RadialBase.prototype.p2 = 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.y6.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.yx.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.yx.lk);
            if (c == 2 || c == 1) {
                b.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = _this.yx.kv.item(l);
                    return $ret;
                })()));
            }
            else {
                b.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = _this.yx.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:yx:abb', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:z2:abc', [1, -1], 'AutoCalloutLabelValueSeparator:aab:abd', [2, " - "], 'AutoCalloutOthersLabelFormat:aad:abe', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:yk:abf', [Array_$type, null], 'AutoCalloutPercentagePrecision:z3:abg', [1, 2], 'AutoCalloutRadialLabelMode:zc:abh', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'CategoryCollisionMode:yy:abi', [CategoryCollisionMode_$type, enumGetBox(CategoryCollisionMode_$type, 1)], 'ClipSeriesToBounds:zo:abj', [0, false], 'IsCustomRadialMarkerStyleAllowed:zp:abk', [0, false], 'IsCustomRadialStyleAllowed:zq:abl', [0, false], 'IsTransitionInEnabled:zr:abm', [0, false], 'LegendProportionalRadialLabelFormat:aaq:abn', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:ym:abo', [Array_$type, null], 'LegendRadialLabelMode:zd:abp', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aau:abq', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yn:abr', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aax:abs', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:yo:abt', [Array_$type, null], 'ProportionalRadialLabelFormat:aa0:abu', [2, null], 'ProportionalRadialLabelFormatSpecifiers:yp:abv', [Array_$type, null], 'TransitionInMode:y1:abw', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:y3:abx', [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 };
