/*
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 { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { List$1 } from "igniteui-angular-core";
import { Number_$type, markType } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionAveDev = /** @class */ (function (_super) {
    tslib_1.__extends(UltraCalcFunctionAveDev, _super);
    function UltraCalcFunctionAveDev() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    UltraCalcFunctionAveDev.prototype.evaluate = function (a, b) {
        var c = 0;
        var d = this._getArguments(a, b, true);
        var e = new List$1(Number_$type, 2, d.length);
        var _loop_1 = function (g) {
            var f = d[g];
            if (f == null) {
                return "continue";
            }
            if (f.isError) {
                return { value: new ExcelCalcValue(f.toErrorValue()) };
            }
            var h;
            if (((function () { var i = f._toDouble1(h); h = i.p0; return i.ret; })())) {
                c += h;
                e.add(h);
            }
        };
        for (var g = 0; g < d.length; g++) {
            var state_1 = _loop_1(g);
            if (typeof state_1 === "object")
                return state_1.value;
        }
        var i = c / e.count;
        var j = 0;
        for (var k = 0; k < e.count; k++) {
            j += Math.abs(e._inner[k] - i);
        }
        var l = j / e.count;
        return new ExcelCalcValue(l);
    };
    UltraCalcFunctionAveDev.prototype.get_name = function () {
        return "avedev";
    };
    Object.defineProperty(UltraCalcFunctionAveDev.prototype, "name", {
        get: function () {
            return this.get_name();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionAveDev.prototype.get_minArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionAveDev.prototype, "minArgs", {
        get: function () {
            return this.get_minArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionAveDev.prototype.get_maxArgs = function () {
        return 0x7FFFFFFF;
    };
    Object.defineProperty(UltraCalcFunctionAveDev.prototype, "maxArgs", {
        get: function () {
            return this.get_maxArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionAveDev.prototype.doesParameterAllowIntermediateResultArray = function (a, b) {
        return (b == false);
    };
    UltraCalcFunctionAveDev.$t = markType(UltraCalcFunctionAveDev, 'UltraCalcFunctionAveDev', BuiltInFunctionBase.$);
    return UltraCalcFunctionAveDev;
}(BuiltInFunctionBase));
export { UltraCalcFunctionAveDev };
//# sourceMappingURL=UltraCalcFunctionAveDev.js.map