/*
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-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { NotImplementedException } from "igniteui-angular-core";
import { CategoryAngleAxis } from "./CategoryAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
import { truncate, intDivide, isNaN_ } from "igniteui-angular-core";
import { MarkerSeries } from "./MarkerSeries";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { DependencyProperty } from "igniteui-angular-core";
import { RadialLabelMode_$type } from "igniteui-angular-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { HighlightingInfo } from "igniteui-angular-core";
import { BindingFormatter } from "igniteui-angular-core";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { RadialFrame } from "./RadialFrame";
import { RadialSeriesRenderManager } from "./RadialSeriesRenderManager";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { ProportionalRadialLabelContext } from "./ProportionalRadialLabelContext";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { DoubleCollection } from "igniteui-angular-core";
import { RadialAxes } from "./RadialAxes";
import { Visibility_$type } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-angular-core";
import { round10N } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
/**
 * @hidden
 */
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.c9.ie;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.ca;
            let c = this.a.b9;
            let d = this.a.getEffectiveViewport();
            let e = this.a.c9.y9;
            if (b.isEmpty || c.isEmpty || e == null || this.a.c9.dp == null || this.a.c9.dp.count == 0) {
                this.b = 0;
                return;
            }
            let f = Math.floor(e.qv(c, d, b));
            let g = Math.ceil(e.qu(c, d, b));
            if (e.df) {
                g = Math.ceil(e.qv(c, d, b));
                f = Math.floor(e.qu(c, d, b));
            }
            if (g < f) {
                g = e.o5 + g;
            }
            let h = this.a.c9.zf;
            let i = h != null ? h.sb : 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.dj) {
                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 = markType(RadialBucketCalculator, 'RadialBucketCalculator', Base.$, [IBucketizer_$type]);
    return RadialBucketCalculator;
})();
/**
 * @hidden
 */
