(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.getProgress = void 0;
    var getProgress = function (_a) {
        var type = _a.type, progress = _a.progress, step = _a.step, current_progress = _a.current_progress;
        var threshold = 20;
        if (type === "Linear") {
            return progress;
        }
        if (type === "LinearSectioned") {
            if (progress > current_progress) {
                while (progress / step >= threshold) {
                    current_progress += threshold;
                    step++;
                }
            }
            else if (progress < current_progress) {
                while (current_progress - progress + threshold >= threshold) {
                    current_progress -= threshold;
                    step--;
                }
            }
        }
        return current_progress;
    };
    exports.getProgress = getProgress;
});
