';var e=t.firstElementChild;document.body.appendChild(e);var i=e.firstElementChild;e.scrollLeft=0;var r=l.getOffset(e),n=l.getOffset(i);e.scrollLeft=999;var o=l.getOffset(i);return{isRtlScrollingInverted:r.left!==n.left&&n.left-o.left!=0,isRtlScrollbarInverted:r.left!==n.left}}},{key:"initHtmlApi",value:function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(function(t){t.forEach(function(t){Array.from(t.addedNodes).forEach(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?!t.SimpleBar&&new l(t,l.getElOptions(t)):Array.from(t.querySelectorAll("[data-simplebar]")).forEach(function(t){!t.SimpleBar&&new l(t,l.getElOptions(t))}))}),Array.from(t.removedNodes).forEach(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?t.SimpleBar&&t.SimpleBar.unMount():Array.from(t.querySelectorAll("[data-simplebar]")).forEach(function(t){t.SimpleBar&&t.SimpleBar.unMount()}))})})}),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))}},{key:"getElOptions",value:function(t){return Array.from(t.attributes).reduce(function(t,e){var i=e.name.match(/data-simplebar-(.+)/);if(i){var r=i[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[r]=!0;break;case"false":t[r]=!1;break;case void 0:t[r]=!0;break;default:t[r]=e.value}}return t},{})}},{key:"removeObserver",value:function(){this.globalObserver.disconnect()}},{key:"initDOMLoadedElements",value:function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.from(document.querySelectorAll("[data-simplebar]")).forEach(function(t){t.SimpleBar||new l(t,l.getElOptions(t))})}},{key:"getOffset",value:function(t){var e=t.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft)}}}],(e=[{key:"init",value:function(){this.el.SimpleBar=this,tr&&(this.initDOM(),this.scrollbarWidth=ye(),this.recalculate(),this.initListeners())}},{key:"initDOM",value:function(){var e=this;if(Array.from(this.el.children).filter(function(t){return t.classList.contains(e.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector(".".concat(this.classNames.wrapper)),this.contentEl=this.el.querySelector(".".concat(this.classNames.content)),this.offsetEl=this.el.querySelector(".".concat(this.classNames.offset)),this.maskEl=this.el.querySelector(".".concat(this.classNames.mask)),this.placeholderEl=this.el.querySelector(".".concat(this.classNames.placeholder)),this.heightAutoObserverWrapperEl=this.el.querySelector(".".concat(this.classNames.heightAutoObserverWrapperEl)),this.heightAutoObserverEl=this.el.querySelector(".".concat(this.classNames.heightAutoObserverEl)),this.axis.x.track.el=this.el.querySelector(".".concat(this.classNames.track,".").concat(this.classNames.horizontal)),this.axis.y.track.el=this.el.querySelector(".".concat(this.classNames.track,".").concat(this.classNames.vertical));else{for(this.wrapperEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentEl.classList.add(this.classNames.content),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.offsetEl.appendChild(this.contentEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),i=document.createElement("div");t.classList.add(this.classNames.track),i.classList.add(this.classNames.scrollbar),this.options.autoHide||i.classList.add(this.classNames.visible),t.appendChild(i),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector(".".concat(this.classNames.scrollbar)),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector(".".concat(this.classNames.scrollbar)),this.el.setAttribute("data-simplebar","init")}},{key:"initListeners",value:function(){var e=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick","touchstart","touchend","touchmove"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,!0)}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentEl.addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.onWindowResize),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){(t.target===e.el||!e.isChildNode(t.target)||t.addedNodes.length||t.removedNodes.length)&&e.recalculate()})}),this.mutationObserver.observe(this.el,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this.resizeObserver=new Zi(this.recalculate),this.resizeObserver.observe(this.el)}},{key:"recalculate",value:function(){var t=this.heightAutoObserverEl.offsetHeight<=1;this.elStyles=window.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction,this.contentEl.style.padding="".concat(this.elStyles.paddingTop," ").concat(this.elStyles.paddingRight," ").concat(this.elStyles.paddingBottom," ").concat(this.elStyles.paddingLeft),this.contentEl.style.height=t?"auto":"100%",this.placeholderEl.style.width="".concat(this.contentEl.scrollWidth,"px"),this.placeholderEl.style.height="".concat(this.contentEl.scrollHeight,"px"),this.wrapperEl.style.margin="-".concat(this.elStyles.paddingTop," -").concat(this.elStyles.paddingRight," -").concat(this.elStyles.paddingBottom," -").concat(this.elStyles.paddingLeft),this.axis.x.track.rect=this.axis.x.track.el.getBoundingClientRect(),this.axis.y.track.rect=this.axis.y.track.el.getBoundingClientRect(),this.axis.x.isOverflowing=(this.scrollbarWidth?this.contentEl.scrollWidth:this.contentEl.scrollWidth-this.minScrollbarWidth)>Math.ceil(this.axis.x.track.rect.width),this.axis.y.isOverflowing=(this.scrollbarWidth?this.contentEl.scrollHeight:this.contentEl.scrollHeight-this.minScrollbarWidth)>Math.ceil(this.axis.y.track.rect.height),this.axis.x.isOverflowing="hidden"!==this.elStyles.overflowX&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==this.elStyles.overflowY&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width="".concat(this.axis.x.scrollbar.size,"px"),this.axis.y.scrollbar.el.style.height="".concat(this.axis.y.scrollbar.size,"px"),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y"),this.hideNativeScrollbar()}},{key:"getScrollbarSize",value:function(){var t,e=0=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height}}])&&ve(t.prototype,e),i&&ve(t,i),l}();return er.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{content:"simplebar-content",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},tr&&er.initHtmlApi(),er});