/*
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 * as tslib_1 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 { MathUtil } from "igniteui-angular-core";
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 { 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 { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var AngleAxisLabelPanel = /** @class */ (function (_super) {
    tslib_1.__extends(AngleAxisLabelPanel, _super);
    function AngleAxisLabelPanel() {
        var _this = _super.call(this) || this;
        _this.ct = false;
        _this.cz = null;
        _this.cx = 0;
        _this.cu = 0;
        _this.cw = 0;
        _this.cv = 0;
        return _this;
    }
    AngleAxisLabelPanel.prototype.ad = function () {
        return new AngleAxisLabelPanelView(this);
    };
    AngleAxisLabelPanel.prototype.b8 = function (a) {
        _super.prototype.b8.call(this, a);
        this.cs = a;
    };
    AngleAxisLabelPanel.prototype.ao = function (a, b) {
        if (!Extensions.b(b)) {
            return false;
        }
        if (this.ac == null || this.ac.i1.isEmpty) {
            return _super.prototype.ao.call(this, a, b);
        }
        return true;
    };
    AngleAxisLabelPanel.prototype.ay = function () {
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        if (this.a3.count != this.a2.count) {
            return a;
        }
        this.cs.ay(a, b);
        var c = false;
        this.am = this.al(a, b);
        if (!this.ac.bz()) {
            c = true;
            this.a9 = this.cx / 2;
            this.a9 = this.a9 + this.cy();
        }
        else {
            c = true;
            this.cs.ac();
        }
        if (c) {
            for (var d = 0; d < a.count; d++) {
                var e = this.a3._inner[d];
                var f = this.a2._inner[d];
                var g = a._inner[d];
                var h = this.cz(f.c);
                var i = h.x - this.bc(e) / 2;
                var j = h.y - this.bb(e) / 2;
                g.x = i;
                g.y = j;
                a._inner[d] = g;
            }
        }
        return a;
    };
    AngleAxisLabelPanel.prototype.cy = function () {
        var a;
        var b;
        b = this.ac;
        a = null;
        if (b != null) {
            a = typeCast(XamDataChart.$, b.bf);
        }
        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.at) !== null && e.at.a3.count > 0 && (!e.bz()) && !e.by() && (e.ag == null || this.ac.ag == null || e.ag.lj == b.ag.lj)) {
                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].at.a9;
            g += c._inner[f].at.a9 * 2 + h;
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.ah = function () {
        return 4;
    };
    AngleAxisLabelPanel.prototype.as = function (a) {
        return a == 4 || a == 5;
    };
    AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
    return AngleAxisLabelPanel;
}(AxisLabelPanelBase));
export { AngleAxisLabelPanel };
/**
 * @hidden
 */
