/*
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 { MarkerSeries } from "./MarkerSeries";
import { Base, runOn, delegateCombine, Number_$type, enumGetBox, Point_$type, typeCast, fromEnum, markType, markDep } from "igniteui-react-core";
import { PolarAxisInfoCache } from "./PolarAxisInfoCache";
import { SeriesRenderer$2 } from "./SeriesRenderer$2";
import { PolarFrame } from "./PolarFrame";
import { DependencyProperty } from "igniteui-react-core";
import { NumericAngleAxis } from "./NumericAngleAxis";
import { NumericRadiusAxis } from "./NumericRadiusAxis";
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 { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { HighlightingInfo } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { PolarAxes } from "./PolarAxes";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { SeriesRenderingArguments } from "./SeriesRenderingArguments";
import { AxisRange } from "./AxisRange";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { GeometryUtil } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { Clipper } from "igniteui-react-core";
import { PolarTrendLineManager } from "./PolarTrendLineManager";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { AssigningPolarStyleEventArgs } from "./AssigningPolarStyleEventArgs";
import { AssigningPolarMarkerStyleEventArgs } from "./AssigningPolarMarkerStyleEventArgs";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
import { Defaults } from "./Defaults";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { GeometryGroup } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
export let PolarBase = /*@__PURE__*/ (() => {
    class PolarBase extends MarkerSeries {
        cq() {
            return new PolarBaseView(this);
        }
        qx(a) {
            super.qx(a);
            this.yp = a;
        }
        o0() {
            super.o0();
            this.yl = null;
            this.ym = null;
        }
        get_fn() {
            return true;
        }
        d9(a, b, c, d) {
            if (!this.hasMarkers) {
                return false;
            }
            let e = this.yl;
            let f = new ScalerParams(1, this.c9.vl, this.wl, e.ch);
            f.c = this.getEffectiveViewport1(this.ct);
            let g = this.ym;
            let h = new ScalerParams(1, this.c9.vl, this.wl, g.ch);
            h.c = this.getEffectiveViewport1(this.ct);
            a.clear();
            this.wy.cj((i) => {
                if (i._visibility == 0) {
                    let j = new SeriesPointOfInterest();
                    let k = i.n;
                    let l = i.o;
                    if (k < this.wl.left || k > this.wl.right || l < this.wl.top || l > this.wl.bottom) {
                        return;
                    }
                    let m;
                    let n;
                    let o = this.yn.f(k, l, this.ct.by, this.ct.bx, this.ct.getEffectiveViewport(), m, n);
                    m = o.p5;
                    n = o.p6;
                    j.d = m;
                    j.e = n;
                    j.b = i.content;
                    j.g = this.va;
                    j.c = i.ak;
                    if (this.g7) {
                        j.g = this.vh(i.ak);
                    }
                    a.add(j);
                }
            });
            return true;
        }
        constructor() {
            super();
            this.yq = null;
            this.yh = null;
            this.yo = null;
            this.ab7 = null;
            this.ab6 = null;
            this.ab5 = null;
            this.y2 = null;
            this.y9 = null;
            this.za = null;
            this.yu = new PolarFrame();
            this.yw = new PolarFrame();
            this.ys = new PolarFrame();
            this.yn = null;
            this.zs = null;
            this.yy = 1;
            this.ze = false;
            this.zd = false;
            this.y7 = null;
            this.y8 = null;
            this.assigningPolarStyle = null;
            this.assigningPolarMarkerStyle = null;
            this.yx = null;
            this.yv = null;
            this.yr = null;
            this.yx = new PolarSeriesRenderManager();
            this.yz = this.y0();
            this.yv = new PolarFrame();
            this.yw.x = runOn(this, this.ab4);
            this.yu.x = runOn(this, this.ab4);
            this.ys.x = runOn(this, this.ab4);
            this.y2 = new SeriesRenderer$2(PolarFrame.$, PolarBaseView.$, 0, runOn(this, this.aa5), runOn(this, this.aa9), runOn(this, this.d1), runOn(this, this.r1), runOn(this, this.aay));
        }
        aay() {
            if (this.da.g) {
                this.da.t();
            }
        }
        aa0() {
            this.yn.e(this.yq.w, this.zb, this.zc, this.ab7, this.ab6, this.ab5, (a, b) => Math.cos(b), (a, b) => Math.sin(b), true);
        }
        f9() {
            return this.highlightedItemsSource != null || (this.aag != null && this.aae != null);
        }
        zq() {
            return false;
        }
        hr() {
            let a = super.hr();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "AngleMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedAngleMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.aa1));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "RadiusMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedRadiusMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.aa2));
                a.add(c);
            }
            if (this.zq()) {
                let d = ((() => {
                    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(d);
            }
            if (!this.zq()) {
                let e = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.rv));
                a.add(e);
            }
            if (!this.zq()) {
                let f = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.rv));
                a.add(f);
            }
            return a;
        }
        aa2(a, b) {
            if (this.aag != null) {
                b.value = this.aag;
                return;
            }
            b.value = this.aat;
        }
        aa1(a, b) {
            if (this.aae != null) {
                b.value = this.aae;
                return;
            }
            b.value = this.aab;
        }
        get zb() {
            return this.y9;
        }
        set zb(a) {
            if (this.y9 != a) {
                let b = this.zb;
                this.y9 = a;
                this.raisePropertyChanged("AngleColumn", b, this.zb);
            }
        }
        get zc() {
            return this.za;
        }
        set zc(a) {
            if (this.za != a) {
                let b = this.zc;
                this.za = a;
                this.raisePropertyChanged("RadiusColumn", b, this.zc);
            }
        }
        get abz() {
            return this.c(PolarBase.aba);
        }
        set abz(a) {
            this.h(PolarBase.aba, a);
        }
        yt() {
            let a = this.ys;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.yw;
            }
            return a;
        }
        p6() {
            super.p6();
            if (this.ym != null) {
                this.ym.h9(false);
            }
            if (this.yl != null) {
                this.yl.h9(false);
            }
        }
        o9(a, b, c, d) {
            let e = false;
            this.yp.c0.g$e(a, b, c, d);
            if (this.yl != null && !this.yl.c1()) {
                e = true;
            }
            if (this.ym != null && !this.ym.c1()) {
                e = true;
            }
            if (e) {
                this.rn(true);
            }
        }
        sk(a, b) {
            this.rn(false);
        }
        sl(a, b) {
            this.rn(false);
        }
        hc(a, b, c) {
            let d = true;
            if (!super.hc(a, b, c) || !c.o() || b.isEmpty || a.isEmpty || this.yl == null || this.ym == null || this.zb == null || this.zc == null || this.zb.count == 0 || this.zc.count == 0 || this.dl == null || this.dl.count != this.zb.count || this.dl.count != this.zc.count || this.yn == null || this.yl.bi == null || this.ym.bi == null || this.yl.ly == this.yl.lx || this.ym.ly == this.ym.lx) {
                d = false;
            }
            return d;
        }
        ro(a) {
            super.ro(a);
            let b;
            let c;
            let d = this.getViewInfo(c, b);
            c = d.p0;
            b = d.p1;
            if (!this.hc(c, b, this.ct)) {
                this.o3(true, this.ct);
                return;
            }
            this.ab7 = b;
            this.ab6 = c;
            this.ab5 = this.ct.getEffectiveViewport();
            this.yo = new PolarAxisInfoCache(this.yl, this.ym, this.dl);
            let e = new SeriesRenderingArguments(this, c, b, a, this.gp);
            let f = this.y2.g(e, this.yu, this.ys, this.yw, this.yp);
            this.yu = f.p1;
            this.ys = f.p2;
            this.yw = f.p3;
        }
        ab4(a) {
            let b = this.yn.h(a.x, a.y, this.ab7, this.ab6, this.ab5, this.yo.e, this.yo.d, this.yo.g, this.yo.f, this.yo.i, this.yo.h);
            return b;
        }
        ax(a) {
            if (a != null && a == this.yl && this.zb != null) {
                return new AxisRange(this.zb.minimum, this.zb.maximum);
            }
            if (a != null && a == this.ym && this.zc != null) {
                return new AxisRange(this.zc.minimum, this.zc.maximum);
            }
            return null;
        }
        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.yl == null || this.zb == null || this.ym == null || this.zc == null) {
                return false;
            }
            if (d < 0 || d > this.zb.count - 1 || d > this.zc.count - 1) {
                return false;
            }
            let e = this.yl.getScaledAngle(this.zb.item(d));
            let f = this.ym.nv(this.zc.item(d));
            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;
        }
        kl(a) {
            let b = this.j1(a);
            if (this.dl != null && b >= 0 && b < this.dl.count) {
                return this.dl.item(b);
            }
            return null;
        }
        j1(a) {
            let b = truncate(Math.round(this.ip(a)));
            return b;
        }
        ip(a) {
            switch (this.yz) {
                case 1: return this.zw(a);
                case 3: return this.zx(a);
                case 2: return this.zu(a);
                case 4: return this.zv(a);
            }
            return -1;
        }
        zv(a) {
            return this.zy(a, false);
        }
        zu(a) {
            let b = this.v1(a);
            let c = b.x;
            let d = b.y;
            if (this.dl == null || this.yl == null || this.ym == null || this.zb == null || this.zc == null) {
                return -1;
            }
            if (this.dl.count > this.z0) {
                return -1;
            }
            if (!this.zi()) {
                return -1;
            }
            let e = this.zs;
            let f = 1.7976931348623157E+308;
            let g = -1;
            for (let h = 0; h < this.zb.count; h++) {
                let i = e._inner[h].x;
                let j = e._inner[h].y;
                let k = (c - i) * (c - i) + (d - j) * (d - j);
                if (k < f) {
                    f = k;
                    g = h;
                }
            }
            return g;
        }
        zi() {
            let a = this.ys;
            if (this.d1()) {
                a = this.yw;
            }
            if (a == null || a.w.count == 0) {
                return false;
            }
            this.zs = a.w;
            return true;
        }
        zy(a, b) {
            if (!this.zl) {
                return -1;
            }
            let c = { $type: Point_$type, x: 0, y: 0 };
            let d = true;
            let e = this.ys;
            if (this.d1()) {
                e = this.yw;
            }
            if (e == null) {
                return -1;
            }
            if (e.m == null) {
                return -1;
            }
            if (this.dl == null || this.dl.count > this.z0) {
                return -1;
            }
            if (!this.zi()) {
                return -1;
            }
            let f = this.zs;
            let g = this.v1(a);
            let h = 1.7976931348623157E+308;
            let i = -1;
            for (let j = 0; j < f.count; j++) {
                let k = f._inner[j];
                if (j > 0) {
                    if (isNaN_(k.x) || isNaN_(k.y) || isNaN_(c.x) || isNaN_(c.y)) {
                        c = k;
                        continue;
                    }
                    if (!b || e.j.containsKey(this.dl.item(j)) || e.j.containsKey(this.dl.item(j - 1))) {
                        let l = GeometryUtil.g(g, c, k);
                        if (l < h) {
                            h = l;
                            i = j;
                        }
                    }
                }
                c = k;
            }
            if (i >= 0) {
                let m = f._inner[i];
                let n = f._inner[i - 1];
                if (!b || (e.j.containsKey(this.dl.item(i)) && e.j.containsKey(this.dl.item(i - 1)))) {
                    let o = GeometryUtil.l(g, n, m);
                    return (i - 1) + o;
                }
                else if (e.j.containsKey(this.dl.item(i))) {
                    return i;
                }
                else {
                    return i - 1;
                }
            }
            return -1;
        }
        zx(a) {
            return this.zy(a, true);
        }
        zw(a) {
            let b = null;
            let c = 1.7976931348623157E+308;
            let d = this.v1(a);
            let e = d.x;
            let f = d.y;
            if (this.yp.c1.e > this.z0) {
                return -1;
            }
            this.yp.c4((g) => {
                if (g._visibility == 0) {
                    let h = this.yp.cu(g);
                    let i = h.left + h.width / 2;
                    let j = h.top + h.height / 2;
                    let k = (e - i) * (e - i) + (f - j) * (f - j);
                    if (k < c) {
                        c = k;
                        b = g;
                    }
                }
            });
            if (b != null) {
                return b.ak;
            }
            return -1;
        }
        v6(a, b, c) {
            if (this.yl == null || this.ym == null || this.zb == null || this.zc == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let d = this.ct.by;
            let e = this.ct.bx;
            let f = this.getEffectiveViewport();
            let g = new ScalerParams(0, d, e, this.yl.ch, f);
            let h = ((() => {
                let $ret = new ScalerParams(0, d, e, this.ym.ch, f);
                $ret.b = this.iw();
                return $ret;
            })());
            if (b) {
                let i = this.ip(a);
                if (i == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                let j = truncate(Math.floor(i));
                let k = truncate(Math.ceil(i));
                if (j < 0) {
                    j = 0;
                }
                if (k < 0) {
                    k = 0;
                }
                if (k > this.dl.count - 1) {
                    k = this.dl.count - 1;
                }
                if (j > this.dl.count - 1) {
                    j = this.dl.count - 1;
                }
                if (k == j) {
                    return this.yn.h(this.zb.item(j), this.zc.item(j), d, e, f, this.yo.e, this.yo.d, this.yo.g, this.yo.f, this.yo.i, this.yo.h);
                }
                let l = i - Math.floor(i);
                let m = this.yn.h(this.zb.item(j), this.zc.item(j), d, e, f, this.yo.e, this.yo.d, this.yo.g, this.yo.f, this.yo.i, this.yo.h);
                let n = this.yn.h(this.zb.item(k), this.zc.item(k), d, e, f, this.yo.e, this.yo.d, this.yo.g, this.yo.f, this.yo.i, this.yo.h);
                let o = m.x;
                let p = m.y;
                let q = n.x;
                let r = n.y;
                let s = q - o;
                let t = r - p;
                return { $type: Point_$type, x: o + s * l, y: p + t * l };
            }
            else {
                let u = this.j1(a);
                if (u == -1) {
                    return { $type: Point_$type, x: NaN, y: NaN };
                }
                return this.yn.h(this.zb.item(u), this.zc.item(u), d, e, f, this.yo.e, this.yo.d, this.yo.g, this.yo.f, this.yo.i, this.yo.h);
            }
        }
        ai() {
            return [this.yl, this.ym];
        }
        ko(a, b) {
            let c = this.nb(b);
            if (c == PolarBase.$$p[3]) {
                return this.kp(a, b, this.aab);
            }
            if (c == PolarBase.$$p[15]) {
                return this.kp(a, b, this.aat);
            }
            if (c == PolarBase.$$p[5]) {
                return this.kp(a, b, this.aae);
            }
            if (c == PolarBase.$$p[6]) {
                return this.kp(a, b, this.aag);
            }
            return super.ko(a, b);
        }
        mb(a) {
            let b = this.nb(a);
            if (b == PolarBase.$$p[3]) {
                return this.aab;
            }
            if (b == PolarBase.$$p[15]) {
                return this.aat;
            }
            if (b == PolarBase.$$p[5]) {
                return this.aae;
            }
            if (b == PolarBase.$$p[6]) {
                return this.aag;
            }
            return super.mb(a);
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            if (this.yp.c0.g$b(a, b, c, d)) {
                this.rn(false);
                this.qh();
            }
            switch (b) {
                case PolarBase.$$p[1]:
                case PolarBase.$$p[2]:
                case PolarBase.$$p[13]:
                case PolarBase.$$p[14]:
                    this.qb();
                    break;
                case "FastItemsSource":
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.zb);
                        c.deregisterColumn(this.zc);
                        this.zb = null;
                        this.zc = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.zb = this.di(this.aab);
                        this.zc = this.di(this.aat);
                    }
                    if ((this.ym != null && !this.ym.c1()) || (this.yl != null && !this.yl.c1())) {
                        this.rn(this.ge && c != null);
                    }
                    break;
                case PolarBase.$$p[0]:
                    if (this.yl != null && this.ym != null) {
                        this.yn = new PolarAxes(this.ym, this.yl);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.yl != null && !this.yl.c1()) {
                        this.rn(false);
                    }
                    else if (c != null && d == null) {
                        this.o3(true, this.ct);
                    }
                    break;
                case PolarBase.$$p[12]:
                    if (this.yl != null && this.ym != null) {
                        this.yn = new PolarAxes(this.ym, this.yl);
                    }
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    if (this.ym != null && !this.ym.c1()) {
                        this.rn(false);
                    }
                    else if (c != null && d == null) {
                        this.o3(true, this.ct);
                    }
                    if (this.yl != null && !this.yl.c1()) {
                        this.yl.h5();
                    }
                    break;
                case PolarBase.$$p[3]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.zb);
                        this.zb = this.di(this.aab);
                    }
                    break;
                case "AngleColumn":
                    this.yp.c0.g$i();
                    if (this.yl != null && !this.yl.c1()) {
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case PolarBase.$$p[15]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.zc);
                        this.zc = this.di(this.aat);
                    }
                    break;
                case "RadiusColumn":
                    this.yp.c0.g$i();
                    if (this.ym != null && !this.ym.c1()) {
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case PolarBase.$$p[16]:
                    this.rn(false);
                    this.qh();
                    break;
                case PolarBase.$$p[11]:
                    this.rn(false);
                    this.qh();
                    break;
                case "TransitionProgress":
                    this.yo = new PolarAxisInfoCache(this.yl, this.ym, this.dl);
                    this.ab7 = this.ct.by;
                    this.ab6 = this.ct.bx;
                    this.ab5 = this.ct.getEffectiveViewport();
                    this.yw.v = this.zr;
                    this.yw.c(this.jo, this.yu, this.ys);
                    if (this.d3(this.ct)) {
                        return;
                    }
                    if (this.jo == 1) {
                        this.aa9(this.ys, this.yp);
                        this.qk();
                    }
                    else {
                        this.aa9(this.yw, this.yp);
                    }
                    if (this.c9 != null) {
                        this.c9.qa(this);
                    }
                    break;
                case "TrendLineBrush":
                    this.rb(b);
                    break;
                case PolarBase.$$p[4]:
                    this.rn(false);
                    this.qh();
                    break;
                case "TrendLineType":
                    this.qh();
                    break;
                case PolarBase.$$p[8]:
                    this.ze = this.zn();
                    this.rn(false);
                    break;
                case PolarBase.$$p[7]:
                    this.zd = this.zm();
                    this.rn(false);
                    break;
                case PolarBase.$$p[9]:
                    this.yz = this.y0();
                    break;
            }
        }
        get yz() {
            return this.yy;
        }
        set yz(a) {
            let b = this.yy;
            this.yy = a;
            if (b != this.yy) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.yy));
            }
        }
        y0() {
            if (this.y1 != 0) {
                return this.y1;
            }
            return this.zl ? 4 : 1;
        }
        get_zl() {
            return false;
        }
        get zl() {
            return this.get_zl();
        }
        zn() {
            return this.zk;
        }
        zm() {
            return this.zj;
        }
        zg(a) {
            if (typeCast(NumericRadiusAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zf(a) {
            if (typeCast(NumericAngleAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        o3(a, b) {
            super.o3(a, b);
            let c = b;
            if (a) {
                c.c1.clear();
            }
            c.c0.g$d();
        }
        yi(a, b) {
            let c = a.top - 10;
            let d = a.bottom + 10;
            let e = a.left - 10;
            let f = a.right + 10;
            let g = ((() => {
                let $ret = new Clipper(1, e, d, f, c, false);
                $ret.i = b;
                return $ret;
            })());
            return g;
        }
        aax(a, b, c, d) {
            a.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, b);
            let e = this.dl;
            for (let f = 0; f < b; f++) {
                let g = a.w._inner[f];
                if (!isInfinity(g.x) && !isInfinity(g.y)) {
                    let h = { $type: Point_$type, x: this.zb.item(f), y: this.zc.item(f) };
                    let i = { $type: Point_$type, x: g.x, y: g.y };
                    a.g.addItem(e.item(f), ((() => {
                        let $ret = new OwnedPoint();
                        $ret.a = e.item(f);
                        $ret.b = h;
                        $ret.c = i;
                        return $ret;
                    })()));
                }
            }
        }
        aa5(a, b) {
            let c = b.by;
            let d = b.bx;
            let e = b.getEffectiveViewport();
            a.j.clear();
            a.n.clear();
            let f = Math.min(this.zb != null ? this.zb.count : 0, this.zc != null ? this.zc.count : 0);
            if (f < 1) {
                return;
            }
            this.yo = new PolarAxisInfoCache(this.yl, this.ym, this.dl);
            this.yq = a;
            this.ab6 = d;
            this.ab7 = c;
            this.ab5 = b.getEffectiveViewport();
            b.cy.l(a.j, this.z1, c, d, this.ib);
            if (f <= this.z1) {
                this.aax(a, f, c, d);
            }
            let g = this.yi(d, a.n);
            let h = Math.min(this.yl.ly, this.yl.lx);
            let i = Math.max(this.yl.lx, this.yl.ly);
            b.c0.i = this.zr;
            b.c0.h = 0;
            b.c0.k = this.ym.np;
            b.c0.j = this.ym.no;
            b.c0.l = (j, k) => this.yn.c(j, k, c, d, e, Math.cos);
            b.c0.m = (j, k) => this.yn.d(j, k, c, d, e, Math.sin);
            let j = new List$1(Number_$type, 0);
            for (let k = 0; k < this.zb.count; k++) {
                if (this.zb.item(k) >= h && this.zb.item(k) <= i) {
                    j.add(this.zb.item(k));
                }
            }
            let l = this.zc;
            if (j.count != this.zb.count) {
                l = new List$1(Number_$type, 0);
                for (let m = 0; m < this.zb.count; m++) {
                    if (this.zb.item(m) >= h && this.zb.item(m) <= i) {
                        l.add(this.zc.item(m));
                    }
                }
            }
            b.c0.n(a.n, this.y3, j, l, this.z2, runOn(this.yl, this.yl.getScaledAngle), runOn(this.ym, this.ym.nv), ((() => {
                let $ret = new TrendResolutionParams();
                $ret.d = this.ib;
                $ret.i = d;
                $ret.h = e;
                $ret.j = c;
                return $ret;
            })()), g, h, i);
        }
        get_fc() {
            return true;
        }
        y5(a, b, c) {
            return null;
        }
        y6(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.yt();
            let e = this.yp.b1(this.v1(b));
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.dl.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else {
                f = e.ak;
            }
            if (f == -1) {
                return null;
            }
            let g = new HighlightingInfo();
            g.i = this;
            g.g = f;
            g.f = f;
            g.c = false;
            g.d = true;
            if (c != null && c.g == g.g && c.f == g.f) {
                return c;
            }
            return g;
        }
        y4(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;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.y5(a, b, this.y7);
                this.y7 = d;
                return d;
            }
            else {
                let e = this.y4(a, b, this.y7);
                this.y7 = e;
                return e;
            }
        }
        df(a, b, c) {
            if (this.fx(this.bv) && !c) {
                let d = this.y6(a, b, this.y8);
                this.y8 = d;
                return d;
            }
            else {
                let e = this.y4(a, b, this.y8);
                e.d = true;
                this.y8 = e;
                return e;
            }
        }
        zp() {
            return (this.assigningPolarStyle != null && this.ze) || (this.bv != 1) || this.d0 || (this.cn != 1) || (this.cm != 1);
        }
        zo() {
            return (this.assigningPolarMarkerStyle != null && this.zd) || this.d0 || (this.bv != 1) || (this.cn != 1) || (this.cm != 1);
        }
        aa9(a, b) {
            this.qt();
            let c = b.by;
            let d = b.bx;
            let e = this.getEffectiveViewport1(b);
            let f = this.wd(b);
            this.yo = new PolarAxisInfoCache(this.yl, this.ym, this.dl);
            if (this.w8()) {
                b.cy.j(a.j, this.xa);
                if (this.zo()) {
                    this.aaz(b, a);
                }
            }
            b.cr();
            let g = this.yi(d, b.c0.g$j.an);
            b.c0.g$h(a.n, g);
            this.aaw(d, c, e, f, b);
        }
        yf(a, b) {
            return this.yg(a, b);
        }
        yg(a, b) {
            if (b < a || a < 0 || a > this.zb.count || b < 0 || b > this.zb.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.dl.item(d);
            }
            return c;
        }
        aaz(a, b) {
            a.b7 = true;
            this.yx.ay(this, this.zo(), runOn(this, this.yf));
            let c = this.yx.d;
            let d = c != null;
            let e = this.getEffectiveViewport1(a);
            let f = this.dl == null ? 0 : this.dl.count;
            this.yp.cj((g) => {
                if (g._visibility == 0) {
                    let h = g.ak;
                    let i = g.content;
                    if (i == null) {
                        i = new DataContext();
                        g.content = i;
                    }
                    if (d) {
                        this.aa3(h, f, a.q);
                    }
                    this.yx.ac(g, i);
                }
            });
        }
        aa4(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.yx.a0(this.yx.b, a, b, false);
            this.yx.ab(this.h9);
            let g = this.yx.ax;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, false);
                g.c = h;
            }
            if (e && this.c9 != null) {
                i = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, false);
                if (i == null && this.bl != null) {
                    i = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, g.z, g.y, false);
                }
                g.d = i;
            }
            if (f && this.c9 != null) {
                j = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, false);
                g.b = j;
            }
            g.h = c;
            this.aa7(g);
            this.yx.z(this, h, i, j, c, d, e, f, a < 0);
        }
        aa3(a, b, c) {
            let d = this.bv != 1;
            let e = this.cn != 1;
            let f = this.cm != 1;
            this.yx.a0(this.yx.d, a, b, true);
            this.yx.aa(this.h9);
            let g = this.yx.aw;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dl;
            let l = null;
            let m = null;
            let n = null;
            if (d && this.c9 != null) {
                h = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.dj.isCrossContextHighlight(this)) {
                    l = this.c9.dj.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.c = h;
            }
            if (e && this.c9 != null) {
                i = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                if (i == null && this.bl != null) {
                    i = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, g.z, g.y, true);
                }
                if (this.c9.dk.isCrossContextHighlight(this)) {
                    m = this.c9.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            if (f && this.c9 != null) {
                j = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.c9.di.isCrossContextHighlight(this)) {
                    n = this.c9.di.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            g.h = c;
            this.aa6(g);
            this.yx.y(this, h, i, j, c, d, e, f, g.v, this.c9.dj.totalHighWaterMark, g.x, this.c9.dk.totalHighWaterMark, g.t, this.c9.di.totalHighWaterMark);
        }
        aa7(a) {
            if (this.assigningPolarStyle != null && this.ze) {
                this.assigningPolarStyle(this, a);
            }
        }
        aa6(a) {
            if (this.assigningPolarMarkerStyle != null && this.zd) {
                this.assigningPolarMarkerStyle(this, a);
            }
        }
        aaw(a, b, c, d, e) {
            e.c3(a, b, c, d);
        }
        sb() {
            super.sb();
            if (this.index < 0) {
                return;
            }
            this.yp.c6();
        }
        rp(a, b) {
            super.rp(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            this.ct.a4(b);
            if (this.d3(this.cs)) {
                return;
            }
            let c = this.cs;
            if (!this.gq) {
                this.yv = new PolarFrame();
                this.aa5(this.yv, c);
            }
            this.gq = false;
            this.aa9(this.yv, 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;
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.yr == null) {
                this.yr = new PolarFrame();
            }
            this.aa5(this.yr, g);
            this.aa9(this.yr, g);
        }
        aa8(a, b) {
            let c = new List$1(Base.$, 0);
            for (let d of fromEnum(b.c)) {
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
            for (let e of fromEnum(c)) {
                b.h(e);
            }
        }
        ye(a, b, c) {
            this.aa0();
            return this.yq.w.toArray();
        }
        zt(a) {
            let b = new List$1(Number_$type, 0);
            let c = this.dl;
            for (let d of fromEnum(this.yp.c1.c)) {
                b.add(c.indexOf(d));
            }
            return b;
        }
        ab3(a) {
            return { $type: Point_$type, x: this.zb.item(a), y: this.zc.item(a) };
        }
        pv(a) {
            super.pv(a);
            this.bb.exportTrendlineData(this, a, this.yp.c0.g$j);
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.kl(c);
            let e = d == null ? NaN : this.iv(d, "RadiusMemberPath");
            let f = d == null ? NaN : this.iv(d, "AngleMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.l = e;
            g.a = 11;
            g.r = this.aat != null ? this.aat : "Radius";
            g.q = "Radius";
            g.s = this.aap != null ? this.aap : "R:";
            g.t = this.aar != null ? this.aar : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 10;
            h.r = this.aab != null ? this.aab : "Angle";
            h.q = "Angle";
            h.s = this.z7 != null ? this.z7 : "A:";
            h.t = this.z9 != null ? this.z9 : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.ma();
            return i;
        }
    }
    PolarBase.$t = /*@__PURE__*/ markType(PolarBase, 'PolarBase', MarkerSeries.$);
    PolarBase.aba = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, PolarBase.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue)));
    PolarBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, PolarBase, 'raisePropertyChanged', ['AngleAxis:yl:abb', [NumericAngleAxis.$, null], 'AngleMemberAsLegendLabel:z7:abc', [2, null], 'AngleMemberAsLegendUnit:z9:abd', [2, null], 'AngleMemberPath:aab:abe', [2], 'ClipSeriesToBounds:zh:abf', [0, false], 'HighlightedAngleMemberPath:aae:abg', [2, null], 'HighlightedRadiusMemberPath:aag:abh', [2, null], 'IsCustomPolarMarkerStyleAllowed:zj:abi', [0, false], 'IsCustomPolarStyleAllowed:zk:abj', [0, false], 'ItemSearchMode:y1:abk', [ScatterItemSearchMode_$type, /*@__PURE__*/ enumGetBox(ScatterItemSearchMode_$type, 0)], 'ItemSearchThreshold:z0:abl', [1, 10000], 'MaximumMarkers:z1:abm', [1, 400], 'RadiusAxis:ym:abn', [NumericRadiusAxis.$, null], 'RadiusMemberAsLegendLabel:aap:abo', [2, null], 'RadiusMemberAsLegendUnit:aar:abp', [2, null], 'RadiusMemberPath:aat:abq', [2], 'UseCartesianInterpolation:zr:aby', [0, true], 'TrendLineType:y3:abw', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness:zz:abv', [1, 1.5], 'TrendLinePeriod:z2:abu', [1, 7], 'TrendLineZIndex:z3:abx', [1, 1], 'TrendLineBrush:ab0:abr', [Brush.$, null], 'TrendLineDashArray:ab1:abs', [DoubleCollection.$], 'TrendLineDashCap:ab2:abt', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]);
    return PolarBase;
})();
/**
 * @hidden
 */
