PageSourceSearch

https://zaomurom.ru/local/js/utils/smooth-progress/dist/SmoothProgress.bundle.js?16428425341732

js zaomurom.ru collected 2026-10-07 16:07:47 UTC 1,732 bytes, 65 lines download raw bytes

1this.BX = this.BX || {};
2this.BX.utils = this.BX.utils || {};
3(function (exports) {
4  'use strict';
5
6  var SmoothProgress = /*#__PURE__*/function () {
7    function SmoothProgress(initial, callback) {
8      babelHelpers.classCallCheck(this, SmoothProgress);
9
10      this._isValid(initial);
11
12      this.value = initial;
13      this.step = 0.01;
14      this.callback = callback;
15      this.lastCallTimer = null;
16      this.valueAtLastOuterCall = this.value;
17    }
18
19    babelHelpers.createClass(SmoothProgress, [{
20      key: "changeAccuracy",
21      value: function changeAccuracy(value) {
22        this._isValid(value);
23
24        this.step = value;
25      }
26    }, {
27      key: "set",
28      value: function set(targetValue) {
29        this._isValid(targetValue);
30
31        this.valueAtLastOuterCall = this.value;
32
33        this._set(targetValue);
34      }
35    }, {
36      key: "_set",
37      value: function _set(targetValue) {
38        var _this = this;
39
40        clearTimeout(this.lastCallTimer);
41        var diff = Math.abs(targetValue - this.value);
42        this.value += (targetValue - this.value) * this.step;
43        this.callback(this.value);
44
45        if (diff > this.step) {
46          this.lastCallTimer = setTimeout(function () {
47            _this._set(targetValue);
48          }, 0);
49        } else {
50          this.lastCallTimer = null;
51        }
52      }
53    }, {
54      key: "_isValid",
55      value: function _isValid(value) {
56        if (1 < value || 0 > value) throw new Error("Value can be only in range between 0 and 1!");
57      }
58    }]);
59    return SmoothProgress;
60  }();
61
62  exports.default = SmoothProgress;
63
64}((this.BX.utils.SmoothProgress = this.BX.utils.SmoothProgress || {})));
65//# sourceMappingURL=SmoothProgress.bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.