/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { AnnotationLayer } from "./AnnotationLayer";
import { Series } from "./Series";
import { DependencyProperty } from "igniteui-angular-core";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { Brush } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { FinalValueLayerFrame } from "./FinalValueLayerFrame";
import { List$1 } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { Dictionary$2 } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { enumGetBox, fromEnum, Point_$type, markType, markDep } from "igniteui-angular-core";
import { AxisAnnotationFrameManager } from "./AxisAnnotationFrameManager";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-angular-core";
/**
 * @hidden
 */
var FinalValueLayer = /** @class */ (function (_super) {
    tslib_1.__extends(FinalValueLayer, _super);
    function FinalValueLayer() {
        var _this = _super.call(this) || this;
        _this.axisAnnotationFormatLabel = null;
        _this.na = null;
        _this.m9 = null;
        var a = new FinalValueLayerFrame();
        var b = new FinalValueLayerFrame();
        var c = new FinalValueLayerFrame();
        var d = _this.fi / 1000;
        _this.l2 = a;
        _this.l1 = b;
        _this.l3 = c;
        _this.ab = FinalValueLayer.$;
        return _this;
    }
    FinalValueLayer.prototype.bf = function () {
        return new FinalValueLayerView(this);
    };
    FinalValueLayer.prototype.iu = function (a) {
        _super.prototype.iu.call(this, a);
        this.m5 = a;
    };
    Object.defineProperty(FinalValueLayer.prototype, "n9", {
        get: function () {
            return new Thickness(1, this.nc, this.ne, this.nd, this.nb);
        },
        enumerable: true,
        configurable: true
    });
    FinalValueLayer.prototype.m8 = function () {
        return this.axisAnnotationFormatLabel != null;
    };
    FinalValueLayer.prototype.ml = function (a, b) {
        if (this.m7 == null || this.m7 == a) {
            if (!this.aq.c) {
                this.jd(b);
            }
        }
    };
    FinalValueLayer.prototype.mn = function (a, b) {
        var e_1, _a;
        _super.prototype.mn.call(this, a, b);
        var c = a;
        c.f.clear();
        c.q.clear();
        c.p.clear();
        c.aa.clear();
        c.o.clear();
        c.z.clear();
        c.g.clear();
        c.h.clear();
        c.j.clear();
        c.l.clear();
        c.k.clear();
        c.i.clear();
        c.m.clear();
        c.n.clear();
        c.r.clear();
        c.s.clear();
        c.u.clear();
        c.w.clear();
        c.v.clear();
        c.t.clear();
        c.x.clear();
        c.y.clear();
        if (this.l8(this.m7)) {
            this.ns(this.m7, c);
        }
        else {
            try {
                for (var _b = tslib_1.__values(fromEnum(this.bs.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var d = _c.value;
                    if (this.l8(d)) {
                        this.ns(d, c);
                    }
                }
            }
            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; }
            }
        }
    };
    FinalValueLayer.prototype.l8 = function (a) {
        if (!_super.prototype.l8.call(this, a)) {
            return false;
        }
        return true;
    };
    FinalValueLayer.prototype.io = function () {
        _super.prototype.io.call(this);
        if (!this.aq.c && !this.ca()) {
            return;
        }
        if (this.ca()) {
            this.nt(this.l3, false);
        }
        else {
            this.nt(this.l1, false);
        }
    };
    FinalValueLayer.prototype.n8 = function (a) {
        var b = NaN;
        var c = NaN;
        var d = this.m6;
        if (d == 0) {
            d = 1;
        }
        var e = false;
        if (d == 2) {
            e = true;
        }
        if (a.isVertical) {
            var f = a.ap();
            if (f != null) {
                if (d == 1 || d == 2) {
                    if (f.b8) {
                        c = a.lo({ $type: Point_$type, x: this.ly.right, y: this.ly.bottom }).y;
                    }
                    else {
                        c = a.lo({ $type: Point_$type, x: this.ly.right, y: this.ly.top }).y;
                    }
                }
                else {
                    if (f.b8) {
                        c = 1;
                    }
                    else {
                        c = 0;
                    }
                }
            }
            return a.ll({ $type: Point_$type, x: 0, y: c }, e, true);
        }
        else {
            var g = a.ap();
            if (g != null) {
                if (d == 1 || d == 2) {
                    if (g.b8) {
                        b = a.lo({ $type: Point_$type, x: this.ly.left, y: this.ly.top }).x;
                    }
                    else {
                        b = a.lo({ $type: Point_$type, x: this.ly.right, y: this.ly.top }).x;
                    }
                }
                else {
                    if (g.b8) {
                        b = 0;
                    }
                    else {
                        b = 1;
                    }
                }
            }
            if (a.cr) {
                return a.ll({ $type: Point_$type, x: b, y: 0 }, e, true);
            }
            else {
                return a.ll({ $type: Point_$type, x: b, y: 0 }, e, true);
            }
        }
    };
    FinalValueLayer.prototype.ns = function (a, b) {
        var c = this.n8(a);
        var d = this.lo(c);
        var e = this.k3;
        if (e == null) {
            e = this.k5;
        }
        if (e == null) {
            e = a.k3;
            if (e != null) {
                e = this.m5.b2(e);
            }
        }
        AxisAnnotationFrameManager.c(b, c, a, this.bs, this.getEffectiveViewport(), e, this.n5, this.n7, this.n6, this.n9, this.nf, this.n5, this.n7, this.n6, this.n9, this.nf, a.isVertical, !a.isVertical);
    };
    FinalValueLayer.prototype.nt = function (a, b) {
        var c = false;
        if (this.m9 == null) {
            c = true;
            this.na = new List$1(Axis.$, 0);
            this.m9 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
        }
        AxisAnnotationFrameManager.d(this, a, c, this.m9, this.na, b, this.ng, this.ng, this.axisAnnotationFormatLabel, this.axisAnnotationFormatLabel);
    };
    FinalValueLayer.prototype.mq = function (a, b) {
        _super.prototype.mq.call(this, a, b);
        if (this.ca()) {
            this.nt(this.l3, true);
        }
        else {
            this.nt(this.l1, false);
        }
    };
    FinalValueLayer.prototype.c8 = function () {
        return true;
    };
    FinalValueLayer.prototype.iz = function (a, b, c, d) {
        var e_2, _a;
        _super.prototype.iz.call(this, a, b, c, d);
        switch (b) {
            case FinalValueLayer.$$p[10]:
                this.jd(true);
                break;
            case FinalValueLayer.$$p[0]:
            case FinalValueLayer.$$p[2]:
            case FinalValueLayer.$$p[4]:
            case FinalValueLayer.$$p[6]:
            case FinalValueLayer.$$p[5]:
            case FinalValueLayer.$$p[3]:
            case FinalValueLayer.$$p[7]:
            case FinalValueLayer.$$p[8]:
            case FinalValueLayer.$$p[9]:
                this.jd(true);
                break;
            case "SeriesViewer":
                var e = this.na;
                var f = this.m9;
                if (f != null) {
                    var _loop_1 = function (g) {
                        var h = g.value;
                        h.c(function (i) { return g.key.ak.remove(i); });
                        h.clear();
                    };
                    try {
                        for (var _b = tslib_1.__values(fromEnum(f)), _c = _b.next(); !_c.done; _c = _b.next()) {
                            var g = _c.value;
                            _loop_1(g);
                        }
                    }
                    catch (e_2_1) { e_2 = { error: e_2_1 }; }
                    finally {
                        try {
                            if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                        }
                        finally { if (e_2) throw e_2.error; }
                    }
                    e.clear();
                    f.clear();
                }
                break;
        }
    };
    FinalValueLayer.$t = markType(FinalValueLayer, 'FinalValueLayer', AnnotationLayer.$);
    FinalValueLayer.$$p = markDep(DependencyProperty, PropertyMetadata, FinalValueLayer, 'raisePropertyChanged', ['AxisAnnotationBackground:n5:nu', [Brush.$, null], 'AxisAnnotationInterpolatedValuePrecision:ng:nv', [1, -1], 'AxisAnnotationOutline:n6:nw', [Brush.$, null], 'AxisAnnotationPaddingBottom:nb:nx', [1, NaN], 'AxisAnnotationPaddingLeft:nc:ny', [1, NaN], 'AxisAnnotationPaddingRight:nd:nz', [1, NaN], 'AxisAnnotationPaddingTop:ne:n0', [1, NaN], 'AxisAnnotationStrokeThickness:nf:n1', [1, NaN], 'AxisAnnotationTextColor:n7:n2', [Brush.$, null], 'FinalValueSelectionMode:m6:n3', [FinalValueSelectionMode_$type, enumGetBox(FinalValueSelectionMode_$type, 0)], 'TargetSeries:m7:n4', [Series.$, null]]);
    return FinalValueLayer;
}(AnnotationLayer));
export { FinalValueLayer };
/**
 * @hidden
 */
var FinalValueLayerView = /** @class */ (function (_super) {
    tslib_1.__extends(FinalValueLayerView, _super);
    function FinalValueLayerView(a) {
        var _this = _super.call(this, a) || this;
        _this.b1 = null;
        _this.b1 = a;
        return _this;
    }
    FinalValueLayerView.prototype.ap = function () {
        _super.prototype.ap.call(this);
    };
    FinalValueLayerView.prototype.b2 = function (a) {
        if (a == null) {
            return a;
        }
        return BrushUtil.l(a, 0.1);
    };
    FinalValueLayerView.prototype.ai = function (a) {
        _super.prototype.ai.call(this, a);
    };
    FinalValueLayerView.$t = markType(FinalValueLayerView, 'FinalValueLayerView', AnnotationLayerView.$);
    return FinalValueLayerView;
}(AnnotationLayerView));
export { FinalValueLayerView };
//# sourceMappingURL=FinalValueLayer_combined.js.map