/*
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 { RadialBucketCalculator } from "./RadialBucketCalculator";
import { markType, typeCast, Point_$type, runOn, delegateCombine, enumGetBox, markDep } from "igniteui-react-core";
import { isNaN_, intDivide, isInfinity } from "igniteui-react-core";
import { RadialBase } from "./RadialBase";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { DependencyProperty } from "igniteui-react-core";
import { TrendLineType_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { RadialFrame } from "./RadialFrame";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { FastItemCoalescingColumn } from "./FastItemCoalescingColumn";
import { ProportionalCategoryAngleAxis } from "./ProportionalCategoryAngleAxis";
import { List$1 } from "igniteui-react-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { RadialBaseView } from "./RadialBaseView";
import { CollisionAvoider } from "./CollisionAvoider";
import { Clipper } from "igniteui-react-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { RadialTrendLineManager } from "./RadialTrendLineManager";
import { CategoryMarkerManager } from "./CategoryMarkerManager";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
export let AnchoredRadialBucketCalculator = /*@__PURE__*/ (() => {
    class AnchoredRadialBucketCalculator extends RadialBucketCalculator {
        constructor(a) {
            super(a);
            this.f = null;
            this.f = a;
        }
        getBucket(a) {
            let b = this.f.c1.abx;
            let c = Math.min(a * this.b, b.count - 1);
            let d = Math.min(c + this.b - 1, b.count - 1);
            let e = NaN;
            let f = NaN;
            for (let g = c; g <= d; ++g) {
                let h = b.item(g);
                if (!isNaN_(e)) {
                    if (!isNaN_(h)) {
                        e = Math.min(e, h);
                        f = Math.max(f, h);
                    }
                }
                else {
                    e = h;
                    f = h;
                }
            }
            if (!isNaN_(e)) {
                return [0.5 * (c + d), e, f, 0];
            }
            return [0.5 * (c + d), NaN, NaN, 0];
        }
    }
    AnchoredRadialBucketCalculator.$t = /*@__PURE__*/ markType(AnchoredRadialBucketCalculator, 'AnchoredRadialBucketCalculator', RadialBucketCalculator.$);
    return AnchoredRadialBucketCalculator;
})();
/**
 * @hidden
 */
