/*
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.sy();
        }
        sy() {
            this.sj = this.sk;
            this.ab = this.sx;
        }
        sq() {
            return -2147483648;
        }
        sz(a) {
        }
        ss() {
            return -2147483648;
        }
        sp() {
            return -2147483648;
        }
        static s3(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.sn.add(c);
            return d;
        }
        static s2(a, b) {
            return StrategyBasedIndicator.s3(a, b, "Period");
        }
        static s0(a, b) {
            return StrategyBasedIndicator.s3(a, b, "LongPeriod");
        }
        static s4(a, b) {
            return StrategyBasedIndicator.s3(a, b, "ShortPeriod");
        }
        rw(a, b) {
            let c = this.ot(a, b);
            let d = this.ou(c);
            return this.sj.b(c, d);
        }
        rt(a, b) {
            let c = this.ot(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.pp(this.rw(a, b))) {
                return false;
            }
            let d = this.ou(c);
            if (this.rq != null) {
                c.minimumValue = this.rq.c;
                c.maximumValue = this.rq.b;
            }
            let e = this.sj.a(c, d);
            for (let f = 0; f < this.ry && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.o2 != null && this.sm(c)) {
                this.o2.cn();
            }
            return e;
        }
        sm(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.rq;
                this.rq = new AxisRange(a.minimumValue, a.maximumValue);
                return this.sl(b, this.rq);
            }
            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.rq;
            this.rq = new AxisRange(c, d);
            return this.sl(f, this.rq);
        }
        sl(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;
        }
        sr(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;
        }
        ot(a, b) {
            let c = super.ot(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.sr(this.sq());
            c.shortPeriod = this.sr(this.ss());
            c.longPeriod = this.sr(this.sp());
            c.multiplier = this.so();
            return c;
        }
        so() {
            return 1;
        }
        static s1(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.sn.add("Multiplier");
            return c;
        }
        kp(a, b, c, d) {
            super.kp(a, b, c, d);
            if (StrategyBasedIndicator.sn.contains(b)) {
                if (this.o2 != null && !this.o2.cn()) {
                    this.ox.bx.e(this.fq);
                    this.rt(0, this.indicatorColumn.count);
                    if (this.rr.b7) {
                        this.rr.b5.g$i();
                    }
                    this.k3(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = /*@__PURE__*/ markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.sn = /*@__PURE__*/ new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
//# sourceMappingURL=StrategyBasedIndicator.js.map
