/*
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 { FinancialIndicator } from "./FinancialIndicator";
import { String_$type, Number_$type, typeCast, fromEnum, markType } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
export let StrategyBasedIndicator = /*@__PURE__*/ (() => {
    class StrategyBasedIndicator extends FinancialIndicator {
        constructor() {
            super();
            this.u3();
        }
        u3() {
            this.uo = this.up;
            this.ab = this.u2;
        }
        uv() {
            return -2147483648;
        }
        u4(a) {
        }
        ux() {
            return -2147483648;
        }
        uu() {
            return -2147483648;
        }
        static u8(a, b, c) {
            let d = DependencyProperty.i(c, Number_$type, b, new PropertyMetadata(2, a, (e, f) => (typeCast(StrategyBasedIndicator.$, e)).raisePropertyChanged(c, f.oldValue, f.newValue)));
            StrategyBasedIndicator.us.add(c);
            return d;
        }
        static u7(a, b) {
            return StrategyBasedIndicator.u8(a, b, "Period");
        }
        static u5(a, b) {
            return StrategyBasedIndicator.u8(a, b, "LongPeriod");
        }
        static u9(a, b) {
            return StrategyBasedIndicator.u8(a, b, "ShortPeriod");
        }
        t1(a, b) {
            let c = this.qx(a, b);
            let d = this.qy(c);
            return this.uo.b(c, d);
        }
        ty(a, b) {
            let c = this.qx(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.rt(this.t1(a, b))) {
                return false;
            }
            let d = this.qy(c);
            if (this.tu != null) {
                c.minimumValue = this.tu.c;
                c.maximumValue = this.tu.b;
            }
            let e = this.uo.a(c, d);
            for (let f = 0; f < this.t3 && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.q6 != null && this.ur(c)) {
                this.q6.c0();
            }
            return e;
        }
        ur(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.tu;
                this.tu = new AxisRange(a.minimumValue, a.maximumValue);
                return this.uq(b, this.tu);
            }
            let c = 1.7976931348623157E+308;
            let d = -1.7976931348623157E+308;
            for (let e of fromEnum(a.indicatorColumn)) {
                if (!isNaN_(e)) {
                    c = Math.min(c, e);
                    d = Math.max(d, e);
                }
            }
            let f = this.tu;
            this.tu = new AxisRange(c, d);
            return this.uq(f, this.tu);
        }
        uq(a, b) {
            if (a == null || b == null) {
                return true;
            }
            if (a.c != b.c) {
                return true;
            }
            if (a.b != b.b) {
                return true;
            }
            return false;
        }
        uw(a) {
            if (a == -2147483648) {
                return 0;
            }
            if (a > this.indicatorColumn.count && this.indicatorColumn.count > 0) {
                a = this.indicatorColumn.count - 1;
            }
            if (a < 1) {
                return 1;
            }
            return a;
        }
        qx(a, b) {
            let c = super.qx(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.uw(this.uv());
            c.shortPeriod = this.uw(this.ux());
            c.longPeriod = this.uw(this.uu());
            c.multiplier = this.ut();
            return c;
        }
        ut() {
            return 1;
        }
        static u6(a, b) {
            let c = DependencyProperty.i("Multiplier", Number_$type, b, new PropertyMetadata(2, a, (d, e) => (typeCast(StrategyBasedIndicator.$, d)).raisePropertyChanged("Multiplier", e.oldValue, e.newValue)));
            StrategyBasedIndicator.us.add("Multiplier");
            return c;
        }
        l9(a, b, c, d) {
            super.l9(a, b, c, d);
            if (StrategyBasedIndicator.us.contains(b)) {
                if (this.q6 != null && !this.q6.c0()) {
                    this.q1.bx.e(this.fx);
                    this.ty(0, this.indicatorColumn.count);
                    if (this.tv.b7) {
                        this.tv.b5.g$i();
                    }
                    this.mn(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.us = new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
