').appendTo(s),t.sliderclass&&s.addClass(t.sliderclass),LS_previewArea.hide().empty(),LayerSlider.hidePreviewSelection(),this.populateSliderPreview(s,a,{addLayerActions:!0,activeSlideOnly:!1,publishedSlidesOnly:!0});let r=0;for(key in lsSliderData.layers){if(parseInt(key)===LS_activeSlideIndex)break;lsSliderData.layers[key].properties.skip||r++}e.plugins&&(e.plugins=jQuery.merge(e.plugins,a));var l={type:"responsive",width:i.width,height:i.height,skin:"noskin",skinsPath:pluginPath+"layerslider/skins/",allowFullscreen:!1,firstSlide:r+1,autoStart:!1,pauseOnHover:!1,startInViewport:!1,autoPlayVideos:!!t.autoplayvideos,slideBGSize:t.slideBGSize,slideBGPosition:t.slideBGPosition,globalBGColor:t.backgroundcolor,globalBGImage:t.backgroundimage,globalBGAttachment:t.globalBGAttachment,globalBGRepeat:t.globalBGRepeat,globalBGPosition:t.globalBGPosition,globalBGSize:t.globalBGSize,parallaxScrollReverse:t.parallaxScrollReverse,playByScroll:!!t.playByScroll,playByScrollStart:!!t.playByScrollStart,playByScrollSkipSlideBreaks:!!t.playByScrollSkipSlideBreaks,playByScrollSpeed:t.playByScrollSpeed||1,navButtons:!1,navStartStop:!1,showCircleTimer:!1,forceLayersOutDuration:t.forceLayersOutDuration||750,allowRestartOnResize:!!t.allowRestartOnResize,fixFloatedContainers:!!t.fixFloatedContainers,preferBlendMode:t.preferBlendMode,sliderFadeInDuration:t.sliderfadeinduration||350,animateFirstSlide:!!t.animateFirstSlide,firstSlideDuration:t.firstSlideDuration,firstSlideTimeShift:t.firstSlideTimeShift,scrollCenterLayers:t.scrollCenterLayers||"center",plugins:a,sliderFadeInDuration:0};t.maxRatio&&(l.maxRatio=t.maxRatio),t.slidebartimer&&!e.timeline&&(l.showSlideBarTimer=!0),t.slideDuration&&(l.slideDuration=t.slideDuration),t.slideTransitionDuration&&(l.slideTransitionDuration=t.slideTransitionDuration),t.slideTimeShift&&(l.slideTimeShift=t.slideTimeShift),e.projectSettings&&(l=jQuery.extend(!0,{},l,e.projectSettings)),s.layerSlider(l)},stopSlidePreview:function(e){if(this.isSlidePreviewActive){this.isSlidePreviewActive=!1,e=e||{},LS_previewArea.show();var t=jQuery("lse-live-preview-area");t.find(".ls-wp-container").layerSlider("destroy",!0),t.hide(),LayerSlider.generatePreview(),LS_Revisions.opened||(LayerSlider.showPreviewSelection(),LayerSlider.updatePreviewSelection())}},loadGoogleFonts:function(e){LS_editorMeta.googleFontsEnabled&&e&&(Array.isArray(e)||(e=[e]),e.forEach((e=>{-1===LS_loadedGoogleFonts.indexOf(e)&&(LS_loadedGoogleFonts.push(e),WebFont.load({google:{families:[e+":100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"]}}))})))},loadProjectGoogleFonts:function(){if(LS_editorMeta.googleFontsEnabled&&window.lsSliderData.googlefonts){let e=window.lsSliderData.googlefonts.map((e=>e.param));LayerSlider.loadGoogleFonts(e)}},loadPreviewGoogleFonts:function(){if(LS_editorMeta.googleFontsEnabled&&window.lsSliderData.googlefonts){let e=jQuery("#lse-project-preview")[0].contentWindow,t=window.lsSliderData.googlefonts.map((e=>e.param));e.loadGoogleFonts&&e.loadGoogleFonts(t)}},reduceGoogleFontList:function(){if(lsSliderData.googlefonts.length){var e=[],t=[];t=(t=lsSliderData.googlefonts.map((function(e){return e.param}))).filter((function(e,t,i){return t===i.indexOf(e)})),jQuery.each(t,(function(t,i){var a=!1;jQuery.each(lsSliderData.layers,(function(t,s){if(jQuery.each(s.sublayers,(function(t,s){if(s.styles&&s.styles["font-family"]&&-1!==s.styles["font-family"].indexOf(i))return a=!0,e.push({param:i}),!1})),a)return!1}))})),lsSliderData.googlefonts=e}},extractLayerFonts:function(e){let t=[];if(e?.styles?.["font-family"]){let i=e.styles["font-family"].split(",");jQuery.each(i,((e,i)=>{(i=(i=(i=(i=i.trim()).replace(/\+/g," ")).replace(/\"/g,"")).replace(/\'/g,""))&&t.push(i)}))}return t},extractSlideFonts:function(e){e=e||LS_activeSlideData;let t=[];return jQuery.each(e.sublayers,((e,i)=>{jQuery.merge(t,LayerSlider.extractLayerFonts(i))})),t=t.filter((function(e,t,i){return t===i.indexOf(e)})),t},extractProjectFonts:function(){let e=[];return jQuery.each(lsSliderData.layers,(function(t,i){jQuery.merge(e,LayerSlider.extractSlideFonts(i))})),e=e.filter((function(e,t,i){return t===i.indexOf(e)})),e},findGoogleFonts:function(e){if(!e||!e.length)return[];let t=[];return LS_FontData.fonts.forEach(((i,a)=>{-1!==e.indexOf(i.family)&&t.push(i.family)})),t},reindexProjectGoogleFonts:function(){let e,t;e=LayerSlider.extractProjectFonts(),e=LayerSlider.findGoogleFonts(e),t=lsSliderData.googlefonts.map((function(e){return e.param})),e.forEach(((e,i)=>{-1===t.indexOf(e)&&(lsSliderData.googlefonts.push({param:e}),LayerSlider.loadGoogleFonts(e))}))},addFontsLoadedEvent:function(){document.fonts&&document.fonts.ready&&window.Promise&&document.fonts.ready.then((function(){jQuery.each(LS_previewItems,(function(e,t){var i=LS_activeSlideData.sublayers[e],a=i.styles.top,s=i.styles.left;LayerSlider.setPositions(t,a,s)})),LayerSlider.updatePreviewSelection(),LS_loadedExternalFonts.length||(LS_loadedExternalFonts=LayerSlider.getExternalFonts())}))},getExternalFonts:function(){let e=document?.fonts?.entries(),t=["dashicons","FontAwesome","Font Awesome"],i=[],a=!1;for(;!a;){const t=e.next();if(t.done)a=t.done;else{let e=Array.isArray(t.value)?t.value[0].family:t.value.family;i.push(e)}}return i=[...new Set(i)],i=i.filter((e=>{excludeFont=!1;for(let i=0;i
{if(t.param){let e=i.indexOf(t.param);-1!==e&&i.splice(e,1)}})),i},startTransitionPreview:function(e){var t,i,a=jQuery(e),s=parseInt(a.data("key"))-1,r=a.closest(".lse-transitions-section").data("tr-type");"3d_transitions"==r?(t="3d",i=layerSliderTransitions["t"+t][s]):"2d_transitions"==r?(t="2d",i=layerSliderTransitions["t"+t][s]):"custom_3d_transitions"==r?(t="3d",i=layerSliderCustomTransitions["t"+t][s]):"custom_2d_transitions"==r&&(t="2d",
i=layerSliderCustomTransitions["t"+t][s]);let l=jQuery.extend(!0,{},{width:500,height:250,imgPath:"../assets/img/",skinPath:"../layerslider/skins/",transitionType:"2d",transitionObject:null,showCircleTimer:!1,pauseOnHover:!1,skin:"noskin",slidedelay:100,startInViewport:!1},{transitionType:t,transitionObject:i,imgPath:lsTrImgPath,skinsPath:pluginPath+"layerslider/skins/"});l.slideTransition={type:l.transitionType,obj:l.transitionObject};let o=jQuery("#lse-slide-transition-sample");jQuery(' \t\t\t\t \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t \t\t\t').appendTo(o),o.find(".lse-transition-preview-slider").layerSlider(l)},stopTransitionPreview:function(){var e=jQuery("#lse-slide-transition-sample").find(".lse-transition-preview-slider");e.length&&e.layerSlider("destroy",!0)},maybeShowScrollTransitionPreviewWarning:function(){if(LS_DataSource.projectHasScrollTransition()||LS_DataSource.projectIsScrollScene()){let e=parseInt(localStorage["lse-scroll-transition-preview-warning-count"])||0;(!LS_scrollTransitionPreviewWarningDisplayed||e<5)&&(localStorage["lse-scroll-transition-preview-warning-count"]=++e,LS_scrollTransitionPreviewWarningDisplayed=!0,lsEditor.notify.show({icon:"play-circle",text:LS_l10n.SLScrollTransitionPreviewWarning,timeout:3500}))}},maybeShowScrollSceneSlidesWarning:function(){let e=window.lsSliderData;return"scroll"===e.properties.scene&&e.layers.length>1&&(lsEditor.bottomNotification.open({uid:"scroll-scene-slides",content:LS_l10n.notifyScrollSceneSlides,color:""}),!0)},maybeShowEndingTransitionWarning:function(){let e=window.lsSliderData;if(e.meta.preventEndingTrWarning||e.layers.length<2)return!1;for(let t of e.layers)for(let e of t.sublayers)if(!e.transition?.transitionout&&void 0!==e.transition?.transitionout&&!e.transition?.texttransitionout&&"forever"!==e.transition?.static)return lsEditor.bottomNotification.open({uid:"missing-ending-transition",content:LS_l10n.notifyMissingEndingTr,color:"yellow",buttons:[{label:LS_l10n.notifyMissingEndingTrMore,href:"https://layerslider.com/blog/ending-transitions-in-layerslider-7-5-and-onwards/"},{label:LS_l10n.notifyMissingEndingTrFix,onClick:function(){lsCommon.smartAlert.confirm(LS_l10n.confirmMissingEndingTrFix,(()=>{LayerSlider.fixEndingTransitionIssues(),lsEditor.bottomNotification.close()}))}}],onDismiss:function(){lsCommon.smartAlert.confirm(LS_l10n.confirmMissingEndingTrDismiss,(()=>{window.lsSliderData.meta.preventEndingTrWarning=!0,lsSetEditorDirtyState(!0),lsEditor.bottomNotification.close()}))}}),!0;return!1},fixEndingTransitionIssues:function(){window.lsSliderData.layers.forEach((e=>{e.sublayers.forEach((e=>{e.transition?.transitionout||void 0===e.transition?.transitionout||e.transition?.texttransitionout||"forever"===e.transition?.static||(e.transition.transitionout=!0)}))})),lsSetEditorDirtyState(!0),jQuery("#lse-show-layer-settings").click(),jQuery("lse-layer-settings lse-subnav-item.lse-layer-transition-tab").click(),jQuery("#lse-transition-dropdown").click().find(".lse-ending-transition-option").click(),LS_DataSource.buildLayer()},getPreviewProjectSettings:function(e){e=e||{};var t=window.lsSliderData.properties,i=lsEditor.workspace.getSize();width=parseInt(i.width),height=parseInt(i.height),type=t.type||"responsive",scene=t.scene||!1,plugins="popup"===type?["popup"]:[],e&&e.plugins&&(e.plugins=jQuery.merge(e.plugins,plugins));var a=t.performanceMode;void 0!==t.performanceMode&&"inherit"!==t.performanceMode||(a=!!LS_pluginSettings.performanceMode);var s={type:type,scene:scene,width:width,height:height,popupWidth:width,popupHeight:height,sceneSpeed:t.sceneSpeed,sceneHeight:t.sceneHeight,stickTo:t.stickTo,smoothScrollDuration:t.smoothScrollDuration||1e3,skin:t.skin,skinsPath:pluginPath+"layerslider/skins/",allowFullscreen:!!t.allowFullscreen,autoStart:!!t.autostart,pauseOnHover:t.pauseonhover,firstSlide:t.firstlayer,shuffleSlideshow:!!t.randomslideshow,navPrevNext:!!t.navprevnext,hoverPrevNext:!!t.hoverprevnext,navStartStop:!!t.navstartstop,navButtons:!!t.navbuttons,hoverBottomNav:!!t.hoverbottomnav,showBarTimer:!!t.bartimer,showCircleTimer:!!t.circletimer,showSlideBarTimer:!!t.slidebartimer,thumbnailNavigation:t.thumb_nav,tnContainerWidth:t.thumb_container_width,tnFillMode:t.tnFillMode||"contain",tnWidth:t.thumb_width,tnHeight:t.thumb_height,tnActiveOpacity:t.thumb_active_opacity,tnInactiveOpacity:t.thumb_inactive_opacity,startInViewport:!1,autoPlayVideos:!!t.autoplayvideos,autoPauseSlideshow:t.autopauseslideshow,forceCycles:!!t.forceloopnum,slideBGSize:t.slideBGSize,slideBGPosition:t.slideBGPosition,globalBGColor:t.backgroundcolor,globalBGImage:t.backgroundimage,globalBGAttachment:t.globalBGAttachment,globalBGRepeat:t.globalBGRepeat,globalBGPosition:t.globalBGPosition,globalBGSize:t.globalBGSize,parallaxScrollReverse:t.parallaxScrollReverse,forceLayersOutDuration:t.forceLayersOutDuration||750,allowRestartOnResize:!!t.allowRestartOnResize,fixFloatedContainers:!!t.fixFloatedContainers,preferBlendMode:t.preferBlendMode,sliderFadeInDuration:t.sliderfadeinduration||350,animateFirstSlide:!!t.animateFirstSlide,firstSlideDuration:t.firstSlideDuration,firstSlideTimeShift:t.firstSlideTimeShift,scrollCenterLayers:t.scrollCenterLayers||"center",playByScroll:!!t.playByScroll,playByScrollStart:!!t.playByScrollStart,playByScrollSkipSlideBreaks:!!t.playByScrollSkipSlideBreaks,playByScrollSpeed:t.playByScrollSpeed||1,plugins:plugins,performanceMode:a,performanceModeTreshold:t.performanceModeTreshold||"20sh",popupShowOnce:!0,popupShowOnTimeout:.5,popupCloseOnTimeout:lsSliderData.properties.popupCloseOnTimeout,popupCloseOnSliderEnd:lsSliderData.properties.popupCloseOnSliderEnd,popupDisableOverlay:lsSliderData.properties.popupDisableOverlay,popupShowCloseButton:lsSliderData.properties.popupShowCloseButton,popupCloseButtonStyle:lsSliderData.properties.popupCloseButtonStyle,popupOverlayClickToClose:lsSliderData.properties.popupOverlayClickToClose,popupStartSliderImmediately:lsSliderData.properties.popupStartSliderImmediately,popupFitWidth:lsSliderData.properties.popupFitWidth,popupFitHeight:lsSliderData.properties.popupFitHeight,popupPositionHorizontal:lsSliderData.properties.popupPositionHorizontal,popupPositionVertical:lsSliderData.properties.popupPositionVertical,popupDistanceLeft:lsSliderData.properties.popupDistanceLeft,popupDistanceRight:lsSliderData.properties.popupDistanceRight,popupDistanceTop:lsSliderData.properties.popupDistanceTop,popupDistanceBottom:lsSliderData.properties.popupDistanceBottom,popupDurationIn:lsSliderData.properties.popupDurationIn,popupDurationOut:lsSliderData.properties.popupDurationOut,popupDelayIn:lsSliderData.properties.popupDelayIn,popupTransitionIn:lsSliderData.properties.popupTransitionIn,popupTransitionOut:lsSliderData.properties.popupTransitionOut,popupOverlayBackground:lsSliderData.properties.popupOverlayBackground,popupOverlayDurationIn:lsSliderData.properties.popupOverlayDurationIn,popupOverlayDurationOut:lsSliderData.properties.popupOverlayDurationOut,popupOverlayTransitionIn:lsSliderData.properties.popupOverlayTransitionIn,popupOverlayTransitionOut:lsSliderData.properties.popupOverlayTransitionOut};return t.maxRatio&&(s.maxRatio=t.maxRatio),"hero"===type&&(s.type="fullsize"),t.slideDuration&&(s.slideDuration=t.slideDuration),t.slideTransitionDuration&&(s.slideTransitionDuration=t.slideTransitionDuration),t.slideTimeShift&&(s.slideTimeShift=t.slideTimeShift),t.loops&&(s.cycles=t.loops),jQuery.extend(!0,s,e)},startProjectPreview:function(e){this.stopLayerPreview(),this.stopSlidePreview(),e=e||{};let t=jQuery("#lse-project-preview");$iframeContent=jQuery(t[0].contentDocument),$iframeBody=jQuery($iframeContent[0].body),$sliderWrapper=jQuery("#lse-project-wrapper",$iframeBody),iframeWindow=jQuery("#lse-project-preview")[0].contentWindow,iframejQuery=iframeWindow.jQuery,$sliderWrapper.html(""),LayerSlider.loadPreviewGoogleFonts();let i=LayerSlider.getPreviewProjectSettings();var a=window.lsSliderData.properties,s=a.sliderstyle,r="popup"===a.type?["popup"]:[],l=a.maxwidth||i.width||1920,o=jQuery('').appendTo($sliderWrapper);s&&o.attr("style",s),a.sliderclass&&o.addClass(a.sliderclass),"responsive"===i.type&&o.css("max-width",l),this.populateSliderPreview(o,r,{publishedSlidesOnly:!0,activeSlideOnly:!1,contentWindow:iframeWindow,skipDeviceLayers:!0,addDeviceLayersClasses:!0,addLayerActions:!0,allowScrollTransitions:!0,allowPinnedLayers:!0}),i.plugins=r,i.sliderFadeInDuration=0,e.projectSettings&&(i=jQuery.extend(!0,{},i,e.projectSettings)),iframeWindow.focus(),iframejQuery("body").attr("data-project-layout",a.type||"responsive").attr("data-project-scene",a.scene||""),iframejQuery("#lse-project-preview-content").on("sliderDidLoad.layerSlider",(function(){jQuery("#lse-make-project-scrollable").is(":checked")&&lsEditor.preview.setProjectScrollable(!0),window.top.lsEditor.loading.hide()})).layerSlider(i),iframejQuery("body").off("keyup.lsPreviewEscKey").on("keyup.lsPreviewEscKey",(function(e){27===e.which&&lsEditor.preview.exit()}))},stopProjectPreview:function(e){e=e||{},(0,jQuery("#lse-project-preview")[0].contentWindow.jQuery)("#lse-project-preview-content").layerSlider("destroy",!0)},startPopupPreview:function(e){this.stopLayerPreview(),this.stopSlidePreview(),e=e||{};var t=window.lsSliderData.properties,i=t.sliderstyle,a="popup"===t.type?["popup"]:[],s=jQuery('