!function(){"use strict";var t=function(t){var e=this;this.navigations=[],this.init=function(){this.config=Object.assign({target:!1,type:"slider"},t||{}),this.config.target&&(this.getSliderNavigations(),this.getTabsNavigations(),this.targetEl&&this.navigations.length&&this.navigations.forEach((t=>{e.startArrows(t),e.startDots(t)})))},this.getSliderNavigations=function(){if("slider"===this.config.type){var t=this.config.target.slider.root;if(t.classList.contains("rey-section-slideshow")){this.targetEl=t;var e=this.targetEl.closest(".elementor-element");e&&(this.navigations=e.querySelectorAll(".rey-sliderNav"))}else if(t.hasAttribute("data-slider-carousel-id")?this.targetEl=t:this.targetEl=t.querySelector('[data-slider-carousel-id]:not([data-slider-carousel-id=""])'),this.targetEl){var i=this.targetEl.getAttribute("data-slider-carousel-id");this.navigations=document.querySelectorAll('.rey-sliderNav[data-slider-id="'+i+'"]')}}},this.getTabsNavigations=function(){"tabs"===this.config.type&&(this.targetEl=this.config.target.root,this.navigations=document.querySelectorAll('.rey-sliderNav[data-slider-id="'+this.config.target.tabsID+'"]'))},this.getData=function(t){this.perPage=1,"slider"===this.config.type?(this.itemsCount=this.config.target.slider.length,this.perPage=this.config.target.slider.options.perPage,t&&t.navLines&&"loop"!==this.config.target.slider.options.type&&(this.itemsCount-=this.perPage-1),this.currentIndex=this.config.target.slider.index):"tabs"===this.config.type&&(this.itemsCount=this.config.target.count,this.currentIndex=this.config.target.currentIndex)},this.runArrowEvents=function(t){var i=function(i){t.counter&&t.current&&(t.current.textContent=rey.util.minTwoDigits(i+1)),t.navLines&&e.handleButtons(t.navLines,i)};"slider"===this.config.type?this.config.target.slider.on("move",(function(t){i(t)})):"tabs"===this.config.type&&rey.hooks.addAction("tabs/changed/"+this.config.target.tabsID,(function(t){i(t)}))},this.goToPrevious=function(){"slider"===this.config.type?this.config.target.slider.go("<"):"tabs"===this.config.type&&this.config.target.goToPrevious()},this.goToNext=function(){"slider"===this.config.type?this.config.target.slider.go(">"):"tabs"===this.config.type&&this.config.target.goToNext()},this.goTo=function(t){"slider"===this.config.type?this.config.target.slider.go(t):"tabs"===this.config.type&&this.config.target.goTo(t)},this.startArrows=function(t){if("arrows"===t.getAttribute("data-type")){var i={};if(i.left=t.querySelector(".rey-arrowSvg--left"),i.right=t.querySelector(".rey-arrowSvg--right"),i.navLines=t.querySelector(".rey-sliderNav-lines"),i.counter=t.querySelector(".rey-sliderNav-counter"),i.current=null,i.total=null,i.counter&&(i.current=i.counter.querySelector(".rey-sliderNav-counterCurrent"),i.total=i.counter.querySelector(".rey-sliderNav-counterTotal")),this.getData(i),this.itemsCount){if(t.classList.remove("--hidden"),i.left&&i.left.addEventListener("click",(function(){e.goToPrevious()})),i.right&&i.right.addEventListener("click",(function(){e.goToNext()})),i.counter&&i.current&&(i.current.textContent=rey.util.minTwoDigits(this.currentIndex+1)),i.counter&&i.total&&(i.total.textContent=rey.util.minTwoDigits(this.itemsCount)),i.navLines){var s=Math.ceil(e.itemsCount/e.perPage);rey.dom.setProperty("--count",s,i.navLines);for(var r=0;r<s;r++)e.createButton(r,i.navLines)}this.runArrowEvents(i)}}},this.runDotsEvents=function(t){"slider"===this.config.type?(this.config.target.slider.on("move",(function(i){e.handleButtons(t,i)})),this.config.target.slider.on("updated",rey.util.debounce((function(i){e.createDots(t,i.perPage)}),200))):"tabs"===this.config.type&&rey.hooks.addAction("tabs/changed/"+this.config.target.tabsID,(function(i){e.handleButtons(t,i)}))},this.startDots=function(t){"bullets"===t.getAttribute("data-type")&&(this.getData(),this.itemsCount&&(t.classList.remove("--hidden"),this.createDots(t),this.runDotsEvents(t)))},this.createDots=function(t,i){i=i||e.perPage,rey.dom.empty(t);for(var s=0;s<Math.ceil(e.itemsCount/i);s++)e.createButton(s,t)},this.handleButtons=function(t,i){t.querySelectorAll("button").forEach((s=>{s.classList.remove("is-active");var r=s.getAttribute("data-go"),n=Math.ceil(i/e.perPage);r&&">"+n==r&&(s.classList.add("is-active"),rey.dom.setProperty("--active",n,t))}))},this.createButton=function(t,i){var s=document.createElement("button");s.setAttribute("data-go",">"+t),s.setAttribute("aria-label","Go to "+t),0===t&&s.classList.add("is-active"),i.append(s),s.addEventListener("click",(function(t){t.preventDefault(),e.goTo(t.currentTarget.getAttribute("data-go"))}))},this.init()};rey.hooks.addAction("slider/mounted",(function(e){new t({target:e,type:"slider"})})),rey.hooks.addAction("tabs/loaded",(function(e){new t({target:e,type:"tabs"})}))}();