/*
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.uu();
        }
        uu() {
            this.uf = this.ug;
            this.ab = this.ut;
        }
        um() {
            return -2147483648;
        }
        uv(a) {
        }
        uo() {
            return -2147483648;
        }
        ul() {
            return -2147483648;
        }
        static uz(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.uj.add(c);
            return d;
        }
        static uy(a, b) {
            return StrategyBasedIndicator.uz(a, b, "Period");
        }
        static uw(a, b) {
            return StrategyBasedIndicator.uz(a, b, "LongPeriod");
        }
        static u0(a, b) {
            return StrategyBasedIndicator.uz(a, b, "ShortPeriod");
        }
        ts(a, b) {
            let c = this.qo(a, b);
            let d = this.qp(c);
            return this.uf.b(c, d);
        }
        tp(a, b) {
            let c = this.qo(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.rk(this.ts(a, b))) {
                return false;
            }
            let d = this.qp(c);
            if (this.tl != null) {
                c.minimumValue = this.tl.c;
                c.maximumValue = this.tl.b;
            }
            let e = this.uf.a(c, d);
            for (let f = 0; f < this.tu && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.qx != null && this.ui(c)) {
                this.qx.c0();
            }
            return e;
        }
        ui(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.tl;
                this.tl = new AxisRange(a.minimumValue, a.maximumValue);
                return this.uh(b, this.tl);
            }
            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.tl;
            this.tl = new AxisRange(c, d);
            return this.uh(f, this.tl);
        }
        uh(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;
        }
        un(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;
        }
        qo(a, b) {
            let c = super.qo(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.un(this.um());
            c.shortPeriod = this.un(this.uo());
            c.longPeriod = this.un(this.ul());
            c.multiplier = this.uk();
            return c;
        }
        uk() {
            return 1;
        }
        static ux(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.uj.add("Multiplier");
            return c;
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            if (StrategyBasedIndicator.uj.contains(b)) {
                if (this.qx != null && !this.qx.c0()) {
                    this.qs.bx.e(this.ft);
                    this.tp(0, this.indicatorColumn.count);
                    if (this.tm.b7) {
                        this.tm.b5.g$i();
                    }
                    this.mh(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.uj = new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