export let PolarSeriesRenderManager = /*@__PURE__*/ (() => {
    class PolarSeriesRenderManager extends SeriesRenderManager {
        constructor() {
            super(...arguments);
            this.aw = null;
            this.ax = null;
        }
        c() {
            this.aw = new AssigningPolarMarkerStyleEventArgs();
            return this.aw;
        }
        a() {
            this.ax = new AssigningPolarStyleEventArgs();
            return this.ax;
        }
        ay(a, b, c) {
            this.w(a, b, c);
        }
        az(a, b, c) {
            this.x(a, b, c);
        }
        a0(a, b, c, d) {
            if (b == -1) {
                a.e = false;
                a.z = 0;
                a.y = c - 1;
            }
            else {
                if (d) {
                    a.z = b;
                    a.y = b;
                }
                else {
                    a.e = false;
                    a.z = b;
                    a.y = b;
                }
            }
        }
    }
    PolarSeriesRenderManager.$t = /*@__PURE__*/ markType(PolarSeriesRenderManager, 'PolarSeriesRenderManager', SeriesRenderManager.$);
    return PolarSeriesRenderManager;
})();
/**
 * @hidden
 */
export let PolarBaseView = /*@__PURE__*/ (() => {
    class PolarBaseView extends MarkerSeriesView {
        constructor(a) {
            super(a);
            this.cz = null;
            this.cy = null;
            this.c0 = null;
            this.c1 = null;
            this.cz = a;
            this.c1 = new HashPool$2(Base.$, Marker.$);
            this.cm(this.c1);
            this.c0 = new PolarTrendLineManager();
        }
        au() {
            super.au();
            this.cy = this.cx();
            if (!this.q) {
                this.cz.z1 = 1000;
                this.b4.w2 = Defaults.e;
            }
        }
        c4(a) {
            this.c1.g(a);
        }
        cx() {
            let a = new NumericMarkerManager(0, (b) => this.c1.item(b), (b) => this.cz.yo.c.item(b), runOn(this, this.c5), runOn(this, this.cw), runOn(this, this.c2));
            a.n = true;
            a.p = runOn(this.cz, this.cz.ab3);
            return a;
        }
        c5(a) {
            this.cz.aa8(a, this.c1);
        }
        cw() {
            return this.cz.ye(this.c1, this.by, this.bx);
        }
        c2() {
            return this.cz.zt(this.c1);
        }
        c3(a, b, c, d) {
            if (this.cz.zh) {
                let e = new GeometryGroup();
                this.cz.ym.n3(e, a, b, c, d);
            }
            else {
            }
        }
        c6() {
            if (this.cz.ab0 != null) {
                this.cz.abz = this.cz.ab0;
            }
            else {
                this.cz.abz = this.cz.u3;
            }
        }
        cj(a) {
            this.c1.f(a);
        }
        a7(a, b) {
            if (a.d) {
                if (this.cz.y3 != 0 && !b) {
                    let c = this.c0.g$j;
                    c.ad = this.cz.zz;
                    c._stroke = this.cz.abz;
                    c.aj = this.cz.ab2;
                    c.ai = this.cz.ab1;
                    a.v(c);
                }
            }
            super.a7(a, b);
        }
        c7() {
            return Rect.empty;
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'><span>" + "${item." + this.cz.aab + "}" + "</span><br/><span";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.cz.title + ": </span><span class='ui-priority-primary'>" + "${item." + this.cz.aat + "}</span></div>";
            return a;
        }
    }
    PolarBaseView.$t = /*@__PURE__*/ markType(PolarBaseView, 'PolarBaseView', MarkerSeriesView.$);
    return PolarBaseView;
})();
