/*
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 { 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
 */
export let RadialBucketCalculator = /*@__PURE__*/ (() => {
    class RadialBucketCalculator extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.c = 0;
            this.d = 0;
            this.b = 0;
            this.a = a;
        }
        getBucket(a) {
            throw new NotImplementedException(0);
        }
        getBucketWithoutUnknowns(a) {
            return this.getBucket(a);
        }
        getErrorBucket(a, b) {
            return NaN;
        }
        getBucketInfo(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
            };
        }
        e(a) {
            let b = this.a.by;
            let c = this.a.bx;
            let d = this.a.getEffectiveViewport();
            let 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;
            }
            let f = Math.floor(e.m6(c, d, b));
            let 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;
            }
            let h = this.a.cw.yw;
            let i = h != null ? h.np : 0.75;
            let j = Math.min(c.width, c.height) * 0.5 * (i) * 2 * Math.PI;
            let 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));
            }
        }
        cacheValues() {
        }
        unCacheValues() {
        }
    }
    RadialBucketCalculator.$t = /*@__PURE__*/ markType(RadialBucketCalculator, 'RadialBucketCalculator', Base.$, [IBucketizer_$type]);
    return RadialBucketCalculator;
})();
/**
 * @hidden
 */
export let RadialBase = /*@__PURE__*/ (() => {
    class RadialBase extends MarkerSeries {
        qx(a) {
            super.qx(a);
            this.y0 = a;
        }
        constructor() {
            super();
            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();
        }
        aay() {
            if (this.da.g) {
                this.da.t();
            }
        }
        get categoryAxis() {
            return this.yr;
        }
        az() {
            return this.yr;
        }
        yf(a, b) {
            return null;
        }
        pp(a) {
            if (a == this.yy) {
                if (this.fg) {
                    this.a9.a$x(this, a, this.yr.lh - 1);
                }
                return;
            }
            super.pp(a);
        }
        ec(a) {
            if (a == this.yy && this.yr != null && this.yr.cl && this.yr.hasOthersCategory) {
                return true;
            }
            return super.ec(a);
        }
        pn(a) {
            if (a == this.yy) {
                if (this.fg) {
                    this.a9.a$an(this, a, this.dl.count - 1);
                }
                return;
            }
            super.pn(a);
        }
        d9(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.yr;
            let f = new ScalerParams(1, this.c9.vl, this.wl, e.ch);
            f.c = this.getEffectiveViewport1(this.ct);
            let g = this.yw;
            let h = new ScalerParams(1, this.c9.vl, this.wl, g.ch);
            h.c = this.getEffectiveViewport1(this.ct);
            let i = this.zw;
            a.clear();
            this.wy.cj((j) => {
                if (j._visibility == 0) {
                    let k = new SeriesPointOfInterest();
                    let l = j.n;
                    let m = j.o;
                    if (l < this.wl.left || l > this.wl.right || m < this.wl.top || m > this.wl.bottom) {
                        return;
                    }
                    let n = null;
                    if (j.content != null) {
                        n = j.content.item;
                    }
                    let o;
                    let p;
                    let 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;
                    let r = k.e;
                    let 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;
        }
        kq(a, b) {
            let 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;
                }
            }
            let d = NaN;
            if (c != null) {
                d = this.ja(c);
            }
            let e = this.aav(d, c, a, this.zv >= 0 ? this.zv : 5, this.zw, false, false, b);
            if (e != null) {
                return e;
            }
            return super.kq(a, b);
        }
        aav(a, b, c, d, e, f, g, h) {
            let i = null;
            let j = (b == this.yy);
            let 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)))) {
                let l = this.zs(a, b, c, d, f);
                let m = this.zt(a, b, c, e, f);
                let n = this.aac(c);
                let o = ((() => {
                    let $ret = new ProportionalRadialLabelContext();
                    $ret.value = l;
                    $ret.percent = m;
                    $ret.label = n;
                    $ret.item = b;
                    return $ret;
                })());
                let 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:
                        {
                            let q = this.aad(a, b, c, d, f);
                            let r = this.aae(a, b, c, e, f);
                            i = q + this.z4 + r;
                        }
                        break;
                    case 5:
                        i = this.aac(c);
                        break;
                    case 6:
                        {
                            let s = this.aad(a, b, c, d, f);
                            let t = this.aac(c);
                            i = t + this.z4 + s;
                        }
                        break;
                    case 7:
                        {
                            let u = this.aae(a, b, c, e, f);
                            let v = this.aac(c);
                            i = v + this.z4 + u;
                        }
                        break;
                    case 8:
                        {
                            let w = this.aad(a, b, c, d, f);
                            let x = this.aae(a, b, c, e, f);
                            let 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;
        }
        aac(a) {
            let b = this.yr;
            let 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) {
                let d = super.kq(a, false);
                if (d != null) {
                    return c.i(d);
                }
                else {
                    return null;
                }
            }
            else {
                return b.ge(a);
            }
        }
        aad(a, b, c, d, e) {
            let 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);
                }
            }
        }
        zs(a, b, c, d, e) {
            let f = a;
            f = this.z0(c, f);
            if (e) {
                return f;
            }
            else {
                a = this.ja(b);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        aae(a, b, c, d, e) {
            if (this.yr == null || !this.yr.cl) {
                return this.aad(a, b, c, d, e);
            }
            let 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) + "%";
                }
            }
        }
        zt(a, b, c, d, e) {
            if (this.yr == null || !this.yr.cl) {
                return this.zs(a, b, c, d, e);
            }
            let f = this.yr.n6(c);
            if (e) {
                return f;
            }
            else {
                a = this.yr.n6(c);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        z0(a, b) {
            return b;
        }
        z2(a, b) {
            let c;
            if (b >= 0) {
                c = round10N(a, b);
            }
            else {
                c = a;
            }
            let d = this.at(false);
            if (d != null) {
                let e = d;
                return e.i(c);
            }
            else {
                return c.toString();
            }
        }
        get_fr() {
            return true;
        }
        get_fc() {
            return true;
        }
        y8(a, b, c) {
            let 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;
        }
        zp() {
            return false;
        }
        hr() {
            let a = super.hr();
            if (this.zp()) {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "DashArray";
                    $ret.p = true;
                    $ret.x = ((() => {
                        let $ret = new DoubleCollection();
                        $ret.add(5);
                        $ret.add(5);
                        return $ret;
                    })());
                    $ret.q = true;
                    return $ret;
                })());
                a.add(b);
            }
            if (!this.zp()) {
                let c = ((() => {
                    let $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()) {
                let d = ((() => {
                    let $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);
            }
            let e = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "IsTransitionInEnabled";
                $ret.x = true;
                $ret.q = true;
                return $ret;
            })());
            a.add(e);
            let f = ((() => {
                let $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;
        }
        kt() {
            if (this.d1()) {
                return this.bl.y4;
            }
            else {
                return this.bl.y1;
            }
        }
        y9(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.y0.cx.c;
            let e = this.y0.cx.d;
            let f = this.y0.cx.b;
            let g = this.y2();
            let h = this.dl.count;
            let i = this.yr;
            let j = -1;
            let k = -1;
            let 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;
            }
            let m = new HighlightingInfo();
            m.i = this;
            m.g = j;
            m.f = k;
            return m;
        }
        za(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.y0.cx.c;
            let e = this.y0.cx.d;
            let f = this.y0.cx.b;
            let g = this.y2();
            let h = this.dl.count;
            let i = this.yr;
            let j = -1;
            let k = -1;
            let 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;
            }
            let m = new HighlightingInfo();
            m.d = true;
            m.i = this;
            m.g = j;
            m.f = k;
            return m;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.y9(a, b, this.zb);
                this.zb = d;
                return d;
            }
            else {
                let e = this.y8(a, b, this.zb);
                this.zb = e;
                return e;
            }
        }
        df(a, b, c) {
            if (this.fx(this.bv) && !c) {
                let d = this.za(a, b, this.zc);
                this.zc = d;
                return d;
            }
            else {
                let e = this.y8(a, b, this.zc);
                e.d = true;
                this.zc = e;
                return e;
            }
        }
        zo() {
            return (this.assigningRadialStyle != null && this.ze) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        zn() {
            return (this.assigningRadialMarkerStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        aa1(a) {
            if (this.assigningRadialStyle != null && this.ze) {
                this.assigningRadialStyle(this, a);
            }
        }
        aa0(a) {
            if (this.assigningRadialMarkerStyle != null && this.zd) {
                this.assigningRadialMarkerStyle(this, a);
            }
        }
        zx(a) {
            return a.cx.b;
        }
        zy(a) {
            return a.cx.c;
        }
        ai() {
            return [this.yr, this.yw];
        }
        sl(a, b) {
            this.y0.cx.e(this.ib);
            this.rn(false);
        }
        sk(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);
        }
        q5(a, b, c, d) {
            super.q5(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;
            }
        }
        zm() {
            return this.zj;
        }
        zl() {
            return this.zi;
        }
        zg(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zf(a) {
            if (typeCast(CategoryAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get_yy() {
            return this.yx;
        }
        get yy() {
            return this.get_yy();
        }
        kl(a) {
            let b = this.j1(a);
            let c = false;
            if (this.yr != null && this.yr.cl) {
                let d = this.yr;
                let e = d.hasOthersCategory && b == this.yr.lg - 1;
                c = e;
            }
            if (c) {
                let f = this.yr;
                return this.yy;
            }
            return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
        }
        zq(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.ct.getEffectiveViewport();
            if (this.yr != null && !b.isEmpty && !c.isEmpty && this.yz != null) {
                let 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;
        }
        ip(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.getEffectiveViewport1(this.ct);
            let e = -1;
            if (this.yr != null && !b.isEmpty && !c.isEmpty && this.yz != null) {
                let f = this.yz.c(a, b, c, d);
                if (f < 0) {
                    f += Math.PI * 2;
                }
                if (f > Math.PI * 2) {
                    f -= Math.PI * 2;
                }
                let g = this.yr.getUnscaledAngle(f);
                if (this.yr.categoryMode != 0) {
                    g -= 0.5;
                }
                e = g;
            }
            return e;
        }
        zr(a, b, c, d) {
            return this.yr.m4(a, b, c, d);
        }
        j1(a) {
            let b = truncate(Math.round(this.ip(a)));
            let c = false;
            if (this.yr != null && this.yr.cl) {
                let d = this.yr;
                let e = d.hasOthersCategory && b == this.yr.lg - 1;
                c = e;
            }
            if (c) {
                let f = this.yr;
                return this.yr.lg - 1;
            }
            if (this.dl != null && b == this.dl.count) {
                b = 0;
            }
            return b;
        }
        gb(a) {
            return false;
        }
        y2() {
            let a = this.y1;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.y4;
            }
            return a;
        }
        p6() {
            super.p6();
            if (this.yr != null) {
                this.yr.h9(false);
            }
            if (this.yw != null) {
                this.yw.h9(false);
            }
        }
        hc(a, b, c) {
            let d = true;
            let e = c;
            if (!super.hc(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;
        }
        yt() {
            return 1;
        }
        zu() {
            return Math.max(0, 0.5 * this.yw.no);
        }
        gl() {
            return this.zk;
        }
        gm() {
            return true;
        }
        ro(a) {
            super.ro(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)) {
                let 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;
                }
                let 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) {
                        let 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) {
                        let 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) {
                        let 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);
                    let g = this.y1;
                    this.y1 = this.y3;
                    this.y3 = g;
                    if (this.gz) {
                        let 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);
            }
        }
        zz() {
            if (this.bl != null) {
                let a = this.bl;
                return a.zz();
            }
            let b = 0;
            for (let c of fromEnum(this.c9.series)) {
                if (c == this || this.bl == c) {
                    return b;
                }
                let d = typeCast(RadialBase.$, c);
                if (d != null && d.yr == this.yr && d.preferredCategoryMode(d.yr) == 2) {
                    b++;
                }
            }
            return -1;
        }
    }
    RadialBase.$t = /*@__PURE__*/ markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = /*@__PURE__*/ 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, /*@__PURE__*/ 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, /*@__PURE__*/ 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, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:yw:abo', [NumericRadiusAxis.$, null]]);
    return RadialBase;
})();
/**
 * @hidden
 */
export let RadialBaseView = /*@__PURE__*/ (() => {
    class RadialBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            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);
        }
        cj(a) {
            this.cy.c(a);
        }
    }
    RadialBaseView.$t = /*@__PURE__*/ markType(RadialBaseView, 'RadialBaseView', MarkerSeriesView.$);
    return RadialBaseView;
})();
