/*
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.ze();
        }
        ze() {
            this.yz = this.y0;
            this.ab = this.zd;
        }
        y6() {
            return -2147483648;
        }
        zf(a) {
        }
        y8() {
            return -2147483648;
        }
        y5() {
            return -2147483648;
        }
        static zj(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.y3.add(c);
            return d;
        }
        static zi(a, b) {
            return StrategyBasedIndicator.zj(a, b, "Period");
        }
        static zg(a, b) {
            return StrategyBasedIndicator.zj(a, b, "LongPeriod");
        }
        static zk(a, b) {
            return StrategyBasedIndicator.zj(a, b, "ShortPeriod");
        }
        yc(a, b) {
            let c = this.uo(a, b);
            let d = this.up(c);
            return this.yz.b(c, d);
        }
        x9(a, b) {
            let c = this.uo(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.vk(this.yc(a, b))) {
                return false;
            }
            let d = this.up(c);
            if (this.x5 != null) {
                c.minimumValue = this.x5.c;
                c.maximumValue = this.x5.b;
            }
            let e = this.yz.a(c, d);
            for (let f = 0; f < this.ye && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.uu != null && this.y2(c)) {
                this.uu.c1();
            }
            return e;
        }
        y2(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.x5;
                this.x5 = new AxisRange(a.minimumValue, a.maximumValue);
                return this.y1(b, this.x5);
            }
            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.x5;
            this.x5 = new AxisRange(c, d);
            return this.y1(f, this.x5);
        }
        y1(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;
        }
        y7(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;
        }
        uo(a, b) {
            let c = super.uo(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.y7(this.y6());
            c.shortPeriod = this.y7(this.y8());
            c.longPeriod = this.y7(this.y5());
            c.multiplier = this.y4();
            return c;
        }
        y4() {
            return 1;
        }
        static zh(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.y3.add("Multiplier");
            return c;
        }
        pa(a, b, c, d) {
            super.pa(a, b, c, d);
            if (StrategyBasedIndicator.y3.contains(b)) {
                if (this.uu != null && !this.uu.c1()) {
                    this.us.b0.e(this.hk);
                    this.x9(0, this.indicatorColumn.count);
                    if (this.x6.ca) {
                        this.x6.b8.g$i();
                    }
                    this.pr(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = /*@__PURE__*/ markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.y3 = /*@__PURE__*/ new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
