/*
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 { FinancialSeries } from "./FinancialSeries";
import { DependencyProperty } from "igniteui-react-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { typeCast, markType, markDep } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
export let FinancialOverlay = /*@__PURE__*/ (() => {
    class FinancialOverlay extends FinancialSeries {
        get_em() {
            return true;
        }
        constructor() {
            super();
            this.x3 = false;
            this.x3 = false;
        }
        no(a, b, c, d) {
            super.no(a, b, c, d);
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                this.t9.i$i();
            }
            this.uq.b0.e(this.hj);
            this.x4();
            if (this.uv != null) {
                this.uv.c1();
            }
            this.pp(true);
        }
        get_gk() {
            return true;
        }
        o8(a, b, c, d) {
            switch (b) {
                case "FastItemsSource":
                    this.x3 = false;
                    break;
                case FinancialOverlay.$$p[0]:
                    this.x3 = false;
                    this.pp(false);
                    this.ol();
                    break;
                case "XAxis":
                    this.x3 = false;
                    break;
            }
            super.o8(a, b, c, d);
        }
        bx() {
            if (this.by == 0) {
                return 1;
            }
            else {
                return super.bx();
            }
        }
        f4(a, b) {
            if (this.f3(a, b)) {
                return true;
            }
            return false;
        }
        ac() {
            super.ac();
            this.pp(false);
        }
        fo(a) {
            let b = this.c6 != null ? this.c6.indexOf(a) : -1;
            let c = this.cj.by;
            c = c.copy();
            let d = this.cj.bx;
            let e = new Rect(0, 0, 0, 1, 1);
            let f = this.tq(this.cj);
            let g = new ScalerParams(0, e, e, this.t9.ch, f);
            let h = new ScalerParams(0, e, e, this.uv.ch, f);
            h.b = this.h2();
            if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
                if (this.t9 != null) {
                    let i = this.t9.ej(b, g);
                    if (i < c.left + 0.1 * c.width) {
                        i = i + 0.4 * c.width;
                    }
                    if (i > c.right - 0.1 * c.width) {
                        i = i - 0.4 * c.width;
                    }
                    c.x = i - 0.5 * c.width;
                }
                if (this.uv != null && this.u4 != null && this.u3 != null && b < this.u4.count && b < this.u3.count) {
                    let j = this.uv.ej(this.u4.item(b), h);
                    let k = this.uv.ej(this.u3.item(b), h);
                    if (!isNaN_(j) && !isNaN_(k)) {
                        let l = Math.abs(j - k);
                        if (c.height < l) {
                            c.height = l;
                            c.y = Math.min(j, k);
                        }
                        else {
                            if (j < c.top + 0.1 * c.height) {
                                j = j + 0.4 * c.height;
                            }
                            if (j > c.bottom - 0.1 * c.height) {
                                j = j - 0.4 * c.height;
                            }
                            c.y = j - 0.5 * c.height;
                        }
                    }
                }
                this.cr.au(this.cy, c, true);
            }
            return b >= 0;
        }
        aq(a) {
            if (a != null && a == this.uv && this.u4 != null && this.u3 != null) {
                return new AxisRange(this.u4.minimum, this.u3.maximum);
            }
            return null;
        }
    }
    FinancialOverlay.$t = /*@__PURE__*/ markType(FinancialOverlay, 'FinancialOverlay', FinancialSeries.$);
    FinancialOverlay.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialOverlay, 'raisePropertyChanged', ['IgnoreFirst:x5:x7', [1, 0]]);
    return FinancialOverlay;
})();
