/*
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 * as tslib_1 from "tslib";
import { IndicatorCalculationStrategy } from "./IndicatorCalculationStrategy";
import { String_$type, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { isNaN_ } from "igniteui-react-core/ES5/number";
/**
 * @hidden
 */
var WilliamsPercentRIndicatorStrategy = /** @class */ (function (_super) {
    tslib_1.__extends(WilliamsPercentRIndicatorStrategy, _super);
    function WilliamsPercentRIndicatorStrategy() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    WilliamsPercentRIndicatorStrategy.prototype.b = function (a, b) {
        var c = new List$1(String_$type, 0);
        c.add("HighColumn");
        c.add("LowColumn");
        c.add("CloseColumn");
        return c;
    };
    WilliamsPercentRIndicatorStrategy.prototype.a = function (a, b) {
        var c = a.period;
        var d = a.highColumn;
        var e = a.lowColumn;
        for (var f = 0; f < a.count; f++) {
            var g = Math.min(c, f);
            var h = -1.7976931348623157E+308;
            var i = 1.7976931348623157E+308;
            for (var j = 0; j < g; j++) {
                if (!isNaN_(d.item(f - j))) {
                    h = Math.max(h, d.item(f - j));
                }
                if (!isNaN_(e.item(f - j))) {
                    i = Math.min(i, e.item(f - j));
                }
            }
            a.indicatorColumn.item(f, b.i((a.closeColumn.item(f) - h) / (h - i) * 100));
        }
        return true;
    };
    WilliamsPercentRIndicatorStrategy.$t = markType(WilliamsPercentRIndicatorStrategy, 'WilliamsPercentRIndicatorStrategy', IndicatorCalculationStrategy.$);
    return WilliamsPercentRIndicatorStrategy;
}(IndicatorCalculationStrategy));
export { WilliamsPercentRIndicatorStrategy };
