/*
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-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
export let StrategyBasedIndicator = /*@__PURE__*/ (() => {
    class StrategyBasedIndicator extends FinancialIndicator {
        constructor() {
            super();
            this.q0();
        }
        q0() {
            this.ql = this.qm;
            this.ab = this.qz;
        }
        qs() {
            return -2147483648;
        }
        q1(a) {
        }
        qu() {
            return -2147483648;
        }
        qr() {
            return -2147483648;
        }
        static q5(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.qp.add(c);
            return d;
        }
        static q4(a, b) {
            return StrategyBasedIndicator.q5(a, b, "Period");
        }
        static q2(a, b) {
            return StrategyBasedIndicator.q5(a, b, "LongPeriod");
        }
        static q6(a, b) {
            return StrategyBasedIndicator.q5(a, b, "ShortPeriod");
        }
        py(a, b) {
            let c = this.mu(a, b);
            let d = this.mv(c);
            return this.ql.b(c, d);
        }
        pv(a, b) {
            let c = this.mu(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.nr(this.py(a, b))) {
                return false;
            }
            let d = this.mv(c);
            if (this.ps != null) {
                c.minimumValue = this.ps.c;
                c.maximumValue = this.ps.b;
            }
            let e = this.ql.a(c, d);
            for (let f = 0; f < this.p0 && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.m3 != null && this.qo(c)) {
                this.m3.cn();
            }
            return e;
        }
        qo(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.ps;
                this.ps = new AxisRange(a.minimumValue, a.maximumValue);
                return this.qn(b, this.ps);
            }
            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.ps;
            this.ps = new AxisRange(c, d);
            return this.qn(f, this.ps);
        }
        qn(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;
        }
        qt(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;
        }
        mu(a, b) {
            let c = super.mu(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.qt(this.qs());
            c.shortPeriod = this.qt(this.qu());
            c.longPeriod = this.qt(this.qr());
            c.multiplier = this.qq();
            return c;
        }
        qq() {
            return 1;
        }
        static q3(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.qp.add("Multiplier");
            return c;
        }
        i7(a, b, c, d) {
            super.i7(a, b, c, d);
            if (StrategyBasedIndicator.qp.contains(b)) {
                if (this.m3 != null && !this.m3.cn()) {
                    this.my.bu.e(this.eu);
                    this.pv(0, this.indicatorColumn.count);
                    if (this.pt.b4) {
                        this.pt.b2.g$i();
                    }
                    this.jl(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = /*@__PURE__*/ markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.qp = /*@__PURE__*/ new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
//# sourceMappingURL=StrategyBasedIndicator.js.map
