(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[95],{ /***/ 83: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var SmoothAnchor = function () { _createClass(SmoothAnchor, null, [{ key: 'default', get: function get() { return { scroll: document }; } }]); function SmoothAnchor(params) { _classCallCheck(this, SmoothAnchor); this._params = Object.assign({}, SmoothAnchor.default, params); } _createClass(SmoothAnchor, [{ key: 'scrollTo', value: function scrollTo(target) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16; var destinationElem = target; var topIndent = 0; //const fixedTop = [ ...document.querySelectorAll( // '.fixed-Top-navbars-wrapper:not(.fixed-Top-navbars-wrapper_default)' ) ]; var fixedTop = Array.from(document.querySelectorAll('.fixed-Top-navbars-wrapper:not(.fixed-Top-navbars-wrapper_default)')); if (fixedTop.length) { topIndent = fixedTop[fixedTop.length - 1].getAttribute('data-bottom') || 0; } var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; var isIE = detectIE(); var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); var scroll = this.scroll === document ? isFirefox || isIE || isChrome ? this.scroll.documentElement : this.scroll.body : this.scroll; var position = destinationElem.getBoundingClientRect(); var top = position.top - parseInt(topIndent, 10); var scrollTop = scroll.scrollTop; if (this.scroll.classList && this.scroll.classList.contains('wpw') && target.classList.contains('scroll-top-button')) { top = -scrollTop; } setTimeout(function () { SmoothAnchor._animate({ duration: duration, timing: function timing(timeFraction) { return timeFraction; }, draw: function draw(progress) { progress = progress < 0 ? 0 : progress; scroll.scrollTop = scrollTop + top * progress; } }); }, delay); } }, { key: 'run', value: function run(target) { var anchor = target.getAttribute('href'); if (!anchor) { return false; } anchor = anchor[0] === '#' ? anchor.replace('#', '') : anchor.replace(/\S+#/g, ''); var destinationElem = anchor ? document.getElementById(anchor) : document.body; if (!destinationElem) { return false; } var topIndent = 0; // const fixedTop = Array.from(document.querySelectorAll( '.fixed-Top-navbars-wrapper:not(.fixed-Top-navbars-wrapper_default)' ) ); // if ( fixedTop.length ) { // topIndent = fixedTop[ fixedTop.length - 1 ].getAttribute( 'data-bottom' ) || 0; // } var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; var isIE = detectIE(); var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); var scroll = this.scroll === document ? isFirefox || isIE || isChrome ? this.scroll.documentElement : this.scroll.body : this.scroll; var position = destinationElem.getBoundingClientRect(); var top = position.top - parseInt(topIndent, 10); var scrollTop = scroll.scrollTop; if (this.scroll.classList && this.scroll.classList.contains('wpw') && target.classList.contains('scroll-top-button')) { top = -scrollTop; } SmoothAnchor._animate({ duration: 200, timing: function timing(timeFraction) { return timeFraction; }, draw: function draw(progress) { progress = progress < 0 ? 0 : progress; scroll.scrollTop = scrollTop + top * progress; } }); } }, { key: 'scroll', get: function get() { return this._params.scroll; } }], [{ key: '_animate', value: function _animate(options) { var start = performance.now(); requestAnimationFrame(function animate(time) { // timeFraction от 0 до 1 var timeFraction = (time - start) / options.duration; if (timeFraction > 1) { timeFraction = 1; } // текущее состояние анимации var progress = options.timing(timeFraction); options.draw(progress); if (timeFraction < 1) { requestAnimationFrame(animate); } }); } }]); return SmoothAnchor; }(); exports.default = SmoothAnchor; function detectIE() { var ua = window.navigator.userAgent; var msie = ua.indexOf('MSIE '); if (msie > 0) { // IE 10 or older => return version number return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); } var trident = ua.indexOf('Trident/'); if (trident > 0) { // IE 11 => return version number var rv = ua.indexOf('rv:'); return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); } var edge = ua.indexOf('Edge/'); if (edge > 0) { // Edge (IE 12+) => return version number return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); } // other browser return false; } /***/ }) }]);