export let AnchoredRadialSeries = /*@__PURE__*/ (() => {
    class AnchoredRadialSeries extends RadialBase {
        cq() {
            return new AnchoredRadialSeriesView(this);
        }
        o0() {
            super.o0();
            this.yr = null;
            this.yw = null;
        }
        mc() {
            return AnchoredRadialSeries.$$p[4];
        }
        ko(a, b) {
            let c = this.nb(b);
            if (c == AnchoredRadialSeries.$$p[4]) {
                return this.kp(a, b, this.acm);
            }
            if (c == AnchoredRadialSeries.$$p[0]) {
                return this.kp(a, b, this.ace);
            }
            return super.ko(a, b);
        }
        mb(a) {
            let b = this.nb(a);
            if (b == AnchoredRadialSeries.$$p[4]) {
                return this.acm;
            }
            if (b == AnchoredRadialSeries.$$p[0]) {
                return this.ace;
            }
            return super.mb(a);
        }
        ja(a) {
            if (a == this.yy) {
                return this.z0(this.abx.count - 1, this.abx.item(this.abx.count - 1));
            }
            return super.ja(a);
        }
        kr(a) {
            if (this.yr != null && this.yr.cl) {
                if (a == this.yr.lh - 1) {
                    return this.yy;
                }
            }
            return super.kr(a);
        }
        qx(a) {
            super.qx(a);
            this.abr = a;
        }
        constructor() {
            super();
            this.abs = null;
            this.ab2 = false;
            this.abw = null;
            this.adc = { $type: Point_$type, x: 0, y: 0 };
            this.abu = null;
            this.abt = null;
            this.aby = false;
            this.abu = new RadialFrame(3);
            this.abs = new CategoryLineRasterizer();
        }
        j8(a, b) {
            return this.j9(a, b, this.yr, null, this.abx);
        }
        j6(a, b) {
            return this.j7(a, b, this.yr, null, this.abx);
        }
        im(a, b, c, d, e) {
            if (this.abx == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.io(a, b, this.yr, d, e, this.abx.count, null);
        }
        i3(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.ab8(this.yr, this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.yr.ch, d);
            f.c = this.c9.v0;
            let g = this.abx;
            if (this.ab2 && typeCast(FastItemCoalescingColumn.$, g) !== null) {
                g = new FastItemCoalescingColumn(this.yr, g.c, false);
            }
            return this.i5(g, a, this.yr, f, e, null, b, c);
        }
        v6(a, b, c) {
            if (this.yw == null || this.yr == null || this.ct == null || this.ct.by.isEmpty || this.ct.bx.isEmpty) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.getEffectiveViewport1(this.ct);
            let e = new ScalerParams(0, this.ct.by, this.ct.bx, this.yw.ch, d);
            e.c = this.getEffectiveViewport1(this.ct);
            let f = this.i3(a, b, c);
            f = this.yw.ek(f, e);
            let g = this.yz.c(a, this.ct.by, this.ct.bx, d);
            if (!b && this.yr != null) {
                let h = this.j8(a, c);
                let i = this.j6(a, c);
                let j = this.ab8(this.yr, this.ct.by, this.ct.bx, d);
                let k = new ScalerParams(0, this.ct.by, this.ct.bx, this.yr.ch, d);
                k.c = this.c9.v0;
                let l = this.im(a, h, this.yr, k, j);
                let m = this.im(a, i, this.yr, k, j);
                if (this.yr.cl) {
                    if (m <= l) {
                        j = this.ab7(i, this.yr, this.ct.by, this.ct.bx, d);
                        if (isNaN_(j)) {
                            j = 0;
                        }
                        g = this.yr.ek(i, k) + j;
                    }
                    else {
                        j = this.ab7(h, this.yr, this.ct.by, this.ct.bx, d);
                        if (isNaN_(j)) {
                            j = 0;
                        }
                        g = this.yr.ek(h, k) + j;
                    }
                }
                else {
                    if (m <= l) {
                        g = this.yr.ek(i, k) + j;
                    }
                    else {
                        g = this.yr.ek(h, k) + j;
                    }
                }
            }
            let n = this.yz.d(g, f, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport());
            let o = this.yz.e(g, f, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport());
            return { $type: Point_$type, x: n, y: o };
        }
        f9() {
            return this.highlightedItemsSource != null || this.ace != null;
        }
        hr() {
            let a = super.hr();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "ValueMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedValueMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.acr));
                a.add(b);
            }
            return a;
        }
        acr(a, b) {
            if (this.ace != null) {
                b.value = this.ace;
                return;
            }
            b.value = this.acm;
        }
        get abx() {
            return this.abw;
        }
        set abx(a) {
            if (this.abw != a) {
                let b = this.abw;
                this.abw = a;
                this.raisePropertyChanged("ValueColumn", b, this.abw);
            }
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = new DataLegendSeriesValueInfo();
            c.a = 0;
            this.ab2 = true;
            c.l = this.i3({ $type: Point_$type, x: a, y: b }, false, false);
            this.ab2 = false;
            c.q = "Value";
            c.r = this.acm != null ? this.acm : "Value";
            c.s = this.aci != null ? this.aci : "V:";
            c.t = this.ack != null ? this.ack : "";
            let d = new DataLegendSeriesContext();
            d.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(c);
                return $ret;
            })());
            d.h = this.ma();
            return d;
        }
        get ac8() {
            return this.c(AnchoredRadialSeries.acv);
        }
        set ac8(a) {
            this.h(AnchoredRadialSeries.acv, a);
        }
        ax(a) {
            if (a != null && a == this.yr && this.abx != null && this.abx.count > 0) {
                return new AxisRange(0, this.abx.count - 1);
            }
            if (a != null && a == this.yw && this.abx != null && this.abx.count > 0) {
                return new AxisRange(this.abx.minimum, this.abx.maximum);
            }
            return null;
        }
        z0(a, b) {
            if (this.ab6) {
                let c = this.abx.c;
                if (a < 0) {
                    return super.z0(a, b);
                }
                if (a > c.count - 1) {
                    if (typeCast(ProportionalCategoryAngleAxis.$, this.yr) !== null) {
                        let d = this.abx;
                        return d.f;
                    }
                    return super.z0(a, b);
                }
                return c.item(a);
            }
            else {
                return super.z0(a, b);
            }
        }
        di(a) {
            let b = super.di(a);
            this.aby = false;
            if (this.yr != null && this.yr.cl) {
                this.aby = true;
                b = new FastItemCoalescingColumn(this.yr, b, this.ab6);
            }
            return b;
        }
        acq(a, b) {
            if (this.aby) {
                let c = b;
                let d = c.c;
                a.deregisterColumn(d);
            }
            else {
                a.deregisterColumn(b);
            }
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            if (this.abr.c2.g$b(a, b, c, d)) {
                this.rn(false);
                this.qh();
            }
            let e = typeCast(NumericAxisBase.$, this.yw);
            switch (b) {
                case AnchoredRadialSeries.$$p[2]:
                case AnchoredRadialSeries.$$p[3]:
                    this.qb();
                    break;
                case AnchoredRadialSeries.$$p[1]:
                case RadialBase.$$p[0]:
                    if (this.abx != null) {
                        this.acq(this.dl, this.abx);
                        this.abx = this.di(this.acm);
                    }
                    break;
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) !== null) {
                        this.acq(c, this.abx);
                        this.abx = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) !== null) {
                        this.abx = this.di(this.acm);
                        this.abr.cx.e(this.ib);
                    }
                    if (e != null && !e.c1()) {
                        this.abr.cx.e(this.ib);
                        this.rn(this.ge && c != null);
                    }
                    break;
                case AnchoredRadialSeries.$$p[4]:
                    if (this.dl != null) {
                        this.acq(this.dl, this.abx);
                        this.abx = this.di(this.acm);
                    }
                    break;
                case "ValueColumn":
                    if (e != null && !e.c1()) {
                        this.abr.cx.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case "TrendLineBrush":
                    this.rb(b);
                    break;
                case "TrendLineType":
                    this.qh();
                    break;
            }
        }
        o9(a, b, c, d) {
            super.o9(a, b, c, d);
            switch (a) {
                case 4:
                case 1:
                case 0:
                    this.abr.cx.e(this.ib);
                    break;
            }
            this.abr.c2.g$e(a, b, c, d);
            switch (a) {
                case 4:
                    if (this.yw != null && !this.yw.c1()) {
                        this.rn(true);
                    }
                    break;
                case 1:
                    if (this.yw != null && !this.yw.c1()) {
                        this.rn(true);
                    }
                    break;
                case 0:
                    if (this.yw != null && !this.yw.c1()) {
                        this.rn(true);
                    }
                    break;
                case 2:
                    if (this.acm != null && this.abr.cx.b > 0 && this.yw != null && !this.yw.c1()) {
                        this.rn(true);
                    }
                    break;
                case 3:
                    if (d == this.acm) {
                        if (this.yw != null && !this.yw.c1()) {
                            this.rn(true);
                        }
                    }
                    break;
            }
        }
        hc(a, b, c) {
            let d = super.hc(a, b, c);
            let e = c;
            if (this.dl == null || this.dl.count == 0 || this.yr == null || this.abx == null || this.yr.lg == 0 || this.yw == null || isInfinity(this.yw.ly) || isInfinity(this.yw.lx) || e.cx.b < 1) {
                d = false;
            }
            return d;
        }
        getOffsetValue() {
            return this.ab8(this.yr, this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        getCategoryWidth() {
            return this.yr.getCategorySize(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        get_ab3() {
            return false;
        }
        get ab3() {
            return this.get_ab3();
        }
        get_ei() {
            return true;
        }
        get_f3() {
            return this.yw != null && this.yw.ch;
        }
        ab8(a, b, c, d) {
            let e = 0;
            let f = this.preferredCategoryMode(a);
            if (f == 0 && a.categoryMode != 0) {
                f = 1;
            }
            switch (f) {
                case 0:
                    e = 0;
                    break;
                case 1:
                    e = 0.5 * a.getCategorySize(b, c, d);
                    break;
                case 2:
                    e = a.getGroupCenter(this.zz(), b, c, d);
                    break;
            }
            if (a.ch) {
                e = -e;
            }
            return e;
        }
        ab7(a, b, c, d, e) {
            let f = 0;
            let g = this.preferredCategoryMode(b);
            if (g == 0 && b.categoryMode != 0) {
                g = 1;
            }
            switch (g) {
                case 0:
                    f = 0;
                    break;
                case 1:
                    f = 0.5 * b.m4(a, c, d, e);
                    break;
                case 2:
                    f = b.m3(a, this.zz(), c, d, e);
                    break;
            }
            if (b.ch) {
                f = -f;
            }
            return f;
        }
        get_ab5() {
            return false;
        }
        get ab5() {
            return this.get_ab5();
        }
        get_abz() {
            return false;
        }
        get abz() {
            return this.get_abz();
        }
        aaz(a, b) {
            let c = b.by;
            let d = b.bx;
            let e = this.getEffectiveViewport1(b);
            let f = this.yr;
            let g = this.yw;
            let h = g.ly;
            let i = g.lx;
            a.f.clear();
            a.n.clear();
            a.q.clear();
            let j = this.w8();
            let k = 0;
            let l = b;
            let m = f.cl;
            let n = new CollisionAvoider();
            let o = 0;
            let p = 0;
            let q = b.cx.d;
            o = this.ab8(f, c, d, e);
            l.c2.i = this.yw.np;
            l.c2.h = this.yw.no;
            l.c2.j = (r, s) => this.ab9(r, s, c, d, e);
            l.c2.k = (r, s) => this.aca(r, s, c, d, e);
            let r = ((() => {
                let $ret = new Clipper(0, d, false);
                $ret.i = a.q;
                return $ret;
            })());
            let s = ((() => {
                let $ret = new TrendResolutionParams();
                $ret.e = b.cx.b;
                $ret.f = b.cx.c;
                $ret.g = q;
                $ret.a = o;
                $ret.d = this.ib;
                $ret.i = d;
                $ret.h = e;
                $ret.j = c;
                return $ret;
            })());
            l.c2.l(a.q, this.abv, this.abx, this.acc, (t) => this.yr.getScaledAngle(t), (t) => this.yw.nv(t), s, r);
            let t = true;
            if (this.ab4(b)) {
                q--;
            }
            for (let u = b.cx.c; u <= q; ++u) {
                let v = u;
                if (v * b.cx.b >= this.yr.lg) {
                    v -= intDivide((this.yr.lg), b.cx.b);
                }
                let w = b.cx.getBucket(v);
                p = 0;
                if (m) {
                    p = this.zr(v, c, d, e);
                }
                w[3] = p;
                if (!isNaN_(w[0])) {
                    let x = false;
                    if (m) {
                        o = this.ab7(v, f, c, d, e);
                        if (isNaN_(o)) {
                            o = 0;
                            x = true;
                        }
                    }
                    w[0] = f.getScaledAngle(w[0]) + o;
                    if (w[1] < h || w[1] > i) {
                        if (this.ab5) {
                            if (w[1] > i && this.abz) {
                            }
                            else {
                                x = true;
                            }
                        }
                        else {
                            if (w[1] > i && this.abz) {
                            }
                            else {
                                continue;
                            }
                        }
                    }
                    if (x) {
                        w[1] = NaN;
                        w[2] = NaN;
                    }
                    w[1] = g.nv(w[1]);
                    if (b.cx.b > 1) {
                        if (w[2] < h || w[2] > i) {
                            continue;
                        }
                        w[2] = g.nv(w[2]);
                    }
                    else {
                        w[2] = w[1];
                    }
                    if ((isNaN_(w[1]) || isNaN_(w[2])) && t && this.ab3 && this.ab1()) {
                        q++;
                    }
                    else {
                        t = false;
                    }
                    a.f.add(w);
                    if (j) {
                        let y = Math.min(v * b.cx.b, this.dl.count - 1);
                        let z = false;
                        if (this.yr.cl) {
                            let aa = this.yr;
                            let ab = aa.hasOthersCategory && (v * b.cx.b) == this.yr.lg - 1;
                            z = ab;
                        }
                        let ac = this.yz.d(w[0], w[1], c, d, e);
                        let ad = this.yz.e(w[0], w[1], c, d, e);
                        let ae = new Rect(0, ac - 5, ad - 5, 11, 11);
                        if (!isNaN_(ac) && !isNaN_(ad) && !isInfinity(ac) && !isInfinity(ad) && n.tryAdd(ae)) {
                            a.n.add({ $type: Point_$type, x: w[0], y: w[1] });
                            let af = b.cy.item(k);
                            af.al = v;
                            af.ak = y;
                            af.content.item = this.dl.item(y);
                            if (z) {
                                af.ak = this.dl.count;
                                let ag = this.yr;
                                af.content.item = this.yy;
                            }
                            ++k;
                        }
                    }
                }
                else {
                    if (t && this.ab3 && this.ab1()) {
                        q++;
                    }
                }
            }
            b.cy.count = k;
            return;
        }
        ab9(a, b, c, d, e) {
            return this.yz.d(a, b, c, d, e);
        }
        aca(a, b, c, d, e) {
            return this.yz.e(a, b, c, d, e);
        }
        ab4(a) {
            let b = a;
            return !this.ab3 && b.cx.c == 0 && b.cx.d == this.yr.lg;
        }
        abq(a, b, c) {
            let d = null;
            let e = c.by;
            let f = c.bx;
            if (b > -1 && !e.isEmpty && !f.isEmpty) {
                let g = a._inner[0][0] < f.left - 2000 ? f.left - 10 : NaN;
                let h = f.bottom + 10;
                let i = a._inner[b][0] > f.right + 2000 ? f.right + 10 : NaN;
                let j = f.top - 10;
                d = new Clipper(1, g, h, i, j, false);
            }
            return d;
        }
        acu(a, b, c, d, e) {
            if (a.count > 0 && d.count > 0) {
                if (!e || this.ab0()) {
                    a.add(this.adc);
                    a.add(a._inner[0]);
                    d.add(this.adc);
                    d.add(d._inner[0]);
                }
            }
        }
        ab1() {
            return !this.ab0();
        }
        ab0() {
            let a = this.ct.by;
            return !a.containsPoint({ $type: Point_$type, x: 0.5, y: 0.5 });
        }
        o3(a, b) {
            super.o3(a, b);
            let c = b;
            if (a) {
                c.cy.clear();
            }
            c.c2.g$d();
        }
        aa2(a, b) {
            this.qt();
            let c = b.by;
            let d = b.bx;
            let e = this.getEffectiveViewport1(b);
            let f = this.wd(b);
            let g = b;
            g.c2.g$g(a.q);
            let h = new List$1(Point_$type, 0);
            for (let i = 0; i < a.n.count; i++) {
                let j = a.n._inner[i];
                let k = this.yz.d(j.x, j.y, c, d, e);
                let l = this.yz.e(j.x, j.y, c, d, e);
                let m = { $type: Point_$type, x: k, y: l };
                h.add(m);
            }
            CategoryMarkerManager.e(this, h, g.cy, this.xa);
            this.acp(b, a);
            g.cr();
            this.aco(d, c, e, f, g);
        }
        abp(a, b, c) {
            if (b < a || a < 0 || a > this.abx.count || b < 0 || b > this.abx.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cn;
            let f = null;
            if (e) {
                f = c.i$b;
            }
            for (let g = a; g <= b; g++) {
                let h = g;
                if (e) {
                    h = f._inner[h];
                }
                d[g - a] = this.dl.item(g);
            }
            return d;
        }
        acs(a, b, c, d, e, f) {
            let g = this.bv != 1;
            let h = this.cn != 1;
            let i = this.cm != 1;
            let j = this.d0;
            this.y7.a3(this.y7.d, d.cn, a, b, c, d, e, f, true);
            this.y7.aa(this.h9);
            let k = this.y7.ax;
            let l = null;
            let m = null;
            let n = null;
            let o = this.dl;
            let p = null;
            let q = null;
            let r = null;
            if (j && this.c9 != null && !k.e) {
                let s = this.vi(k.z);
                let t = this.vj(k.z);
                this.y7.ag = s;
                this.y7.ah = t;
                k.aa = s;
                k.ab = t;
            }
            if (g && this.c9 != null) {
                l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, true);
                if (this.c9.dj.isCrossContextHighlight(this)) {
                    p = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, true);
                }
                k.c = l;
            }
            if (h && this.c9 != null) {
                m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, true);
                if (m == null && this.bl != null) {
                    m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, true);
                }
                if (this.c9.dk.isCrossContextHighlight(this)) {
                    q = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, true);
                }
                k.d = m;
            }
            if (i && this.c9 != null) {
                n = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, true);
                if (this.c9.di.isCrossContextHighlight(this)) {
                    r = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, true);
                }
                k.b = n;
            }
            k.h = f;
            this.aa0(k);
            this.y7.y(this, l, m, n, f, g, h, i, k.v, this.c9.dj.totalHighWaterMark, k.x, this.c9.dk.totalHighWaterMark, k.t, this.c9.di.totalHighWaterMark);
        }
        act(a, b, c, d, e, f) {
            let g = this.bv != 1;
            let h = this.cn != 1;
            let i = this.cn != 1;
            let j = this.d0;
            this.y7.a3(this.y7.b, d.cn, a, b, c, d, e, f, false);
            this.y7.ab(this.h9);
            let k = this.y7.ay;
            let l = null;
            let m = null;
            let n = null;
            let o = this.dl;
            if (j && this.c9 != null && !k.e) {
                let p = this.vh(k.z);
                let q = this.vk(k.z);
                this.y7.ag = p;
                this.y7.ah = q;
                k.aa = p;
                k.ab = q;
            }
            if (g && this.c9 != null) {
                l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, false);
                k.c = l;
            }
            if (h && this.c9 != null) {
                m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, false);
                if (m == null && this.bl != null) {
                    m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, false);
                }
                k.d = m;
            }
            k.h = f;
            this.aa1(k);
            this.y7.z(this, l, m, n, f, g, h, i, b < 0);
        }
        acp(a, b) {
            a.b7 = true;
            this.y7.a1(this, this.zn(), runOn(this, this.yf), this.zx(a), this.zy(a));
            let c = this.y7.d;
            let d = c != null;
            let e = this.yr;
            if (e == null) {
                return;
            }
            let f = this.getEffectiveViewport1(a);
            let g = new ScalerParams(0, a.by, a.bx, e.ch, f);
            let h = this.dl == null ? 0 : this.dl.count;
            let i = a;
            let j = b.f;
            let k = i.cx.c;
            let l = i.cx.d;
            let m = i.cx.b;
            let n = k * m;
            for (let o = 0; o < a.cy.count; o++) {
                let p = a.cy.item(o);
                let q = p.content;
                if (d) {
                    let r = p.al;
                    this.acs(j, r, h, e, g, a.q);
                }
                this.y7.ac(p, q);
            }
        }
        aco(a, b, c, d, e) {
            e.c3(a, b, c, d);
        }
        sb() {
            super.sb();
            if (this.index < 0) {
                return;
            }
            this.abr.c4();
        }
        kv(a, b) {
            if (a == this.abr.c2.g$j) {
                return null;
            }
            return super.kv(a, b);
        }
        gb(a) {
            let b = this.ct.by;
            b = b.copy();
            let c = this.ct.bx;
            let d = !b.isEmpty && !c.isEmpty && this.dl != null ? this.dl.indexOf(a) : -1;
            if (this.yr == null || this.abx == null || this.yw == null) {
                return false;
            }
            if (d < 0 || d > this.abx.count - 1) {
                return false;
            }
            let e = this.yr.getScaledAngle(d);
            let f = this.yw.nv(this.abx.item(d));
            if (isNaN_(f)) {
                f = (this.yw.no + this.yw.np) / 2;
            }
            let g = 0.5 + (Math.cos(e) * f);
            let h = 0.5 + (Math.sin(e) * f);
            if (!isNaN_(g)) {
                if (g < b.left + 0.1 * b.width) {
                    g = g + 0.4 * b.width;
                    b.x = g - 0.5 * b.width;
                }
                if (g > b.right - 0.1 * b.width) {
                    g = g - 0.4 * b.width;
                    b.x = g - 0.5 * b.width;
                }
            }
            if (!isNaN_(h)) {
                if (h < b.top + 0.1 * b.height) {
                    h = h + 0.4 * b.height;
                    b.y = h - 0.5 * b.height;
                }
                if (h > b.bottom - 0.1 * b.height) {
                    h = h - 0.4 * b.height;
                    b.y = h - 0.5 * b.height;
                }
            }
            if (this.c1 != null) {
                this.c1.au(this.c9, b, true);
            }
            return d >= 0;
        }
        rp(a, b) {
            super.rp(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            this.ct.a4(b);
            let c = typeCast(AnchoredRadialSeriesView.$, this.cs);
            c.cx.e(this.ib);
            if (this.d3(this.cs)) {
                return;
            }
            if (!this.gq) {
                this.abu = new RadialFrame(3);
                this.aaz(this.abu, c);
            }
            this.gq = false;
            this.aa2(this.abu, c);
            this.gy = false;
        }
        rm(a, b, c, d, e) {
            super.rm(a, b, c, d, e);
            let f = this.a9.a$j.item(d);
            let g = f;
            g.cx.e(this.ib);
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.abt == null) {
                this.abt = new RadialFrame(3);
            }
            this.abt.v();
            this.aaz(this.abt, g);
            this.aa2(this.abt, g);
        }
        pv(a) {
            super.pv(a);
            this.bb.exportTrendlineData(this, a, this.abr.c2.g$j);
        }
    }
    AnchoredRadialSeries.$t = /*@__PURE__*/ markType(AnchoredRadialSeries, 'AnchoredRadialSeries', RadialBase.$);
    AnchoredRadialSeries.acv = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, AnchoredRadialSeries.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue)));
    AnchoredRadialSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnchoredRadialSeries, 'raisePropertyChanged', ['HighlightedValueMemberPath:ace:acw', [2, null], 'UseCategoryNormalizedValues:ab6:ac4', [0, false], 'ValueMemberAsLegendLabel:aci:ac5', [2, null], 'ValueMemberAsLegendUnit:ack:ac6', [2, null], 'ValueMemberPath:acm:ac7', [2, null], 'TrendLineType:abv:ac2', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:acb:ac1', [1, 1.5], 'TrendLinePeriod:acc:ac0', [1, 7], 'TrendLineZIndex:acd:ac3', [1, 1], 'TrendLineBrush:ac9:acx', [Brush.$, null], 'TrendLineDashArray:ada:acy', [DoubleCollection.$], 'TrendLineDashCap:adb:acz', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]);
    return AnchoredRadialSeries;
})();
/**
 * @hidden
 */
