/*
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, 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 { 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 { 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.da = false;
        _this.dg = null;
        _this.de = 0;
        _this.db = 0;
        _this.dd = 0;
        _this.dc = 0;
        return _this;
    }
    AngleAxisLabelPanel.prototype.ae = function () {
        return new AngleAxisLabelPanelView(this);
    };
    AngleAxisLabelPanel.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    AngleAxisLabelPanel.prototype.at = function (a, b) {
        if (!Extensions.b(b)) {
            return false;
        }
        if (this.ad == null || this.ad.kc.isEmpty) {
            return _super.prototype.at.call(this, a, b);
        }
        return true;
    };
    AngleAxisLabelPanel.prototype.a5 = function () {
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        if (this.bb.count != this.ba.count) {
            return a;
        }
        this.c9.a0(a, b);
        var c = false;
        this.ao = this.an(a, b);
        if (!this.ad.b7()) {
            c = true;
            this.bh = this.de / 2;
            this.bh = this.bh + this.df();
        }
        else {
            c = true;
            this.c9.ac();
        }
        if (c) {
            for (var d = 0; d < a.count; d++) {
                var e = this.bb._inner[d];
                var f = this.ba._inner[d];
                var g = a._inner[d];
                var h = this.dg(f.c);
                var i = h.x - this.bk(e) / 2;
                var j = h.y - this.bj(e) / 2;
                g.x = i;
                g.y = j;
                a._inner[d] = g;
            }
        }
        return a;
    };
    AngleAxisLabelPanel.prototype.df = function () {
        var a;
        var b;
        b = this.ad;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.bh);
        }
        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.av) !== null && e.av.bb.count > 0 && (!e.b7()) && !e.b4() && (e.ai == null || this.ad.ai == null || e.ai.nm == b.ai.nm)) {
                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 {
            g += c._inner[f - 1].av.bh;
            g += c._inner[f].av.bh * 2 + h;
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.ai = function () {
        return 4;
    };
    AngleAxisLabelPanel.prototype.ay = 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.ml = null;
        _this.mi = null;
        _this.mm = false;
        _this.mq = NaN;
        _this.mj = null;
        _this.mr = 0;
        _this.mo = 0;
        _this.mp = 0;
        _this.m2 = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.mi = _this.mh();
        _this.ml = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.a3 = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.hr = function (a) {
        _super.prototype.hr.call(this, a);
        this.mg = a;
    };
    CategoryAngleAxis.prototype.get_b8 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.au = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dg = function (b) {
            var c = _this.bh != null ? _this.bh.s9 : Rect.empty;
            var d = !c.isEmpty ? _this.kc : Rect.empty;
            return _this.nf(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.av.bh);
        };
        return a;
    };
    CategoryAngleAxis.prototype.m0 = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.mh = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.dc;
            $ret.e = _this.db;
            $ret.b = _this.av;
            return $ret;
        })());
        if (this.ay != null) {
            this.ay.registerAxis(this);
        }
        var b = new CategoryAxisRenderer(a);
        b.u = function () {
            var c = _this.a4.a1();
            var d = _this.a4.a4();
            var e = _this.a4.a2();
            var f = _this.a4.a3();
            _this.ik();
            _this.hh(c);
            _this.hh(d);
            _this.hh(e);
            _this.hh(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.mk != null; };
        b.d = function (c, d, e, f) { return _this.mf(c, d, e, f); };
        b.v = function () {
            if (!_this.mm) {
                _this.mm = true;
                _this.mk.c0();
                _this.mm = false;
            }
        };
        b.g = function (c, d) {
            var e = typeGetValue(c);
            if (e > _this.kq.count - 1) {
                e -= _this.kq.count;
            }
            var f = _this.kq.item(e);
            return _this.fy(f);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.ay == null || _this.ay.visibility == 0) && _this.mk != null && _this.mq != c) {
                var d = typeCast(XamDataChart.$, _this.bh);
                if (d == null) {
                    return;
                }
                _this.mq = c;
                _this.av.bg = c;
                d.l6();
                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.av) !== null) {
                            e.a4.ag();
                        }
                    }
                }
                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.ml.m(d, e, c.z, c.aa, f.minLength, f.maxLength, f.center);
        };
        b.l = function (c, d, e, f) {
            var g = typeCast(RadialAxisRenderingParameters.$, c);
            _this.ml.n(d, e, f, g.z, c.aa, g.minLength, g.maxLength, g.center);
        };
        b.m = function (c, d) { return _this.getScaledAngle(d); };
        b.q = function (c, d) {
            if (_this.m0(d - _this.mr) < 0) {
                return false;
            }
            if (_this.m0(d - _this.mr - (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.ml.i(c.t, c.n, c.z, c.aa, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.mu();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.nf(d, f.center, c.aa, c.z, 0);
            if (g.x < c.z.right && g.x >= c.z.left && g.y < c.z.bottom && g.y >= c.z.top) {
                return true;
            }
            return false;
        };
        b.a = function (c, d, e, f) {
            var g = c.y;
            var h = new ScalerParams(0, c.aa, c.z, _this.cg, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.le);
                var k = _this.ei(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.mx);
        return b;
    };
    CategoryAngleAxis.prototype.nf = function (a, b, c, d, e) {
        var f = this.mu();
        var g = ViewportUtils.b(e, c, d);
        if (this.ay != null && (this.ay.c == 5 || this.ay.c == 1)) {
            g *= -1;
        }
        var h = b.x + (f + g) * Math.cos(a);
        var i = b.y + (f + g) * Math.sin(a);
        h = ViewportUtils.c(h, c, d);
        i = ViewportUtils.f(i, c, d);
        return { $type: Point_$type, x: h, y: i };
    };
    CategoryAngleAxis.prototype.mu = function () {
        if (this.mk == null) {
            return 0;
        }
        if (!this.b4()) {
            return this.mk.nr();
        }
        else {
            return this.mk.ns((this.fu));
        }
    };
    CategoryAngleAxis.prototype.mf = function (a, b, c, d) {
        if (this.kq == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.kq.count - 1;
        var g = this.a4.a1();
        var h = this.a4.a4();
        var i = this.a4.a2();
        var j = this.a4.a3();
        e.t = g;
        e.w = h;
        e.u = i;
        e.v = j;
        e.l = f;
        e.m = 0;
        e.h = false;
        e.z = a;
        e.y = c;
        e.x = d;
        e.aa = b;
        e.g = this.mn();
        e.p = this.my;
        e.o = this.ex();
        e.q = this.mz;
        e.s = this.fz;
        var k = this.ml.f(b);
        var l = this.ml.g(b);
        var m = 0.5 * this.mk.nm;
        var n = 0.5 * this.mk.nl;
        var o = k;
        var p = l;
        var q = this.mk.nr();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.ml.k(b, e, 0, this.kq.count, this.cg, 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.ae = this.kq.count;
        e.ab = this.categoryMode;
        e.ad = true;
        e.ac = this.cg;
        e.af = this.lg;
        e.f = new CategoryTickmarkValues();
        e.j = this.cx;
        return e;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c) {
        var d = this.ml.l(a, b, c);
        b = d.p1;
        c = d.p2;
        return {
            p1: b,
            p2: c
        };
    };
    CategoryAngleAxis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.h7(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "mk", {
        get: function () {
            if (this.mj != null) {
                return this.mj;
            }
            var a = typeCast(XamDataChart.$, this.bh);
            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.mj;
        },
        set: function (a) {
            this.mj = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.aj = function () {
        return this.mk;
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.le;
    };
    CategoryAngleAxis.prototype.k3 = function (a, b, c) {
        var d = this.la(a, b, c);
        var e = 0;
        if (!isNaN_(this.k9)) {
            e = Math.min(this.k9, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.lg - (this.lg - 1) * e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.lg > 1) {
            var f = this.la(b, c, d);
            var g = 0;
            if (!isNaN_(this.k9)) {
                g = Math.min(this.k9, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.lg - (this.lg - 1) * g);
            var j = (h - i) / (this.lg - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.mx = function (a) {
        var b = 0.5;
        if (this.lg > 1) {
            var c = this.la(Rect.empty, Rect.empty, Rect.empty);
            var d = 0;
            if (!isNaN_(this.k9)) {
                d = Math.min(this.k9, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.lg - (this.lg - 1) * d);
            var g = (e - f) / (this.lg - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.h8 = function (a) {
        _super.prototype.h8.call(this, a);
        var b = this.bh != null ? this.bh.s9 : Rect.empty;
        var c = !b.isEmpty ? this.kc : Rect.empty;
        var d = this.j7();
        var e = this.j6();
        var f = this.mi.c(a, c, b, d, e);
        if (f != null) {
            this.ms = f.f.m;
            this.mt = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.mw = function (a, b) {
        var c;
        var d;
        var e = this.ml.l(b, c, d);
        c = e.p1;
        d = e.p2;
        if (c == 0) {
            if (this.cg) {
                return this.le;
            }
            else {
                return 0;
            }
        }
        var f = this.getUnscaledAngle(c);
        if (f < 0 || f > this.le) {
            f = this.getUnscaledAngle(c + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.mv = function (a, b) {
        var c;
        var d;
        var e = this.ml.l(b, c, d);
        c = e.p1;
        d = e.p2;
        if (d > Math.PI * 2) {
            d = d - Math.PI * 2;
        }
        if (d == Math.PI * 2) {
            if (this.cg) {
                return 0;
            }
            else {
                return this.le;
            }
        }
        var f = this.getUnscaledAngle(d);
        if (f < 0 || f > this.le) {
            f = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.le;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.ch) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.mr;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.mr) {
            a += 2 * Math.PI;
        }
        var b = (a - this.mr) / (2 * Math.PI);
        if (this.cg) {
            b = 1 - b;
        }
        return b * (this.le);
    };
    CategoryAngleAxis.prototype.ei = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.el = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.hv = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.hv.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bh);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nb(f);
                if (f != null) {
                    f.n1(this);
                }
                this.cp = true;
                this.h7(false);
                break;
            case CategoryAngleAxis.$$p[0]:
                this.mr = this.m1;
                while (this.mr < 0) {
                    this.mr += 360;
                }
                while (this.mr >= 360) {
                    this.mr -= 360;
                }
                this.mr = (this.mr * Math.PI) / 180;
                this.cp = true;
                this.h7(false);
                try {
                    for (var _d = __values(fromEnum(this.dd)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.ml(false);
                        g.ls();
                    }
                }
                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":
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.cp = true;
                            h.h6();
                        }
                    }
                    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.cp = true;
                                i.h6();
                            }
                        }
                    }
                    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.mi = this.mh();
                this.m9();
                this.cp = true;
                this.h7(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.m9 = function () {
        this.mq = NaN;
    };
    CategoryAngleAxis.prototype.nb = function (a) {
        this.mk = a;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "my", {
        get: function () {
            return this.c(CategoryAngleAxis.nc);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.nc, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "ms", {
        get: function () {
            return this.mo;
        },
        set: function (a) {
            if (this.ms != a) {
                var b = this.mo;
                this.mo = a;
                this.h1("ActualInterval", b, this.ms);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.eu = function () {
        return this.ms;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "mz", {
        get: function () {
            return this.c(CategoryAngleAxis.nd);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.nd, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "mt", {
        get: function () {
            return this.mp;
        },
        set: function (a) {
            if (this.mt != a) {
                var b = this.mp;
                this.mp = a;
                this.h1("ActualMinorInterval", b, this.mt);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.mn = function () {
        return !isNaN_(this.my);
    };
    CategoryAngleAxis.prototype.get_a1 = function () {
        return 2;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.c2 = function () {
        if (this.cp && this.c3) {
            this.bb = this.ba();
        }
        if (this.kq == null) {
            return false;
        }
        var a = this.kq.count;
        if (a != this.m3) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.m3, a);
            this.m3 = a;
            this.h2(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "m3", {
        get: function () {
            return this.m2;
        },
        set: function (a) {
            this.m2 = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j4 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        var f = typeCast(RadialAxisRenderingParameters.$, this.mi.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.c(i, b, c);
        j = ViewportUtils.f(j, b, c);
        k = ViewportUtils.c(k, b, c);
        l = ViewportUtils.f(l, b, c);
        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.co;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.el.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$b = function (a, b) {
        return this.ei.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$d = function (a, b, c, d, e) {
        this.hl.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d) {
        this.hm.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.hn.apply(this, arguments);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "j$a", {
        get: function () {
            return this.cg;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.nc = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.h1("Interval", b.oldValue, b.newValue);
        a.h7(false);
    }));
    CategoryAngleAxis.nd = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).h1("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).h7(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h1', ['StartAngleOffset:m1:ne', [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.ni = null;
        _this.nj = false;
        _this.nk = NaN;
        _this.nl = 0;
        _this.ng = null;
        _this.ab = NumericAngleAxis.$;
        _this.ni = new PolarAxisRenderingManager();
        _this.ky = _this.kw();
        return _this;
    }
    NumericAngleAxis.prototype.a3 = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.hr = function (a) {
        _super.prototype.hr.call(this, a);
        this.nf = a;
    };
    NumericAngleAxis.prototype.get_b8 = function () {
        return true;
    };
    NumericAngleAxis.prototype.au = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dg = function (b) {
            var c = _this.bh != null ? _this.bh.s9 : Rect.empty;
            var d = !c.isEmpty ? _this.kc : Rect.empty;
            return _this.nv(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.av.bh);
        };
        return a;
    };
    NumericAngleAxis.prototype.nm = function () {
        if (this.nh == null) {
            return 0;
        }
        if (!this.b4()) {
            return this.nh.nr();
        }
        else {
            return this.nh.ns((this.fu));
        }
    };
    NumericAngleAxis.prototype.no = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.kw = function () {
        var _this = this;
        var a = _super.prototype.kw.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.ay == null || _this.ay.visibility == 0) && _this.nh != null && _this.nk != b) {
                var c = typeCast(XamDataChart.$, _this.bh);
                if (c == null) {
                    return;
                }
                _this.nk = b;
                _this.av.bg = b;
                c.l6();
                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.av) !== null) {
                            d.a4.ag();
                        }
                    }
                }
                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.nm();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.ni.i(b.t, b.n, b.z, b.aa, c.center, c.minAngle, c.maxAngle);
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.ni.m(c, d, b.z, b.aa, e.minLength, e.maxLength, e.center);
        };
        a.l = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.ni.n(c, d, e, f.z, b.aa, f.minLength, f.maxLength, f.center);
        };
        a.d = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, _this.kz(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.nj) {
                _this.nj = true;
                _this.nh.c0();
                _this.nj = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.nh != null; };
        a.q = function (b, c) {
            if (_this.no(c - _this.nl) < 0) {
                return false;
            }
            if (_this.no(c - _this.nl - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.nv(_this.getScaledAngle(e.l), e.center, b.aa, b.z, 0);
            var g = _this.nv(c, e.center, b.aa, b.z, 0);
            if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                return false;
            }
            if (g.x < b.z.right && g.x >= b.z.left && g.y < b.z.bottom && g.y >= b.z.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.nv = function (a, b, c, d, e) {
        var f = this.nm();
        var g = ViewportUtils.b(e, c, d);
        if (this.ay != null && (this.ay.c == 5 || this.ay.c == 1)) {
            g *= -1;
        }
        var h = b.x + (f + g) * Math.cos(a);
        var i = b.y + (f + g) * Math.sin(a);
        h = ViewportUtils.c(h, c, d);
        i = ViewportUtils.f(i, c, d);
        return { $type: Point_$type, x: h, y: i };
    };
    NumericAngleAxis.prototype.ei = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.l1) / (this.l0 - this.l1);
        }
        else {
            d = (a - this.lv) / (this.lu - this.lv);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.nl;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.lh, this.ch);
    };
    NumericAngleAxis.prototype.el = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.nl) / (2 * Math.PI);
        if (this.cg) {
            b = 1 - b;
        }
        if (this.lh) {
            return Math.exp(b * (this.l0 - this.l1) + this.l1);
        }
        else {
            return this.lv + b * (this.lu - this.lv);
        }
    };
    NumericAngleAxis.prototype.hv = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.hv.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bh);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nt(f);
                if (f != null) {
                    f.n1(this);
                }
                this.h7(false);
                break;
            case NumericAngleAxis.$$p[0]:
                this.nl = this.np;
                while (this.nl < 0) {
                    this.nl += 360;
                }
                while (this.nl >= 360) {
                    this.nl -= 360;
                }
                this.nl = (this.np * Math.PI) / 180;
                this.h7(false);
                try {
                    for (var _d = __values(fromEnum(this.da())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.ml(false);
                        g.ls();
                    }
                }
                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.h6();
                        }
                    }
                    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.h6();
                            }
                        }
                    }
                    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.ky = this.kw();
                this.nr();
                this.cp = true;
                this.h7(false);
                break;
        }
    };
    NumericAngleAxis.prototype.nr = function () {
        this.nk = NaN;
    };
    NumericAngleAxis.prototype.k0 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.kz = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.kz.call(this, a, b, c, d));
        var f = this.ni.f(b);
        var g = this.ni.g(b);
        var h = 0.5 * this.nh.nm;
        var i = 0.5 * this.nh.nl;
        var j = f;
        var k = g;
        var l = this.nh.nr();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.ni.k(b, e, this.lv, this.lu, this.cg, 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) {
        var d = this.ni.l(a, b, c);
        b = d.p1;
        c = d.p2;
        return {
            p1: b,
            p2: c
        };
    };
    NumericAngleAxis.prototype.h8 = function (a) {
        _super.prototype.h8.call(this, a);
        var b = this.bh != null ? this.bh.s9 : Rect.empty;
        var c = !b.isEmpty ? this.kc : Rect.empty;
        var d = this.j7();
        var e = this.j6();
        var f = this.ky.c(a, c, b, d, e);
        if (f != null) {
            this.lt = f.f.m;
            this.lw = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "nh", {
        get: function () {
            if (this.ng != null) {
                return this.ng;
            }
            var a = typeCast(XamDataChart.$, this.bh);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].cl) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.ng;
        },
        set: function (a) {
            this.ng = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.aj = function () {
        return this.nh;
    };
    NumericAngleAxis.prototype.nt = function (a) {
        this.nh = a;
    };
    NumericAngleAxis.prototype.io = function (a, b) {
        _super.prototype.io.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c0();
        }
    };
    NumericAngleAxis.prototype.get_a1 = function () {
        return 2;
    };
    Object.defineProperty(NumericAngleAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.j4 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        if (this.nh == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.kz(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.c(i, b, c);
        j = ViewportUtils.f(j, b, c);
        k = ViewportUtils.c(k, b, c);
        l = ViewportUtils.f(l, b, c);
        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, 'h1', ['StartAngleOffset:np:nu', [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.ni = null;
        _this.nj = false;
        _this.nk = NaN;
        _this.nm = 0;
        _this.nl = 0;
        _this.no = 0;
        _this.nf = null;
        _this.ab = NumericRadiusAxis.$;
        _this.nm = _this.nw;
        _this.nl = _this.nv;
        _this.ni = new PolarAxisRenderingManager();
        _this.ky = _this.kw();
        return _this;
    }
    NumericRadiusAxis.prototype.a3 = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.hr = function (a) {
        _super.prototype.hr.call(this, a);
        this.nh = a;
    };
    NumericRadiusAxis.prototype.get_cl = function () {
        return true;
    };
    NumericRadiusAxis.prototype.eh = function () {
        var a = this.nm;
        var b = this.nl;
        var c = Math.min(this.nq(), this.np()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.nq = function () {
        return this.kc.width;
    };
    NumericRadiusAxis.prototype.np = function () {
        return this.kc.height;
    };
    NumericRadiusAxis.prototype.au = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.nn = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.kw = function () {
        var _this = this;
        var a = _super.prototype.kw.call(this);
        a.b.c = function (b) {
            if ((_this.ay == null || _this.ay.visibility == 0) && _this.ng != null) {
                if ((_this.ay == null || (_this.ay.c == 4 || _this.ay.c == 5)) && _this.nk != b) {
                    _this.nk = b;
                    _this.av.bg = b;
                    _this.bh.l6();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.ni.i(c, d, e.z, e.aa, e.center, e.minAngle, e.maxAngle);
        };
        a.l = function (b, c, d, e) {
            if (d == e) {
                return;
            }
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.ni.j(c, d, e, f.z, f.aa, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.ns(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.ni.m(b.t, c.crossingAngleRadians, b.z, b.aa, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.ay == null || (_this.ay.c == 4 || _this.ay.c == 0) ? b.z.top : b.z.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.nn(_this.fu) * Math.PI) / 180;
            if (_this.ay == null || (_this.ay.c == 4 || _this.ay.c == 5)) {
                c.n = ViewportUtils.f(0.5, c.aa, c.z) - b.z.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.av);
                if (d != null) {
                    var e = 0;
                    if (_this.ay != null && _this.ay.c == 4) {
                        e = 1;
                    }
                    d.dy = { $type: Point_$type, x: ViewportUtils.c(0.5, c.aa, c.z), y: e };
                    d.dv = c.crossingAngleRadians;
                }
            }
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            if (_this.ng == null) {
                return false;
            }
            if (c > e.effectiveMaximum) {
                return false;
            }
            var f = false;
            f = _this.ay == null || (_this.ay.c == 4 || _this.ay.c == 5);
            var g = 0;
            if (f) {
                g = _this.no;
            }
            var h = e.center.x + c * Math.cos(g);
            var i = e.center.y + c * Math.sin(g);
            h = ViewportUtils.c(h, e.aa, e.z);
            i = ViewportUtils.f(i, e.aa, e.z);
            if (h <= b.z.right && h >= b.z.left && ((i <= b.z.bottom && i >= b.z.top) || !f)) {
                return true;
            }
            return false;
        };
        a.h = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return new LabelPosition(ViewportUtils.c(d.center.x + c, 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.ei = function (a, b) {
        return this.ns(a);
    };
    NumericRadiusAxis.prototype.nt = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.lv) - this.l1) / (this.l0 - this.l1);
            }
            else {
                f = (Math.log(a) - this.l1) / (this.l0 - this.l1);
            }
        }
        else {
            f = (a - this.lv) / (this.lu - this.lv);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.ns = function (a) {
        return this.nt(a, this.lh, this.ch, this.nm, this.nl);
    };
    NumericRadiusAxis.prototype.nu = function (a) {
        var b = a * 2;
        b = (b - this.nl) / (this.nm - this.nl);
        if (this.cg) {
            b = 1 - b;
        }
        if (this.lh) {
            return Math.exp(b * (this.l0 - this.l1) + this.l1);
        }
        else {
            return this.lv + b * (this.lu - this.lv);
        }
    };
    NumericRadiusAxis.prototype.el = function (a, b) {
        return this.nu(a);
    };
    NumericRadiusAxis.prototype.hv = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.no = this.nn(this.fu) * Math.PI / 180;
                break;
        }
        _super.prototype.hv.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.nm = this.nw;
                if (this.nm < 0) {
                    this.nm = 0.1;
                }
                if (this.nm > 1) {
                    this.nm = 1;
                }
                if (this.nl >= this.nm) {
                    this.nl = this.nm - 0.01;
                    if (this.nl < 0) {
                        this.nl = 0;
                        this.nm = 0.01;
                    }
                }
                this.cp = true;
                this.h7(false);
                if (this.ng != null) {
                    this.ng.h6();
                }
                try {
                    for (var _c = __values(fromEnum(this.da())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.ml(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.nl = this.nv;
                if (this.nl < 0) {
                    this.nl = 0.1;
                }
                if (this.nl > 1) {
                    this.nl = 1;
                }
                if (this.nl >= this.nm) {
                    this.nl = this.nm - 0.01;
                    if (this.nl < 0) {
                        this.nl = 0;
                        this.nm = 0.01;
                    }
                }
                this.cp = true;
                this.h7(false);
                if (this.ng != null) {
                    this.ng.h6();
                }
                try {
                    for (var _e = __values(fromEnum(this.da())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.e1 = true;
                        f.ml(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.bh != null) {
                    this.bh.mj();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.n1(null);
                }
                if (g != null) {
                    this.n1(g);
                    g.nt(this);
                }
                if (h != null) {
                    this.n1(h);
                    h.nb(this);
                }
                this.cp = true;
                this.h7(false);
                break;
            case "IsInverted":
                if (this.ng != null) {
                    this.ng.cp = true;
                    this.ng.h7(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.n1 = function (a) {
        this.ng = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "ng", {
        get: function () {
            if (this.nf != null) {
                return this.nf;
            }
            var a = typeCast(XamDataChart.$, this.bh);
            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.nf;
        },
        set: function (a) {
            this.nf = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.aj = function () {
        return this.ng;
    };
    NumericRadiusAxis.prototype.k0 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.kz = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.kz.call(this, a, b, c, d));
        var f = this.ni.f(b);
        var g = this.ni.g(b);
        var h = 0.5 * this.nm;
        var i = 0.5 * this.nl;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.tl)) {
            k = this.lu;
            j = this.lv;
        }
        else {
            k = Math.min(g, h);
            j = this.nu(f);
            k = this.nu(k);
            var l = this.n2(a, b, j, k);
            j = l.p2;
            k = l.p3;
        }
        var m = { $type: Point_$type, x: 0.5, y: 0.5 };
        var n = f;
        var o = g;
        var p = Math.min(a.width, a.height) * (this.nm - this.nl) / 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.lv) {
            s = this.lv;
        }
        if (t > this.lu) {
            t = this.lu;
        }
        this.ly = s;
        this.lx = 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.ng);
        if (u != null) {
            var v = void 0;
            var w = void 0;
            var x = u.getMinMaxAngle(b, v, w);
            v = x.p1;
            w = x.p2;
            e.minAngle = Math.min(v, w);
            e.maxAngle = Math.max(v, w);
        }
        var y = this.nr();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.k3;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.nx(m, e.minLength, e.maxLength, b, a);
        }
        return e;
    };
    NumericRadiusAxis.prototype.n2 = function (a, b, c, d) {
        var e = { $type: Point_$type, x: 0.5, y: 0.5 };
        var f = 0;
        if (this.cg) {
            f = this.ns(this.lv);
        }
        else {
            f = this.ns(this.lu);
        }
        var g = 0;
        if (this.fu != null) {
            g = this.no;
        }
        var h = e.x + f * Math.cos(g);
        var i = e.y + f * Math.sin(g);
        e.x = ViewportUtils.c(e.x, b, a);
        e.y = ViewportUtils.f(e.y, b, a);
        h = ViewportUtils.c(h, b, a);
        i = ViewportUtils.f(i, b, a);
        if (h >= a.left && h <= a.right && i >= a.top && i <= a.bottom) {
            if (this.cg) {
                d = this.lv;
            }
            else {
                d = this.lu;
            }
        }
        if (e.x >= a.left && e.x <= a.right && e.y >= a.top && e.y <= a.bottom) {
            if (this.cg) {
                c = this.lu;
            }
            else {
                c = this.lv;
            }
        }
        return {
            p2: c,
            p3: d
        };
    };
    NumericRadiusAxis.prototype.nx = function (a, b, c, d, e) {
        var f = ViewportUtils.d(c - b, d, e);
        var g = f / Math.min(e.width, e.height);
        if (g > 0.7) {
            return 10;
        }
        return 5;
    };
    NumericRadiusAxis.prototype.nr = function () {
        var a = 0;
        if (!this.cg) {
            a = this.ns(this.lu);
        }
        else {
            a = this.ns(this.lv);
        }
        return a;
    };
    NumericRadiusAxis.prototype.m0 = function (a) {
        if (this.ng != null) {
            this.ng.h6();
        }
    };
    NumericRadiusAxis.prototype.h8 = function (a) {
        _super.prototype.h8.call(this, a);
        var b = this.bh != null ? this.bh.s9 : Rect.empty;
        var c = !b.isEmpty ? this.kc : Rect.empty;
        var d = this.j7();
        var e = this.j6();
        var f = this.ky.c(a, c, b, d, e);
        if (f != null) {
            this.lt = f.f.m;
            this.lw = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.io = function (a, b) {
        _super.prototype.io.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c0();
        }
    };
    NumericRadiusAxis.prototype.n0 = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.kz(b, c, d, e));
        if (f == null) {
            return;
        }
        this.ni.j(a.d, f.minLength, f.maxLength, b, c, f.center, f.minAngle, f.maxAngle);
    };
    NumericRadiusAxis.prototype.get_a1 = function () {
        return 3;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.j4 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.kz(c, b, d, e));
        var g = a;
        var h = new PathGeometry();
        var i = ViewportUtils.d(g, b, c);
        var j = ViewportUtils.g(g, b, c);
        if (i <= 0 || j <= 0) {
            return null;
        }
        var k = ViewportUtils.c(f.center.x, b, c);
        var l = ViewportUtils.f(f.center.y, b, c);
        if (f.maxAngle - f.minAngle < Math.PI && f.maxAngle - f.minAngle > 0) {
            var m = { $type: Point_$type, x: ViewportUtils.c(f.center.x + g * Math.cos(f.minAngle), b, c), y: ViewportUtils.f(f.center.y + g * Math.sin(f.minAngle), b, c) };
            var n_1 = { $type: Point_$type, x: ViewportUtils.c(f.center.x + g * Math.cos(f.maxAngle), b, c), y: ViewportUtils.f(f.center.y + g * Math.sin(f.maxAngle), b, c) };
            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, 'h1', ['InnerRadiusExtentScale:nv:n3', [1, 0], 'RadiusExtentScale:nw:n4', [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.da = true;
    };
    AngleAxisLabelPanelView.prototype.a0 = function (a, b) {
        this.az.de = -1.7976931348623157E+308;
        this.az.db = -1.7976931348623157E+308;
        this.az.dd = -1.7976931348623157E+308;
        this.az.dc = -1.7976931348623157E+308;
        for (var c = 0; c < this.a.bb.count; c++) {
            var d = this.a.bb._inner[c];
            var e = this.a.ba._inner[c];
            var f = e.a;
            var g = this.az.dg(e.c);
            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.dd = Math.max(h, this.az.dd);
            this.az.dc = Math.max(i, this.az.dc);
            this.az.de = Math.max(j, this.az.de);
            this.az.db = Math.max(k, this.az.db);
            var n = new Rect(0, l, m, j, k);
            a.add(n);
            b.add(f);
        }
    };
    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.bj = null;
        _this.bj = a;
        return _this;
    }
    CategoryAngleAxisView.prototype.aj = function () {
        _super.prototype.aj.call(this);
        this.a.jv = AxisDefaults.h;
        this.a.jy = AxisDefaults.g;
    };
    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.bj = null;
        _this.bj = a;
        return _this;
    }
    NumericAngleAxisView.prototype.aj = function () {
        _super.prototype.aj.call(this);
        this.a.jv = AxisDefaults.h;
        this.a.jy = AxisDefaults.g;
    };
    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.bj = null;
        _this.bj = a;
        return _this;
    }
    NumericRadiusAxisView.prototype.aj = function () {
        _super.prototype.aj.call(this);
        this.a.jv = AxisDefaults.h;
        this.a.jy = AxisDefaults.g;
    };
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