export let RadialBase = /*@__PURE__*/ (() => {
    class RadialBase extends MarkerSeries {
        constructor() {
            super();
            this.zo = null;
            this.zv = false;
            this.zu = false;
            this.zs = null;
            this.zt = null;
            this.assigningRadialStyle = null;
            this.assigningRadialMarkerStyle = null;
            this.y2 = null;
            this.y6 = null;
            this.y3 = null;
            this.y5 = null;
            this.y4 = null;
            this.zk = new RadialFrame(4);
            this.zl = new RadialFrame(4);
            this.zi = new RadialFrame(4);
            this.zg = null;
            this.ze = null;
            this.ze = new CategoryTransitionSourceFramePreparer();
            this.zo = new RadialSeriesRenderManager();
        }
        q7(a) {
            super.q7(a);
            this.zh = a;
        }
        abg() {
            if (this.dd.g) {
                this.dd.t();
            }
        }
        get categoryAxis() {
            return this.y9;
        }
        a0() {
            return this.y9;
        }
        yx(a, b) {
            return null;
        }
        py(a) {
            if (this.y9.dj && this.y9.rs(a)) {
                if (this.fj) {
                    this.ba.a$x(this, a, this.y9.o6 - 1);
                }
                return;
            }
            super.py(a);
        }
        eg(a) {
            if (this.y9 != null && this.y9.dj && this.y9.hasOthersCategory) {
                if (this.y9.rs(a)) {
                    return true;
                }
            }
            return super.eg(a);
        }
        pw(a) {
            if (this.y9.dj && this.y9.rs(a)) {
                if (this.fj) {
                    this.ba.a$an(this, a, this.dp.count - 1);
                }
                return;
            }
            super.pw(a);
        }
        ed(a, b, c, d, e) {
            if (!this.hasMarkers) {
                return false;
            }
            let f = this.y9;
            let g = new ScalerParams(1, this.dc.xm, this.w2, f.df);
            g.c = this.getEffectiveViewport1(this.cw);
            let h = this.zf;
            let i = new ScalerParams(1, this.dc.xm, this.w2, h.df);
            i.c = this.getEffectiveViewport1(this.cw);
            let j = this.aad;
            a.clear();
            this.xg.cw((k) => {
                if (k._visibility == 0) {
                    let l = new SeriesPointOfInterest();
                    let m = k.n;
                    let n = k.o;
                    if (!e && (m < this.w2.left || m > this.w2.right || n < this.w2.top || n > this.w2.bottom)) {
                        return;
                    }
                    let o = null;
                    if (k.content != null) {
                        o = k.content.item;
                    }
                    let p;
                    let q;
                    let r = this.zg.h(m, n, this.cw.ca, this.cw.b9, this.cw.getEffectiveViewport(), p, q);
                    p = r.p5;
                    q = r.p6;
                    l.d = p;
                    l.e = q;
                    let s = l.e;
                    let t = k.ak;
                    l.f = this.abd(s, o, t, d, j, c, b, false);
                    l.b = k.content;
                    l.g = this.vq;
                    l.c = k.ak;
                    if (this.ha) {
                        l.g = this.vx(k.ak);
                    }
                    l.a = this.ar(k.ak, k.al);
                    a.add(l);
                }
            });
            return true;
        }
        kw(a, b) {
            let c = null;
            if (this.dp != null) {
                if (a >= 0 && a < this.dp.count) {
                    c = this.dp.item(a);
                }
                if (this.y9 != null && this.y9.dj && a == this.y9.othersIndex) {
                    c = this.y9.r5(false);
                }
            }
            let d = NaN;
            if (c != null) {
                d = this.jf(c);
            }
            let e = this.abd(d, c, a, this.aac >= 0 ? this.aac : 5, this.aad, false, false, b);
            if (e != null) {
                return e;
            }
            return super.kw(a, b);
        }
        abd(a, b, c, d, e, f, g, h) {
            let i = null;
            let j = this.y9.dj && this.y9.rs(b);
            let k = this.zm;
            if (h) {
                k = this.zn;
            }
            if (k == 0) {
                if (h) {
                    k = 5;
                }
                else {
                    k = 6;
                }
            }
            if ((h && ((this.y3 != null) || (j && this.y4 != null))) || (!h && ((this.y6 != null) || (j && this.y5 != null)))) {
                let l = this.z9(a, b, c, d, f);
                let m = this.aaa(a, b, c, e, f);
                let n = this.aau(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.y4;
                    }
                    else {
                        p = this.y5;
                    }
                    if (p == null) {
                        if (h) {
                            p = this.y3;
                        }
                        else {
                            p = this.y6;
                        }
                    }
                }
                else {
                    if (h) {
                        p = this.y3;
                    }
                    else {
                        p = this.y6;
                    }
                }
                i = p.i(o);
            }
            else if (k != 1) {
                switch (k) {
                    case 2:
                        i = this.aav(a, b, c, d, f);
                        break;
                    case 3:
                        i = this.aaw(a, b, c, e, f);
                        break;
                    case 4:
                        {
                            let q = this.aav(a, b, c, d, f);
                            let r = this.aaw(a, b, c, e, f);
                            i = q + this.aal + r;
                        }
                        break;
                    case 5:
                        i = this.aau(c);
                        break;
                    case 6:
                        {
                            let s = this.aav(a, b, c, d, f);
                            let t = this.aau(c);
                            i = t + this.aal + s;
                        }
                        break;
                    case 7:
                        {
                            let u = this.aaw(a, b, c, e, f);
                            let v = this.aau(c);
                            i = v + this.aal + u;
                        }
                        break;
                    case 8:
                        {
                            let w = this.aav(a, b, c, d, f);
                            let x = this.aaw(a, b, c, e, f);
                            let y = this.aau(c);
                            i = y + this.aal + w + this.aal + x;
                        }
                        break;
                }
            }
            else {
                if (g) {
                    i = this.aav(a, b, c, d, f);
                }
                else {
                    i = this.aau(c);
                }
            }
            return i;
        }
        aau(a) {
            let b = this.y9;
            let c = this.au(true);
            if (this.y9 != null && this.y9.dj && this.y9.hasOthersCategory && a == this.y9.othersIndex) {
                if (this.y2 != null) {
                    c = this.y2;
                }
            }
            if (c != null) {
                let d = super.kw(a, false);
                if (d != null) {
                    return c.i(d);
                }
                else {
                    return null;
                }
            }
            else {
                return b.ih(a);
            }
        }
        aav(a, b, c, d, e) {
            let f = a;
            f = this.aah(c, f);
            if (e) {
                return this.aaj(f, d);
            }
            else {
                a = this.jf(b);
                if (!isNaN_(a)) {
                    return this.aaj(a, d);
                }
                else {
                    return this.aaj(f, d);
                }
            }
        }
        z9(a, b, c, d, e) {
            let f = a;
            f = this.aah(c, f);
            if (e) {
                return f;
            }
            else {
                a = this.jf(b);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        aaw(a, b, c, d, e) {
            if (this.y9 == null || !this.y9.dj) {
                return this.aav(a, b, c, d, e);
            }
            let f = this.y9.rz(c);
            if (e) {
                return this.aaj(f, d) + "%";
            }
            else {
                a = this.y9.rz(c);
                if (!isNaN_(a)) {
                    return this.aaj(a, d) + "%";
                }
                else {
                    return this.aaj(f, d) + "%";
                }
            }
        }
        aaa(a, b, c, d, e) {
            if (this.y9 == null || !this.y9.dj) {
                return this.z9(a, b, c, d, e);
            }
            let f = this.y9.rz(c);
            if (e) {
                return f;
            }
            else {
                a = this.y9.rz(c);
                if (!isNaN_(a)) {
                    return a;
                }
                else {
                    return f;
                }
            }
        }
        aah(a, b) {
            return b;
        }
        aaj(a, b) {
            let c;
            if (b >= 0) {
                c = round10N(a, b);
            }
            else {
                c = a;
            }
            let d = this.au(false);
            if (d != null) {
                let e = d;
                return e.i(c);
            }
            else {
                return c.toString();
            }
        }
        get_fu() {
            return true;
        }
        get_ff() {
            return true;
        }
        zp(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dp.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        z6() {
            return false;
        }
        hu() {
            let a = super.hu();
            if (this.z6()) {
                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.z6()) {
                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.r8));
                a.add(c);
            }
            if (!this.z6()) {
                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.r8));
                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;
        }
        kz() {
            if (this.d4()) {
                return this.bo.zl;
            }
            else {
                return this.bo.zi;
            }
        }
        zq(a, b, c) {
            if (this.dp == null) {
                return null;
            }
            let d = this.zh.da.c;
            let e = this.zh.da.d;
            let f = this.zh.da.b;
            let g = this.zj();
            let h = this.dp.count;
            let i = this.y9;
            let j = -1;
            let k = -1;
            let l = this.j7(b);
            if (isNaN_(b.x) || isNaN_(b.y)) {
                if (a != null && this.dp != null) {
                    if (this.y9.dj && this.y9.rs(a)) {
                        l = this.y9.othersIndex;
                    }
                    else {
                        l = this.dp.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;
        }
        zr(a, b, c) {
            if (this.dp == null) {
                return null;
            }
            let d = this.zh.da.c;
            let e = this.zh.da.d;
            let f = this.zh.da.b;
            let g = this.zj();
            let h = this.dp.count;
            let i = this.y9;
            let j = -1;
            let k = -1;
            let l = this.j7(b);
            if (isNaN_(b.x) || isNaN_(b.y)) {
                if (a != null && this.dp != null) {
                    if (this.y9.dj && this.y9.rs(a)) {
                        l = this.y9.othersIndex;
                    }
                    else {
                        l = this.dp.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.d = true;
            m.i = this;
            m.g = j;
            m.f = k;
            return m;
        }
        dh(a, b, c) {
            if (this.ef && this.f0(this.by) && !c) {
                let d = this.zq(a, b, this.zs);
                this.zs = d;
                return d;
            }
            else {
                let e = this.zp(a, b, this.zs);
                this.zs = e;
                return e;
            }
        }
        di(a, b, c) {
            if (this.f0(this.by) && !c) {
                let d = this.zr(a, b, this.zt);
                this.zt = d;
                return d;
            }
            else {
                let e = this.zp(a, b, this.zt);
                e.d = true;
                this.zt = e;
                return e;
            }
        }
        z5() {
            return (this.assigningRadialStyle != null && this.zv) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
        }
        z4() {
            return (this.assigningRadialMarkerStyle != null && this.zu) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
        }
        abj(a) {
            if (this.assigningRadialStyle != null && this.zv) {
                this.assigningRadialStyle(this, a);
            }
        }
        abi(a) {
            if (this.assigningRadialMarkerStyle != null && this.zu) {
                this.assigningRadialMarkerStyle(this, a);
            }
        }
        aae(a) {
            return a.da.b;
        }
        aaf(a) {
            return a.da.c;
        }
        ai() {
            return [this.y9, this.zf];
        }
        sz(a, b) {
            this.zh.da.e(this.ie);
            this.ry(false);
        }
        sy(a, b) {
            if (this.g2 && this.ju < 0.05 && (this.dc == null || !this.dc.f4())) {
                this.g3 = true;
                this.g6 = false;
                this.gl = false;
            }
            this.zh.da.e(this.ie);
            this.ry(false);
        }
        rg(a, b, c, d) {
            super.rg(a, b, c, d);
            switch (b) {
                case RadialBase.$$p[6]:
                    this.ry(false);
                    break;
                case RadialBase.$$p[14]:
                    this.pk();
                    this.ry(false);
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.y9 != null) {
                            this.y9.cq(this);
                        }
                        if (this.zf != null) {
                            this.zf.cq(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.y9 != null) {
                            this.y9.du(this);
                        }
                        if (this.zf != null) {
                            this.zf.du(this);
                        }
                    }
                    this.zh.da.e(this.ie);
                    this.ry(false);
                    break;
                case RadialBase.$$p[0]:
                    if (this.y9 != null && this.zf != null) {
                        this.zg = new RadialAxes(this.zf, this.y9);
                    }
                    if (c != null) {
                        c.cq(this);
                    }
                    if (d != null) {
                        d.du(this);
                    }
                    this.zh.da.e(this.ie);
                    this.ry(false);
                    break;
                case RadialBase.$$p[22]:
                    if (this.y9 != null && this.zf != null) {
                        this.zg = new RadialAxes(this.zf, this.y9);
                    }
                    if (c != null) {
                        c.cq(this);
                    }
                    if (d != null) {
                        d.du(this);
                    }
                    this.zh.da.e(this.ie);
                    if (this.zf == null || !this.zf.d2()) {
                        this.ry(false);
                    }
                    break;
                case RadialBase.$$p[3]:
                case RadialBase.$$p[4]:
                    if (this.aan != null) {
                        this.y2 = new BindingFormatter();
                        this.y2.j = this.aan;
                        this.y2.d = this.yw;
                    }
                    else {
                        this.y2 = null;
                    }
                    break;
                case RadialBase.$$p[19]:
                case RadialBase.$$p[20]:
                    if (this.aba != null) {
                        this.y6 = new BindingFormatter();
                        this.y6.j = this.aba;
                        this.y6.d = this.y1;
                    }
                    else {
                        this.y6 = null;
                    }
                    break;
                case RadialBase.$$p[12]:
                case RadialBase.$$p[13]:
                    if (this.aa0 != null) {
                        this.y3 = new BindingFormatter();
                        this.y3.j = this.aa0;
                        this.y3.d = this.yy;
                    }
                    else {
                        this.y3 = null;
                    }
                    break;
                case RadialBase.$$p[17]:
                case RadialBase.$$p[18]:
                    if (this.aba != null) {
                        this.y5 = new BindingFormatter();
                        this.y5.j = this.aa7;
                        this.y5.d = this.y0;
                    }
                    else {
                        this.y5 = null;
                    }
                    break;
                case RadialBase.$$p[15]:
                case RadialBase.$$p[16]:
                    if (this.aa0 != null) {
                        this.y4 = new BindingFormatter();
                        this.y4.j = this.aa4;
                        this.y4.d = this.yz;
                    }
                    else {
                        this.y4 = null;
                    }
                    break;
                case "SyncLink":
                    if (this.c4 != null && this.dc != null) {
                        this.zh.da.e(this.ie);
                        this.ry(false);
                    }
                    break;
                case "TransitionProgress":
                    this.zl.c(this.ju, this.zk, this.zi);
                    if (this.d7(this.cw)) {
                        return;
                    }
                    if (this.ju == 1) {
                        this.zi.y();
                        this.abk(this.zi, this.zh);
                        if (this.g2) {
                            this.g2 = false;
                            this.pc();
                            this.dd.r = truncate(this.jc());
                            this.dd.b = this.de;
                        }
                        if (this.g5) {
                            this.g5 = false;
                            this.pc();
                            this.dd.r = truncate(this.jc());
                            this.dd.b = this.de;
                            this.q6();
                        }
                        this.qu();
                    }
                    else {
                        this.abk(this.zl, this.zh);
                    }
                    if (this.dc != null) {
                        this.dc.rz(this);
                    }
                    break;
                case RadialBase.$$p[8]:
                    this.ry(false);
                    this.qr();
                    break;
                case "VisibilityProxy":
                    if (EnumUtil.getEnumValue(Visibility_$type, c) != 0 && EnumUtil.getEnumValue(Visibility_$type, d) == 0) {
                        this.zh.da.e(this.ie);
                    }
                    break;
                case RadialBase.$$p[10]:
                    this.zv = this.z3();
                    this.ry(false);
                    break;
                case RadialBase.$$p[9]:
                    this.zu = this.z2();
                    this.ry(false);
                    break;
            }
        }
        z3() {
            return this.z0;
        }
        z2() {
            return this.zz;
        }
        zx(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zw(a) {
            if (typeCast(CategoryAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        kr(a) {
            let b = this.j7(a);
            let c = false;
            if (this.y9 != null && this.y9.dj) {
                let d = this.y9;
                let e = d.hasOthersCategory && b == this.y9.o5 - 1;
                c = e;
            }
            if (c) {
                return this.y9.r5(true);
            }
            return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
        }
        z7(a) {
            let b = this.cw.ca;
            let c = this.cw.b9;
            let d = this.cw.getEffectiveViewport();
            if (this.y9 != null && !b.isEmpty && !c.isEmpty && this.zg != null) {
                let e = this.zg.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;
        }
        it(a) {
            let b = this.cw.ca;
            let c = this.cw.b9;
            let d = this.getEffectiveViewport1(this.cw);
            let e = -1;
            if (this.y9 != null && !b.isEmpty && !c.isEmpty && this.zg != null) {
                let f = this.zg.c(a, b, c, d);
                if (f < 0) {
                    f += Math.PI * 2;
                }
                if (f > Math.PI * 2) {
                    f -= Math.PI * 2;
                }
                let g = this.y9.getUnscaledAngle(f);
                if (this.y9.categoryMode != 0) {
                    g -= 0.5;
                }
                e = g;
            }
            return e;
        }
        z8(a, b, c, d) {
            return this.y9.qt(a, b, c, d);
        }
        j7(a) {
            let b = truncate(Math.round(this.it(a)));
            let c = false;
            if (this.y9 != null && this.y9.dj) {
                let d = this.y9;
                let e = d.hasOthersCategory && b == this.y9.o5 - 1;
                c = e;
            }
            if (c) {
                let f = this.y9;
                return this.y9.o5 - 1;
            }
            if (this.dp != null && b == this.dp.count) {
                b = 0;
            }
            return b;
        }
        ge(a) {
            return false;
        }
        zj() {
            let a = this.zi;
            if (this.d4()) {
                if (this.dd.g) {
                    this.dd.t();
                }
                a = this.zl;
            }
            return a;
        }
        qh() {
            super.qh();
            if (this.y9 != null) {
                this.y9.k3(false);
            }
            if (this.zf != null) {
                this.zf.k3(false);
            }
        }
        hf(a, b, c) {
            let d = true;
            let e = c;
            if (!super.hf(a, b, c) || !c.r() || b.isEmpty || a.isEmpty || this.y9 == null || this.y9.itemsSource == null || this.zf == null || this.zg == null || this.dp == null || this.y9.b0 == null || this.zf.b0 == null || this.zf.pr == this.zf.pq) {
                e.da.b = 0;
                d = false;
            }
            return d;
        }
        zc() {
            return 1;
        }
        aab() {
            return Math.max(0, 0.5 * this.zf.sa);
        }
        go() {
            return this.z1;
        }
        gp() {
            return true;
        }
        rz(a) {
            super.rz(a);
            this.zh.da.e(this.ie);
            if (this.d7(this.cw)) {
                this.zi.ab();
                this.zl.ab();
                this.zk.ab();
                return;
            }
            if (this.gs) {
                if (this.d4()) {
                    if (this.dd.g) {
                        this.dd.t();
                    }
                    this.abk(this.zl, this.zh);
                }
                else {
                    this.abk(this.zi, this.zh);
                }
                return;
            }
            if (this.gg(a)) {
                let b = this.zk;
                if (this.d4()) {
                    if (this.dd.g) {
                        this.dd.t();
                    }
                    this.zk = this.zl;
                    this.zl = b;
                }
                else {
                    this.zk = this.zi;
                    this.zi = b;
                }
                let c = false;
                this.abh(this.zi, this.zh);
                if (this.g4) {
                    this.dd.w();
                    this.dd.r = truncate(this.jd());
                    this.dd.b = this.df != null ? this.df : this.de;
                    if (this.g5) {
                        let d = this.zl;
                        this.zl = this.zk;
                        this.zk = d;
                        c = true;
                    }
                    this.ze.x(this, this.zk, this.zi, this.isVertical, this.y9, this.zf, this.zd, this.zc(), this.c6, this.c5(), runOn(this, this.aab), this.zh.b9);
                    if (this.g5) {
                        let e = this.zl;
                        this.zl = this.zk;
                        this.zk = e;
                    }
                    this.g5 = false;
                }
                if (this.g7) {
                    this.dd.w();
                    this.dd.r = truncate(this.je());
                    this.dd.b = this.dg != null ? this.dg : this.de;
                    if (this.g2) {
                        let f = this.zl;
                        this.zl = this.zk;
                        this.zk = f;
                        c = true;
                    }
                    this.ze.x(this, this.zk, this.zi, this.isVertical, this.y9, this.zf, this.zd, this.zc(), this.c6, this.c5(), runOn(this, this.aab), this.zh.b9);
                    let g = this.zi;
                    this.zi = this.zk;
                    this.zk = g;
                    if (this.g2) {
                        let h = this.zl;
                        this.zl = this.zk;
                        this.zk = h;
                    }
                    this.g2 = false;
                }
                this.eb = false;
                if (!c) {
                    this.o7();
                }
                this.sf();
                if (this.g4) {
                    this.g3 = false;
                    this.g2 = true;
                }
                if (this.g7) {
                    this.g6 = false;
                    this.g5 = true;
                }
            }
            else {
                this.abh(this.zi, this.zh);
                this.abk(this.zi, this.zh);
            }
        }
        aag() {
            if (this.bo != null) {
                let a = this.bo;
                return a.aag();
            }
            let b = 0;
            for (let c of fromEnum(this.dc.series)) {
                if (c == this || this.bo == c) {
                    return b;
                }
                let d = typeCast(RadialBase.$, c);
                if (d != null && d.y9 == this.y9 && d.preferredCategoryMode(d.y9) == 2) {
                    b++;
                }
            }
            return -1;
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.qa(a, c, b);
            return c.toArray();
        }
        qa(a, b, c) {
            let d = this.cw.ca;
            let e = this.cw.b9;
            let f = this.cw.getEffectiveViewport();
            let g, h;
            let i = this.zg.f(this.dc.xr(a), d, e, f, g, h);
            g = i.p4;
            h = i.p5;
            if (g == -1 || h == -1) {
                return;
            }
            let j = h - g + 1;
            if (g > h) {
                j = this.y9.o6 - g + h + 1;
            }
            if (j > 0 && (c == 7 || c == 6)) {
                b.add(((() => {
                    let $ret = new ChartSelection();
                    $ret.series = this;
                    return $ret;
                })()));
                return;
            }
            for (let k = 0; k < j; k++) {
                let l = (k + g) % (this.y9.o6);
                if (c == 2 || c == 1) {
                    b.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = this.y9.oh.item(l);
                        return $ret;
                    })()));
                }
                else {
                    b.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = this.y9.oh.item(l);
                        $ret.series = this;
                        return $ret;
                    })()));
                }
            }
        }
    }
    RadialBase.$t = markType(RadialBase, 'RadialBase', MarkerSeries.$, [IHasCategoryModePreference_$type]);
    RadialBase.$$p = markDep(DependencyProperty, PropertyMetadata, RadialBase, 'raisePropertyChanged', ['AngleAxis:y9:abl', [CategoryAngleAxis.$, null], 'AutoCalloutLabelPrecision:aac:abm', [1, -1], 'AutoCalloutLabelValueSeparator:aal:abn', [2, " - "], 'AutoCalloutOthersLabelFormat:aan:abo', [2, null], 'AutoCalloutOthersLabelFormatSpecifiers:yw:abp', [Array_$type, null], 'AutoCalloutPercentagePrecision:aad:abq', [1, 2], 'AutoCalloutRadialLabelMode:zm:abr', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'CategoryCollisionMode:za:abs', [CategoryCollisionMode_$type, enumGetBox(CategoryCollisionMode_$type, 1)], 'ClipSeriesToBounds:zy:abt', [0, false], 'IsCustomRadialMarkerStyleAllowed:zz:abu', [0, false], 'IsCustomRadialStyleAllowed:z0:abv', [0, false], 'IsTransitionInEnabled:z1:abw', [0, false], 'LegendProportionalRadialLabelFormat:aa0:abx', [2, null], 'LegendProportionalRadialLabelFormatSpecifiers:yy:aby', [Array_$type, null], 'LegendRadialLabelMode:zn:abz', [RadialLabelMode_$type, enumGetBox(RadialLabelMode_$type, 0)], 'OthersLegendProportionalRadialLabelFormat:aa4:ab0', [2, null], 'OthersLegendProportionalRadialLabelFormatSpecifiers:yz:ab1', [Array_$type, null], 'OthersProportionalRadialLabelFormat:aa7:ab2', [2, null], 'OthersProportionalRadialLabelFormatSpecifiers:y0:ab3', [Array_$type, null], 'ProportionalRadialLabelFormat:aba:ab4', [2, null], 'ProportionalRadialLabelFormatSpecifiers:y1:ab5', [Array_$type, null], 'TransitionInMode:zd:ab6', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'ValueAxis:zf:ab7', [NumericRadiusAxis.$, null]]);
    return RadialBase;
})();
/**
 * @hidden
 */
export let RadialBaseView = /*@__PURE__*/ (() => {
    class RadialBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.da = null;
            this.c9 = null;
            this.db = null;
            this.dc = 0;
            this.dd = null;
            this.c9 = a;
            this.db = new Pool$1(Marker.$);
            this.c0(this.db);
        }
        cw(a) {
            this.db.c(a);
        }
    }
    RadialBaseView.$t = markType(RadialBaseView, 'RadialBaseView', MarkerSeriesView.$);
    return RadialBaseView;
})();
