/*
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-react-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-react-core";
import { Extensions } from "igniteui-react-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-react-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-react-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-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-react-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { ArcSegment } from "igniteui-react-core";
import { Size } from "igniteui-react-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.kd.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.b8()) {
            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.bi);
        }
        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.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.no == b.aj.no)) {
                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].aw.bh;
            g += c._inner[f].aw.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.mm = null;
        _this.mj = null;
        _this.mn = false;
        _this.mr = NaN;
        _this.mk = null;
        _this.ms = 0;
        _this.mp = 0;
        _this.mq = 0;
        _this.m3 = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.mj = _this.mi();
        _this.mm = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.a4 = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.hs = function (a) {
        _super.prototype.hs.call(this, a);
        this.mh = a;
    };
    CategoryAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dg = function (b) {
            var c = _this.bi != null ? _this.bi.tn : Rect.empty;
            var d = !c.isEmpty ? _this.kd : Rect.empty;
            return _this.ng(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.aw.bh);
        };
        return a;
    };
    CategoryAngleAxis.prototype.m1 = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.mi = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.dd;
            $ret.e = _this.dc;
            $ret.b = _this.aw;
            return $ret;
        })());
        if (this.az != null) {
            this.az.registerAxis(this);
        }
        var b = new CategoryAxisRenderer(a);
        b.u = function () {
            var c = _this.a5.a1();
            var d = _this.a5.a4();
            var e = _this.a5.a2();
            var f = _this.a5.a3();
            _this.il();
            _this.hi(c);
            _this.hi(d);
            _this.hi(e);
            _this.hi(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.ml != null; };
        b.d = function (c, d, e, f) { return _this.mg(c, d, e, f); };
        b.v = function () {
            if (!_this.mn) {
                _this.mn = true;
                _this.ml.c1();
                _this.mn = false;
            }
        };
        b.g = function (c, d) {
            var e = typeGetValue(c);
            if (e > _this.kr.count - 1) {
                e -= _this.kr.count;
            }
            var f = _this.kr.item(e);
            return _this.fz(f);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.ml != null && _this.mr != c) {
                var d = typeCast(XamDataChart.$, _this.bi);
                if (d == null) {
                    return;
                }
                _this.mr = c;
                _this.aw.bg = c;
                d.mg();
                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.aw) !== null) {
                            e.a5.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.mm.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.mm.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.m1(d - _this.ms) < 0) {
                return false;
            }
            if (_this.m1(d - _this.ms - (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.mm.i(c.t, c.n, c.z, c.aa, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.mv();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.ng(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.ch, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.lf);
                var k = _this.ej(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.my);
        return b;
    };
    CategoryAngleAxis.prototype.ng = function (a, b, c, d, e) {
        var f = this.mv();
        var g = ViewportUtils.b(e, c, d);
        if (this.az != null && (this.az.c == 5 || this.az.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.mv = function () {
        if (this.ml == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.ml.nt();
        }
        else {
            return this.ml.nu((this.fv));
        }
    };
    CategoryAngleAxis.prototype.mg = function (a, b, c, d) {
        if (this.kr == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.kr.count - 1;
        var g = this.a5.a1();
        var h = this.a5.a4();
        var i = this.a5.a2();
        var j = this.a5.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.mo();
        e.p = this.mz;
        e.o = this.ey();
        e.q = this.m0;
        e.s = this.f0;
        var k = this.mm.f(b);
        var l = this.mm.g(b);
        var m = 0.5 * this.ml.no;
        var n = 0.5 * this.ml.nn;
        var o = k;
        var p = l;
        var q = this.ml.nt();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.mm.k(b, e, 0, this.kr.count, this.ch, 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.kr.count;
        e.ab = this.categoryMode;
        e.ad = true;
        e.ac = this.ch;
        e.af = this.lh;
        e.f = new CategoryTickmarkValues();
        e.j = this.cy;
        return e;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c) {
        var d = this.mm.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.h8(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "ml", {
        get: function () {
            if (this.mk != null) {
                return this.mk;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            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.mk;
        },
        set: function (a) {
            this.mk = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ak = function () {
        return this.ml;
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.lf;
    };
    CategoryAngleAxis.prototype.k4 = function (a, b, c) {
        var d = this.lb(a, b, c);
        var e = 0;
        if (!isNaN_(this.la)) {
            e = Math.min(this.la, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.lh - (this.lh - 1) * e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.lh > 1) {
            var f = this.lb(b, c, d);
            var g = 0;
            if (!isNaN_(this.la)) {
                g = Math.min(this.la, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.lh - (this.lh - 1) * g);
            var j = (h - i) / (this.lh - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.my = function (a) {
        var b = 0.5;
        if (this.lh > 1) {
            var c = this.lb(Rect.empty, Rect.empty, Rect.empty);
            var d = 0;
            if (!isNaN_(this.la)) {
                d = Math.min(this.la, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.lh - (this.lh - 1) * d);
            var g = (e - f) / (this.lh - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.h9 = function (a) {
        _super.prototype.h9.call(this, a);
        var b = this.bi != null ? this.bi.tn : Rect.empty;
        var c = !b.isEmpty ? this.kd : Rect.empty;
        var d = this.j8();
        var e = this.j7();
        var f = this.mj.c(a, c, b, d, e);
        if (f != null) {
            this.mt = f.f.m;
            this.mu = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.mx = function (a, b) {
        var c;
        var d;
        var e = this.mm.l(b, c, d);
        c = e.p1;
        d = e.p2;
        if (c == 0) {
            if (this.ch) {
                return this.lf;
            }
            else {
                return 0;
            }
        }
        var f = this.getUnscaledAngle(c);
        if (f < 0 || f > this.lf) {
            f = this.getUnscaledAngle(c + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.mw = function (a, b) {
        var c;
        var d;
        var e = this.mm.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.ch) {
                return 0;
            }
            else {
                return this.lf;
            }
        }
        var f = this.getUnscaledAngle(d);
        if (f < 0 || f > this.lf) {
            f = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return f;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.lf;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.ci) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.ms;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.ms) {
            a += 2 * Math.PI;
        }
        var b = (a - this.ms) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        return b * (this.lf);
    };
    CategoryAngleAxis.prototype.ej = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.em = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.hw = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.hw.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nc(f);
                if (f != null) {
                    f.n3(this);
                }
                this.cq = true;
                this.h8(false);
                break;
            case CategoryAngleAxis.$$p[0]:
                this.ms = this.m2;
                while (this.ms < 0) {
                    this.ms += 360;
                }
                while (this.ms >= 360) {
                    this.ms -= 360;
                }
                this.ms = (this.ms * Math.PI) / 180;
                this.cq = true;
                this.h8(false);
                try {
                    for (var _d = __values(fromEnum(this.de)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.pp(false);
                        g.ol();
                    }
                }
                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.cq = true;
                            h.h7();
                        }
                    }
                    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.cq = true;
                                i.h7();
                            }
                        }
                    }
                    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.mj = this.mi();
                this.na();
                this.cq = true;
                this.h8(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.na = function () {
        this.mr = NaN;
    };
    CategoryAngleAxis.prototype.nc = function (a) {
        this.ml = a;
    };
    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.h2("ActualInterval", b, this.mt);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ev = function () {
        return this.mt;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "m0", {
        get: function () {
            return this.c(CategoryAngleAxis.ne);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.ne, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "mu", {
        get: function () {
            return this.mq;
        },
        set: function (a) {
            if (this.mu != a) {
                var b = this.mq;
                this.mq = a;
                this.h2("ActualMinorInterval", b, this.mu);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.mo = function () {
        return !isNaN_(this.mz);
    };
    CategoryAngleAxis.prototype.get_a2 = function () {
        return 2;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.c3 = function () {
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        if (this.kr == null) {
            return false;
        }
        var a = this.kr.count;
        if (a != this.m4) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.m4, a);
            this.m4 = a;
            this.h3(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "m4", {
        get: function () {
            return this.m3;
        },
        set: function (a) {
            this.m3 = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j5 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        var f = typeCast(RadialAxisRenderingParameters.$, this.mj.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.cp;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$d = function (a, b) {
        return this.em.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.ej.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) {
        this.hm.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.hn.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$g = function (a, b, c, d) {
        this.ho.apply(this, arguments);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "j$b", {
        get: function () {
            return this.ch;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
    CategoryAngleAxis.nd = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.h2("Interval", b.oldValue, b.newValue);
        a.h8(false);
    }));
    CategoryAngleAxis.ne = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).h2("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).h8(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h2', ['StartAngleOffset:m2:nf', [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.nk = null;
        _this.nl = false;
        _this.nm = NaN;
        _this.nn = 0;
        _this.ni = null;
        _this.ab = NumericAngleAxis.$;
        _this.nk = new PolarAxisRenderingManager();
        _this.k0 = _this.ky();
        return _this;
    }
    NumericAngleAxis.prototype.a4 = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.hs = function (a) {
        _super.prototype.hs.call(this, a);
        this.nh = a;
    };
    NumericAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    NumericAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.dg = function (b) {
            var c = _this.bi != null ? _this.bi.tn : Rect.empty;
            var d = !c.isEmpty ? _this.kd : Rect.empty;
            return _this.nx(b, { $type: Point_$type, x: 0.5, y: 0.5 }, c, d, _this.aw.bh);
        };
        return a;
    };
    NumericAngleAxis.prototype.no = function () {
        if (this.nj == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.nj.nt();
        }
        else {
            return this.nj.nu((this.fv));
        }
    };
    NumericAngleAxis.prototype.nq = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.ky = function () {
        var _this = this;
        var a = _super.prototype.ky.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.nj != null && _this.nm != b) {
                var c = typeCast(XamDataChart.$, _this.bi);
                if (c == null) {
                    return;
                }
                _this.nm = b;
                _this.aw.bg = b;
                c.mg();
                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.aw) !== null) {
                            d.a5.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.no();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.nk.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.nk.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.nk.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.k1(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.nl) {
                _this.nl = true;
                _this.nj.c1();
                _this.nl = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.nj != null; };
        a.q = function (b, c) {
            if (_this.nq(c - _this.nn) < 0) {
                return false;
            }
            if (_this.nq(c - _this.nn - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.nx(_this.getScaledAngle(e.l), e.center, b.aa, b.z, 0);
            var g = _this.nx(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.nx = function (a, b, c, d, e) {
        var f = this.no();
        var g = ViewportUtils.b(e, c, d);
        if (this.az != null && (this.az.c == 5 || this.az.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.ej = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.l3) / (this.l2 - this.l3);
        }
        else {
            d = (a - this.lx) / (this.lw - this.lx);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.nn;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.lj, this.ci);
    };
    NumericAngleAxis.prototype.em = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.nn) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lj) {
            return Math.exp(b * (this.l2 - this.l3) + this.l3);
        }
        else {
            return this.lx + b * (this.lw - this.lx);
        }
    };
    NumericAngleAxis.prototype.hw = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.hw.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nv(f);
                if (f != null) {
                    f.n3(this);
                }
                this.h8(false);
                break;
            case NumericAngleAxis.$$p[0]:
                this.nn = this.nr;
                while (this.nn < 0) {
                    this.nn += 360;
                }
                while (this.nn >= 360) {
                    this.nn -= 360;
                }
                this.nn = (this.nr * Math.PI) / 180;
                this.h8(false);
                try {
                    for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.pp(false);
                        g.ol();
                    }
                }
                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.h7();
                        }
                    }
                    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.h7();
                            }
                        }
                    }
                    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.k0 = this.ky();
                this.nt();
                this.cq = true;
                this.h8(false);
                break;
        }
    };
    NumericAngleAxis.prototype.nt = function () {
        this.nm = NaN;
    };
    NumericAngleAxis.prototype.k2 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.k1 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k1.call(this, a, b, c, d));
        var f = this.nk.f(b);
        var g = this.nk.g(b);
        var h = 0.5 * this.nj.no;
        var i = 0.5 * this.nj.nn;
        var j = f;
        var k = g;
        var l = this.nj.nt();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.nk.k(b, e, this.lx, this.lw, this.ch, 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.nk.l(a, b, c);
        b = d.p1;
        c = d.p2;
        return {
            p1: b,
            p2: c
        };
    };
    NumericAngleAxis.prototype.h9 = function (a) {
        _super.prototype.h9.call(this, a);
        var b = this.bi != null ? this.bi.tn : Rect.empty;
        var c = !b.isEmpty ? this.kd : Rect.empty;
        var d = this.j8();
        var e = this.j7();
        var f = this.k0.c(a, c, b, d, e);
        if (f != null) {
            this.lv = f.f.m;
            this.ly = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "nj", {
        get: function () {
            if (this.ni != null) {
                return this.ni;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            if (a != null) {
                for (var b = 0; b < a.axes.count; b++) {
                    if (a.axes._inner[b].cm) {
                        return a.axes._inner[b];
                    }
                }
            }
            return this.ni;
        },
        set: function (a) {
            this.ni = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.ak = function () {
        return this.nj;
    };
    NumericAngleAxis.prototype.nv = function (a) {
        this.nj = a;
    };
    NumericAngleAxis.prototype.ip = function (a, b) {
        _super.prototype.ip.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c1();
        }
    };
    NumericAngleAxis.prototype.get_a2 = function () {
        return 2;
    };
    Object.defineProperty(NumericAngleAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.j5 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        if (this.nj == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.k1(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, 'h2', ['StartAngleOffset:nr:nw', [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.nk = null;
        _this.nl = false;
        _this.nm = NaN;
        _this.no = 0;
        _this.nn = 0;
        _this.nq = 0;
        _this.nh = null;
        _this.ab = NumericRadiusAxis.$;
        _this.no = _this.ny;
        _this.nn = _this.nx;
        _this.nk = new PolarAxisRenderingManager();
        _this.k0 = _this.ky();
        return _this;
    }
    NumericRadiusAxis.prototype.a4 = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.hs = function (a) {
        _super.prototype.hs.call(this, a);
        this.nj = a;
    };
    NumericRadiusAxis.prototype.get_cm = function () {
        return true;
    };
    NumericRadiusAxis.prototype.ei = function () {
        var a = this.no;
        var b = this.nn;
        var c = Math.min(this.ns(), this.nr()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.ns = function () {
        return this.kd.width;
    };
    NumericRadiusAxis.prototype.nr = function () {
        return this.kd.height;
    };
    NumericRadiusAxis.prototype.av = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.np = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.ky = function () {
        var _this = this;
        var a = _super.prototype.ky.call(this);
        a.b.c = function (b) {
            if ((_this.az == null || _this.az.visibility == 0) && _this.ni != null) {
                if ((_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) && _this.nm != b) {
                    _this.nm = b;
                    _this.aw.bg = b;
                    _this.bi.mg();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.nk.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.nk.j(c, d, e, f.z, f.aa, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.nu(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.nk.m(b.t, c.crossingAngleRadians, b.z, b.aa, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.az == null || (_this.az.c == 4 || _this.az.c == 0) ? b.z.top : b.z.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.np(_this.fv) * Math.PI) / 180;
            if (_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) {
                c.n = ViewportUtils.f(0.5, c.aa, c.z) - b.z.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.aw);
                if (d != null) {
                    var e = 0;
                    if (_this.az != null && _this.az.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.ni == null) {
                return false;
            }
            if (c > e.effectiveMaximum) {
                return false;
            }
            var f = false;
            f = _this.az == null || (_this.az.c == 4 || _this.az.c == 5);
            var g = 0;
            if (f) {
                g = _this.nq;
            }
            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.ej = function (a, b) {
        return this.nu(a);
    };
    NumericRadiusAxis.prototype.nv = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.lx) - this.l3) / (this.l2 - this.l3);
            }
            else {
                f = (Math.log(a) - this.l3) / (this.l2 - this.l3);
            }
        }
        else {
            f = (a - this.lx) / (this.lw - this.lx);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.nu = function (a) {
        return this.nv(a, this.lj, this.ci, this.no, this.nn);
    };
    NumericRadiusAxis.prototype.nw = function (a) {
        var b = a * 2;
        b = (b - this.nn) / (this.no - this.nn);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lj) {
            return Math.exp(b * (this.l2 - this.l3) + this.l3);
        }
        else {
            return this.lx + b * (this.lw - this.lx);
        }
    };
    NumericRadiusAxis.prototype.em = function (a, b) {
        return this.nw(a);
    };
    NumericRadiusAxis.prototype.hw = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.nq = this.np(this.fv) * Math.PI / 180;
                break;
        }
        _super.prototype.hw.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.no = this.ny;
                if (this.no < 0) {
                    this.no = 0.1;
                }
                if (this.no > 1) {
                    this.no = 1;
                }
                if (this.nn >= this.no) {
                    this.nn = this.no - 0.01;
                    if (this.nn < 0) {
                        this.nn = 0;
                        this.no = 0.01;
                    }
                }
                this.cq = true;
                this.h8(false);
                if (this.ni != null) {
                    this.ni.h7();
                }
                try {
                    for (var _c = __values(fromEnum(this.db())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.pp(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.nn = this.nx;
                if (this.nn < 0) {
                    this.nn = 0.1;
                }
                if (this.nn > 1) {
                    this.nn = 1;
                }
                if (this.nn >= this.no) {
                    this.nn = this.no - 0.01;
                    if (this.nn < 0) {
                        this.nn = 0;
                        this.no = 0.01;
                    }
                }
                this.cq = true;
                this.h8(false);
                if (this.ni != null) {
                    this.ni.h7();
                }
                try {
                    for (var _e = __values(fromEnum(this.db())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.f8 = true;
                        f.pp(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.bi != null) {
                    this.bi.mu();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.n3(null);
                }
                if (g != null) {
                    this.n3(g);
                    g.nv(this);
                }
                if (h != null) {
                    this.n3(h);
                    h.nc(this);
                }
                this.cq = true;
                this.h8(false);
                break;
            case "IsInverted":
                if (this.ni != null) {
                    this.ni.cq = true;
                    this.ni.h8(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.n3 = function (a) {
        this.ni = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "ni", {
        get: function () {
            if (this.nh != null) {
                return this.nh;
            }
            var a = typeCast(XamDataChart.$, this.bi);
            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.nh;
        },
        set: function (a) {
            this.nh = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.ak = function () {
        return this.ni;
    };
    NumericRadiusAxis.prototype.k2 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.k1 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k1.call(this, a, b, c, d));
        var f = this.nk.f(b);
        var g = this.nk.g(b);
        var h = 0.5 * this.no;
        var i = 0.5 * this.nn;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.tz)) {
            k = this.lw;
            j = this.lx;
        }
        else {
            k = Math.min(g, h);
            j = this.nw(f);
            k = this.nw(k);
            var l = this.n4(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.no - this.nn) / 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.lx) {
            s = this.lx;
        }
        if (t > this.lw) {
            t = this.lw;
        }
        this.l0 = s;
        this.lz = 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.ni);
        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.nt();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.k5;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.nz(m, e.minLength, e.maxLength, b, a);
        }
        return e;
    };
    NumericRadiusAxis.prototype.n4 = function (a, b, c, d) {
        var e = { $type: Point_$type, x: 0.5, y: 0.5 };
        var f = 0;
        if (this.ch) {
            f = this.nu(this.lx);
        }
        else {
            f = this.nu(this.lw);
        }
        var g = 0;
        if (this.fv != null) {
            g = this.nq;
        }
        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.ch) {
                d = this.lx;
            }
            else {
                d = this.lw;
            }
        }
        if (e.x >= a.left && e.x <= a.right && e.y >= a.top && e.y <= a.bottom) {
            if (this.ch) {
                c = this.lw;
            }
            else {
                c = this.lx;
            }
        }
        return {
            p2: c,
            p3: d
        };
    };
    NumericRadiusAxis.prototype.nz = 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.nt = function () {
        var a = 0;
        if (!this.ch) {
            a = this.nu(this.lw);
        }
        else {
            a = this.nu(this.lx);
        }
        return a;
    };
    NumericRadiusAxis.prototype.m2 = function (a) {
        if (this.ni != null) {
            this.ni.h7();
        }
    };
    NumericRadiusAxis.prototype.h9 = function (a) {
        _super.prototype.h9.call(this, a);
        var b = this.bi != null ? this.bi.tn : Rect.empty;
        var c = !b.isEmpty ? this.kd : Rect.empty;
        var d = this.j8();
        var e = this.j7();
        var f = this.k0.c(a, c, b, d, e);
        if (f != null) {
            this.lv = f.f.m;
            this.ly = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.ip = function (a, b) {
        _super.prototype.ip.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c1();
        }
    };
    NumericRadiusAxis.prototype.n2 = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.k1(b, c, d, e));
        if (f == null) {
            return;
        }
        this.nk.j(a.d, f.minLength, f.maxLength, b, c, f.center, f.minAngle, f.maxAngle);
    };
    NumericRadiusAxis.prototype.get_a2 = function () {
        return 3;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.j5 = function (a, b, c, d, e) {
        if (d === void 0) {
            d = null;
        }
        if (e === void 0) {
            e = null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.k1(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, 'h2', ['InnerRadiusExtentScale:nx:n5', [1, 0], 'RadiusExtentScale:ny:n6', [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.jw = AxisDefaults.h;
        this.a.jz = 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.jw = AxisDefaults.h;
        this.a.jz = 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.jw = AxisDefaults.h;
        this.a.jz = AxisDefaults.g;
    };
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
