/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __values } from "tslib";
import { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Point_$type, typeGetValue, fromEnum, runOn, Number_$type, enumGetBox, markDep } from "igniteui-angular-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-angular-core";
import { Extensions } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-angular-core";
import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { DependencyProperty } from "igniteui-angular-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-angular-core";
import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters";
import { CategoryTickmarkValues } from "./CategoryTickmarkValues";
import { SeriesViewer } from "./SeriesViewer";
import { ScalerParams } from "./ScalerParams";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { LineGeometry } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-angular-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { ArcSegment } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var AngleAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AngleAxisLabelPanel, _super);
    function AngleAxisLabelPanel() {
        var _this = _super.call(this) || this;
        _this.dd = false;
        _this.dl = null;
        _this.di = 0;
        _this.df = 0;
        _this.dh = 0;
        _this.dg = 0;
        _this.de = 0;
        return _this;
    }
    AngleAxisLabelPanel.prototype.ae = function () {
        return new AngleAxisLabelPanelView(this);
    };
    AngleAxisLabelPanel.prototype.ck = function (a) {
        _super.prototype.ck.call(this, a);
        this.dc = a;
    };
    AngleAxisLabelPanel.prototype.au = function (a, b) {
        if (!Extensions.b(b)) {
            return false;
        }
        if (this.ad == null || this.ad.n1.isEmpty) {
            return _super.prototype.au.call(this, a, b);
        }
        return true;
    };
    AngleAxisLabelPanel.prototype.a8 = function () {
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        if (this.be.count != this.bd.count) {
            return a;
        }
        var c = 1;
        if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
            c = this.ad.p8();
        }
        else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
            c = this.ad.r5();
        }
        if (c == 2) {
            this.dc.a0(a, b);
        }
        else {
            this.dc.a1(a, b);
        }
        var d = false;
        this.ao = this.an(a, b);
        if (!this.ad.c4()) {
            d = true;
            switch (c) {
                case 1:
                    this.dn();
                    break;
                case 2:
                    this.dm();
                    break;
            }
        }
        else {
            d = true;
            this.dc.ac();
        }
        if (d) {
            for (var e = 0; e < a.count; e++) {
                var f = this.be._inner[e];
                var g = this.bd._inner[e];
                var h = a._inner[e];
                var i = this.dl(g.c, h.width, h.height);
                var j = i.x - this.bn(f) / 2;
                var k = i.y - this.bm(f) / 2;
                h.x = j;
                h.y = k;
                a._inner[e] = h;
            }
        }
        return a;
    };
    AngleAxisLabelPanel.prototype.dn = function () {
        this.bk = this.di / 2;
        this.bk = this.bk + this.dj();
    };
    AngleAxisLabelPanel.prototype.dm = function () {
        this.bk = 5;
        this.bk = this.bk + this.dk();
    };
    AngleAxisLabelPanel.prototype.dk = function () {
        var a;
        var b;
        b = this.ad;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.b0);
        }
        if (a == null || b == null) {
            return 0;
        }
        var c = new List$1(Axis.$, 0);
        for (var d = 0; d < a.axes.count; d++) {
            var e = a.axes._inner[d];
            if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a0) !== null && e.a0.be.count > 0 && (!e.c4()) && !e.cv() && (e.am == null || this.ad.am == null || e.am.sb == b.am.sb)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        if (f > 0) {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var h = c._inner[f - 1];
                if (h.p7 == 2) {
                    g += h.a0.de;
                }
                else {
                    g += c._inner[f - 1].a0.bk;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.p7 == 2) {
                    g += i.a0.de;
                }
                else {
                    g += c._inner[f - 1].a0.bk;
                }
            }
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.dj = function () {
        var a;
        var b;
        b = this.ad;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.b0);
        }
        if (a == null || b == null) {
            return 0;
        }
        var c = new List$1(Axis.$, 0);
        for (var d = 0; d < a.axes.count; d++) {
            var e = a.axes._inner[d];
            if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a0) !== null && e.a0.be.count > 0 && (!e.c4()) && !e.cv() && (e.am == null || this.ad.am == null || e.am.sb == b.am.sb)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        var h = 5;
        if (f == 0) {
            g += h;
        }
        else {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.p7 == 2) {
                    g += i.a0.de;
                }
                else {
                    g += c._inner[f - 1].a0.bk;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var j = c._inner[f - 1];
                if (j.r4 == 2) {
                    g += j.a0.de;
                }
                else {
                    g += c._inner[f - 1].a0.bk;
                }
            }
            g += c._inner[f].a0.bk * 2 + h;
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.ai = function () {
        return 4;
    };
    AngleAxisLabelPanel.prototype.a1 = function (a) {
        return a == 4 || a == 5;
    };
    AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
    return AngleAxisLabelPanel;
}(AxisLabelPanelBase));
export { AngleAxisLabelPanel };
/**
 * @hidden
 */
var CategoryAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAngleAxis, _super);
    function CategoryAngleAxis() {
        var _this = _super.call(this) || this;
        _this.qf = null;
        _this.qc = null;
        _this.qg = false;
        _this.qn = NaN;
        _this.qd = null;
        _this.qo = 0;
        _this.ql = 0;
        _this.qm = 0;
        _this.q1 = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.qc = _this.qb();
        _this.qf = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.bm = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.kb = function (a) {
        _super.prototype.kb.call(this, a);
        this.qa = a;
    };
    CategoryAngleAxis.prototype.ak = function () {
        return new CategoryAngleAxis();
    };
    CategoryAngleAxis.prototype.jr = function (a) {
        _super.prototype.jr.call(this, a);
        this.ju(a, "ActualMinorInterval");
        this.ju(a, "StartAngleOffset");
        this.ju(a, "LabelMode");
    };
    CategoryAngleAxis.prototype.ju = function (a, b) {
        _super.prototype.ju.call(this, a, b);
        var c = typeCast(CategoryAngleAxis.$, a);
        if (c == null) {
            return;
        }
        if (b == "ActualMinorInterval") {
            c.qy = this.qq;
        }
        if (b == "StartAngleOffset") {
            c.q0 = this.q0;
        }
        if (b == "LabelMode") {
            c.p7 = this.p7;
        }
    };
    CategoryAngleAxis.prototype.get_c5 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.az = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dl = function (b, c, d) {
            var e = _this.b0 != null ? _this.b0.xm : Rect.empty;
            var f = !e.isEmpty ? _this.n1 : Rect.empty;
            var g = _this.nw();
            switch (_this.p7) {
                case 2: return _this.ri(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a0.bk);
                case 0:
                case 1:
                default: return _this.rj(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a0.bk);
            }
        };
        return a;
    };
    CategoryAngleAxis.prototype.qj = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.q6 = function () {
        return null;
    };
    CategoryAngleAxis.prototype.qz = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.qb = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.eg;
            $ret.e = _this.ef;
            $ret.b = _this.a0;
            return $ret;
        })());
        if (this.a3 != null) {
            this.a3.registerAxis(this);
        }
        var b = new CategoryAxisRenderer(a);
        b.u = function () {
            var c = _this.bn.a4();
            var d = _this.bn.a7();
            var e = _this.bn.a5();
            var f = _this.bn.a6();
            _this.lf();
            _this.jp(c);
            _this.jp(d);
            _this.jp(e);
            _this.jp(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.qe != null; };
        b.d = function (c, d, e, f) { return _this.p9(c, d, e, f); };
        b.v = function () {
            if (!_this.qg) {
                _this.qg = true;
                _this.qe.d2();
                _this.qg = false;
            }
        };
        b.g = function (c, d) {
            var e = typeGetValue(c);
            if (e == _this.o5 - 1) {
                if (_this.dj) {
                    if (_this.qj(e)) {
                        return _this.q6();
                    }
                }
            }
            if (e > _this.o5 - 1) {
                e -= _this.o5;
            }
            if (_this.qk(e)) {
                return null;
            }
            var f = _this.oh.item(e);
            return _this.hf(f);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.a3 == null || _this.a3.visibility == 0) && _this.qe != null && _this.qn != c) {
                var d = typeCast(XamDataChart.$, _this.b0);
                if (d == null) {
                    return;
                }
                _this.qn = c;
                _this.a0.bj = c;
                d.o1();
                try {
                    for (var _b = __values(fromEnum(d.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var e = _c.value;
                        if (e != _this && typeCast(AngleAxisLabelPanel.$, e.a0) !== null) {
                            e.bn.ai();
                        }
                    }
                }
                catch (e_1_1) {
                    e_1 = { error: e_1_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_1)
                            throw e_1.error;
                    }
                }
            }
        };
        b.k = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            _this.qf.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center);
        };
        b.l = function (c, d, e, f) {
            var g = typeCast(RadialAxisRenderingParameters.$, c);
            _this.qf.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center);
        };
        b.m = function (c, d) { return _this.getScaledAngle(d); };
        b.q = function (c, d) {
            if (_this.qz(d - _this.qo) < 0) {
                return false;
            }
            if (_this.qz(d - _this.qo - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        b.j = function (c) {
            var d = typeCast(RadialAxisRenderingParameters.$, c);
            if (d.e == d.k._inner[0]) {
                _this.qf.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.qr();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.rj(d, f.center, c.ab, c.aa, c.z, 0);
            if (g.x < c.aa.right && g.x >= c.aa.left && g.y < c.aa.bottom && g.y >= c.aa.top) {
                return true;
            }
            return false;
        };
        b.a = function (c, d, e, f) {
            var g = c.z;
            var h = new ScalerParams(0, c.ab, c.aa, _this.df, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.o5);
                var k = _this.ft(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.qw);
        return b;
    };
    CategoryAngleAxis.prototype.qk = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.rj = function (a, b, c, d, e, f) {
        var g = this.qr();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.a3 != null && (this.a3.c == 5 || this.a3.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    CategoryAngleAxis.prototype.ri = function (a, b, c, d, e, f, g, h) {
        if (!isNaN_(b) && !isNaN_(c)) {
            var i = this.qr();
            var j = b / f.width;
            var k = c / f.width;
            var l = ViewportUtils.a(h, e, f, g);
            var m = GeometryUtil.l(i, a, j, k);
            var n = d.x + (m + l) * Math.cos(a);
            var o = d.y + (m + l) * Math.sin(a);
            n = ViewportUtils.e(n, e, f, g);
            o = ViewportUtils.i(o, e, f, g);
            return { $type: Point_$type, x: n, y: o };
        }
        else {
            return this.rj(a, d, e, f, g, h);
        }
    };
    CategoryAngleAxis.prototype.qr = function () {
        if (this.qe == null) {
            return 0;
        }
        if (!this.cv()) {
            return this.qe.sg();
        }
        else {
            return this.qe.sh((this.ha));
        }
    };
    CategoryAngleAxis.prototype.p9 = function (a, b, c, d) {
        if (this.oh == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.o6 - 1;
        var g = this.bn.a4();
        var h = this.bn.a7();
        var i = this.bn.a5();
        var j = this.bn.a6();
        e.u = g;
        e.x = h;
        e.v = i;
        e.w = j;
        e.l = f;
        e.m = 0;
        e.h = false;
        e.aa = a;
        e.z = c;
        e.y = d;
        e.ab = b;
        e.g = this.qi();
        e.p = this.qx;
        e.o = this.f9();
        e.s = this.q3();
        e.q = this.qy;
        e.t = this.hg;
        var k = this.qf.h(b, a, c);
        var l = this.qf.i(b, a, c);
        var m = 0.5 * this.qe.sb;
        var n = 0.5 * this.qe.sa;
        var o = k;
        var p = l;
        var q = this.qe.sg();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.qf.m(b, a, c, e, 0, this.o6, this.df, runOn(this, this.getUnscaledAngle), r);
        var s = { $type: Point_$type, x: 0.5, y: 0.5 };
        e.center = s;
        e.maxLength = p;
        e.minLength = o;
        e.effectiveMaximum = q;
        e.af = this.o6;
        e.ac = this.categoryMode;
        e.ae = true;
        e.ad = this.df;
        e.ag = this.o7;
        e.f = new CategoryTickmarkValues();
        e.j = this.dz;
        return e;
    };
    CategoryAngleAxis.prototype.q3 = function () {
        return -1;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
        var f = this.qf.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    CategoryAngleAxis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.k3(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "qe", {
        get: function () {
            if (this.qd != null) {
                return this.qd;
            }
            var a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericRadiusAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.qd;
        },
        set: function (a) {
            this.qd = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ao = function () {
        return this.qe;
    };
    CategoryAngleAxis.prototype.p8 = function () {
        if (this.p7 == 0) {
            return 1;
        }
        else {
            return this.p7;
        }
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.o5;
    };
    CategoryAngleAxis.prototype.get_qh = function () {
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "qh", {
        get: function () {
            return this.get_qh();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.qt = function (a, b, c, d) {
        return this.ou(b, c, d);
    };
    CategoryAngleAxis.prototype.ou = function (a, b, c) {
        var d = this.o1(a, b, c);
        var e = 0;
        if (!isNaN_(this.o0)) {
            e = Math.min(this.o0, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.o7 - (this.o7 - 1) * e);
    };
    CategoryAngleAxis.prototype.qs = function (a, b, c, d, e) {
        return this.getGroupCenter(b, c, d, e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.o7 > 1) {
            var f = this.o1(b, c, d);
            var g = 0;
            if (!isNaN_(this.o0)) {
                g = Math.min(this.o0, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.o7 - (this.o7 - 1) * g);
            var j = (h - i) / (this.o7 - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.qw = function (a) {
        var b = 0.5;
        if (this.o7 > 1) {
            var c = this.o1(Rect.empty, Rect.empty, Rect.empty);
            var d = 0;
            if (!isNaN_(this.o0)) {
                d = Math.min(this.o0, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.o7 - (this.o7 - 1) * d);
            var g = (e - f) / (this.o7 - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.k4 = function (a) {
        _super.prototype.k4.call(this, a);
        var b = this.b0 != null ? this.b0.xm : Rect.empty;
        var c = !b.isEmpty ? this.n1 : Rect.empty;
        var d = this.nw();
        var e = this.nv();
        var f = this.qc.c(a, c, b, d, e);
        if (f != null) {
            this.qp = f.f.m;
            this.qq = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.qv = function (a, b, c) {
        var d;
        var e;
        var f = this.qf.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (d == 0) {
            if (this.df) {
                return this.o5;
            }
            else {
                return 0;
            }
        }
        var g = this.getUnscaledAngle(d);
        if (g < 0 || g > this.o5) {
            g = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.qu = function (a, b, c) {
        var d;
        var e;
        var f = this.qf.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (e > Math.PI * 2) {
            e = e - Math.PI * 2;
        }
        if (e == Math.PI * 2) {
            if (this.df) {
                return 0;
            }
            else {
                return this.o5;
            }
        }
        var g = this.getUnscaledAngle(e);
        if (g < 0 || g > this.o5) {
            g = this.getUnscaledAngle(e + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.o5;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.dg) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.qo;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.qo) {
            a += 2 * Math.PI;
        }
        var b = (a - this.qo) / (2 * Math.PI);
        if (this.df) {
            b = 1 - b;
        }
        return b * (this.o5);
    };
    CategoryAngleAxis.prototype.ft = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.fw = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.fd = function (a) {
        var b = { $type: Point_$type, x: 0.5, y: 0.5 };
        var c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
        var d = Math.acos((a.x - b.x) / c);
        if ((a.y - b.y) < 0) {
            d = (2 * Math.PI) - d;
        }
        return d;
    };
    CategoryAngleAxis.prototype.kf = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.kf.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.b0);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.rd(f);
                if (f != null) {
                    f.sq(this);
                }
                this.dr = true;
                this.k3(false);
                break;
            case CategoryAngleAxis.$$p[1]:
                this.qo = this.q0;
                while (this.qo < 0) {
                    this.qo += 360;
                }
                while (this.qo >= 360) {
                    this.qo -= 360;
                }
                this.qo = (this.qo * Math.PI) / 180;
                this.dr = true;
                this.k3(false);
                try {
                    for (var _d = __values(fromEnum(this.eh)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.ry(false);
                        g.qr();
                    }
                }
                catch (e_2_1) {
                    e_2 = { error: e_2_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                }
                break;
            case "Label":
            case CategoryAngleAxis.$$p[0]:
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.dr = true;
                            h.k2();
                        }
                    }
                    catch (e_3_1) {
                        e_3 = { error: e_3_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_3)
                                throw e_3.error;
                        }
                    }
                }
                break;
            case "CrossingValue":
                if (e != null) {
                    try {
                        for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                            var i = _j.value;
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.dr = true;
                                i.k2();
                            }
                        }
                    }
                    catch (e_4_1) {
                        e_4 = { error: e_4_1 };
                    }
                    finally {
                        try {
                            if (_j && !_j.done && (_c = _h.return))
                                _c.call(_h);
                        }
                        finally {
                            if (e_4)
                                throw e_4.error;
                        }
                    }
                }
                break;
            case "LabelSettings":
                this.qc = this.qb();
                this.rb();
                this.dr = true;
                this.k3(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.rb = function () {
        this.qn = NaN;
    };
    CategoryAngleAxis.prototype.rd = function (a) {
        this.qe = a;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "qx", {
        get: function () {
            return this.c(CategoryAngleAxis.re);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.re, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "qp", {
        get: function () {
            return this.ql;
        },
        set: function (a) {
            if (this.qp != a) {
                var b = this.ql;
                this.ql = a;
                this.kx("ActualInterval", b, this.qp);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.f5 = function () {
        return this.qp;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "qy", {
        get: function () {
            return this.c(CategoryAngleAxis.rg);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.rg, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "qq", {
        get: function () {
            return this.qm;
        },
        set: function (a) {
            if (this.qq != a) {
                var b = this.qm;
                this.qm = a;
                this.kx("ActualMinorInterval", b, this.qq);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.qi = function () {
        return !isNaN_(this.qx);
    };
    CategoryAngleAxis.prototype.get_bk = function () {
        return 2;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "bk", {
        get: function () {
            return this.get_bk();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.d4 = function () {
        if (this.dr && this.d5) {
            this.bu = this.bt();
        }
        if (this.oh == null) {
            return false;
        }
        var a = this.oh.count;
        if (a != this.q2) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.q2, a);
            this.q2 = a;
            this.ky(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "q2", {
        get: function () {
            return this.q1;
        },
        set: function (a) {
            this.q1 = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ns = function (a, b, c, d, e) {
        var f = typeCast(RadialAxisRenderingParameters.$, this.qc.d(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "isVertical", {
        get: function () {
            return this.dq;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$d = function (a, b) {
        return this.fw.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.ft.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) {
        this.j5.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.j6.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$g = function (a, b, c, d) {
        this.j7.apply(this, arguments);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "j$b", {
        get: function () {
            return this.df;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.re = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.kx("Interval", b.oldValue, b.newValue);
        a.k3(false);
    }));
    CategoryAngleAxis.rg = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).kx("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).k3(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'kx', ['LabelMode:p7:rf', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:q0:rh', [1, 0]]);
    return CategoryAngleAxis;
}(CategoryAxisBase));
export { CategoryAngleAxis };
/**
 * @hidden
 */
var NumericAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAngleAxis, _super);
    function NumericAngleAxis() {
        var _this = _super.call(this) || this;
        _this.r9 = null;
        _this.sa = false;
        _this.sb = NaN;
        _this.sc = 0;
        _this.r7 = null;
        _this.ab = NumericAngleAxis.$;
        _this.r9 = new PolarAxisRenderingManager();
        _this.oq = _this.oo();
        return _this;
    }
    NumericAngleAxis.prototype.bm = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.kb = function (a) {
        _super.prototype.kb.call(this, a);
        this.r6 = a;
    };
    NumericAngleAxis.prototype.ak = function () {
        return new NumericAngleAxis();
    };
    NumericAngleAxis.prototype.jr = function (a) {
        _super.prototype.jr.call(this, a);
        this.ju(a, "LabelMode");
        this.ju(a, "StartAngleOffset");
    };
    NumericAngleAxis.prototype.ju = function (a, b) {
        _super.prototype.ju.call(this, a, b);
        var c = typeCast(NumericAngleAxis.$, a);
        if (c == null) {
            return;
        }
        var d = this;
        if (b == "LabelMode") {
            c.r4 = d.r4;
        }
        if (b == "StartAngleOffset") {
            c.sg = d.sg;
        }
    };
    NumericAngleAxis.prototype.get_c5 = function () {
        return true;
    };
    NumericAngleAxis.prototype.az = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dl = function (b, c, d) {
            var e = _this.b0 != null ? _this.b0.xm : Rect.empty;
            var f = !e.isEmpty ? _this.n1 : Rect.empty;
            var g = _this.nw();
            return _this.so(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a0.bk);
        };
        return a;
    };
    NumericAngleAxis.prototype.sd = function () {
        if (this.r8 == null) {
            return 0;
        }
        if (!this.cv()) {
            return this.r8.sg();
        }
        else {
            return this.r8.sh((this.ha));
        }
    };
    NumericAngleAxis.prototype.sf = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.oo = function () {
        var _this = this;
        var a = _super.prototype.oo.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.a3 == null || _this.a3.visibility == 0) && _this.r8 != null && _this.sb != b) {
                var c = typeCast(XamDataChart.$, _this.b0);
                if (c == null) {
                    return;
                }
                _this.sb = b;
                _this.a0.bj = b;
                c.o1();
                try {
                    for (var _b = __values(fromEnum(c.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        if (d != _this && typeCast(AngleAxisLabelPanel.$, d.a0) !== null) {
                            d.bn.ai();
                        }
                    }
                }
                catch (e_5_1) {
                    e_5 = { error: e_5_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_5)
                            throw e_5.error;
                    }
                }
            }
        };
        a.e = function (b) {
            b.n = _this.sd();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.r9.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle);
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.r9.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center);
        };
        a.l = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.r9.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center);
        };
        a.d = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, _this.or(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.sa) {
                _this.sa = true;
                _this.r8.d2();
                _this.sa = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.r8 != null; };
        a.q = function (b, c) {
            if (_this.sf(c - _this.sc) < 0) {
                return false;
            }
            if (_this.sf(c - _this.sc - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.so(_this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0);
            var g = _this.so(c, e.center, b.ab, b.aa, b.z, 0);
            if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                return false;
            }
            if (g.x < b.aa.right && g.x >= b.aa.left && g.y < b.aa.bottom && g.y >= b.aa.top) {
                return true;
            }
            return false;
        };
        a.r = function (b, c, d, e) {
            if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) {
                return b.m;
            }
            else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericAngleAxis.prototype.so = function (a, b, c, d, e, f) {
        var g = this.sd();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.a3 != null && (this.a3.c == 5 || this.a3.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    NumericAngleAxis.prototype.ft = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.p1) / (this.p0 - this.p1);
        }
        else {
            d = (a - this.pr) / (this.pq - this.pr);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.sc;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.pc, this.dg);
    };
    NumericAngleAxis.prototype.fw = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.sc) / (2 * Math.PI);
        if (this.df) {
            b = 1 - b;
        }
        if (this.pc) {
            return Math.exp(b * (this.p0 - this.p1) + this.p1);
        }
        else {
            return this.pr + b * (this.pq - this.pr);
        }
    };
    NumericAngleAxis.prototype.r5 = function () {
        if (this.r4 == 0) {
            return 1;
        }
        else {
            return this.r4;
        }
    };
    NumericAngleAxis.prototype.kf = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.kf.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.b0);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.sl(f);
                if (f != null) {
                    f.sq(this);
                }
                this.k3(false);
                break;
            case NumericAngleAxis.$$p[1]:
                this.sc = this.sg;
                while (this.sc < 0) {
                    this.sc += 360;
                }
                while (this.sc >= 360) {
                    this.sc -= 360;
                }
                this.sc = (this.sg * Math.PI) / 180;
                this.k3(false);
                try {
                    for (var _d = __values(fromEnum(this.ed())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.ry(false);
                        g.qr();
                    }
                }
                catch (e_6_1) {
                    e_6 = { error: e_6_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_6)
                            throw e_6.error;
                    }
                }
                break;
            case "Label":
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.k2();
                        }
                    }
                    catch (e_7_1) {
                        e_7 = { error: e_7_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_7)
                                throw e_7.error;
                        }
                    }
                }
                break;
            case "CrossingValue":
                if (e != null) {
                    try {
                        for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                            var i = _j.value;
                            if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
                                i.k2();
                            }
                        }
                    }
                    catch (e_8_1) {
                        e_8 = { error: e_8_1 };
                    }
                    finally {
                        try {
                            if (_j && !_j.done && (_c = _h.return))
                                _c.call(_h);
                        }
                        finally {
                            if (e_8)
                                throw e_8.error;
                        }
                    }
                }
                break;
            case "LabelSettings":
                this.oq = this.oo();
                this.sj();
                this.dr = true;
                this.k3(false);
                break;
        }
    };
    NumericAngleAxis.prototype.sj = function () {
        this.sb = NaN;
    };
    NumericAngleAxis.prototype.os = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.or = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.or.call(this, a, b, c, d));
        var f = this.r9.h(b, a, c);
        var g = this.r9.i(b, a, c);
        var h = 0.5 * this.r8.sb;
        var i = 0.5 * this.r8.sa;
        var j = f;
        var k = g;
        var l = this.r8.sg();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.r9.m(b, a, c, e, this.pr, this.pq, this.df, runOn(this, this.getUnscaledAngle), m);
        var n = { $type: Point_$type, x: 0.5, y: 0.5 };
        e.center = n;
        e.maxLength = k;
        e.minLength = j;
        e.effectiveMaximum = l;
        return e;
    };
    NumericAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
        var f = this.r9.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    NumericAngleAxis.prototype.k4 = function (a) {
        _super.prototype.k4.call(this, a);
        var b = this.b0 != null ? this.b0.xm : Rect.empty;
        var c = !b.isEmpty ? this.n1 : Rect.empty;
        var d = this.nw();
        var e = this.nv();
        var f = this.oq.c(a, c, b, d, e);
        if (f != null) {
            this.pp = f.f.m;
            this.ps = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "r8", {
        get: function () {
            if (this.r7 != null) {
                return this.r7;
            }
            var a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].dl) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.r7;
        },
        set: function (a) {
            this.r7 = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.ao = function () {
        return this.r8;
    };
    NumericAngleAxis.prototype.sl = function (a) {
        this.r8 = a;
    };
    NumericAngleAxis.prototype.li = function (a, b) {
        _super.prototype.li.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.d2();
        }
    };
    NumericAngleAxis.prototype.get_bk = function () {
        return 2;
    };
    Object.defineProperty(NumericAngleAxis.prototype, "bk", {
        get: function () {
            return this.get_bk();
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.ns = function (a, b, c, d, e) {
        if (this.r8 == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.or(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
    NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'kx', ['LabelMode:r4:sm', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:sg:sn', [1, 0]]);
    return NumericAngleAxis;
}(NumericAxisBase));
export { NumericAngleAxis };
/**
 * @hidden
 */
var NumericRadiusAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericRadiusAxis, _super);
    function NumericRadiusAxis() {
        var _this = _super.call(this) || this;
        _this.r7 = null;
        _this.r8 = false;
        _this.r9 = NaN;
        _this.sb = 0;
        _this.sa = 0;
        _this.sd = 0;
        _this.r4 = null;
        _this.ab = NumericRadiusAxis.$;
        _this.sb = _this.sl;
        _this.sa = _this.sk;
        _this.r7 = new PolarAxisRenderingManager();
        _this.oq = _this.oo();
        return _this;
    }
    NumericRadiusAxis.prototype.bm = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.kb = function (a) {
        _super.prototype.kb.call(this, a);
        this.r6 = a;
    };
    NumericRadiusAxis.prototype.ak = function () {
        return new NumericRadiusAxis();
    };
    NumericRadiusAxis.prototype.jr = function (a) {
        _super.prototype.jr.call(this, a);
        this.ju(a, "InnerRadiusExtentScale");
        this.ju(a, "RadiusExtentScale");
    };
    NumericRadiusAxis.prototype.ju = function (a, b) {
        _super.prototype.ju.call(this, a, b);
        var c = typeCast(NumericRadiusAxis.$, a);
        if (c == null) {
            return;
        }
        var d = this;
        if (b == "InnerRadiusExtentScale") {
            c.sk = d.sk;
        }
        if (b == "RadiusExtentScale") {
            c.sl = d.sl;
        }
    };
    NumericRadiusAxis.prototype.get_dl = function () {
        return true;
    };
    NumericRadiusAxis.prototype.fs = function () {
        var a = this.sb;
        var b = this.sa;
        var c = Math.min(this.sf(), this.se()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.sf = function () {
        return this.n1.width;
    };
    NumericRadiusAxis.prototype.se = function () {
        return this.n1.height;
    };
    NumericRadiusAxis.prototype.az = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.sc = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.oo = function () {
        var _this = this;
        var a = _super.prototype.oo.call(this);
        a.b.c = function (b) {
            if ((_this.a3 == null || _this.a3.visibility == 0) && _this.r5 != null) {
                if ((_this.a3 == null || (_this.a3.c == 4 || _this.a3.c == 5)) && _this.r9 != b) {
                    _this.r9 = b;
                    _this.a0.bj = b;
                    _this.b0.o1();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.r7.k(c, d, e.aa, e.z, e.ab, e.center, e.minAngle, e.maxAngle);
        };
        a.l = function (b, c, d, e) {
            if (d == e) {
                return;
            }
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.r7.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.sh(c); };
        a.q = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return c <= d.effectiveMaximum;
        };
        a.n = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return c <= d.effectiveMaximum;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            _this.r7.o(b.u, c.crossingAngleRadians, b.aa, b.z, b.ab, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.a3 == null || (_this.a3.c == 4 || _this.a3.c == 0) ? b.aa.top : b.aa.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.sc(_this.ha) * Math.PI) / 180;
            if (_this.a3 == null || (_this.a3.c == 4 || _this.a3.c == 5)) {
                c.n = ViewportUtils.i(0.5, c.ab, c.aa, c.z) - b.aa.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.a0);
                if (d != null) {
                    var e = 0;
                    if (_this.a3 != null && _this.a3.c == 4) {
                        e = 1;
                    }
                    d.d1 = { $type: Point_$type, x: ViewportUtils.e(0.5, c.ab, c.aa, c.z), y: e };
                    d.dy = c.crossingAngleRadians;
                }
            }
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            if (_this.r5 == null) {
                return false;
            }
            if (c > e.effectiveMaximum) {
                return false;
            }
            var f = false;
            f = _this.a3 == null || (_this.a3.c == 4 || _this.a3.c == 5);
            var g = 0;
            if (f) {
                g = _this.sd;
            }
            var h = e.center.x + c * Math.cos(g);
            var i = e.center.y + c * Math.sin(g);
            h = ViewportUtils.e(h, e.ab, e.aa, e.z);
            i = ViewportUtils.i(i, e.ab, e.aa, e.z);
            if (h <= b.aa.right && h >= b.aa.left && ((i <= b.aa.bottom && i >= b.aa.top) || !f)) {
                return true;
            }
            return false;
        };
        a.h = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return new LabelPosition(ViewportUtils.e(d.center.x + c, d.ab, d.aa, d.z));
        };
        a.r = function (b, c, d, e) {
            if (c < b.m) {
                return b.m;
            }
            else if (c > b.l) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericRadiusAxis.prototype.ft = function (a, b) {
        return this.sh(a);
    };
    NumericRadiusAxis.prototype.si = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.pr) - this.p1) / (this.p0 - this.p1);
            }
            else {
                f = (Math.log(a) - this.p1) / (this.p0 - this.p1);
            }
        }
        else {
            f = (a - this.pr) / (this.pq - this.pr);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.sh = function (a) {
        return this.si(a, this.pc, this.dg, this.sb, this.sa);
    };
    NumericRadiusAxis.prototype.sj = function (a) {
        var b = a * 2;
        b = (b - this.sa) / (this.sb - this.sa);
        if (this.df) {
            b = 1 - b;
        }
        if (this.pc) {
            return Math.exp(b * (this.p0 - this.p1) + this.p1);
        }
        else {
            return this.pr + b * (this.pq - this.pr);
        }
    };
    NumericRadiusAxis.prototype.fw = function (a, b) {
        return this.sj(a);
    };
    NumericRadiusAxis.prototype.kf = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.sd = this.sc(this.ha) * Math.PI / 180;
                break;
        }
        _super.prototype.kf.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.sb = this.sl;
                if (this.sb < 0) {
                    this.sb = 0.1;
                }
                if (this.sb > 1) {
                    this.sb = 1;
                }
                if (this.sa >= this.sb) {
                    this.sa = this.sb - 0.01;
                    if (this.sa < 0) {
                        this.sa = 0;
                        this.sb = 0.01;
                    }
                }
                this.dr = true;
                this.k3(false);
                if (this.r5 != null) {
                    this.r5.k2();
                }
                try {
                    for (var _c = __values(fromEnum(this.ed())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.ry(false);
                    }
                }
                catch (e_9_1) {
                    e_9 = { error: e_9_1 };
                }
                finally {
                    try {
                        if (_d && !_d.done && (_a = _c.return))
                            _a.call(_c);
                    }
                    finally {
                        if (e_9)
                            throw e_9.error;
                    }
                }
                break;
            case NumericRadiusAxis.$$p[0]:
                this.sa = this.sk;
                if (this.sa < 0) {
                    this.sa = 0.1;
                }
                if (this.sa > 1) {
                    this.sa = 1;
                }
                if (this.sa >= this.sb) {
                    this.sa = this.sb - 0.01;
                    if (this.sa < 0) {
                        this.sa = 0;
                        this.sb = 0.01;
                    }
                }
                this.dr = true;
                this.k3(false);
                if (this.r5 != null) {
                    this.r5.k2();
                }
                try {
                    for (var _e = __values(fromEnum(this.ed())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.g1 = true;
                        f.ry(false);
                    }
                }
                catch (e_10_1) {
                    e_10 = { error: e_10_1 };
                }
                finally {
                    try {
                        if (_f && !_f.done && (_b = _e.return))
                            _b.call(_e);
                    }
                    finally {
                        if (e_10)
                            throw e_10.error;
                    }
                }
                if (this.b0 != null) {
                    this.b0.pf();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.sq(null);
                }
                if (g != null) {
                    this.sq(g);
                    g.sl(this);
                }
                if (h != null) {
                    this.sq(h);
                    h.rd(this);
                }
                this.dr = true;
                this.k3(false);
                break;
            case "IsInverted":
                if (this.r5 != null) {
                    this.r5.dr = true;
                    this.r5.k3(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.sq = function (a) {
        this.r5 = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "r5", {
        get: function () {
            if (this.r4 != null) {
                return this.r4;
            }
            var a = typeCast(XamDataChart.$, this.b0);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (typeCast(NumericAngleAxis.$, a.axes._inner[b]) !== null || typeCast(CategoryAngleAxis.$, a.axes._inner[b]) !== null) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.r4;
        },
        set: function (a) {
            this.r4 = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.ao = function () {
        return this.r5;
    };
    NumericRadiusAxis.prototype.os = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.or = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.or.call(this, a, b, c, d));
        var f = this.r7.h(b, a, c);
        var g = this.r7.i(b, a, c);
        var h = 0.5 * this.sb;
        var i = 0.5 * this.sa;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.xz)) {
            k = this.pq;
            j = this.pr;
        }
        else {
            k = Math.min(g, h);
            j = this.sj(f);
            k = this.sj(k);
            var l = this.sr(a, c, b, j, k);
            j = l.p3;
            k = l.p4;
        }
        var m = { $type: Point_$type, x: 0.5, y: 0.5 };
        var n = f;
        var o = g;
        var p = Math.min(d.width, d.height) * (this.sb - this.sa) / 2;
        if (this.sd == 0) {
            p = d.width * (this.sb - this.sa) / 2;
        }
        e.center = m;
        var q = Math.max(o, n);
        var r = Math.min(n, o);
        e.maxLength = q;
        e.minLength = r;
        var s = Math.min(j, k);
        var t = Math.max(j, k);
        if (s < this.pr) {
            s = this.pr;
        }
        if (t > this.pq) {
            t = this.pq;
        }
        this.pu = s;
        this.pt = t;
        e.k.add(((function () {
            var $ret = new RangeInfo();
            $ret.d = s;
            $ret.c = t;
            $ret.b = p;
            return $ret;
        })()));
        var u = typeCast(IAngleScaler_$type, this.r5);
        if (u != null) {
            var v = void 0;
            var w = void 0;
            var x = u.getMinMaxAngle(b, a, c, v, w);
            v = x.p3;
            w = x.p4;
            e.minAngle = Math.min(v, w);
            e.maxAngle = Math.max(v, w);
        }
        var y = this.sg();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.ov;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.sm(m, e.minLength, e.maxLength, b, a, c);
        }
        return e;
    };
    NumericRadiusAxis.prototype.sr = function (a, b, c, d, e) {
        var f = { $type: Point_$type, x: 0.5, y: 0.5 };
        var g = 0;
        if (this.df) {
            g = this.sh(this.pr);
        }
        else {
            g = this.sh(this.pq);
        }
        var h = 0;
        if (this.ha != null) {
            h = this.sd;
        }
        var i = f.x + g * Math.cos(h);
        var j = f.y + g * Math.sin(h);
        f.x = ViewportUtils.e(f.x, c, a, b);
        f.y = ViewportUtils.i(f.y, c, a, b);
        i = ViewportUtils.e(i, c, a, b);
        j = ViewportUtils.i(j, c, a, b);
        if (i >= a.left && i <= a.right && j >= a.top && j <= a.bottom) {
            if (this.df) {
                e = this.pr;
            }
            else {
                e = this.pq;
            }
        }
        if (f.x >= a.left && f.x <= a.right && f.y >= a.top && f.y <= a.bottom) {
            if (this.df) {
                d = this.pq;
            }
            else {
                d = this.pr;
            }
        }
        return {
            p3: d,
            p4: e
        };
    };
    NumericRadiusAxis.prototype.sm = function (a, b, c, d, e, f) {
        var g = ViewportUtils.d(c - b, d, e, f);
        var h = g / Math.min(e.width, e.height);
        if (h > 0.7) {
            return 10;
        }
        return 5;
    };
    NumericRadiusAxis.prototype.sg = function () {
        var a = 0;
        if (!this.df) {
            a = this.sh(this.pq);
        }
        else {
            a = this.sh(this.pr);
        }
        return a;
    };
    NumericRadiusAxis.prototype.rh = function (a) {
        if (this.r5 != null) {
            this.r5.k2();
        }
    };
    NumericRadiusAxis.prototype.k4 = function (a) {
        _super.prototype.k4.call(this, a);
        var b = this.b0 != null ? this.b0.xm : Rect.empty;
        var c = !b.isEmpty ? this.n1 : Rect.empty;
        var d = this.nw();
        var e = this.nv();
        var f = this.oq.c(a, c, b, d, e);
        if (f != null) {
            this.pp = f.f.m;
            this.ps = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.li = function (a, b) {
        _super.prototype.li.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.d2();
        }
    };
    NumericRadiusAxis.prototype.sp = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.or(b, c, d, e));
        if (f == null) {
            return;
        }
        this.r7.l(a.d, f.minLength, f.maxLength, b, d, c, f.center, f.minAngle, f.maxAngle);
    };
    NumericRadiusAxis.prototype.get_bk = function () {
        return 3;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "bk", {
        get: function () {
            return this.get_bk();
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.ns = function (a, b, c, d, e) {
        var f = typeCast(PolarAxisRenderingParameters.$, this.or(c, b, d, e));
        var g = a;
        var h = new PathGeometry();
        var i = ViewportUtils.d(g, b, c, d);
        var j = ViewportUtils.h(g, b, c, d);
        if (i <= 0 || j <= 0) {
            return null;
        }
        var k = ViewportUtils.e(f.center.x, b, c, d);
        var l = ViewportUtils.i(f.center.y, b, c, d);
        if (f.maxAngle - f.minAngle < Math.PI && f.maxAngle - f.minAngle > 0) {
            var m = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.minAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.minAngle), b, c, d) };
            var n_1 = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.maxAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.maxAngle), b, c, d) };
            var o = new PathFigure();
            o._startPoint = m;
            o._isClosed = false;
            o._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = n_1;
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(o);
        }
        else {
            var p = new PathFigure();
            p._startPoint = { $type: Point_$type, x: k, y: l - j };
            p._isClosed = true;
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l + j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l - j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(p);
        }
        return h;
    };
    NumericRadiusAxis.$t = markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$);
    NumericRadiusAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericRadiusAxis, 'kx', ['InnerRadiusExtentScale:sk:ss', [1, 0], 'RadiusExtentScale:sl:st', [1, 0.75]]);
    return NumericRadiusAxis;
}(NumericAxisBase));
export { NumericRadiusAxis };
/**
 * @hidden
 */
var AngleAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AngleAxisLabelPanelView, _super);
    function AngleAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    AngleAxisLabelPanelView.prototype.an = function () {
        _super.prototype.an.call(this);
        this.az.dd = true;
    };
    AngleAxisLabelPanelView.prototype.a1 = function (a, b) {
        this.az.di = -1.7976931348623157E+308;
        this.az.df = -1.7976931348623157E+308;
        this.az.dh = -1.7976931348623157E+308;
        this.az.dg = -1.7976931348623157E+308;
        for (var c = 0; c < this.a.be.count; c++) {
            var d = this.a.be._inner[c];
            var e = this.a.bd._inner[c];
            var f = e.a;
            var g = this.az.dl(e.c, NaN, NaN);
            var h = this.m(d);
            var i = this.l(d);
            var j = h + this.p() + this.q();
            var k = i + this.r() + this.o();
            var l = g.x - j / 2;
            var m = g.y - k / 2;
            this.az.dh = Math.max(h, this.az.dh);
            this.az.dg = Math.max(i, this.az.dg);
            this.az.di = Math.max(j, this.az.di);
            this.az.df = Math.max(k, this.az.df);
            var n = new Rect(0, l, m, j, k);
            a.add(n);
            b.add(f);
        }
    };
    AngleAxisLabelPanelView.prototype.a0 = function (a, b) {
        this.az.de = -1.7976931348623157E+308;
        var c = 0;
        if (typeCast(CategoryAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.qr() * this.az.ad.n1.width;
        }
        else if (typeCast(NumericAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.sd() * this.az.ad.n1.width;
        }
        var d = { $type: Point_$type, x: this.az.ad.n1.width * 0.5, y: this.az.ad.n1.width * 0.5 };
        for (var e = 0; e < this.a.be.count; e++) {
            var f = this.a.be._inner[e];
            var g = this.a.bd._inner[e];
            var h = g.a;
            var i = this.m(f);
            var j = this.l(f);
            var k = i + this.p() + this.q();
            var l = j + this.r() + this.o();
            var m = this.az.dl(g.c, k, l);
            var n = m.x - k / 2;
            var o = m.y - l / 2;
            var p = new Rect(0, n, o, i, j);
            if (!h) {
                var q = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.top - d.y) * (p.top - d.y));
                var r = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.top - d.y) * (p.top - d.y));
                var s = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                var t = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                this.az.de = Math.max(q - c, this.az.de);
                this.az.de = Math.max(r - c, this.az.de);
                this.az.de = Math.max(s - c, this.az.de);
                this.az.de = Math.max(t - c, this.az.de);
            }
            a.add(p);
            b.add(h);
        }
    };
    AngleAxisLabelPanelView.prototype.o = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.p = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.q = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.r = function () {
        return 0;
    };
    AngleAxisLabelPanelView.$t = markType(AngleAxisLabelPanelView, 'AngleAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return AngleAxisLabelPanelView;
}(AxisLabelPanelBaseView));
export { AngleAxisLabelPanelView };
/**
 * @hidden
 */
var CategoryAngleAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAngleAxisView, _super);
    function CategoryAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    CategoryAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.ni = AxisDefaults.axis_MajorBrush;
        this.a.nm = AxisDefaults.axis_LineBrush;
    };
    CategoryAngleAxisView.$t = markType(CategoryAngleAxisView, 'CategoryAngleAxisView', CategoryAxisBaseView.$);
    return CategoryAngleAxisView;
}(CategoryAxisBaseView));
export { CategoryAngleAxisView };
/**
 * @hidden
 */
var NumericAngleAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAngleAxisView, _super);
    function NumericAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.ni = AxisDefaults.axis_MajorBrush;
        this.a.nm = AxisDefaults.axis_LineBrush;
    };
    NumericAngleAxisView.$t = markType(NumericAngleAxisView, 'NumericAngleAxisView', NumericAxisBaseView.$);
    return NumericAngleAxisView;
}(NumericAxisBaseView));
export { NumericAngleAxisView };
/**
 * @hidden
 */
var NumericRadiusAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericRadiusAxisView, _super);
    function NumericRadiusAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericRadiusAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.ni = AxisDefaults.axis_MajorBrush;
        this.a.nm = AxisDefaults.axis_LineBrush;
    };
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
