/*
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 { 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 { 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 { 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.ib;
        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.yr;
        if (b.isEmpty || c.isEmpty || e == null || this.a.cw.dl == null || this.a.cw.dl.count == 0) {
            this.b = 0;
            return;
        }
        var f = Math.floor(e.m6(c, d, b));
        var g = Math.ceil(e.m5(c, d, b));
        if (e.ch) {
            g = Math.ceil(e.m6(c, d, b));
            f = Math.floor(e.m5(c, d, b));
        }
        if (g < f) {
            g = e.lg + g;
        }
        var h = this.a.cw.yw;
        var i = h != null ? h.np : 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.y7 = null;
        _this.ze = false;
        _this.zd = false;
        _this.zb = null;
        _this.zc = null;
        _this.assigningRadialStyle = null;
        _this.assigningRadialMarkerStyle = null;
        _this.yk = null;
        _this.yo = null;
        _this.yl = null;
        _this.yn = null;
        _this.ym = null;
        _this.yx = new OthersCategoryContext();
        _this.y3 = new RadialFrame(4);
        _this.y4 = new RadialFrame(4);
        _this.y1 = new RadialFrame(4);
        _this.yz = null;
        _this.yv = null;
        _this.yv = new CategoryTransitionSourceFramePreparer();
        _this.y7 = new RadialSeriesRenderManager();
        return _this;
    }
    RadialBase.prototype.qx = function (a) {
        _super.prototype.qx.call(this, a);
        this.y0 = a;
    };
    RadialBase.prototype.aay = function () {
        if (this.da.g) {
            this.da.t();
        }
    };
    Object.defineProperty(RadialBase.prototype, "categoryAxis", {
        get: function () {
            return this.yr;
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.az = function () {
        return this.yr;
    };
    RadialBase.prototype.yf = function (a, b) {
        return null;
    };
    RadialBase.prototype.pp = function (a) {
        if (a == this.yy) {
            if (this.fg) {
                this.a9.a$x(this, a, this.yr.lh - 1);
            }
            return;
        }
        _super.prototype.pp.call(this, a);
    };
    RadialBase.prototype.ec = function (a) {
        if (a == this.yy && this.yr != null && this.yr.cl && this.yr.hasOthersCategory) {
            return true;
        }
        return _super.prototype.ec.call(this, a);
    };
    RadialBase.prototype.pn = function (a) {
        if (a == this.yy) {
            if (this.fg) {
                this.a9.a$an(this, a, this.dl.count - 1);
            }
            return;
        }
        _super.prototype.pn.call(this, a);
    };
    RadialBase.prototype.d9 = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.yr;
        var f = new ScalerParams(1, this.c9.vl, this.wl, e.ch);
        f.c = this.getEffectiveViewport1(this.ct);
        var g = this.yw;
        var h = new ScalerParams(1, this.c9.vl, this.wl, g.ch);
        h.c = this.getEffectiveViewport1(this.ct);
        var i = this.zw;
        a.clear();
        this.wy.cj(function (j) {
            if (j._visibility == 0) {
                var k = new SeriesPointOfInterest();
                var l = j.n;
                var m = j.o;
                if (l < _this.wl.left || l > _this.wl.right || m < _this.wl.top || m > _this.wl.bottom) {
                    return;
                }
                var n = null;
                if (j.content != null) {
                    n = j.content.item;
                }
                var o = void 0;
                var p = void 0;
                var q = _this.yz.g(l, m, _this.ct.by, _this.ct.bx, _this.ct.getEffectiveViewport(), o, p);
                o = q.p5;
                p = q.p6;
                k.d = o;
                k.e = p;
                var r = k.e;
                var s = j.ak;
                k.f = _this.aav(r, n, s, d, i, c, b, false);
                k.b = j.content;
                k.g = _this.va;
                k.c = j.ak;
                if (_this.g7) {
                    k.g = _this.vh(j.ak);
                }
                k.a = _this.aq(j.ak, j.al);
                a.add(k);
            }
        });
        return true;
    };
    RadialBase.prototype.kq = function (a, b) {
        var c = null;
        if (this.dl != null) {
            if (a >= 0 && a < this.dl.count) {
                c = this.dl.item(a);
            }
            if (this.yr != null && this.yr.cl && a == this.yr.othersIndex) {
                c = this.yy;
            }
        }
        var d = NaN;
        if (c != null) {
            d = this.ja(c);
        }
        var e = this.aav(d, c, a, this.zv >= 0 ? this.zv : 5, this.zw, false, false, b);
        if (e != null) {
            return e;
        }
        return _super.prototype.kq.call(this, a, b);
    };
    RadialBase.prototype.aav = function (a, b, c, d, e, f, g, h) {
        var i = null;
        var j = (b == this.yy);
        var k = this.y5;
        if (h) {
            k = this.y6;
        }
        if (k == 0) {
            if (h) {
                k = 5;
            }
            else {
                k = 6;
            }
        }
        if ((h && ((this.yl != null) || (j && this.ym != null))) || (!h && ((this.yo != null) || (j && this.yn != null)))) {
            var l_1 = this.zs(a, b, c, d, f);
            var m_1 = this.zt(a, b, c, e, f);
            var n_1 = this.aac(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.ym;
                }
                else {
                    p = this.yn;
                }
                if (p == null) {
                    if (h) {
                        p = this.yl;
                    }
                    else {
                        p = this.yo;
                    }
                }
            }
            else {
                if (h) {
                    p = this.yl;
                }
                else {
                    p = this.yo;
                }
            }
            i = p.i(o);
        }
        else if (k != 1) {
            switch (k) {
                case 2:
                    i = this.aad(a, b, c, d, f);
                    break;
                case 3:
                    i = this.aae(a, b, c, e, f);
                    break;
                case 4:
                    {
                        var q = this.aad(a, b, c, d, f);
                        var r = this.aae(a, b, c, e, f);
                        i = q + this.z4 + r;
                    }
                    break;
                case 5:
                    i = this.aac(c);
                    break;
                case 6:
                    {
                        var s = this.aad(a, b, c, d, f);
                        var t = this.aac(c);
                        i = t + this.z4 + s;
                    }
                    break;
                case 7:
                    {
                        var u = this.aae(a, b, c, e, f);
                        var v = this.aac(c);
                        i = v + this.z4 + u;
                    }
                    break;
                case 8:
                    {
                        var w = this.aad(a, b, c, d, f);
                        var x = this.aae(a, b, c, e, f);
                        var y = this.aac(c);
                        i = y + this.z4 + w + this.z4 + x;
                    }
                    break;
            }
        }
        else {
            if (g) {
                i = this.aad(a, b, c, d, f);
            }
            else {
                i = this.aac(c);
            }
        }
        return i;
    };
    RadialBase.prototype.aac = function (a) {
        var b = this.yr;
        var c = this.at(true);
        if (this.yr != null && this.yr.cl && this.yr.hasOthersCategory && a == this.yr.othersIndex) {
            if (this.yk != null) {
                c = this.yk;
            }
        }
        if (c != null) {
            var d = _super.prototype.kq.call(this, a, false);
            if (d != null) {
                return c.i(d);
            }
            else {
                return null;
            }
        }
        else {
            return b.ge(a);
        }
    };
    RadialBase.prototype.aad = function (a, b, c, d, e) {
        var f = a;
        f = this.z0(c, f);
        if (e) {
            return this.z2(f, d);
        }
        else {
            a = this.ja(b);
            if (!isNaN_(a)) {
                return this.z2(a, d);
            }
            else {
                return this.z2(f, d);
            }
        }
    };
    RadialBase.prototype.zs = function (a, b, c, d, e) {
        var f = a;
        f = this.z0(c, f);
        if (e) {
            return f;
        }
        else {
            a = this.ja(b);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.aae = function (a, b, c, d, e) {
        if (this.yr == null || !this.yr.cl) {
            return this.aad(a, b, c, d, e);
        }
        var f = this.yr.n6(c);
        if (e) {
            return this.z2(f, d) + "%";
        }
        else {
            a = this.yr.n6(c);
            if (!isNaN_(a)) {
                return this.z2(a, d) + "%";
            }
            else {
                return this.z2(f, d) + "%";
            }
        }
    };
    RadialBase.prototype.zt = function (a, b, c, d, e) {
        if (this.yr == null || !this.yr.cl) {
            return this.zs(a, b, c, d, e);
        }
        var f = this.yr.n6(c);
        if (e) {
            return f;
        }
        else {
            a = this.yr.n6(c);
            if (!isNaN_(a)) {
                return a;
            }
            else {
                return f;
            }
        }
    };
    RadialBase.prototype.z0 = function (a, b) {
        return b;
    };
    RadialBase.prototype.z2 = function (a, b) {
        var c;
        if (b >= 0) {
            c = round10N(a, b);
        }
        else {
            c = a;
        }
        var d = this.at(false);
        if (d != null) {
            var e = d;
            return e.i(c);
        }
        else {
            return c.toString();
        }
    };
    RadialBase.prototype.get_fr = function () {
        return true;
    };
    RadialBase.prototype.get_fc = function () {
        return true;
    };
    RadialBase.prototype.y8 = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dl.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    RadialBase.prototype.zp = function () {
        return false;
    };
    RadialBase.prototype.hr = function () {
        var a = _super.prototype.hr.call(this);
        if (this.zp()) {
            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.zp()) {
            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.rv));
            a.add(c);
        }
        if (!this.zp()) {
            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.rv));
            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.kt = function () {
        if (this.d1()) {
            return this.bl.y4;
        }
        else {
            return this.bl.y1;
        }
    };
    RadialBase.prototype.y9 = function (a, b, c) {
        if (this.dl == null) {
            return null;
        }
        var d = this.y0.cx.c;
        var e = this.y0.cx.d;
        var f = this.y0.cx.b;
        var g = this.y2();
        var h = this.dl.count;
        var i = this.yr;
        var j = -1;
        var k = -1;
        var l = this.j1(b);
        if (isNaN_(b.x) || isNaN_(b.y)) {
            if (a != null && this.dl != null) {
                if (a == this.yy) {
                    l = this.yr.othersIndex;
                }
                else {
                    l = this.dl.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.za = function (a, b, c) {
        if (this.dl == null) {
            return null;
        }
        var d = this.y0.cx.c;
        var e = this.y0.cx.d;
        var f = this.y0.cx.b;
        var g = this.y2();
        var h = this.dl.count;
        var i = this.yr;
        var j = -1;
        var k = -1;
        var l = this.j1(b);
        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.de = function (a, b, c) {
        if (this.eb && this.fx(this.bv) && !c) {
            var d = this.y9(a, b, this.zb);
            this.zb = d;
            return d;
        }
        else {
            var e = this.y8(a, b, this.zb);
            this.zb = e;
            return e;
        }
    };
    RadialBase.prototype.df = function (a, b, c) {
        if (this.fx(this.bv) && !c) {
            var d = this.za(a, b, this.zc);
            this.zc = d;
            return d;
        }
        else {
            var e = this.y8(a, b, this.zc);
            e.d = true;
            this.zc = e;
            return e;
        }
    };
    RadialBase.prototype.zo = function () {
        return (this.assigningRadialStyle != null && this.ze) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
    };
    RadialBase.prototype.zn = function () {
        return (this.assigningRadialMarkerStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
    };
    RadialBase.prototype.aa1 = function (a) {
        if (this.assigningRadialStyle != null && this.ze) {
            this.assigningRadialStyle(this, a);
        }
    };
    RadialBase.prototype.aa0 = function (a) {
        if (this.assigningRadialMarkerStyle != null && this.zd) {
            this.assigningRadialMarkerStyle(this, a);
        }
    };
    RadialBase.prototype.zx = function (a) {
        return a.cx.b;
    };
    RadialBase.prototype.zy = function (a) {
        return a.cx.c;
    };
    RadialBase.prototype.ai = function () {
        return [this.yr, this.yw];
    };
    RadialBase.prototype.sl = function (a, b) {
        this.y0.cx.e(this.ib);
        this.rn(false);
    };
    RadialBase.prototype.sk = function (a, b) {
        if (this.gz && this.jo < 0.05 && (this.c9 == null || !this.c9.fj())) {
            this.g0 = true;
            this.g3 = false;
            this.gi = false;
        }
        this.y0.cx.e(this.ib);
        this.rn(false);
    };
    RadialBase.prototype.q5 = function (a, b, c, d) {
        _super.prototype.q5.call(this, a, b, c, d);
        switch (b) {
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.yr != null) {
                        this.yr.b0(this);
                    }
                    if (this.yw != null) {
                        this.yw.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.yr != null) {
                        this.yr.ct(this);
                    }
                    if (this.yw != null) {
                        this.yw.ct(this);
                    }
                }
                this.y0.cx.e(this.ib);
                this.rn(false);
                break;
            case RadialBase.$$p[0]:
                if (this.yr != null && this.yw != null) {
                    this.yz = new RadialAxes(this.yw, this.yr);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y0.cx.e(this.ib);
                this.rn(false);
                break;
            case RadialBase.$$p[21]:
                if (this.yr != null && this.yw != null) {
                    this.yz = new RadialAxes(this.yw, this.yr);
                }
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.y0.cx.e(this.ib);
                if (this.yw == null || !this.yw.c1()) {
                    this.rn(false);
                }
                break;
            case RadialBase.$$p[3]:
            case RadialBase.$$p[4]:
                if (this.z6 != null) {
                    this.yk = new BindingFormatter();
                    this.yk.j = this.z6;
                    this.yk.d = this.ye;
                }
                else {
                    this.yk = null;
                }
                break;
            case RadialBase.$$p[18]:
            case RadialBase.$$p[19]:
                if (this.aas != null) {
                    this.yo = new BindingFormatter();
                    this.yo.j = this.aas;
                    this.yo.d = this.yj;
                }
                else {
                    this.yo = null;
                }
                break;
            case RadialBase.$$p[11]:
            case RadialBase.$$p[12]:
                if (this.aai != null) {
                    this.yl = new BindingFormatter();
                    this.yl.j = this.aai;
                    this.yl.d = this.yg;
                }
                else {
                    this.yl = null;
                }
                break;
            case RadialBase.$$p[16]:
            case RadialBase.$$p[17]:
                if (this.aas != null) {
                    this.yn = new BindingFormatter();
                    this.yn.j = this.aap;
                    this.yn.d = this.yi;
                }
                else {
                    this.yn = null;
                }
                break;
            case RadialBase.$$p[14]:
            case RadialBase.$$p[15]:
                if (this.aai != null) {
                    this.ym = new BindingFormatter();
                    this.ym.j = this.aam;
                    this.ym.d = this.yh;
                }
                else {
                    this.ym = null;
                }
                break;
            case "SyncLink":
                if (this.c1 != null && this.c9 != null) {
                    this.y0.cx.e(this.ib);
                    this.rn(false);
                }
                break;
            case "TransitionProgress":
                this.y4.c(this.jo, this.y3, this.y1);
                if (this.d3(this.ct)) {
                    return;
                }
                if (this.jo == 1) {
                    this.y1.w();
                    this.aa2(this.y1, this.y0);
                    if (this.gz) {
                        this.gz = false;
                        this.o4();
                        this.da.r = truncate(this.i7());
                        this.da.b = this.db;
                    }
                    if (this.g2) {
                        this.g2 = false;
                        this.o4();
                        this.da.r = truncate(this.i7());
                        this.da.b = this.db;
                        this.qw();
                    }
                    this.qk();
                }
                else {
                    this.aa2(this.y4, this.y0);
                }
                if (this.c9 != null) {
                    this.c9.qa(this);
                }
                break;
            case RadialBase.$$p[7]:
                this.rn(false);
                this.qh();
                break;
            case "VisibilityProxy":
                if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                    this.y0.cx.e(this.ib);
                }
                break;
            case RadialBase.$$p[9]:
                this.ze = this.zm();
                this.rn(false);
                break;
            case RadialBase.$$p[8]:
                this.zd = this.zl();
                this.rn(false);
                break;
        }
    };
    RadialBase.prototype.zm = function () {
        return this.zj;
    };
    RadialBase.prototype.zl = function () {
        return this.zi;
    };
    RadialBase.prototype.zg = function (a) {
        if (typeCast(NumericRadiusAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.zf = function (a) {
        if (typeCast(CategoryAngleAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    RadialBase.prototype.get_yy = function () {
        return this.yx;
    };
    Object.defineProperty(RadialBase.prototype, "yy", {
        get: function () {
            return this.get_yy();
        },
        enumerable: false,
        configurable: true
    });
    RadialBase.prototype.kl = function (a) {
        var b = this.j1(a);
        var c = false;
        if (this.yr != null && this.yr.cl) {
            var d = this.yr;
            var e = d.hasOthersCategory && b == this.yr.lg - 1;
            c = e;
        }
        if (c) {
            var f = this.yr;
            return this.yy;
        }
        return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
    };
    RadialBase.prototype.zq = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = this.ct.getEffectiveViewport();
        if (this.yr != null && !b.isEmpty && !c.isEmpty && this.yz != null) {
            var e = this.yz.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.ip = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = this.getEffectiveViewport1(this.ct);
        var e = -1;
        if (this.yr != null && !b.isEmpty && !c.isEmpty && this.yz != null) {
            var f = this.yz.c(a, b, c, d);
            if (f < 0) {
                f += Math.PI * 2;
            }
            if (f > Math.PI * 2) {
                f -= Math.PI * 2;
            }
            var g = this.yr.getUnscaledAngle(f);
            if (this.yr.categoryMode != 0) {
                g -= 0.5;
            }
            e = g;
        }
        return e;
    };
    RadialBase.prototype.zr = function (a, b, c, d) {
        return this.yr.m4(a, b, c, d);
    };
    RadialBase.prototype.j1 = function (a) {
        var b = truncate(Math.round(this.ip(a)));
        var c = false;
        if (this.yr != null && this.yr.cl) {
            var d = this.yr;
            var e = d.hasOthersCategory && b == this.yr.lg - 1;
            c = e;
        }
        if (c) {
            var f = this.yr;
            return this.yr.lg - 1;
        }
        if (this.dl != null && b == this.dl.count) {
            b = 0;
        }
        return b;
    };
    RadialBase.prototype.gb = function (a) {
        return false;
    };
    RadialBase.prototype.y2 = function () {
        var a = this.y1;
        if (this.d1()) {
            if (this.da.g) {
                this.da.t();
            }
            a = this.y4;
        }
        return a;
    };
    RadialBase.prototype.p6 = function () {
        _super.prototype.p6.call(this);
        if (this.yr != null) {
            this.yr.h9(false);
        }
        if (this.yw != null) {
            this.yw.h9(false);
        }
    };
    RadialBase.prototype.hc = function (a, b, c) {
        var d = true;
        var e = c;
        if (!_super.prototype.hc.call(this, a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yr == null || this.yr.itemsSource == null || this.yw == null || this.yz == null || this.dl == null || this.yr.bi == null || this.yw.bi == null || this.yw.ly == this.yw.lx) {
            e.cx.b = 0;
            d = false;
        }
        return d;
    };
    RadialBase.prototype.yt = function () {
        return 1;
    };
    RadialBase.prototype.zu = function () {
        return Math.max(0, 0.5 * this.yw.no);
    };
    RadialBase.prototype.gl = function () {
        return this.zk;
    };
    RadialBase.prototype.gm = function () {
        return true;
    };
    RadialBase.prototype.ro = function (a) {
        _super.prototype.ro.call(this, a);
        this.y0.cx.e(this.ib);
        if (this.d3(this.ct)) {
            this.y1.z();
            this.y4.z();
            this.y3.z();
            return;
        }
        if (this.gp) {
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                this.aa2(this.y4, this.y0);
            }
            else {
                this.aa2(this.y1, this.y0);
            }
            return;
        }
        if (this.gd(a)) {
            var b = this.y3;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                this.y3 = this.y4;
                this.y4 = b;
            }
            else {
                this.y3 = this.y1;
                this.y1 = b;
            }
            var c = false;
            this.aaz(this.y1, this.y0);
            if (this.g1) {
                this.da.w();
                this.da.r = truncate(this.i8());
                this.da.b = this.dc != null ? this.dc : this.db;
                if (this.g2) {
                    var d = this.y4;
                    this.y4 = this.y3;
                    this.y3 = d;
                    c = true;
                }
                this.yv.s(this, this.y3, this.y1, this.isVertical, this.yr, this.yw, this.yu, this.yt(), this.c3, this.c2(), runOn(this, this.zu), this.y0.bx);
                if (this.g2) {
                    var e = this.y4;
                    this.y4 = this.y3;
                    this.y3 = e;
                }
                this.g2 = false;
            }
            if (this.g4) {
                this.da.w();
                this.da.r = truncate(this.i9());
                this.da.b = this.dd != null ? this.dd : this.db;
                if (this.gz) {
                    var f = this.y4;
                    this.y4 = this.y3;
                    this.y3 = f;
                    c = true;
                }
                this.yv.s(this, this.y3, this.y1, this.isVertical, this.yr, this.yw, this.yu, this.yt(), this.c3, this.c2(), runOn(this, this.zu), this.y0.bx);
                var g = this.y1;
                this.y1 = this.y3;
                this.y3 = g;
                if (this.gz) {
                    var h = this.y4;
                    this.y4 = this.y3;
                    this.y3 = h;
                }
                this.gz = false;
            }
            this.d7 = false;
            if (!c) {
                this.oz();
            }
            this.r1();
            if (this.g1) {
                this.g0 = false;
                this.gz = true;
            }
            if (this.g4) {
                this.g3 = false;
                this.g2 = true;
            }
        }
        else {
            this.aaz(this.y1, this.y0);
            this.aa2(this.y1, this.y0);
        }
    };
    RadialBase.prototype.zz = function () {
        var e_1, _a;
        if (this.bl != null) {
            var a = this.bl;
            return a.zz();
        }
        var b = 0;
        try {
            for (var _b = __values(fromEnum(this.c9.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                if (c == this || this.bl == c) {
                    return b;
                }
                var d = typeCast(RadialBase.$, c);
                if (d != null && d.yr == this.yr && d.preferredCategoryMode(d.yr) == 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.$t = markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = markDep(DependencyProperty, PropertyMetadata, RadialBase, 'raisePropertyChanged', ['AngleAxis:yr:aa3', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:zv:aa4', [1, -1], 'AutoCalloutLabelValueSeparator:z4:aa5', [2, " - "], 'AutoCalloutOthersLabelFormat:z6:aa6', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:ye:aa7', [Array_$type, null], 'AutoCalloutPercentagePrecision:zw:aa8', [1, 2], 'AutoCalloutRadialLabelMode:y5:aa9', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'ClipSeriesToBounds:zh:aba', [0, false], 'IsCustomRadialMarkerStyleAllowed:zi:abb', [0, false], 'IsCustomRadialStyleAllowed:zj:abc', [0, false], 'IsTransitionInEnabled:zk:abd', [0, false], 'LegendProportionalRadialLabelFormat:aai:abe', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:yg:abf', [Array_$type, null], 'LegendRadialLabelMode:y6:abg', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aam:abh', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yh:abi', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aap:abj', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:yi:abk', [Array_$type, null], 'ProportionalRadialLabelFormat:aas:abl', [2, null], 'ProportionalRadialLabelFormatSpecifiers:yj:abm', [Array_$type, null], 'TransitionInMode:yu:abn', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:yw:abo', [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 };
