/*
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.zc();
        }
        zc() {
            this.yx = this.yy;
            this.ab = this.zb;
        }
        y4() {
            return -2147483648;
        }
        zd(a) {
        }
        y6() {
            return -2147483648;
        }
        y3() {
            return -2147483648;
        }
        static zh(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.y1.add(c);
            return d;
        }
        static zg(a, b) {
            return StrategyBasedIndicator.zh(a, b, "Period");
        }
        static ze(a, b) {
            return StrategyBasedIndicator.zh(a, b, "LongPeriod");
        }
        static zi(a, b) {
            return StrategyBasedIndicator.zh(a, b, "ShortPeriod");
        }
        ya(a, b) {
            let c = this.um(a, b);
            let d = this.un(c);
            return this.yx.b(c, d);
        }
        x7(a, b) {
            let c = this.um(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.vi(this.ya(a, b))) {
                return false;
            }
            let d = this.un(c);
            if (this.x3 != null) {
                c.minimumValue = this.x3.c;
                c.maximumValue = this.x3.b;
            }
            let e = this.yx.a(c, d);
            for (let f = 0; f < this.yc && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.uv != null && this.y0(c)) {
                this.uv.c1();
            }
            return e;
        }
        y0(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.x3;
                this.x3 = new AxisRange(a.minimumValue, a.maximumValue);
                return this.yz(b, this.x3);
            }
            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.x3;
            this.x3 = new AxisRange(c, d);
            return this.yz(f, this.x3);
        }
        yz(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;
        }
        y5(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;
        }
        um(a, b) {
            let c = super.um(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.y5(this.y4());
            c.shortPeriod = this.y5(this.y6());
            c.longPeriod = this.y5(this.y3());
            c.multiplier = this.y2();
            return c;
        }
        y2() {
            return 1;
        }
        static zf(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.y1.add("Multiplier");
            return c;
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            if (StrategyBasedIndicator.y1.contains(b)) {
                if (this.uv != null && !this.uv.c1()) {
                    this.uq.b0.e(this.hj);
                    this.x7(0, this.indicatorColumn.count);
                    if (this.x4.ca) {
                        this.x4.b8.g$i();
                    }
                    this.pp(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = /*@__PURE__*/ markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.y1 = /*@__PURE__*/ new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
