(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.calculateChange = void 0;
    var calculateChange = function (e, container) {
        var containerWidth = container.clientWidth;
        var x = e.pageX;
        var left = x - (container.getBoundingClientRect().left + window.scrollX);
        var alpha;
        if (left < 0) {
            alpha = 0;
        }
        else if (left > containerWidth) {
            alpha = 100;
        }
        else {
            var percent = (left * 100) / containerWidth;
            alpha = (100 * percent) / 100;
        }
        return Math.round(alpha);
    };
    exports.calculateChange = calculateChange;
});
