(e=>{function t(v,_){var h,e,t,i,r,a,o,n,s,l=v.find(".premium-adv-carousel__container"),g=l.data("settings"),u=v.find(".premium-adv-carousel__inner-container");function c(){l.on("mouseenter.paMediaWheel",function(){h.css("animation-play-state","paused")}).on("mouseleave.paMediaWheel",function(){h.css("animation-play-state","running")})}function m(){v.find("iframe").attr("src",""),$video=v.find("video[pa-playing='true']").each(function(){var e=_(this).get(0);e.pause(),e.currentTime=0}),v.find(".premium-adv-carousel__video-icon, .premium-adv-carousel__vid-overlay").css("visibility","visible"),v.find(".premium-adv-carousel__media-wrap").css("background","unset")}function y(){var e=0;return v.find(".premium-adv-carousel__item").each(function(){e+=_(this).outerWidth(!0)}),h.css({width:e}),e}function d(){var e,t,i=v.find(".premium-adv-carousel__item"),r=g.dir,a=g.reverse,o=0,n=h.outerHeight();if("horizontal"===r){for(var s=y(),l=(h.css({height:n,position:"relative"}),h.find(".premium-adv-carousel__item-outer-wrapper").css("position","absolute"),"normal"===a?h.find(".premium-adv-carousel__item-outer-wrapper").css("right",0):(h.css("left","-"+s/i.length+"px"),"rtl"===document.dir&&h.css("direction","ltr")),getComputedStyle(v[0]).getPropertyValue("--pa-wheel-spacing")||0),u="normal"===a?-1:1,c=0;s<=v.outerWidth(!0)||s-v.outerWidth(!0)<=400;)t=e=void 0,e=h.children().length,t=new DocumentFragment,h.find(".premium-adv-carousel__item-outer-wrapper:lt("+e+")").clone(!0,!0).appendTo(t),h.append(t),s=y();gsap.set(v.find(".premium-adv-carousel__item-outer-wrapper"),{x:function(e){return c=(transformVal=c)+v.find(".premium-adv-carousel__item").eq(e).outerWidth(!0)+parseFloat(l),transformVal*u}});var m=s+v.find(".premium-adv-carousel__item").length*parseFloat(l),d=gsap.to(v.find(".premium-adv-carousel__item-outer-wrapper"),{duration:g.speed,ease:"none",x:("normal"===a?"-=":"+=")+m,modifiers:{x:gsap.utils.unitize(function(e){var e=parseFloat(e)%m,t=Math.max(e,-m);return"normal"===a?t:e})},repeat:-1})}else{i.each(function(){o+=_(this).outerHeight(!0)}),h.css({position:"relative",height:o}),h.find(".premium-adv-carousel__item-outer-wrapper").css("position","absolute"),"normal"===a?h.find(".premium-adv-carousel__item-outer-wrapper").css("bottom",0):h.css("top","-"+o/i.length+"px");var l=getComputedStyle(v[0]).getPropertyValue("--pa-wheel-spacing")||0,u="normal"===a?-1:1,p=0,f=(gsap.set(v.find(".premium-adv-carousel__item-outer-wrapper"),{y:function(e){return p=(transformVal=p)+v.find(".premium-adv-carousel__item").eq(e).outerHeight(!0)+parseFloat(l),transformVal*u}}),o+v.find(".premium-adv-carousel__item").length*parseFloat(l)),d=gsap.to(v.find(".premium-adv-carousel__item-outer-wrapper"),{duration:g.speed,ease:"none",y:("normal"===a?"-=":"+=")+f,modifiers:{y:gsap.utils.unitize(function(e){var e=parseFloat(e)%f,t=Math.max(e,-f);return"normal"===a?t:e})},repeat:-1})}g.pauseOnHover&&v.hover(function(){d.pause()},function(){d.play()})}g&&("infinite"===g.type?(h=l.find(".premium-adv-carousel__items"),e=g.lightbox_type,"load"===g.renderEvent?d():(t=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(d(),t.unobserve(e.target))})})).observe(v[0]),u.css("visibility","inherit"),g.pauseOnHover&&c(),g.scroll?(c(),"horizontal"===g.dir&&l.find(".premium-adv-carousel__inner-container").mousewheel(function(e,t){this.scrollLeft-=30*t,e.preventDefault()})):l.find(".premium-adv-carousel__inner-container").css({overflow:"hidden"})):(i=v.find(".premium-adv-carousel__items"),r=v.find(".premium-adv-carousel__item-outer-wrapper"),a=v.find(".premium-adv-carousel__prev-icon").html(),o=v.find(".premium-adv-carousel__next-icon").html(),n=["mobile","mobile_extra","tablet","tablet_extra"].includes(elementorFrontend.getCurrentDeviceMode()),v.find(".premium-adv-carousel__icons-holder").remove(),u.flipster({itemContainer:i,itemSelector:r,style:g.type,fadeIn:0,start:g.start,loop:g.loop,autoplay:g.autoPlay,scrollwheel:g.scroll,pauseOnHover:g.pauseOnHover,click:!g.loop&&g.click,keyboard:g.keyboard,touch:g.touch,spacing:g.spacing,buttons:!!g.buttons&&"custom",buttonPrev:a,buttonNext:o,onItemSwitch:function(){m()}}).css("visibility","inherit"),g.keyboard&&!n&&(s=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(_.fn.focusWithoutScrolling=function(){var e=window.scrollX,t=window.scrollY;this.focus(),window.scrollTo(e,t)},u.focusWithoutScrolling(),s.unobserve(e.target))})})).observe(u[0]),g.loop&&g.click&&v.find(".premium-adv-carousel__item-outer-wrapper").on("click.paFlipClick",function(){var e=_(this).index();u.flipster("jump",e)})),"yes"===g.light_box?"default"===e&&v.find(".premium-adv-carousel__inner-container a[data-rel^='prettyPhoto']").prettyPhoto({theme:g.theme,hook:"data-rel",opacity:.7,show_title:!1,deeplinking:!1,overlay_gallery:g.overlay,custom_markup:"",default_width:900,default_height:506,social_tools:""}):v.find(".premium-adv-carousel__item .premium-adv-carousel__video-wrap").each(function(e,r){var a=_(r).data("type");_(r).closest(".premium-adv-carousel__item").on("click.paPlayVid"+e,function(){var e,t,i=_(this);m(),i.find(".premium-adv-carousel__media-wrap").css("background","#000"),i.find(".premium-adv-carousel__video-icon, .premium-adv-carousel__vid-overlay").css("visibility","hidden"),("hosted"!==a?(t=(t=(i=i.find(".premium-adv-carousel__iframe-wrap")).data("src")).replace("&mute","&autoplay=1&mute"),(e=_("<iframe/>")).attr({src:t,frameborder:"0",allowfullscreen:"1",allow:"autoplay;encrypted-media;"}),i.html(e),e):((t=_(r).find("video")).attr("pa-playing","true").get(0).play(),t)).css("visibility","visible")})}),v.find(".premium-adv-carousel__item--container[data-template-src]").each(function(){var e=_(this).data("template-src"),t=_("#"+e);t.length?elementorFrontend.isEditMode()?(v.find(".elementor-element-overlay").remove(),_(this).append(t.clone(!0))):_(this).append(t):_(this).html('<div class="premium-error-notice"><span>Container with ID <b>'+e+"</b> does not exist on this page. Please make sure that container ID is properly set from section settings -> Advanced tab -> CSS ID.<span></div>")}))}e(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/premium-media-wheel.default",t)})})(jQuery);