export let AnchoredRadialSeriesView = /*@__PURE__*/ (() => {
    class AnchoredRadialSeriesView extends RadialBaseView {
        constructor(a) {
            super(a);
            this.c1 = null;
            this.c2 = null;
            this.cx = new AnchoredRadialBucketCalculator(this);
            this.c1 = a;
            this.c2 = new RadialTrendLineManager();
        }
        c3(a, b, c, d) {
        }
        c4() {
            this.c1.ac8 = null;
            if (this.c1.ac9 != null) {
                this.c1.ac8 = this.c1.ac9;
            }
            else {
                this.c1.ac8 = this.c1.u3;
            }
        }
        a7(a, b) {
            if (a.d) {
                if (!b) {
                }
                if (this.c1.abv != 0 && !b) {
                    let c = this.c2.g$j;
                    c.ad = this.c1.acb;
                    c._stroke = this.c1.ac8;
                    c.ai = this.c1.ada;
                    c.aj = this.c1.adb;
                    a.v(c);
                }
            }
            super.a7(a, b);
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.c1.yr.f1 != null) {
                a += "<span>${item." + this.c1.yr.f1 + "}</span><br/>";
            }
            a += "<span";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.c1.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.c1.acm + "}</span></div>";
            return a;
        }
    }
    AnchoredRadialSeriesView.$t = /*@__PURE__*/ markType(AnchoredRadialSeriesView, 'AnchoredRadialSeriesView', RadialBaseView.$);
    return AnchoredRadialSeriesView;
})();
