/*
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 { 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
 */
export class FinalValueLayer extends AnnotationLayer {
    constructor() {
        super();
        this.axisAnnotationFormatLabel = null;
        this.na = null;
        this.m9 = null;
        let a = new FinalValueLayerFrame();
        let b = new FinalValueLayerFrame();
        let c = new FinalValueLayerFrame();
        let d = this.fi / 1000;
        this.l2 = a;
        this.l1 = b;
        this.l3 = c;
        this.ab = FinalValueLayer.$;
    }
    bf() {
        return new FinalValueLayerView(this);
    }
    iu(a) {
        super.iu(a);
        this.m5 = a;
    }
    get n9() {
        return new Thickness(1, this.nc, this.ne, this.nd, this.nb);
    }
    m8() {
        return this.axisAnnotationFormatLabel != null;
    }
    ml(a, b) {
        if (this.m7 == null || this.m7 == a) {
            if (!this.aq.c) {
                this.jd(b);
            }
        }
    }
    mn(a, b) {
        super.mn(a, b);
        let 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 {
            for (let d of fromEnum(this.bs.series)) {
                if (this.l8(d)) {
                    this.ns(d, c);
                }
            }
        }
    }
    l8(a) {
        if (!super.l8(a)) {
            return false;
        }
        return true;
    }
    io() {
        super.io();
        if (!this.aq.c && !this.ca()) {
            return;
        }
        if (this.ca()) {
            this.nt(this.l3, false);
        }
        else {
            this.nt(this.l1, false);
        }
    }
    n8(a) {
        let b = NaN;
        let c = NaN;
        let d = this.m6;
        if (d == 0) {
            d = 1;
        }
        let e = false;
        if (d == 2) {
            e = true;
        }
        if (a.isVertical) {
            let 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 {
            let 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);
            }
        }
    }
    ns(a, b) {
        let c = this.n8(a);
        let d = this.lo(c);
        let 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);
    }
    nt(a, b) {
        let 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);
    }
    mq(a, b) {
        super.mq(a, b);
        if (this.ca()) {
            this.nt(this.l3, true);
        }
        else {
            this.nt(this.l1, false);
        }
    }
    c8() {
        return true;
    }
    iz(a, b, c, d) {
        super.iz(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":
                let e = this.na;
                let f = this.m9;
                if (f != null) {
                    for (let g of fromEnum(f)) {
                        let h = g.value;
                        h.c((i) => g.key.ak.remove(i));
                        h.clear();
                    }
                    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]]);
/**
 * @hidden
 */
export class FinalValueLayerView extends AnnotationLayerView {
    constructor(a) {
        super(a);
        this.b1 = null;
        this.b1 = a;
    }
    ap() {
        super.ap();
    }
    b2(a) {
        if (a == null) {
            return a;
        }
        return BrushUtil.l(a, 0.1);
    }
    ai(a) {
        super.ai(a);
    }
}
FinalValueLayerView.$t = markType(FinalValueLayerView, 'FinalValueLayerView', AnnotationLayerView.$);
//# sourceMappingURL=FinalValueLayer_combined.js.map