/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __values } from "tslib";
import { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Point_$type, typeGetValue, fromEnum, runOn, Number_$type, enumGetBox, markDep } from "igniteui-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 { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { DependencyProperty } from "igniteui-react-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-react-core";
import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters";
import { CategoryTickmarkValues } from "./CategoryTickmarkValues";
import { SeriesViewer } from "./SeriesViewer";
import { ScalerParams } from "./ScalerParams";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { LineGeometry } from "igniteui-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.di = null;
        _this.df = 0;
        _this.dc = 0;
        _this.de = 0;
        _this.dd = 0;
        _this.db = 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.kh.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;
        }
        var c = 1;
        if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
            c = this.ad.mm();
        }
        else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
            c = this.ad.n1();
        }
        if (c == 2) {
            this.c9.a0(a, b);
        }
        else {
            this.c9.a1(a, b);
        }
        var d = false;
        this.ao = this.an(a, b);
        if (!this.ad.b8()) {
            d = true;
            switch (c) {
                case 1:
                    this.dk();
                    break;
                case 2:
                    this.dj();
                    break;
            }
        }
        else {
            d = true;
            this.c9.ac();
        }
        if (d) {
            for (var e = 0; e < a.count; e++) {
                var f = this.bb._inner[e];
                var g = this.ba._inner[e];
                var h = a._inner[e];
                var i = this.di(g.c, h.width, h.height);
                var j = i.x - this.bk(f) / 2;
                var k = i.y - this.bj(f) / 2;
                h.x = j;
                h.y = k;
                a._inner[e] = h;
            }
        }
        return a;
    };
    AngleAxisLabelPanel.prototype.dk = function () {
        this.bh = this.df / 2;
        this.bh = this.bh + this.dg();
    };
    AngleAxisLabelPanel.prototype.dj = function () {
        this.bh = 5;
        this.bh = this.bh + this.dh();
    };
    AngleAxisLabelPanel.prototype.dh = 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.n7 == b.aj.n7)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        if (f > 0) {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var h = c._inner[f - 1];
                if (h.ml == 2) {
                    g += h.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.ml == 2) {
                    g += i.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
        }
        return g;
    };
    AngleAxisLabelPanel.prototype.dg = 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.n7 == b.aj.n7)) {
                c.add(e);
            }
        }
        var f = c.indexOf(b);
        if (f == -1) {
            return 0;
        }
        var g = 0;
        var h = 5;
        if (f == 0) {
            g += h;
        }
        else {
            if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
                var i = c._inner[f - 1];
                if (i.ml == 2) {
                    g += i.aw.db;
                }
                else {
                    g += c._inner[f - 1].aw.bh;
                }
            }
            else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
                var j = c._inner[f - 1];
                if (j.n0 == 2) {
                    g += j.aw.db;
                }
                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.mt = null;
        _this.mq = null;
        _this.mu = false;
        _this.m1 = NaN;
        _this.mr = null;
        _this.m2 = 0;
        _this.mz = 0;
        _this.m0 = 0;
        _this.nf = 1;
        _this.ab = CategoryAngleAxis.$;
        _this.mq = _this.mp();
        _this.mt = new PolarAxisRenderingManager();
        return _this;
    }
    CategoryAngleAxis.prototype.a4 = function () {
        return new CategoryAngleAxisView(this);
    };
    CategoryAngleAxis.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.mo = a;
    };
    CategoryAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    CategoryAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.di = function (b, c, d) {
            var e = _this.bi != null ? _this.bi.v4 : Rect.empty;
            var f = !e.isEmpty ? _this.kh : Rect.empty;
            var g = _this.kc();
            switch (_this.ml) {
                case 2: return _this.nw(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
                case 0:
                case 1:
                default: return _this.nx(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
            }
        };
        return a;
    };
    CategoryAngleAxis.prototype.mx = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.nk = function () {
        return null;
    };
    CategoryAngleAxis.prototype.nd = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    CategoryAngleAxis.prototype.mp = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.de;
            $ret.e = _this.dd;
            $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.a4();
            var d = _this.a5.a7();
            var e = _this.a5.a5();
            var f = _this.a5.a6();
            _this.ip();
            _this.hk(c);
            _this.hk(d);
            _this.hk(e);
            _this.hk(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.ms != null; };
        b.d = function (c, d, e, f) { return _this.mn(c, d, e, f); };
        b.v = function () {
            if (!_this.mu) {
                _this.mu = true;
                _this.ms.c1();
                _this.mu = false;
            }
        };
        b.g = function (c, d) {
            var e = typeGetValue(c);
            if (e == _this.lj - 1) {
                if (_this.cl) {
                    if (_this.mx(e)) {
                        return _this.nk();
                    }
                }
            }
            if (e > _this.lj - 1) {
                e -= _this.lj;
            }
            if (_this.my(e)) {
                return null;
            }
            var f = _this.kv.item(e);
            return _this.f1(f);
        };
        b.b.c = function (c) {
            var e_1, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.ms != null && _this.m1 != c) {
                var d = typeCast(XamDataChart.$, _this.bi);
                if (d == null) {
                    return;
                }
                _this.m1 = c;
                _this.aw.bg = c;
                d.n3();
                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.ai();
                        }
                    }
                }
                catch (e_1_1) {
                    e_1 = { error: e_1_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_1)
                            throw e_1.error;
                    }
                }
            }
        };
        b.k = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            _this.mt.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center);
        };
        b.l = function (c, d, e, f) {
            var g = typeCast(RadialAxisRenderingParameters.$, c);
            _this.mt.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center);
        };
        b.m = function (c, d) { return _this.getScaledAngle(d); };
        b.q = function (c, d) {
            if (_this.nd(d - _this.m2) < 0) {
                return false;
            }
            if (_this.nd(d - _this.m2 - (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.mt.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle);
            }
        };
        b.e = function (c) {
            c.n = _this.m5();
            c.r = c.n;
        };
        b.p = function (c, d, e) {
            var f = typeCast(RadialAxisRenderingParameters.$, c);
            if (e) {
                return false;
            }
            var g = _this.nx(d, f.center, c.ab, c.aa, c.z, 0);
            if (g.x < c.aa.right && g.x >= c.aa.left && g.y < c.aa.bottom && g.y >= c.aa.top) {
                return true;
            }
            return false;
        };
        b.a = function (c, d, e, f) {
            var g = c.z;
            var h = new ScalerParams(0, c.ab, c.aa, _this.ch, g);
            var i = d;
            if (_this.categoryMode != 0) {
                var j = (e * f) + 1;
                j = Math.min(j, _this.lj);
                var k = _this.el(j, h);
                i = (d + k) / 2;
            }
            return i;
        };
        b.f = runOn(this, this.getGroupCenter);
        b.i = runOn(this, this.na);
        return b;
    };
    CategoryAngleAxis.prototype.my = function (a) {
        return false;
    };
    CategoryAngleAxis.prototype.nx = function (a, b, c, d, e, f) {
        var g = this.m5();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    CategoryAngleAxis.prototype.nw = function (a, b, c, d, e, f, g, h) {
        if (!isNaN_(b) && !isNaN_(c)) {
            var i = this.m5();
            var j = b / f.width;
            var k = c / f.width;
            var l = ViewportUtils.a(h, e, f, g);
            var m = GeometryUtil.l(i, a, j, k);
            var n = d.x + (m + l) * Math.cos(a);
            var o = d.y + (m + l) * Math.sin(a);
            n = ViewportUtils.e(n, e, f, g);
            o = ViewportUtils.i(o, e, f, g);
            return { $type: Point_$type, x: n, y: o };
        }
        else {
            return this.nx(a, d, e, f, g, h);
        }
    };
    CategoryAngleAxis.prototype.m5 = function () {
        if (this.ms == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.ms.oc();
        }
        else {
            return this.ms.od((this.fx));
        }
    };
    CategoryAngleAxis.prototype.mn = function (a, b, c, d) {
        if (this.kv == null) {
            return null;
        }
        var e = new RadialAxisRenderingParameters();
        var f = this.lk - 1;
        var g = this.a5.a4();
        var h = this.a5.a7();
        var i = this.a5.a5();
        var j = this.a5.a6();
        e.u = g;
        e.x = h;
        e.v = i;
        e.w = j;
        e.l = f;
        e.m = 0;
        e.h = false;
        e.aa = a;
        e.z = c;
        e.y = d;
        e.ab = b;
        e.g = this.mw();
        e.p = this.nb;
        e.o = this.e0();
        e.s = this.nh();
        e.q = this.nc;
        e.t = this.f2;
        var k = this.mt.h(b, a, c);
        var l = this.mt.i(b, a, c);
        var m = 0.5 * this.ms.n7;
        var n = 0.5 * this.ms.n6;
        var o = k;
        var p = l;
        var q = this.ms.oc();
        if (isNaN_(q) || isInfinity(q)) {
            return null;
        }
        if (p >= m) {
            p = q;
        }
        if (o < n) {
            o = n;
        }
        var r = a.width;
        this.mt.m(b, a, c, e, 0, this.lk, 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.af = this.lk;
        e.ac = this.categoryMode;
        e.ae = true;
        e.ad = this.ch;
        e.ag = this.ll;
        e.f = new CategoryTickmarkValues();
        e.j = this.cy;
        return e;
    };
    CategoryAngleAxis.prototype.nh = function () {
        return -1;
    };
    CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
        var f = this.mt.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    CategoryAngleAxis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.ib(false);
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "ms", {
        get: function () {
            if (this.mr != null) {
                return this.mr;
            }
            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.mr;
        },
        set: function (a) {
            this.mr = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ak = function () {
        return this.ms;
    };
    CategoryAngleAxis.prototype.mm = function () {
        if (this.ml == 0) {
            return 1;
        }
        else {
            return this.ml;
        }
    };
    CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
        return 2 * Math.PI / this.lj;
    };
    CategoryAngleAxis.prototype.get_mv = function () {
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "mv", {
        get: function () {
            return this.get_mv();
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.m7 = function (a, b, c, d) {
        return this.k8(b, c, d);
    };
    CategoryAngleAxis.prototype.k8 = function (a, b, c) {
        var d = this.lf(a, b, c);
        var e = 0;
        if (!isNaN_(this.le)) {
            e = Math.min(this.le, 1);
        }
        var f = 1 - 0.5 * d;
        return this.getCategorySize(a, b, c) * f / (this.ll - (this.ll - 1) * e);
    };
    CategoryAngleAxis.prototype.m6 = function (a, b, c, d, e) {
        return this.getGroupCenter(b, c, d, e);
    };
    CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
        var e = 0.5;
        if (this.ll > 1) {
            var f = this.lf(b, c, d);
            var g = 0;
            if (!isNaN_(this.le)) {
                g = Math.min(this.le, 1);
            }
            var h = 1 - 0.5 * f;
            var i = h / (this.ll - (this.ll - 1) * g);
            var j = (h - i) / (this.ll - 1);
            e = 0.25 * f + 0.5 * i + a * j;
        }
        return this.getCategorySize(b, c, d) * e;
    };
    CategoryAngleAxis.prototype.na = function (a) {
        var b = 0.5;
        if (this.ll > 1) {
            var c = this.lf(Rect.empty, Rect.empty, Rect.empty);
            var d = 0;
            if (!isNaN_(this.le)) {
                d = Math.min(this.le, 1);
            }
            var e = 1 - 0.5 * c;
            var f = e / (this.ll - (this.ll - 1) * d);
            var g = (e - f) / (this.ll - 1);
            b = 0.25 * c + 0.5 * f + a * g;
        }
        return b;
    };
    CategoryAngleAxis.prototype.ic = function (a) {
        _super.prototype.ic.call(this, a);
        var b = this.bi != null ? this.bi.v4 : Rect.empty;
        var c = !b.isEmpty ? this.kh : Rect.empty;
        var d = this.kc();
        var e = this.kb();
        var f = this.mq.c(a, c, b, d, e);
        if (f != null) {
            this.m3 = f.f.m;
            this.m4 = f.f.l;
        }
    };
    CategoryAngleAxis.prototype.m9 = function (a, b, c) {
        var d;
        var e;
        var f = this.mt.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (d == 0) {
            if (this.ch) {
                return this.lj;
            }
            else {
                return 0;
            }
        }
        var g = this.getUnscaledAngle(d);
        if (g < 0 || g > this.lj) {
            g = this.getUnscaledAngle(d + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.m8 = function (a, b, c) {
        var d;
        var e;
        var f = this.mt.n(c, a, b, d, e);
        d = f.p3;
        e = f.p4;
        if (e > Math.PI * 2) {
            e = e - Math.PI * 2;
        }
        if (e == Math.PI * 2) {
            if (this.ch) {
                return 0;
            }
            else {
                return this.lj;
            }
        }
        var g = this.getUnscaledAngle(e);
        if (g < 0 || g > this.lj) {
            g = this.getUnscaledAngle(e + Math.PI * 2);
        }
        return g;
    };
    CategoryAngleAxis.prototype.getScaledAngle = function (a) {
        var b = this.lj;
        var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
        if (this.ci) {
            c = 1 - c;
        }
        return (c * 2 * Math.PI) + this.m2;
    };
    CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
        if (a < this.m2) {
            a += 2 * Math.PI;
        }
        var b = (a - this.m2) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        return b * (this.lj);
    };
    CategoryAngleAxis.prototype.el = function (a, b) {
        return this.getScaledAngle(a);
    };
    CategoryAngleAxis.prototype.eo = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    CategoryAngleAxis.prototype.d5 = function (a) {
        var b = { $type: Point_$type, x: 0.5, y: 0.5 };
        var c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
        var d = Math.acos((a.x - b.x) / c);
        if ((a.y - b.y) < 0) {
            d = (2 * Math.PI) - d;
        }
        return d;
    };
    CategoryAngleAxis.prototype.hz = function (a, b, c, d) {
        var e_2, _a, e_3, _b, e_4, _c;
        _super.prototype.hz.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.nr(f);
                if (f != null) {
                    f.om(this);
                }
                this.cq = true;
                this.ib(false);
                break;
            case CategoryAngleAxis.$$p[1]:
                this.m2 = this.ne;
                while (this.m2 < 0) {
                    this.m2 += 360;
                }
                while (this.m2 >= 360) {
                    this.m2 -= 360;
                }
                this.m2 = (this.m2 * Math.PI) / 180;
                this.cq = true;
                this.ib(false);
                try {
                    for (var _d = __values(fromEnum(this.df)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.rp(false);
                        g.qj();
                    }
                }
                catch (e_2_1) {
                    e_2 = { error: e_2_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                }
                break;
            case "Label":
            case CategoryAngleAxis.$$p[0]:
                if (e != null) {
                    try {
                        for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.cq = true;
                            h.ia();
                        }
                    }
                    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.ia();
                            }
                        }
                    }
                    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.mq = this.mp();
                this.np();
                this.cq = true;
                this.ib(false);
                break;
        }
    };
    CategoryAngleAxis.prototype.np = function () {
        this.m1 = NaN;
    };
    CategoryAngleAxis.prototype.nr = function (a) {
        this.ms = a;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "nb", {
        get: function () {
            return this.c(CategoryAngleAxis.ns);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.ns, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "m3", {
        get: function () {
            return this.mz;
        },
        set: function (a) {
            if (this.m3 != a) {
                var b = this.mz;
                this.mz = a;
                this.h5("ActualInterval", b, this.m3);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.ex = function () {
        return this.m3;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "nc", {
        get: function () {
            return this.c(CategoryAngleAxis.nu);
        },
        set: function (a) {
            this.h(CategoryAngleAxis.nu, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAngleAxis.prototype, "m4", {
        get: function () {
            return this.m0;
        },
        set: function (a) {
            if (this.m4 != a) {
                var b = this.m0;
                this.m0 = a;
                this.h5("ActualMinorInterval", b, this.m4);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.mw = function () {
        return !isNaN_(this.nb);
    };
    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.kv == null) {
            return false;
        }
        var a = this.kv.count;
        if (a != this.ng) {
            var b = new AxisRangeChangedEventArgs(0, 1, 1, this.ng, a);
            this.ng = a;
            this.h6(b);
            return true;
        }
        return false;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "ng", {
        get: function () {
            return this.nf;
        },
        set: function (a) {
            this.nf = a;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j8 = function (a, b, c, d, e) {
        var f = typeCast(RadialAxisRenderingParameters.$, this.mq.d(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    Object.defineProperty(CategoryAngleAxis.prototype, "isVertical", {
        get: function () {
            return this.cp;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAngleAxis.prototype.j$d = function (a, b) {
        return this.eo.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$c = function (a, b) {
        return this.el.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) {
        this.hp.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
        this.hq.apply(this, arguments);
    };
    CategoryAngleAxis.prototype.j$g = function (a, b, c, d) {
        this.hr.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.ns = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        a.h5("Interval", b.oldValue, b.newValue);
        a.ib(false);
    }));
    CategoryAngleAxis.nu = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
        (typeCast(CategoryAngleAxis.$, a)).h5("MinorInterval", b.oldValue, b.newValue);
        (typeCast(CategoryAngleAxis.$, a)).ib(false);
    }));
    CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h5', ['LabelMode:ml:nt', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:ne:nv', [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.n5 = null;
        _this.n6 = false;
        _this.n7 = NaN;
        _this.n8 = 0;
        _this.n3 = null;
        _this.ab = NumericAngleAxis.$;
        _this.n5 = new PolarAxisRenderingManager();
        _this.k4 = _this.k2();
        return _this;
    }
    NumericAngleAxis.prototype.a4 = function () {
        return new NumericAngleAxisView(this);
    };
    NumericAngleAxis.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.n2 = a;
    };
    NumericAngleAxis.prototype.get_b9 = function () {
        return true;
    };
    NumericAngleAxis.prototype.av = function () {
        var _this = this;
        var a = new AngleAxisLabelPanel();
        a.di = function (b, c, d) {
            var e = _this.bi != null ? _this.bi.v4 : Rect.empty;
            var f = !e.isEmpty ? _this.kh : Rect.empty;
            var g = _this.kc();
            return _this.ok(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
        };
        return a;
    };
    NumericAngleAxis.prototype.n9 = function () {
        if (this.n4 == null) {
            return 0;
        }
        if (!this.b5()) {
            return this.n4.oc();
        }
        else {
            return this.n4.od((this.fx));
        }
    };
    NumericAngleAxis.prototype.ob = function (a) {
        return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
    };
    NumericAngleAxis.prototype.k2 = function () {
        var _this = this;
        var a = _super.prototype.k2.call(this);
        a.b.c = function (b) {
            var e_5, _a;
            if ((_this.az == null || _this.az.visibility == 0) && _this.n4 != null && _this.n7 != b) {
                var c = typeCast(XamDataChart.$, _this.bi);
                if (c == null) {
                    return;
                }
                _this.n7 = b;
                _this.aw.bg = b;
                c.n3();
                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.ai();
                        }
                    }
                }
                catch (e_5_1) {
                    e_5 = { error: e_5_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_5)
                            throw e_5.error;
                    }
                }
            }
        };
        a.e = function (b) {
            b.n = _this.n9();
            b.r = b.n;
        };
        a.j = function (b) {
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            if (c.e == c.k._inner[0]) {
                _this.n5.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle);
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.n5.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center);
        };
        a.l = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.n5.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center);
        };
        a.d = function (b, c, d, e) {
            var f = typeCast(PolarAxisRenderingParameters.$, _this.k5(b, c, d, e));
            return f;
        };
        a.v = function () {
            if (!_this.n6) {
                _this.n6 = true;
                _this.n4.c1();
                _this.n6 = false;
            }
        };
        a.m = function (b, c) { return _this.getScaledAngle(c); };
        a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.n4 != null; };
        a.q = function (b, c) {
            if (_this.ob(c - _this.n8) < 0) {
                return false;
            }
            if (_this.ob(c - _this.n8 - (2 * Math.PI)) > 0) {
                return false;
            }
            return true;
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            var f = _this.ok(_this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0);
            var g = _this.ok(c, e.center, b.ab, b.aa, b.z, 0);
            if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
                return false;
            }
            if (g.x < b.aa.right && g.x >= b.aa.left && g.y < b.aa.bottom && g.y >= b.aa.top) {
                return true;
            }
            return false;
        };
        a.r = function (b, c, d, e) {
            if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) {
                return b.m;
            }
            else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericAngleAxis.prototype.ok = function (a, b, c, d, e, f) {
        var g = this.n9();
        var h = ViewportUtils.a(f, c, d, e);
        if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
            h *= -1;
        }
        var i = b.x + (g + h) * Math.cos(a);
        var j = b.y + (g + h) * Math.sin(a);
        i = ViewportUtils.e(i, c, d, e);
        j = ViewportUtils.i(j, c, d, e);
        return { $type: Point_$type, x: i, y: j };
    };
    NumericAngleAxis.prototype.el = function (a, b) {
        return this.getScaledAngle(a);
    };
    NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
        var d = 0;
        if (b) {
            d = (Math.log(a) - this.ma) / (this.l9 - this.ma);
        }
        else {
            d = (a - this.l4) / (this.l3 - this.l4);
        }
        if (c) {
            d = 1 - d;
        }
        return (d * 2 * Math.PI) + this.n8;
    };
    NumericAngleAxis.prototype.getScaledAngle = function (a) {
        return this.getScaledAngle1(a, this.lp, this.ci);
    };
    NumericAngleAxis.prototype.eo = function (a, b) {
        return this.getUnscaledAngle(a);
    };
    NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
        var b = (a - this.n8) / (2 * Math.PI);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lp) {
            return Math.exp(b * (this.l9 - this.ma) + this.ma);
        }
        else {
            return this.l4 + b * (this.l3 - this.l4);
        }
    };
    NumericAngleAxis.prototype.n1 = function () {
        if (this.n0 == 0) {
            return 1;
        }
        else {
            return this.n0;
        }
    };
    NumericAngleAxis.prototype.hz = function (a, b, c, d) {
        var e_6, _a, e_7, _b, e_8, _c;
        _super.prototype.hz.call(this, a, b, c, d);
        var e = typeCast(XamDataChart.$, this.bi);
        switch (b) {
            case "CrossingAxis":
                var f = typeCast(NumericRadiusAxis.$, d);
                this.oh(f);
                if (f != null) {
                    f.om(this);
                }
                this.ib(false);
                break;
            case NumericAngleAxis.$$p[1]:
                this.n8 = this.oc;
                while (this.n8 < 0) {
                    this.n8 += 360;
                }
                while (this.n8 >= 360) {
                    this.n8 -= 360;
                }
                this.n8 = (this.oc * Math.PI) / 180;
                this.ib(false);
                try {
                    for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var g = _e.value;
                        g.rp(false);
                        g.qj();
                    }
                }
                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.ia();
                        }
                    }
                    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.ia();
                            }
                        }
                    }
                    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.k4 = this.k2();
                this.of();
                this.cq = true;
                this.ib(false);
                break;
        }
    };
    NumericAngleAxis.prototype.of = function () {
        this.n7 = NaN;
    };
    NumericAngleAxis.prototype.k6 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericAngleAxis.prototype.k5 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k5.call(this, a, b, c, d));
        var f = this.n5.h(b, a, c);
        var g = this.n5.i(b, a, c);
        var h = 0.5 * this.n4.n7;
        var i = 0.5 * this.n4.n6;
        var j = f;
        var k = g;
        var l = this.n4.oc();
        if (isNaN_(l) || isInfinity(l)) {
            return null;
        }
        if (k >= h) {
            k = l;
        }
        if (j < i) {
            j = i;
        }
        var m = a.width;
        this.n5.m(b, a, c, e, this.l4, this.l3, 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, d, e) {
        var f = this.n5.n(a, b, c, d, e);
        d = f.p3;
        e = f.p4;
        return {
            p3: d,
            p4: e
        };
    };
    NumericAngleAxis.prototype.ic = function (a) {
        _super.prototype.ic.call(this, a);
        var b = this.bi != null ? this.bi.v4 : Rect.empty;
        var c = !b.isEmpty ? this.kh : Rect.empty;
        var d = this.kc();
        var e = this.kb();
        var f = this.k4.c(a, c, b, d, e);
        if (f != null) {
            this.l2 = f.f.m;
            this.l5 = f.f.l;
        }
    };
    Object.defineProperty(NumericAngleAxis.prototype, "n4", {
        get: function () {
            if (this.n3 != null) {
                return this.n3;
            }
            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.n3;
        },
        set: function (a) {
            this.n3 = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericAngleAxis.prototype.ak = function () {
        return this.n4;
    };
    NumericAngleAxis.prototype.oh = function (a) {
        this.n4 = a;
    };
    NumericAngleAxis.prototype.is = function (a, b) {
        _super.prototype.is.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.j8 = function (a, b, c, d, e) {
        if (this.n4 == null) {
            return null;
        }
        var f = typeCast(PolarAxisRenderingParameters.$, this.k5(c, b, d, e));
        if (f == null) {
            return null;
        }
        var g = Math.cos(a);
        var h = Math.sin(a);
        var i = f.center.x + g * f.minLength;
        var j = f.center.y + h * f.minLength;
        var k = f.center.x + g * f.maxLength;
        var l = f.center.y + h * f.maxLength;
        i = ViewportUtils.e(i, b, c, d);
        j = ViewportUtils.i(j, b, c, d);
        k = ViewportUtils.e(k, b, c, d);
        l = ViewportUtils.i(l, b, c, d);
        var m = new LineGeometry();
        m.d = { $type: Point_$type, x: i, y: j };
        m.c = { $type: Point_$type, x: k, y: l };
        return m;
    };
    NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
    NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'h5', ['LabelMode:n0:oi', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:oc:oj', [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.n3 = null;
        _this.n4 = false;
        _this.n5 = NaN;
        _this.n7 = 0;
        _this.n6 = 0;
        _this.n9 = 0;
        _this.n0 = null;
        _this.ab = NumericRadiusAxis.$;
        _this.n7 = _this.oh;
        _this.n6 = _this.og;
        _this.n3 = new PolarAxisRenderingManager();
        _this.k4 = _this.k2();
        return _this;
    }
    NumericRadiusAxis.prototype.a4 = function () {
        return new NumericRadiusAxisView(this);
    };
    NumericRadiusAxis.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.n2 = a;
    };
    NumericRadiusAxis.prototype.get_cm = function () {
        return true;
    };
    NumericRadiusAxis.prototype.ek = function () {
        var a = this.n7;
        var b = this.n6;
        var c = Math.min(this.ob(), this.oa()) * (a - b) / 2;
        c = Math.max(c, 14);
        return c;
    };
    NumericRadiusAxis.prototype.ob = function () {
        return this.kh.width;
    };
    NumericRadiusAxis.prototype.oa = function () {
        return this.kh.height;
    };
    NumericRadiusAxis.prototype.av = function () {
        return new RadialAxisLabelPanel();
    };
    NumericRadiusAxis.prototype.n8 = function (a) {
        if (a == null) {
            return 0;
        }
        return a;
    };
    NumericRadiusAxis.prototype.k2 = function () {
        var _this = this;
        var a = _super.prototype.k2.call(this);
        a.b.c = function (b) {
            if ((_this.az == null || _this.az.visibility == 0) && _this.n1 != null) {
                if ((_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) && _this.n5 != b) {
                    _this.n5 = b;
                    _this.aw.bg = b;
                    _this.bi.n3();
                }
            }
        };
        a.k = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            _this.n3.k(c, d, e.aa, e.z, e.ab, e.center, e.minAngle, e.maxAngle);
        };
        a.l = function (b, c, d, e) {
            if (d == e) {
                return;
            }
            var f = typeCast(PolarAxisRenderingParameters.$, b);
            _this.n3.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle);
        };
        a.m = function (b, c) { return _this.od(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.n3.o(b.u, c.crossingAngleRadians, b.aa, b.z, b.ab, c.minLength, c.maxLength, c.center);
        };
        a.e = function (b) {
            b.n = _this.az == null || (_this.az.c == 4 || _this.az.c == 0) ? b.aa.top : b.aa.bottom;
            b.r = b.n;
            var c = typeCast(PolarAxisRenderingParameters.$, b);
            c.crossingAngleRadians = (_this.n8(_this.fx) * Math.PI) / 180;
            if (_this.az == null || (_this.az.c == 4 || _this.az.c == 5)) {
                c.n = ViewportUtils.i(0.5, c.ab, c.aa, c.z) - b.aa.top;
                c.r = c.n;
                var d = typeCast(RadialAxisLabelPanel.$, _this.aw);
                if (d != null) {
                    var e = 0;
                    if (_this.az != null && _this.az.c == 4) {
                        e = 1;
                    }
                    d.dy = { $type: Point_$type, x: ViewportUtils.e(0.5, c.ab, c.aa, c.z), y: e };
                    d.dv = c.crossingAngleRadians;
                }
            }
        };
        a.p = function (b, c, d) {
            var e = typeCast(PolarAxisRenderingParameters.$, b);
            if (_this.n1 == 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.n9;
            }
            var h = e.center.x + c * Math.cos(g);
            var i = e.center.y + c * Math.sin(g);
            h = ViewportUtils.e(h, e.ab, e.aa, e.z);
            i = ViewportUtils.i(i, e.ab, e.aa, e.z);
            if (h <= b.aa.right && h >= b.aa.left && ((i <= b.aa.bottom && i >= b.aa.top) || !f)) {
                return true;
            }
            return false;
        };
        a.h = function (b, c) {
            var d = typeCast(PolarAxisRenderingParameters.$, b);
            return new LabelPosition(ViewportUtils.e(d.center.x + c, d.ab, d.aa, d.z));
        };
        a.r = function (b, c, d, e) {
            if (c < b.m) {
                return b.m;
            }
            else if (c > b.l) {
                return b.l;
            }
            return c;
        };
        return a;
    };
    NumericRadiusAxis.prototype.el = function (a, b) {
        return this.od(a);
    };
    NumericRadiusAxis.prototype.oe = function (a, b, c, d, e) {
        var f = 0;
        if (b) {
            if (a <= 0) {
                f = (Math.log(this.l4) - this.ma) / (this.l9 - this.ma);
            }
            else {
                f = (Math.log(a) - this.ma) / (this.l9 - this.ma);
            }
        }
        else {
            f = (a - this.l4) / (this.l3 - this.l4);
        }
        if (c) {
            f = 1 - f;
        }
        f = e + (f * (d - e));
        f /= 2;
        return f;
    };
    NumericRadiusAxis.prototype.od = function (a) {
        return this.oe(a, this.lp, this.ci, this.n7, this.n6);
    };
    NumericRadiusAxis.prototype.of = function (a) {
        var b = a * 2;
        b = (b - this.n6) / (this.n7 - this.n6);
        if (this.ch) {
            b = 1 - b;
        }
        if (this.lp) {
            return Math.exp(b * (this.l9 - this.ma) + this.ma);
        }
        else {
            return this.l4 + b * (this.l3 - this.l4);
        }
    };
    NumericRadiusAxis.prototype.eo = function (a, b) {
        return this.of(a);
    };
    NumericRadiusAxis.prototype.hz = function (a, b, c, d) {
        var e_9, _a, e_10, _b;
        switch (b) {
            case "CrossingValue":
                this.n9 = this.n8(this.fx) * Math.PI / 180;
                break;
        }
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case NumericRadiusAxis.$$p[1]:
                this.n7 = this.oh;
                if (this.n7 < 0) {
                    this.n7 = 0.1;
                }
                if (this.n7 > 1) {
                    this.n7 = 1;
                }
                if (this.n6 >= this.n7) {
                    this.n6 = this.n7 - 0.01;
                    if (this.n6 < 0) {
                        this.n6 = 0;
                        this.n7 = 0.01;
                    }
                }
                this.cq = true;
                this.ib(false);
                if (this.n1 != null) {
                    this.n1.ia();
                }
                try {
                    for (var _c = __values(fromEnum(this.db())), _d = _c.next(); !_d.done; _d = _c.next()) {
                        var e = _d.value;
                        e.rp(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.n6 = this.og;
                if (this.n6 < 0) {
                    this.n6 = 0.1;
                }
                if (this.n6 > 1) {
                    this.n6 = 1;
                }
                if (this.n6 >= this.n7) {
                    this.n6 = this.n7 - 0.01;
                    if (this.n6 < 0) {
                        this.n6 = 0;
                        this.n7 = 0.01;
                    }
                }
                this.cq = true;
                this.ib(false);
                if (this.n1 != null) {
                    this.n1.ia();
                }
                try {
                    for (var _e = __values(fromEnum(this.db())), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var f = _f.value;
                        f.g0 = true;
                        f.rp(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.oh();
                }
                break;
            case "CrossingAxis":
                var g = typeCast(NumericAngleAxis.$, d);
                var h = typeCast(CategoryAngleAxis.$, d);
                if (g == null && h == null) {
                    this.om(null);
                }
                if (g != null) {
                    this.om(g);
                    g.oh(this);
                }
                if (h != null) {
                    this.om(h);
                    h.nr(this);
                }
                this.cq = true;
                this.ib(false);
                break;
            case "IsInverted":
                if (this.n1 != null) {
                    this.n1.cq = true;
                    this.n1.ib(false);
                }
                break;
        }
    };
    NumericRadiusAxis.prototype.om = function (a) {
        this.n1 = a;
    };
    Object.defineProperty(NumericRadiusAxis.prototype, "n1", {
        get: function () {
            if (this.n0 != null) {
                return this.n0;
            }
            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.n0;
        },
        set: function (a) {
            this.n0 = a;
        },
        enumerable: false,
        configurable: true
    });
    NumericRadiusAxis.prototype.ak = function () {
        return this.n1;
    };
    NumericRadiusAxis.prototype.k6 = function () {
        return new PolarAxisRenderingParameters();
    };
    NumericRadiusAxis.prototype.k5 = function (a, b, c, d) {
        var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k5.call(this, a, b, c, d));
        var f = this.n3.h(b, a, c);
        var g = this.n3.i(b, a, c);
        var h = 0.5 * this.n7;
        var i = 0.5 * this.n6;
        var j, k;
        if (Rect.l_op_Equality(b, SeriesViewer.wg)) {
            k = this.l3;
            j = this.l4;
        }
        else {
            k = Math.min(g, h);
            j = this.of(f);
            k = this.of(k);
            var l = this.on(a, c, b, j, k);
            j = l.p3;
            k = l.p4;
        }
        var m = { $type: Point_$type, x: 0.5, y: 0.5 };
        var n = f;
        var o = g;
        var p = Math.min(d.width, d.height) * (this.n7 - this.n6) / 2;
        if (this.n9 == 0) {
            p = d.width * (this.n7 - this.n6) / 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.l4) {
            s = this.l4;
        }
        if (t > this.l3) {
            t = this.l3;
        }
        this.l7 = s;
        this.l6 = 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.n1);
        if (u != null) {
            var v = void 0;
            var w = void 0;
            var x = u.getMinMaxAngle(b, a, c, v, w);
            v = x.p3;
            w = x.p4;
            e.minAngle = Math.min(v, w);
            e.maxAngle = Math.max(v, w);
        }
        var y = this.oc();
        if (o >= h) {
            o = y;
        }
        if (n < i) {
            n = i;
        }
        e.minLength = n;
        e.maxLength = o;
        e.effectiveMaximum = y;
        e.f = this.k9;
        var z = typeCast(LinearTickmarkValues.$, e.f);
        if (z != null) {
            z.y = this.oi(m, e.minLength, e.maxLength, b, a, c);
        }
        return e;
    };
    NumericRadiusAxis.prototype.on = function (a, b, c, d, e) {
        var f = { $type: Point_$type, x: 0.5, y: 0.5 };
        var g = 0;
        if (this.ch) {
            g = this.od(this.l4);
        }
        else {
            g = this.od(this.l3);
        }
        var h = 0;
        if (this.fx != null) {
            h = this.n9;
        }
        var i = f.x + g * Math.cos(h);
        var j = f.y + g * Math.sin(h);
        f.x = ViewportUtils.e(f.x, c, a, b);
        f.y = ViewportUtils.i(f.y, c, a, b);
        i = ViewportUtils.e(i, c, a, b);
        j = ViewportUtils.i(j, c, a, b);
        if (i >= a.left && i <= a.right && j >= a.top && j <= a.bottom) {
            if (this.ch) {
                e = this.l4;
            }
            else {
                e = this.l3;
            }
        }
        if (f.x >= a.left && f.x <= a.right && f.y >= a.top && f.y <= a.bottom) {
            if (this.ch) {
                d = this.l3;
            }
            else {
                d = this.l4;
            }
        }
        return {
            p3: d,
            p4: e
        };
    };
    NumericRadiusAxis.prototype.oi = function (a, b, c, d, e, f) {
        var g = ViewportUtils.d(c - b, d, e, f);
        var h = g / Math.min(e.width, e.height);
        if (h > 0.7) {
            return 10;
        }
        return 5;
    };
    NumericRadiusAxis.prototype.oc = function () {
        var a = 0;
        if (!this.ch) {
            a = this.od(this.l3);
        }
        else {
            a = this.od(this.l4);
        }
        return a;
    };
    NumericRadiusAxis.prototype.nj = function (a) {
        if (this.n1 != null) {
            this.n1.ia();
        }
    };
    NumericRadiusAxis.prototype.ic = function (a) {
        _super.prototype.ic.call(this, a);
        var b = this.bi != null ? this.bi.v4 : Rect.empty;
        var c = !b.isEmpty ? this.kh : Rect.empty;
        var d = this.kc();
        var e = this.kb();
        var f = this.k4.c(a, c, b, d, e);
        if (f != null) {
            this.l2 = f.f.m;
            this.l5 = f.f.l;
        }
    };
    NumericRadiusAxis.prototype.is = function (a, b) {
        _super.prototype.is.call(this, a, b);
        if (b.height != a.height || b.width != a.width) {
            this.c1();
        }
    };
    NumericRadiusAxis.prototype.ol = function (a, b, c, d, e) {
        var f = typeCast(IPolarRadialRenderingParameters_$type, this.k5(b, c, d, e));
        if (f == null) {
            return;
        }
        this.n3.l(a.d, f.minLength, f.maxLength, b, d, 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.j8 = function (a, b, c, d, e) {
        var f = typeCast(PolarAxisRenderingParameters.$, this.k5(c, b, d, e));
        var g = a;
        var h = new PathGeometry();
        var i = ViewportUtils.d(g, b, c, d);
        var j = ViewportUtils.h(g, b, c, d);
        if (i <= 0 || j <= 0) {
            return null;
        }
        var k = ViewportUtils.e(f.center.x, b, c, d);
        var l = ViewportUtils.i(f.center.y, b, c, d);
        if (f.maxAngle - f.minAngle < Math.PI && f.maxAngle - f.minAngle > 0) {
            var m = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.minAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.minAngle), b, c, d) };
            var n_1 = { $type: Point_$type, x: ViewportUtils.e(f.center.x + g * Math.cos(f.maxAngle), b, c, d), y: ViewportUtils.i(f.center.y + g * Math.sin(f.maxAngle), b, c, d) };
            var o = new PathFigure();
            o._startPoint = m;
            o._isClosed = false;
            o._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = n_1;
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(o);
        }
        else {
            var p = new PathFigure();
            p._startPoint = { $type: Point_$type, x: k, y: l - j };
            p._isClosed = true;
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l + j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            p._segments.add(((function () {
                var $ret = new ArcSegment();
                $ret.b = false;
                $ret.e = { $type: Point_$type, x: k, y: l - j };
                $ret.f = new Size(1, i, j);
                $ret.d = 1;
                return $ret;
            })()));
            h.c.add(p);
        }
        return h;
    };
    NumericRadiusAxis.$t = markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$);
    NumericRadiusAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericRadiusAxis, 'h5', ['InnerRadiusExtentScale:og:oo', [1, 0], 'RadiusExtentScale:oh:op', [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.a1 = function (a, b) {
        this.az.df = -1.7976931348623157E+308;
        this.az.dc = -1.7976931348623157E+308;
        this.az.de = -1.7976931348623157E+308;
        this.az.dd = -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.di(e.c, NaN, NaN);
            var h = this.m(d);
            var i = this.l(d);
            var j = h + this.p() + this.q();
            var k = i + this.r() + this.o();
            var l = g.x - j / 2;
            var m = g.y - k / 2;
            this.az.de = Math.max(h, this.az.de);
            this.az.dd = Math.max(i, this.az.dd);
            this.az.df = Math.max(j, this.az.df);
            this.az.dc = Math.max(k, this.az.dc);
            var n = new Rect(0, l, m, j, k);
            a.add(n);
            b.add(f);
        }
    };
    AngleAxisLabelPanelView.prototype.a0 = function (a, b) {
        this.az.db = -1.7976931348623157E+308;
        var c = 0;
        if (typeCast(CategoryAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.m5() * this.az.ad.kh.width;
        }
        else if (typeCast(NumericAngleAxis.$, this.az.ad) !== null) {
            c = this.az.ad.n9() * this.az.ad.kh.width;
        }
        var d = { $type: Point_$type, x: this.az.ad.kh.width * 0.5, y: this.az.ad.kh.width * 0.5 };
        for (var e = 0; e < this.a.bb.count; e++) {
            var f = this.a.bb._inner[e];
            var g = this.a.ba._inner[e];
            var h = g.a;
            var i = this.m(f);
            var j = this.l(f);
            var k = i + this.p() + this.q();
            var l = j + this.r() + this.o();
            var m = this.az.di(g.c, k, l);
            var n = m.x - k / 2;
            var o = m.y - l / 2;
            var p = new Rect(0, n, o, i, j);
            if (!h) {
                var q = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.top - d.y) * (p.top - d.y));
                var r = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.top - d.y) * (p.top - d.y));
                var s = Math.sqrt((p.left - d.x) * (p.left - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                var t = Math.sqrt((p.right - d.x) * (p.right - d.x) + (p.bottom - d.y) * (p.bottom - d.y));
                this.az.db = Math.max(q - c, this.az.db);
                this.az.db = Math.max(r - c, this.az.db);
                this.az.db = Math.max(s - c, this.az.db);
                this.az.db = Math.max(t - c, this.az.db);
            }
            a.add(p);
            b.add(h);
        }
    };
    AngleAxisLabelPanelView.prototype.o = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.p = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.q = function () {
        return 0;
    };
    AngleAxisLabelPanelView.prototype.r = function () {
        return 0;
    };
    AngleAxisLabelPanelView.$t = markType(AngleAxisLabelPanelView, 'AngleAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return AngleAxisLabelPanelView;
}(AxisLabelPanelBaseView));
export { AngleAxisLabelPanelView };
/**
 * @hidden
 */
var CategoryAngleAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAngleAxisView, _super);
    function CategoryAngleAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    CategoryAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jz = AxisDefaults.h;
        this.a.j2 = 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.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericAngleAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jz = AxisDefaults.h;
        this.a.j2 = 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.bm = null;
        _this.bm = a;
        return _this;
    }
    NumericRadiusAxisView.prototype.al = function () {
        _super.prototype.al.call(this);
        this.a.jz = AxisDefaults.h;
        this.a.j2 = AxisDefaults.g;
    };
    NumericRadiusAxisView.$t = markType(NumericRadiusAxisView, 'NumericRadiusAxisView', NumericAxisBaseView.$);
    return NumericRadiusAxisView;
}(NumericAxisBaseView));
export { NumericRadiusAxisView };
