
/*
	* LayerSlider Add-On: Popups
	*
	* (c) 2011-2025 George Krupa, John Gera & Kreatura Media
	*
	* LayerSlider home:		https://layerslider.com/popups/
	* Licensing:			https://layerslider.com/licensing/
*/



;(function(a){window._layerSlider.plugins.popup=function(b,c,d){var f=this,e={startInViewport:!1,playByScroll:!1,allowFullscreen:!1,insertSelector:null,performanceMode:!1,scene:!1},g=window._lsData;f.pluginData={name:"Popups Add-On for LayerSlider",version:"2.3",requiredLSVersion:"8.0.0",authorName:"Kreatura",releaseDate:"2025. 10. 07."},f.pluginDefaults={eventNamespace:"PU",keys:{popupShowOnClick:["plugin","settings"],popupShowOnScroll:["plugin","settings"],popupShowOnLeave:["plugin","settings"],popupShowOnIdle:["plugin","settings"],popupShowOnTimeout:["plugin","settings"],popupShowOnce:["plugin","settings"],popupCloseOnScroll:["plugin","settings"],popupCloseOnTimeout:["plugin","settings"],popupCloseOnSliderEnd:["plugin","settings"],popupCloseOnEsc:["plugin","settings"],popupShowCloseButton:["plugin","settings"],popupCloseButtonStyle:["plugin","settings"],popupResetOnClose:["plugin","settings"],popupDisableOverlay:["plugin","settings"],popupOverlayClickToClose:["plugin","settings"],popupStartSliderImmediately:["plugin","settings"],popupWidth:["popup","styleSettings"],popupHeight:["popup","styleSettings"],popupFitWidth:["popup","styleSettings"],popupFitHeight:["popup","styleSettings"],popupCustomStyle:["popup","styleSettings"],popupPositionHorizontal:["popup","styleSettings"],popupPositionVertical:["popup","styleSettings"],popupDistanceLeft:["popup","styleSettings"],popupDistanceRight:["popup","styleSettings"],popupDistanceTop:["popup","styleSettings"],popupDistanceBottom:["popup","styleSettings"],popupDurationIn:["popup","transitionSettings"],popupDurationOut:["popup","transitionSettings"],popupDelayIn:["popup","transitionSettings"],popupEaseIn:["popup","transitionSettings"],popupEaseOut:["popup","transitionSettings"],popupTransitionIn:["popup","transitionSettings"],popupTransitionOut:["popup","transitionSettings"],popupCustomTransitionIn:["popup","transitionSettings"],popupCustomTransitionOut:["popup","transitionSettings"],popupOverlayBackground:["overlay","styleSettings"],popupOverlayDurationIn:["overlay","transitionSettings"],popupOverlayDurationOut:["overlay","transitionSettings"],popupOverlayEaseIn:["overlay","transitionSettings"],popupOverlayEaseOut:["overlay","transitionSettings"],popupOverlayTransitionIn:["overlay","transitionSettings"],popupOverlayTransitionOut:["overlay","transitionSettings"]}},f.state={initialized:!1,openedAtLeastOnce:!1,is:null},f.init=function(){var a,c,d;for(var e in f.pluginDefaults.keys)a=f[f.pluginDefaults.keys[e][0]][f.pluginDefaults.keys[e][1]],b.o.hasOwnProperty(e)&&(c=e.split("popup")[1],c=c.substr(0,1).toLowerCase()+c.substr(1),b.o[e]!==a[c]&&(d=c.toLowerCase(),-1!==d.indexOf("ease")&&(b.o[e]=b.functions.convert.easing(b.o[e])),(-1!==d.indexOf("duration")||-1!==d.indexOf("delay"))&&"number"==typeof b.o[e]&&(b.o[e]/=1e3),a[c]=b.o[e]));f.plugin.setOptions(),f.slider.setOptions(),f.popup.createMarkup(),f.popup.setStyles(),f.popup.setTransitions(),f.slider.setStyles(),f.overlay.createMarkup(),f.overlay.setTransitions(),f.events.set(),f.state.initialized=!0},f.plugin={settings:{showOnClick:!1,showOnScroll:!1,showOnLeave:!1,showOnIdle:!1,showOnTimeout:!1,closeOnScroll:!1,closeOnTimeout:!1,closeOnSliderEnd:!1,closeOnEsc:!1,showOnce:!0,disableOverlay:!1,showCloseButton:!0,closeButtonStyle:"",overlayClickToClose:!0,startSliderImmediately:!1,resetOnClose:"slide"},setOptions:function(){this.settings.$clickTriggerElements=a(this.settings.showOnClick).add("[data-ls-popup-trigger-for=\""+c.attr("id")+"\"], [href=\"#"+c.attr("id")+"\"], ."+c.attr("id")),a("[href=\"#"+c.attr("id")+"\"]").on("click."+f.pluginDefaults.eventNamespace+d,function(a){a.preventDefault()}),c[0].style.width&&-1!==c[0].style.width.indexOf("px")&&!b.o.popupWidth&&(f.popup.styleSettings.width=parseInt(c[0].style.width)),c[0].style.height&&-1!==c[0].style.height.indexOf("px")&&!b.o.popupHeight&&(f.popup.styleSettings.height=parseInt(c[0].style.height)),b.o.popupPositionHorizontal&&("left"===b.o.popupPositionHorizontal||"right"===b.o.popupPositionHorizontal)&&(f.popup.styleSettings.positionHorizontal=b.o.popupPositionHorizontal),"fullwidth"===b.o.type&&(f.popup.styleSettings.positionHorizontal="left"),b.o.popupPositionVertical&&("top"===b.o.popupPositionVertical||"bottom"===b.o.popupPositionVertical)&&(f.popup.styleSettings.positionVertical=b.o.popupPositionVertical),b.o.popupDistanceLeft&&(f.popup.styleSettings.distanceLeft=b.o.popupDistanceLeft),b.o.popupDistanceRight&&(f.popup.styleSettings.distanceRight=b.o.popupDistanceRight),b.o.popupDistanceTop&&(f.popup.styleSettings.distanceTop=b.o.popupDistanceTop),b.o.popupDistanceBottom&&(f.popup.styleSettings.distanceBottom=b.o.popupDistanceBottom),f.plugin.settings.closeOnSliderEnd&&c.on("slideChangeWillStart.layerSlider",function(a,b){if(b.slides.current.index===b.slides.count)return f.events.hide(),!1})}},f.overlay={styleSettings:{overlayBackground:"rgba(0,0,0,.85)"},transitionSettings:{overlayDurationIn:.4,overlayDurationOut:.4,overlayEaseIn:b.gsap.Quint.easeIn,overlayEaseOut:b.gsap.Quint.easeIn,overlayTransitionIn:"fade",overlayTransitionOut:"fade"},createMarkup:function(){f.$overlay=a("<div>").addClass("ls-popup-overlay").css({background:this.styleSettings.overlayBackground}).insertBefore(f.$popup)},setTransitions:function(){this.transitionSettings.styleInFrom={opacity:1,display:"block"},this.transitionSettings.styleInTo={ease:this.transitionSettings.overlayEaseIn,opacity:1,x:0,y:0,z:0,rotation:0,rotationX:0,rotationY:0,scaleX:1,scaleY:1,skewX:0,skewY:0,borderRadius:0},this.transitionSettings.styleOutTo={ease:this.transitionSettings.overlayEaseOut,onComplete:function(){b.gsap.TweenMax.set(f.$overlay[0],{display:"none",x:0,y:0,opacity:0})}}},show:function(){switch(this.transitionSettings.overlayTransitionIn.toLowerCase()){default:case"fade":this.transitionSettings.styleInFrom.opacity=0;break;case"slidefromtop":this.transitionSettings.styleInFrom.y=-g.viewport.height;break;case"slidefrombottom":this.transitionSettings.styleInFrom.y=g.viewport.height;break;case"slidefromleft":this.transitionSettings.styleInFrom.x=-g.viewport.width;break;case"slidefromright":this.transitionSettings.styleInFrom.x=g.viewport.width;break;case"fadefromtopleft":this.transitionSettings.styleInFrom.x=-g.viewport.width,this.transitionSettings.styleInFrom.y=-g.viewport.height,this.transitionSettings.styleInFrom.opacity=0;break;case"fadefromtopright":this.transitionSettings.styleInFrom.x=g.viewport.width,this.transitionSettings.styleInFrom.y=-g.viewport.height,this.transitionSettings.styleInFrom.opacity=0;break;case"fadefrombottomleft":this.transitionSettings.styleInFrom.x=-g.viewport.width,this.transitionSettings.styleInFrom.y=g.viewport.height,this.transitionSettings.styleInFrom.opacity=0;break;case"fadefrombottomright":this.transitionSettings.styleInFrom.x=g.viewport.width,this.transitionSettings.styleInFrom.y=g.viewport.height,this.transitionSettings.styleInFrom.opacity=0;break;case"scale":this.transitionSettings.styleInFrom.scaleX=0,this.transitionSettings.styleInFrom.scaleY=0;}b.gsap.TweenMax.fromTo(f.$overlay[0],this.transitionSettings.overlayDurationIn,this.transitionSettings.styleInFrom,this.transitionSettings.styleInTo)},hide:function(){switch(this.transitionSettings.overlayTransitionOut.toLowerCase()){default:case"fade":this.transitionSettings.styleOutTo.opacity=0;break;case"slidetotop":this.transitionSettings.styleOutTo.y=-g.viewport.height;break;case"slidetobottom":this.transitionSettings.styleOutTo.y=g.viewport.height;break;case"slidetoleft":this.transitionSettings.styleOutTo.x=-g.viewport.width;break;case"slidetoright":this.transitionSettings.styleOutTo.x=g.viewport.width;break;case"fadetotopleft":this.transitionSettings.styleOutTo.x=-g.viewport.width,this.transitionSettings.styleOutTo.y=-g.viewport.height,this.transitionSettings.styleOutTo.opacity=0;break;case"fadetotopright":this.transitionSettings.styleOutTo.x=g.viewport.width,this.transitionSettings.styleOutTo.y=-g.viewport.height,this.transitionSettings.styleOutTo.opacity=0;break;case"fadetobottomleft":this.transitionSettings.styleOutTo.x=-g.viewport.width,this.transitionSettings.styleOutTo.y=g.viewport.height,this.transitionSettings.styleOutTo.opacity=0;break;case"fadetobottomright":this.transitionSettings.styleOutTo.x=g.viewport.width,this.transitionSettings.styleOutTo.y=g.viewport.height,this.transitionSettings.styleOutTo.opacity=0;break;case"scale":this.transitionSettings.styleOutTo.scaleX=0,this.transitionSettings.styleOutTo.scaleY=0;}b.gsap.TweenMax.to(f.$overlay[0],this.transitionSettings.overlayDurationOut,this.transitionSettings.styleOutTo)}},f.popup={styleSettings:{width:640,height:360,fitWidth:!1,fitHeight:!1,customStyle:"",positionHorizontal:"center",positionVertical:"middle",distanceLeft:10,distanceRight:10,distanceTop:10,distanceBottom:10},transitionSettings:{durationIn:1,durationOut:.5,delayIn:.2,easeIn:b.gsap.Quint.easeInOut,easeOut:b.gsap.Quint.easeIn,transitionIn:"fade",transitionOut:"fade",customTransitionIn:!1,customTransitionOut:!1},createMarkup:function(){var b;b=c.parent().is(".ls-popup")?c.parent():a("<div class=\"ls-popup\">"),a("body").append(b.append(a("<div class=\"ls-popup-inner\">").append(c))),c.attr("style",c.attr("style")+"; "+f.popup.styleSettings.customStyle),f.$inner=c.parent(),f.$popup=f.$inner.parent(),f.plugin.settings.showCloseButton&&c.append("<div class=\"ls-popup-close-button\" style=\""+f.plugin.settings.closeButtonStyle+"\"></div>")},setStyles:function(){f.$popup.css({left:f.popup.styleSettings.distanceLeft,right:f.popup.styleSettings.distanceRight,top:f.popup.styleSettings.distanceTop,bottom:f.popup.styleSettings.distanceBottom}),f.$inner.css({maxWidth:b.slider.initial?b.slider.initial.maxWidth:c[0].style.maxWidth||c.css("max-width"),maxHeight:b.slider.initial&&b.slider.initial.maxHeight?b.slider.initial.maxHeight:c[0].style.maxHeight||c.css("max-height"),width:f.popup.styleSettings.width,height:f.popup.styleSettings.height})},setTransitions:function(){this.transitionSettings.styleInFrom={transformPerspective:500,transformOrigin:"50% 50%"},"object"==typeof this.transitionSettings.customTransitionIn&&(this.transitionSettings.styleInFrom=a.extend({},this.transitionSettings.styleInFrom,this.transitionSettings.customTransitionIn)),this.transitionSettings.styleInTo={opacity:1,x:0,y:0,z:0,rotation:0,rotationX:0,rotationY:0,scaleX:1,scaleY:1,skewX:0,skewY:0,delay:this.transitionSettings.delayIn,ease:this.transitionSettings.easeIn,onStart:function(){b.layers.get("active").filter("[data-countdown]").each(function(){var c=a(this),d=c.data(b.defaults.init.dataKey);d.is.countdown&&b.countdown.startInterval(c,d.countdownSettings)}),f.state.is="opening",f.plugin.settings.startSliderImmediately&&c.layerSlider("resumePopup")},onComplete:function(){b.api.hasEvent("popupDidOpen")&&b.api.triggerEvent("popupDidOpen",b.api.eventData()),f.state.openedAtLeastOnce=!0,f.state.is="opened",b.slider.state.popupShouldStart=!0,(!f.plugin.settings.startSliderImmediately||f.plugin.settings.startSliderImmediately&&0===f.popup.transitionSettings.durationIn)&&c.layerSlider("resumePopup"),"number"==typeof f.plugin.settings.closeOnTimeout&&setTimeout(function(){f.events.hide()},1e3*f.plugin.settings.closeOnTimeout),(f.plugin.settings.showOnScroll||f.plugin.settings.closeOnScroll)&&f.events.checkScrollPositions()}},this.transitionSettings.styleOutTo={ease:this.transitionSettings.easeOut,transformOrigin:"50% 50%",onStart:function(){f.state.is="closing"},onComplete:function(){b.layers.get("countdown").each(function(){var c=a(this),d=c.data(b.defaults.init.dataKey);d.is.countdown&&b.countdown.stopInterval(d.countdownSettings)}),f.plugin.settings.startSliderImmediately&&c.layerSlider("pause"),f.$popup.removeClass("ls-popup-visible"),b.slider.state.popupIsVisible=!1,b.slider.state.popupShouldStart=!1,f.plugin.settings.showOnce?(b.api.hasEvent("popupDidClose")&&b.api.triggerEvent("popupDidClose",b.api.eventData()),f.events.destroy()):(b.gsap.TweenMax.set(c[0],{opacity:1,x:0,y:0,z:0,rotation:0,rotationX:0,rotationY:0,scaleX:1,scaleY:1,skewX:0,skewY:0}),f.plugin.settings.resetOnClose&&c.layerSlider("resetSlide"),"slider"===f.plugin.settings.resetOnClose&&(c.layerSlider("fastChangeTo",1),b.slideshow.state.pausedByLastCycle&&(b.slideshow.state.pausedByLastCycle=!1,b.slideshow.state.paused=!1,b.slideshow.state.running=!0)),(f.plugin.settings.showOnScroll||f.plugin.settings.closeOnScroll)&&f.events.checkScrollPositions(),b.api.hasEvent("popupDidClose")&&b.api.triggerEvent("popupDidClose",b.api.eventData())),b.slides[b.slides.current.index||1].data.hasSmartBG&&(b.transitions.layers.timeline.forceRestart=!0),f.state.is="closed"}},"object"==typeof this.transitionSettings.customTransitionOut&&(this.transitionSettings.styleOutTo=a.extend({},this.transitionSettings.styleOutTo,this.transitionSettings.customTransitionOut))},show:function(){if(b.slider.shouldResize=!0,b.slider.state.popupIsVisible=!0,b.slider.state.popupShouldStart=!!f.plugin.settings.startSliderImmediately,f.$popup.addClass("ls-popup-visible"),a(window).trigger("resize."+d),f.events.resize(),"object"!=typeof this.transitionSettings.customTransitionIn)switch(this.transitionSettings.transitionIn.toLowerCase()){default:case"fade":this.transitionSettings.styleInFrom.opacity=0;break;case"slidefromtop":this.transitionSettings.styleInFrom.y=g.scroll.top-(b.slider.height+b.slider.offset.top);break;case"slidefrombottom":this.transitionSettings.styleInFrom.y=g.scroll.top+g.viewport.height-b.slider.offset.top;break;case"slidefromleft":this.transitionSettings.styleInFrom.x=g.scroll.left-(b.slider.width+b.slider.offset.left);break;case"slidefromright":this.transitionSettings.styleInFrom.x=g.scroll.left+g.viewport.width-b.slider.offset.left;break;case"rotatefromtop":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.y=-(b.slider.height/2),this.transitionSettings.styleInFrom.rotationX=30,this.transitionSettings.styleInTo.ease=b.gsap.Quint.easeOut;break;case"rotatefrombottom":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.y=b.slider.height/2,this.transitionSettings.styleInFrom.rotationX=-30,this.transitionSettings.styleInTo.ease=b.gsap.Quint.easeOut;break;case"rotatefromleft":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.x=-(b.slider.width/2),this.transitionSettings.styleInFrom.rotationY=-30,this.transitionSettings.styleInTo.ease=b.gsap.Quint.easeOut;break;case"rotatefromright":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.x=b.slider.width/2,this.transitionSettings.styleInFrom.rotationY=30,this.transitionSettings.styleInTo.ease=b.gsap.Quint.easeOut;break;case"scalefromtop":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleY=1.5,this.transitionSettings.styleInFrom.y=-(b.slider.height/4),this.transitionSettings.styleInFrom.transformOrigin="50% 100%",this.transitionSettings.styleInTo.ease=b.gsap.Back.easeOut;break;case"scalefrombottom":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleY=1.5,this.transitionSettings.styleInFrom.y=b.slider.height/4,this.transitionSettings.styleInFrom.transformOrigin="50% 0",this.transitionSettings.styleInTo.ease=b.gsap.Back.easeOut;break;case"scalefromleft":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleX=1.5,this.transitionSettings.styleInFrom.x=-(b.slider.width/4),this.transitionSettings.styleInFrom.transformOrigin="100% 50%",this.transitionSettings.styleInTo.ease=b.gsap.Back.easeOut;break;case"scalefromright":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleX=1.5,this.transitionSettings.styleInFrom.x=b.slider.width/4,this.transitionSettings.styleInFrom.transformOrigin="0 50%",this.transitionSettings.styleInTo.ease=b.gsap.Back.easeOut;break;case"scale":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleX=.5,this.transitionSettings.styleInFrom.scaleY=.5;break;case"spin":this.transitionSettings.styleInFrom.rotation=360,this.transitionSettings.styleInFrom.scaleX=0,this.transitionSettings.styleInFrom.scaleY=0,this.transitionSettings.styleInTo.ease=b.gsap.Quart.easeOut;break;case"spinx":this.transitionSettings.styleInFrom.rotationX=360,this.transitionSettings.styleInFrom.scaleX=0,this.transitionSettings.styleInFrom.scaleY=0,this.transitionSettings.styleInTo.ease=b.gsap.Quart.easeOut;break;case"spiny":this.transitionSettings.styleInFrom.rotationY=360,this.transitionSettings.styleInFrom.scaleX=0,this.transitionSettings.styleInFrom.scaleY=0,this.transitionSettings.styleInTo.ease=b.gsap.Quart.easeOut;break;case"elastic":this.transitionSettings.styleInFrom.opacity=0,this.transitionSettings.styleInFrom.scaleX=1.2,this.transitionSettings.styleInFrom.scaleY=.8,this.transitionSettings.styleInTo.ease=b.gsap.Elastic.easeOut;}c.css({transformOrigin:this.transitionSettings.styleInFrom.transformOrigin}),b.gsap.TweenMax.fromTo(c[0],this.transitionSettings.durationIn,this.transitionSettings.styleInFrom,this.transitionSettings.styleInTo)},hide:function(){if("object"!=typeof this.transitionSettings.customTransitionOut)switch(this.transitionSettings.transitionOut.toLowerCase()){default:case"fade":this.transitionSettings.styleOutTo.opacity=0;break;case"slidetotop":this.transitionSettings.styleOutTo.y=g.scroll.top-(b.slider.height+b.slider.offset.top);break;case"slidetobottom":this.transitionSettings.styleOutTo.y=g.scroll.top+g.viewport.height-b.slider.offset.top;break;case"slidetoleft":this.transitionSettings.styleOutTo.x=g.scroll.left-(b.slider.width+b.slider.offset.left);break;case"slidetoright":this.transitionSettings.styleOutTo.x=g.scroll.left+g.viewport.width-b.slider.offset.left;break;case"rotatetotop":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.y=-(b.slider.height/2),this.transitionSettings.styleOutTo.rotationX=30,this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"rotatetobottom":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.y=b.slider.height/2,this.transitionSettings.styleOutTo.rotationX=-30,this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"rotatetoleft":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.x=-(b.slider.width/2),this.transitionSettings.styleOutTo.rotationY=-30,this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"rotatetoright":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.x=b.slider.width/2,this.transitionSettings.styleOutTo.rotationY=30,this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"scale":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleX=.5,this.transitionSettings.styleOutTo.scaleY=.5;break;case"scaletotop":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleY=1.5,this.transitionSettings.styleOutTo.y=-(b.slider.height/4),this.transitionSettings.styleOutTo.transformOrigin="50% 100%",this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"scaletobottom":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleY=1.5,this.transitionSettings.styleOutTo.y=b.slider.height/4,this.transitionSettings.styleOutTo.transformOrigin="50% 0",this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"scaletoleft":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleX=1.5,this.transitionSettings.styleOutTo.x=-(b.slider.width/4),this.transitionSettings.styleOutTo.transformOrigin="100% 50%",this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"scaletoright":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleX=1.5,this.transitionSettings.styleOutTo.x=b.slider.width/4,this.transitionSettings.styleOutTo.transformOrigin="0 50%",this.transitionSettings.styleOutTo.ease=b.gsap.Quint.easeIn;break;case"spin":this.transitionSettings.styleOutTo.rotation=360,this.transitionSettings.styleOutTo.scaleX=0,this.transitionSettings.styleOutTo.scaleY=0,this.transitionSettings.styleOutTo.ease=b.gsap.Quart.easeIn;break;case"spinx":this.transitionSettings.styleOutTo.rotationX=360,this.transitionSettings.styleOutTo.scaleX=0,this.transitionSettings.styleOutTo.scaleY=0,this.transitionSettings.styleOutTo.ease=b.gsap.Quart.easeIn;break;case"spiny":this.transitionSettings.styleOutTo.rotationY=360,this.transitionSettings.styleOutTo.scaleX=0,this.transitionSettings.styleOutTo.scaleY=0,this.transitionSettings.styleOutTo.ease=b.gsap.Quart.easeIn;break;case"elastic":this.transitionSettings.styleOutTo.opacity=0,this.transitionSettings.styleOutTo.scaleX=1.2,this.transitionSettings.styleOutTo.scaleY=.8,this.transitionSettings.styleOutTo.ease=b.gsap.Back.easeInOut;}f.plugin.settings.startSliderImmediately||c.layerSlider("pause"),c.css({transformOrigin:this.transitionSettings.styleOutTo.transformOrigin}),b.gsap.TweenMax.to(c[0],this.transitionSettings.durationOut,this.transitionSettings.styleOutTo),b.slider.shouldResize=!1}},f.slider={setOptions:function(){b.o.popupFitWidth||b.o.popupFitHeight?(b.o.type="fullsize",b.o.fullSizeMode="fitheight",b.o.popupFitWidth&&!b.o.popupFitHeight&&c.css({maxHeight:f.popup.styleSettings.height}),b.o.popupFitHeight&&!b.o.popupFitWidth&&c.css({maxWidth:f.popup.styleSettings.width})):(b.o.type="responsive",c.css({maxWidth:f.popup.styleSettings.width,maxHeight:f.popup.styleSettings.height})),b.slider.isPopup=!0,a.extend(b.o,e),f.plugin.settings.closeOnEsc&&(window._layerSlider.closePopupsOnEsc[d]=!0)},setStyles:function(){var a={};switch(f.popup.styleSettings.positionHorizontal){case"left":a.left=0,a.right="auto";break;case"right":a.left="auto",a.right=0;break;case"center":a.left="50%",a.right="auto";}switch(f.popup.styleSettings.positionVertical){case"top":a.top=0,a.bottom="auto";break;case"bottom":a.top="auto",a.bottom=0;break;case"middle":a.top="50%",a.bottom="auto";}c.css(a)}},f.events={set:function(){c.on("sliderDidLoad.layerSlider",function(){f.plugin.settings.$clickTriggerElements&&0<f.plugin.settings.$clickTriggerElements.length&&f.plugin.settings.$clickTriggerElements.on("click."+f.pluginDefaults.eventNamespace+d,function(b){if(b.preventDefault(),f.$popup.hasClass("ls-popup-visible"))f.events.hide();else{var c=a(this).data("ls-popup-slide");f.events.show(!!(c&&a.isNumeric(c))&&c)}}),(f.plugin.settings.showOnScroll||f.plugin.settings.closeOnScroll)&&(f.events.scrollDirection="down",f.events.lastScrollPosition=g.scroll.top,f.events.checkScrollPositions(),a(window).on("scroll."+f.pluginDefaults.eventNamespace+d,function(){(g.scroll.top>=f.events.lastScrollPosition&&"up"===f.events.scrollDirection||g.scroll.top<=f.events.lastScrollPosition&&"down"===f.events.scrollDirection&&0!==g.scroll.top)&&f.events.switchScrollDirection(),f.events.lastScrollPosition=g.scroll.top,f.events.scrollDirection===f.events.popupShouldShowTriggerAnEventByScrolling&&("auto"===f.plugin.settings.scrollPosition?b.slider.offset.top>g.scroll.top&&b.slider.offset.top<g.scroll.top+g.viewport.height?"down"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0):"up"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0):"number"==typeof f.plugin.settings.scrollPosition?g.scroll.top>=f.plugin.settings.scrollPosition?"down"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0):"up"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0):-1!==f.plugin.settings.scrollPosition.indexOf("%")&&(parseInt(g.scroll.top/((g.document.height-g.viewport.height)/100))>parseInt(f.plugin.settings.scrollPosition)?"down"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0):"up"===f.events.scrollDirection&&(b.slider.state.popupIsVisible?f.events.popupShouldHide=!0:f.events.popupShouldShow=!0))),f.events.popupShouldShow?(f.events.popupShouldShow=!1,f.events.show(),f.events.checkScrollPositions()):f.events.popupShouldHide&&(f.events.popupShouldHide=!1,f.events.hide())}),a(window).trigger("scroll."+f.pluginDefaults.eventNamespace+d)),f.plugin.settings.showOnLeave&&(a(document).on("mousemove."+f.pluginDefaults.eventNamespace+d,function(a){f.events.mousePositionTop=a.pageY-g.scroll.top}),a("html").on("mouseleave."+f.pluginDefaults.eventNamespace+d,function(){100>f.events.mousePositionTop&&f.events.show()})),f.plugin.settings.showOnIdle&&"number"==typeof f.plugin.settings.showOnIdle&&(f.events.idleTime=0,f.events.startIdleTimer(),a(window).on("load."+f.pluginDefaults.eventNamespace+d,function(){f.events.startIdleTimer()}),a(document).on("mousemove."+f.pluginDefaults.eventNamespace+d+" keypress."+f.pluginDefaults.eventNamespace+d,function(){f.events.startIdleTimer()})),f.plugin.settings.hasOwnProperty("showOnTimeout")&&"number"==typeof f.plugin.settings.showOnTimeout&&f.events.startTimeout(),a(window).on("resize."+f.pluginDefaults.eventNamespace+d,function(){b.slider.state.popupIsVisible&&f.events.resize()}),a(window).on("orientationchange."+f.pluginDefaults.eventNamespace+d,function(){b.slider.state.popupIsVisible&&setTimeout(function(){b.resize.all(),f.events.resize()},750)})}),f.plugin.settings.overlayClickToClose&&f.$overlay.on("click."+f.pluginDefaults.eventNamespace+d,function(){f.events.hide()}),c.on("click."+f.pluginDefaults.eventNamespace+d,"[href=\"#popupclose\"], [href=\"#popupClose\"], [href=\"#closepopup\"], [href=\"#closePopup\"], .ls-popup-close, .ls-close-popup, .ls-popup-close-button, .ls-close-popup-button",function(a){a.preventDefault(),f.events.hide()}),a(document).on("click."+f.pluginDefaults.eventNamespace+d,".ls-close-all-popups-button",function(a){a.preventDefault(),f.events.hide()})},checkScrollPositions:function(){f.plugin.settings.scrollPosition=f.plugin.settings.closeOnScroll&&b.slider.state.popupIsVisible?f.plugin.settings.closeOnScroll:f.plugin.settings.showOnScroll&&!b.slider.state.popupIsVisible?f.plugin.settings.showOnScroll:"","auto"===f.plugin.settings.scrollPosition?b.slider.offset.top>g.scroll.top&&b.slider.offset.top<g.scroll.top+g.viewport.height?f.events.popupShouldShowTriggerAnEventByScrolling="up":f.events.popupShouldShowTriggerAnEventByScrolling="down":"number"==typeof f.plugin.settings.scrollPosition?g.scroll.top>=f.plugin.settings.scrollPosition?f.events.popupShouldShowTriggerAnEventByScrolling="up":f.events.popupShouldShowTriggerAnEventByScrolling="down":-1!==f.plugin.settings.scrollPosition.indexOf("%")&&(parseInt(g.scroll.top/((g.document.height-g.viewport.height)/100))>parseInt(f.plugin.settings.scrollPosition)?f.events.popupShouldShowTriggerAnEventByScrolling="up":f.events.popupShouldShowTriggerAnEventByScrolling="down")},switchScrollDirection:function(){f.plugin.settings.scrollPosition&&("up"===f.events.scrollDirection?f.events.scrollDirection="down":f.events.scrollDirection="up")},startIdleTimer:function(){f.events.idleTimer&&clearTimeout(f.events.idleTimer),f.events.idleTimer=setTimeout(function(){f.events.show()},1e3*f.plugin.settings.showOnIdle)},startTimeout:function(){f.events.timeout&&clearTimeout(f.events.timeout),b.slider.state.popupIsWaitingForDelay=!0,f.events.timeout=setTimeout(function(){b.slider.state.popupIsWaitingForDelay=!1,b.slider.state.waitingForPopupTimer&&(b.slider.state.waitingForPopupTimer=!1,b.transitions.start()),f.events.show()},1e3*f.plugin.settings.showOnTimeout)},show:function(a){if(!c.hasClass("ls-forcehide")&&!b.slider.state.popupIsVisible){b.api.hasEvent("popupWillOpen")&&b.api.triggerEvent("popupWillOpen",b.api.eventData());var d=function(){f.plugin.settings.disableOverlay||f.overlay.show(),f.popup.show()};a?c.layerSlider("fastChangeTo",a,d):d()}},hide:function(){b.slider.state.popupIsVisible&&(b.api.hasEvent("popupWillClose")&&b.api.triggerEvent("popupWillClose",b.api.eventData()),!f.plugin.settings.disableOverlay&&f.overlay.hide(),f.popup.hide())},resize:function(){var a={};"center"===f.popup.styleSettings.positionHorizontal&&(a.marginLeft=-b.slider.width/2),"middle"===f.popup.styleSettings.positionVertical&&(a.marginTop=-b.slider.height/2),c.css(a);var d=c.offset();b.slider.offset.left=d.left,b.slider.offset.top=d.top},destroy:function(){c.on("sliderDidRemove.layerSlider",function(){a([window,document,a("body")[0],a("html")[0],f.plugin.settings.$clickTriggerElements]).off(f.pluginDefaults.eventNamespace+d),f.$overlay.remove(),f.$popup.remove()}).layerSlider("destroy",!0)}}},a(document).on("keydown.lsGlobal",function(a){if(27===a.which)for(var b in window._layerSlider.closePopupsOnEsc)window._layerSliders[b].api.methods("closePopup")})})(jQuery,void 0);