(function(){if("undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof HTMLElement){var d=!1;try{var e=document.createElement("div");e.addEventListener("focus",function(a){a.preventDefault();a.stopPropagation()},!0);e.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!==typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return d=!1;d=!0}}))}catch(a){}if(void 0===HTMLElement.prototype.nativeFocus&&
!d){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var g=function(a){a=a.parentNode;for(var b=[],c=document.scrollingElement||document.documentElement;a&&a!==c;)(a.offsetHeight<a.scrollHeight||a.offsetWidth<a.scrollWidth)&&b.push([a,a.scrollTop,a.scrollLeft]),a=a.parentNode;a=c;b.push([a,a.scrollTop,a.scrollLeft]);return b},f=function(a){for(var b=0;b<a.length;b++)a[b][0].scrollTop=a[b][1],a[b][0].scrollLeft=a[b][2]};HTMLElement.prototype.focus=function(a){if(a&&a.preventScroll){var b=
g(this);if("function"===typeof setTimeout){var c=this;setTimeout(function(){c.nativeFocus();f(b)},0)}else this.nativeFocus(),f(b)}else this.nativeFocus()}}}})();