var CategoryAngleAxis = /** @class */ (function (_super) {
    tslib_1.__extends(CategoryAngleAxis, _super);
    function CategoryAngleAxis() {
        var _this = _super.call(this) || this;
        _this.k2 = null;
        _this.kz = null;
        _this.k3 = false;
        _this.k7 = NaN;
        _this.k0 = null;
        _this.k8 = 0;
        _this.k5 = 0;
        _this.k6 = 0;
        _this.lj = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.kz = _this.ky();
        _this.k2 = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.a1 = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.gs = function (a) {
        _super.prototype.gs.call(this, a);
        this.kx = a;
    };
    CategoryAngleAxis.prototype.get_b0 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.as = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.cz = function (b) {
            var c = _this.bf != null ? _this.bf.mq : Rect.empty;
            var d = !c.isEmpty ? _this.i1 : Rect.empty;
            return _this.lw(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.at.a9);
        };
        return a;
    };
    CategoryAngleAxis.prototype.lh = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.ky = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.cw;
            $ret.e = _this.cv;
            $ret.b = _this.at;
            return $ret;
        })());
        if (this.aw != null) {
            this.aw.registerAxis(this);
        }
        var b = new CategoryAxisRenderer(a);
        b.u = function () {
            var c = _this.a2.ay();
            var d = _this.a2.a1();
            var e = _this.a2.az();
            var f = _this.a2.a0();
            _this.he();
            _this.gi(c);
            _this.gi(d);
            _this.gi(e);
            _this.gi(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.k1 != null; };
        b.d = function (c, d, e, f) { return _this.kw(c, d, e, f); };
        b.v = function () {
            if (!_this.k3) {
                _this.k3 = true;
                _this.k1.cl();
                _this.k3 = false;
            }
        };
        b.g = function (c) {
            var d = typeGetValue(c);
            if (d > _this.jf.count - 1) {
                d -= _this.jf.count;
            }
            var e = _this.jf.item(d);
            return _this.e6(e);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.aw == null || _this.aw.visibility == 0) && _this.k1 != null && _this.k7 != c) {
                var d = typeCast(XamDataChart.$, _this.bf);
                if (d == null) {
                    return;
                }
                _this.k7 = c;
                _this.at.a8 = c;
                d.ht();
                try {
                    for (var _b = tslib_1.__values(fromEnum(d.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var e = _c.value;
                        if (e != _this && typeCast(AngleAxisLabelPanel.$, e.at) !== null) {
                            e.a2.ad();
                        }
                    }
                }
                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.k2.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.k2.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.lh(d - _this.k8) < 0) {
                return false;
            }
            if (_this.lh(d - _this.k8 - (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.k2.i(c.t, c.n, c.z, c.aa, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.lb();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.lw(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.b8, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.jy);
                var k = _this.dw(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.le);
        return b;
    };
    CategoryAngleAxis.prototype.lw = function (a, b, c, d, e) {
        var f = this.lb();
        var g = ViewportUtils.b(e, c, d);
        if (this.aw != null && (this.aw.c == 5 || this.aw.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.lb = function () {
        if (this.k1 == null) {
            return 0;
        }
        if (!this.by()) {
            return this.k1.lo();
        }
        else {
            return this.k1.lp((this.e2));
        }
    };
    CategoryAngleAxis.prototype.kw = function (a, b, c, d) {
        if (this.jf == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.jf.count - 1;
        var g = this.a2.ay();
        var h = this.a2.a1();
        var i = this.a2.az();
        var j = this.a2.a0();
        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.k4();
        e.p = this.lf;
        e.o = this.d9();
        e.q = this.lg;
        e.s = this.e7;
        var k = this.k2.f(b);
        var l = this.k2.g(b);
        var m = 0.5 * this.k1.lj;
        var n = 0.5 * this.k1.li;
        var o = k;
        var p = l;
        var q = this.k1.lo();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.k2.k(b, e, 0, this.jf.count, this.b8, 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.jf.count;
        e.ab = this.categoryMode;
        e.ad = true;
        e.ac = this.b8;
        e.af = this.j1;
        e.f = new CategoryTickmarkValues();
        e.j = this.cj;
        return e;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c) {
        var d = this.k2.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.g6(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "k1", {
        get: function () {
            if (this.k0 != null) {
                return this.k0;
            }
            var a = typeCast(XamDataChart.$, this.bf);
            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.k0;
        },
        set: function (a) {
            this.k0 = a;
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.ah = function () {
        return this.k1;
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.jy;
    };
    CategoryAngleAxis.prototype.jr = function (a, b, c) {
        var d = !isNaN_(this.jo) ? MathUtil.b(this.jo, 0, 1) : 0;
        var e = 0;
        if (!isNaN_(this.jv)) {
            e = Math.min(this.jv, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.j1 - (this.j1 - 1) * e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.j1 > 1) {
            var f = !isNaN_(this.jo) ? MathUtil.b(this.jo, 0, 1) : 0;
            var g = 0;
            if (!isNaN_(this.jv)) {
                g = Math.min(this.jv, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.j1 - (this.j1 - 1) * g);
            var j = (h - i) / (this.j1 - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.le = function (a) {
        var b = 0.5;
        if (this.j1 > 1) {
            var c = !isNaN_(this.jo) ? MathUtil.b(this.jo, 0, 1) : 0;
            var d = 0;
            if (!isNaN_(this.jv)) {
                d = Math.min(this.jv, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.j1 - (this.j1 - 1) * d);
            var g = (e - f) / (this.j1 - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.g7 = function (a) {
        _super.prototype.g7.call(this, a);
        var b = this.bf != null ? this.bf.mq : Rect.empty;
        var c = !b.isEmpty ? this.i1 : Rect.empty;
        var d = this.iw();
        var e = this.iv();
        var f = this.kz.c(a, c, b, d, e);
        if (f != null) {
            this.k9 = f.f.m;
            this.la = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.ld = function (a, b) {
        var c;
        var d;
        var e = this.k2.l(b, c, d);
        c = e.p1;
        d = e.p2;
        if (c == 0) {
            if (this.b8) {
                return this.jy;
            }
            else {
                return 0;
            }
        }
        var f = this.getUnscaledAngle(c);
        if (f < 0 || f > this.jy) {
            f = this.getUnscaledAngle(c + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.lc = function (a, b) {
        var c;
        var d;
        var e = this.k2.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.b8) {
                return 0;
            }
            else {
                return this.jy;
            }
        }
        var f = this.getUnscaledAngle(d);
        if (f < 0 || f > this.jy) {
            f = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.jy;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.b9) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.k8;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.k8) {
            a += 2 * Math.PI;
        }
        var b = (a - this.k8) / (2 * Math.PI);
        if (this.b8) {
            b = 1 - b;
        }
        return b * (this.jy);
    };
    CategoryAngleAxis.prototype.dw = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.dz = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.gu = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.gu.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bf);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.ls(f);
                if (f != null) {
                    f.ly(this);
                }
                this.cg = true;
                this.g6(false);
                break;
            case CategoryAngleAxis.$$p[0]:
                this.k8 = this.li;
                while (this.k8 < 0) {
                    this.k8 += 360;
                }
                while (this.k8 >= 360) {
                    this.k8 -= 360;
                }
                this.k8 = (this.k8 * Math.PI) / 180;
                this.cg = true;
                this.g6(false);
                try {
                    for (var _d = tslib_1.__values(fromEnum(this.cx)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.jd(false);
                        g.ik();
                    }
                }
                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 = tslib_1.__values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.cg = true;
                            h.g5();
                        }
                    }
                    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 = tslib_1.__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.cg = true;
                                i.g5();
                            }
                        }
                    }
                    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.kz = this.ky();
                this.lq();
                this.cg = true;
                this.g6(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.lq = function () {
        this.k7 = NaN;
    };
    CategoryAngleAxis.prototype.ls = function (a) {
        this.k1 = a;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "lf", {
        get: function () {
            return this.c(CategoryAngleAxis.lt);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.lt, a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "k9", {
        get: function () {
            return this.k5;
        },
        set: function (a) {
            if (this.k9 != a) {
                var b = this.k5;
                this.k5 = a;
                this.g0("ActualInterval", b, this.k9);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.d7 = function () {
        return this.k9;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "lg", {
        get: function () {
            return this.c(CategoryAngleAxis.lu);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.lu, a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "la", {
        get: function () {
            return this.k6;
        },
        set: function (a) {
            if (this.la != a) {
                var b = this.k6;
                this.k6 = a;
                this.g0("ActualMinorInterval", b, this.la);
            }
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.k4 = function () {
        return false;
    };
    CategoryAngleAxis.prototype.get_az = function () {
        return 2;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "az", {
        get: function () {
            return this.get_az();
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.cn = function () {
        if (this.cg && this.co) {
            this.a9 = this.a8();
        }
        if (this.jf == null) {
            return false;
        }
        var a = this.jf.count;
        if (a != this.lk) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.lk, a);
            this.lk = a;
            this.g1(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "lk", {
        get: function () {
            return this.lj;
        },
        set: function (a) {
            this.lj = a;
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.it = function (a, b, c, d, e) {
        if (d === void 0) { d = null; }
        if (e === void 0) { e = null; }
        var f = typeCast(RadialAxisRenderingParameters.$, this.kz.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.cf;
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.dz.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$b = function (a, b) {
        return this.dw.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$d = function (a, b, c, d, e) {
        this.gm.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d) {
        this.gn.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.go.apply(this, arguments);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "j$a", {
        get: function () {
            return this.b8;
        },
        enumerable: true,
        configurable: true
    });
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.lt = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.g0("Interval", b.oldValue, b.newValue);
        a.g6(false);
    }));
    CategoryAngleAxis.lu = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).g0("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).g6(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'g0', ['StartAngleOffset:li:lv', [1, 0]]);
    return CategoryAngleAxis;
}(CategoryAxisBase));
export { CategoryAngleAxis };
/**
 * @hidden
 */
var NumericAngleAxis = /** @class */ (function (_super) {
    tslib_1.__extends(NumericAngleAxis, _super);
    function NumericAngleAxis() {
        var _this = _super.call(this) || this;
        _this.lf = null;
        _this.lg = false;
        _this.lh = NaN;
        _this.li = 0;
        _this.ld = null;
        _this.ab = NumericAngleAxis.$;
        _this.lf = new PolarAxisRenderingManager();
        _this.jf = _this.jd();
        return _this;
    }
    NumericAngleAxis.prototype.a1 = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.gs = function (a) {
        _super.prototype.gs.call(this, a);
        this.lc = a;
    };
    NumericAngleAxis.prototype.get_b0 = function () {
        return true;
    };
    NumericAngleAxis.prototype.as = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.cz = function (b) {
            var c = _this.bf != null ? _this.bf.mq : Rect.empty;
            var d = !c.isEmpty ? _this.i1 : Rect.empty;
            return _this.ls(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.at.a9);
        };
        return a;
    };
    NumericAngleAxis.prototype.lj = function () {
        if (this.le == null) {
            return 0;
        }
        if (!this.by()) {
            return this.le.lo();
        }
        else {
            return this.le.lp((this.e2));
        }
    };
    NumericAngleAxis.prototype.ll = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.jd = function () {
        var _this = this;
        var a = _super.prototype.jd.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.aw == null || _this.aw.visibility == 0) && _this.le != null && _this.lh != b) {
                var c = typeCast(XamDataChart.$, _this.bf);
                if (c == null) {
                    return;
                }
                _this.lh = b;
                _this.at.a8 = b;
                c.ht();
                try {
                    for (var _b = tslib_1.__values(fromEnum(c.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        if (d != _this && typeCast(AngleAxisLabelPanel.$, d.at) !== null) {
                            d.a2.ad();
                        }
                    }
                }
                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.lj();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.lf.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.lf.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.lf.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.jg(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.lg) {
                _this.lg = true;
                _this.le.cl();
                _this.lg = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.le != null; };
        a.q = function (b, c) {
            if (_this.ll(c - _this.li) < 0) {
                return false;
            }
            if (_this.ll(c - _this.li - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.ls(_this.getScaledAngle(e.l), e.center, b.aa, b.z, 0);
            var g = _this.ls(c, e.center, b.aa, b.z, 0);
            if (d && MathUtil.e(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.ls = function (a, b, c, d, e) {
        var f = this.lj();
        var g = ViewportUtils.b(e, c, d);
        if (this.aw != null && (this.aw.c == 5 || this.aw.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.dw = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.ka) / (this.j9 - this.ka);
        }
        else {
            d = (a - this.j4) / (this.j3 - this.j4);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.li;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.ju, this.b9);
    };
    NumericAngleAxis.prototype.dz = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.li) / (2 * Math.PI);
        if (this.b8) {
            b = 1 - b;
        }
        if (this.ju) {
            return Math.exp(b * (this.j9 - this.ka) + this.ka);
        }
        else {
            return this.j4 + b * (this.j3 - this.j4);
        }
    };
    NumericAngleAxis.prototype.gu = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.gu.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bf);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.lq(f);
                if (f != null) {
                    f.ly(this);
                }
                this.g6(false);
                break;
            case NumericAngleAxis.$$p[0]:
                this.li = this.lm;
                while (this.li < 0) {
                    this.li += 360;
                }
                while (this.li >= 360) {
                    this.li -= 360;
                }
                this.li = (this.lm * Math.PI) / 180;
                this.g6(false);
                try {
                    for (var _d = tslib_1.__values(fromEnum(this.cu())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.jd(false);
                        g.ik();
                    }
                }
                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 = tslib_1.__values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.g5();
                        }
                    }
                    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 = tslib_1.__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.g5();
                            }
                        }
                    }
                    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.jf = this.jd();
                this.lo();
                this.cg = true;
                this.g6(false);
                break;
        }
    };
    NumericAngleAxis.prototype.lo = function () {
        this.lh = NaN;
    };
    NumericAngleAxis.prototype.jh = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.jg = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.jg.call(this, a, b, c, d));
        var f = this.lf.f(b);
        var g = this.lf.g(b);
        var h = 0.5 * this.le.lj;
        var i = 0.5 * this.le.li;
        var j = f;
        var k = g;
        var l = this.le.lo();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.lf.k(b, e, this.j4, this.j3, this.b8, 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.lf.l(a, b, c);
        b = d.p1;
        c = d.p2;
        return {
            p1: b,
            p2: c
        };
    };
    NumericAngleAxis.prototype.g7 = function (a) {
        _super.prototype.g7.call(this, a);
        var b = this.bf != null ? this.bf.mq : Rect.empty;
        var c = !b.isEmpty ? this.i1 : Rect.empty;
        var d = this.iw();
        var e = this.iv();
        var f = this.jf.c(a, c, b, d, e);
        if (f != null) {
            this.j2 = f.f.m;
            this.j5 = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "le", {
        get: function () {
            if (this.ld != null) {
                return this.ld;
            }
            var a = typeCast(XamDataChart.$, this.bf);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].cc) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.ld;
        },
        set: function (a) {
            this.ld = a;
        },
        enumerable: true,
        configurable: true
    });
    NumericAngleAxis.prototype.ah = function () {
        return this.le;
    };
    NumericAngleAxis.prototype.lq = function (a) {
        this.le = a;
    };
    NumericAngleAxis.prototype.hh = function (a, b) {
        _super.prototype.hh.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.cl();
        }
    };
    NumericAngleAxis.prototype.get_az = function () {
        return 2;
    };
    Object.defineProperty(NumericAngleAxis.prototype, "az", {
        get: function () {
            return this.get_az();
        },
        enumerable: true,
        configurable: true
    });
    NumericAngleAxis.prototype.it = function (a, b, c, d, e) {
        if (d === void 0) { d = null; }
        if (e === void 0) { e = null; }
        if (this.le == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.jg(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, 'g0', ['StartAngleOffset:lm:lr', [1, 0]]);
    return NumericAngleAxis;
}(NumericAxisBase));
export { NumericAngleAxis };
/**
 * @hidden
 */
var NumericRadiusAxis = /** @class */ (function (_super) {
    tslib_1.__extends(NumericRadiusAxis, _super);
    function NumericRadiusAxis() {
        var _this = _super.call(this) || this;
        _this.lf = null;
        _this.lg = false;
        _this.lh = NaN;
        _this.lj = 0;
        _this.li = 0;
        _this.ll = 0;
        _this.lc = null;
        _this.ab = NumericRadiusAxis.$;
        _this.lj = _this.lt;
        _this.li = _this.ls;
        _this.lf = new PolarAxisRenderingManager();
        _this.jf = _this.jd();
        return _this;
    }
    NumericRadiusAxis.prototype.a1 = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.gs = function (a) {
        _super.prototype.gs.call(this, a);
        this.le = a;
    };
    NumericRadiusAxis.prototype.get_cc = function () {
        return true;
    };
    NumericRadiusAxis.prototype.dv = function () {
        var a = this.lj;
        var b = this.li;
        var c = Math.min(this.ln(), this.lm()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.ln = function () {
        return this.i1.width;
    };
    NumericRadiusAxis.prototype.lm = function () {
        return this.i1.height;
    };
    NumericRadiusAxis.prototype.as = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.lk = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.jd = function () {
        var _this = this;
        var a = _super.prototype.jd.call(this);
        a.b.c = function (b) {
            if ((_this.aw == null || _this.aw.visibility == 0) && _this.ld != null) {
                if ((_this.aw == null || (_this.aw.c == 4 || _this.aw.c == 5)) && _this.lh != b) {
                    _this.lh = b;
                    _this.at.a8 = b;
                    _this.bf.ht();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.lf.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.lf.j(c, d, e, f.z, f.aa, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.lp(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.lf.m(b.t, c.crossingAngleRadians, b.z, b.aa, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.aw == null || (_this.aw.c == 4 || _this.aw.c == 0) ? b.z.top : b.z.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.lk(_this.e2) * Math.PI) / 180;
            if (_this.aw == null || (_this.aw.c == 4 || _this.aw.c == 5)) {
                c.n = ViewportUtils.f(0.5, c.aa, c.z) - b.z.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.at);
                if (d != null) {
                    var e = 0;
                    if (_this.aw != null && _this.aw.c == 4) {
                        e = 1;
                    }
                    d.dh = { $type: Point_$type, x: ViewportUtils.c(0.5, c.aa, c.z), y: e };
                    d.de = c.crossingAngleRadians;
                }
            }
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            if (_this.ld == null) {
                return false;
            }
            if (c > e.effectiveMaximum) {
                return false;
            }
            var f = false;
            f = _this.aw == null || (_this.aw.c == 4 || _this.aw.c == 5);
            var g = 0;
            if (f) {
                g = _this.ll;
            }
            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.dw = function (a, b) {
        return this.lp(a);
    };
    NumericRadiusAxis.prototype.lq = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.j4) - this.ka) / (this.j9 - this.ka);
            }
            else {
                f = (Math.log(a) - this.ka) / (this.j9 - this.ka);
            }
        }
        else {
            f = (a - this.j4) / (this.j3 - this.j4);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.lp = function (a) {
        return this.lq(a, this.ju, this.b9, this.lj, this.li);
    };
    NumericRadiusAxis.prototype.lr = function (a) {
        var b = a * 2;
        b = (b - this.li) / (this.lj - this.li);
        if (this.b8) {
            b = 1 - b;
        }
        if (this.ju) {
            return Math.exp(b * (this.j9 - this.ka) + this.ka);
        }
        else {
            return this.j4 + b * (this.j3 - this.j4);
        }
    };
    NumericRadiusAxis.prototype.dz = function (a, b) {
        return this.lr(a);
    };
    NumericRadiusAxis.prototype.gu = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.ll = this.lk(this.e2) * Math.PI / 180;
                break;
        }
        _super.prototype.gu.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.lj = this.lt;
                if (this.lj < 0) {
                    this.lj = 0.1;
                }
                if (this.lj > 1) {
                    this.lj = 1;
                }
                if (this.li >= this.lj) {
                    this.li = this.lj - 0.01;
                    if (this.li < 0) {
                        this.li = 0;
                        this.lj = 0.01;
                    }
                }
                this.cg = true;
                this.g6(false);
                if (this.ld != null) {
                    this.ld.g5();
                }
                try {
                    for (var _c = tslib_1.__values(fromEnum(this.cu())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.jd(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.li = this.ls;
                if (this.li < 0) {
                    this.li = 0.1;
                }
                if (this.li > 1) {
                    this.li = 1;
                }
                if (this.li >= this.lj) {
                    this.li = this.lj - 0.01;
                    if (this.li < 0) {
                        this.li = 0;
                        this.lj = 0.01;
                    }
                }
                this.cg = true;
                this.g6(false);
                if (this.ld != null) {
                    this.ld.g5();
                }
                try {
                    for (var _e = tslib_1.__values(fromEnum(this.cu())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.dl = true;
                        f.jd(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.bf != null) {
                    this.bf.h1();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.ly(null);
                }
                if (g != null) {
                    this.ly(g);
                    g.lq(this);
                }
                if (h != null) {
                    this.ly(h);
                    h.ls(this);
                }
                this.cg = true;
                this.g6(false);
                break;
            case "IsInverted":
                if (this.ld != null) {
                    this.ld.cg = true;
                    this.ld.g6(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.ly = function (a) {
        this.ld = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "ld", {
        get: function () {
            if (this.lc != null) {
                return this.lc;
            }
            var a = typeCast(XamDataChart.$, this.bf);
            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.lc;
        },
        set: function (a) {
            this.lc = a;
        },
        enumerable: true,
        configurable: true
    });
    NumericRadiusAxis.prototype.ah = function () {
        return this.ld;
    };
    NumericRadiusAxis.prototype.jh = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.jg = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.jg.call(this, a, b, c, d));
        var f = this.lf.f(b);
        var g = this.lf.g(b);
        var h = 0.5 * this.lj;
        var i = 0.5 * this.li;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.m0)) {
            k = this.j3;
            j = this.j4;
        }
        else {
            k = Math.min(g, h);
            j = this.lr(f);
            k = this.lr(k);
            var l = this.lz(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.lj - this.li) / 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.j4) {
            s = this.j4;
        }
        if (t > this.j3) {
            t = this.j3;
        }
        this.j7 = s;
        this.j6 = 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.ld);
        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.lo();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.jk;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.lu(m, e.minLength, e.maxLength, b, a);
        }
        return e;
    };
    NumericRadiusAxis.prototype.lz = function (a, b, c, d) {
        var e = { $type: Point_$type, x: 0.5, y: 0.5 };
        var f = 0;
        if (this.b8) {
            f = this.lp(this.j4);
        }
        else {
            f = this.lp(this.j3);
        }
        var g = 0;
        if (this.e2 != null) {
            g = this.ll;
        }
        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.b8) {
                d = this.j4;
            }
            else {
                d = this.j3;
            }
        }
        if (e.x >= a.left && e.x <= a.right && e.y >= a.top && e.y <= a.bottom) {
            if (this.b8) {
                c = this.j3;
            }
            else {
                c = this.j4;
            }
        }
        return {
            p2: c,
            p3: d
        };
    };
    NumericRadiusAxis.prototype.lu = 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.lo = function () {
        var a = 0;
        if (!this.b8) {
            a = this.lp(this.j3);
        }
        else {
            a = this.lp(this.j4);
        }
        return a;
    };
    NumericRadiusAxis.prototype.k2 = function (a) {
        if (this.ld != null) {
            this.ld.g5();
        }
    };
    NumericRadiusAxis.prototype.g7 = function (a) {
        _super.prototype.g7.call(this, a);
        var b = this.bf != null ? this.bf.mq : Rect.empty;
        var c = !b.isEmpty ? this.i1 : Rect.empty;
        var d = this.iw();
        var e = this.iv();
        var f = this.jf.c(a, c, b, d, e);
        if (f != null) {
            this.j2 = f.f.m;
            this.j5 = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.hh = function (a, b) {
        _super.prototype.hh.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.cl();
        }
    };
    NumericRadiusAxis.prototype.lx = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.jg(b, c, d, e));
        if (f == null) {
            return;
        }
        this.lf.j(a.d, f.minLength, f.maxLength, b, c, f.center, f.minAngle, f.maxAngle);
    };
    NumericRadiusAxis.prototype.get_az = function () {
        return 3;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "az", {
        get: function () {
            return this.get_az();
        },
        enumerable: true,
        configurable: true
    });
    NumericRadiusAxis.prototype.it = function (a, b, c, d, e) {
        if (d === void 0) { d = null; }
        if (e === void 0) { e = null; }
        var f = typeCast(PolarAxisRenderingParameters.$, this.jg(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, 'g0', ['InnerRadiusExtentScale:ls:l0', [1, 0], 'RadiusExtentScale:lt:l1', [1, 0.75]]);
    return NumericRadiusAxis;
}(NumericAxisBase));
export { NumericRadiusAxis };
/**
 * @hidden
 */
var AngleAxisLabelPanelView = /** @class */ (function (_super) {
    tslib_1.__extends(AngleAxisLabelPanelView, _super);
    function AngleAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.ax = null;
        _this.ax = a;
        return _this;
    }
    AngleAxisLabelPanelView.prototype.am = function () {
        _super.prototype.am.call(this);
        this.ax.ct = true;
    };
    AngleAxisLabelPanelView.prototype.ay = function (a, b) {
        this.ax.cx = -1.7976931348623157E+308;
        this.ax.cu = -1.7976931348623157E+308;
        this.ax.cw = -1.7976931348623157E+308;
        this.ax.cv = -1.7976931348623157E+308;
        for (var c = 0; c < this.a.a3.count; c++) {
            var d = this.a.a3._inner[c];
            var e = this.a.a2._inner[c];
            var f = e.a;
            var g = this.ax.cz(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.ax.cw = Math.max(h, this.ax.cw);
            this.ax.cv = Math.max(i, this.ax.cv);
            this.ax.cx = Math.max(j, this.ax.cx);
            this.ax.cu = Math.max(k, this.ax.cu);
            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 */ (function (_super) {
    tslib_1.__extends(CategoryAngleAxisView, _super);
    function CategoryAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bg = null;
        _this.bg = a;
        return _this;
    }
    CategoryAngleAxisView.$t = markType(CategoryAngleAxisView, 'CategoryAngleAxisView', CategoryAxisBaseView.$);
    return CategoryAngleAxisView;
}(CategoryAxisBaseView));
export { CategoryAngleAxisView };
/**
 * @hidden
 */
var NumericAngleAxisView = /** @class */ (function (_super) {
    tslib_1.__extends(NumericAngleAxisView, _super);
    function NumericAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bg = null;
        _this.bg = a;
        return _this;
    }
    NumericAngleAxisView.$t = markType(NumericAngleAxisView, 'NumericAngleAxisView', NumericAxisBaseView.$);
    return NumericAngleAxisView;
}(NumericAxisBaseView));
export { NumericAngleAxisView };
/**
 * @hidden
 */
var NumericRadiusAxisView = /** @class */ (function (_super) {
    tslib_1.__extends(NumericRadiusAxisView, _super);
    function NumericRadiusAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bg = null;
        _this.bg = a;
        return _this;
    }
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
//# sourceMappingURL=AngleAxisLabelPanel_combined.js.map