var main_tour=new Shepherd.Tour;main_tour.options.defaults={classes:"shepherd-theme-arrows shepherd-main-tour",showCancelLink:!0},main_tour.can_still_go_back=!0;var skip_button=jQuery(".metaslider-ui .slide").length?[{text:metaslider_tour.main_tour.skip_language,action:function(){main_tour.show("step_preview_slideshow")}}]:[];main_tour.addStep("step_add_slide",{title:metaslider_tour.main_tour.step1.title,text:metaslider_tour.main_tour.step1.message,attachTo:"button.add-slide bottom",classes:"shepherd-theme-arrows shepherd-main-tour super-index",tetherOptions:{offset:"-5px 0"},buttons:skip_button}),main_tour.addStep("step_show_slide_types",{title:metaslider_tour.main_tour.step2a.title,text:metaslider_tour.main_tour.step2a.message,attachTo:".media-menu right",classes:"shepherd-theme-arrows shepherd-main-tour super-index",tetherOptions:{constraints:null,attachment:"top left",targetAttachment:"top right",targetOffset:"10% -35px"},buttons:[{text:metaslider_tour.main_tour.next_language,action:function(){main_tour.next()}}]}),main_tour.addStep("step_add_media",{title:metaslider_tour.main_tour.step2b.title,text:metaslider_tour.main_tour.step2b.message,attachTo:".media-modal.wp-core-ui top",classes:"shepherd-theme-arrows shepherd-main-tour super-index",tetherOptions:{targetAttachment:"bottom right",offset:"50px 140px"},buttons:[]}),main_tour.addStep("step_preview_slideshow",{title:metaslider_tour.main_tour.step3.title,text:metaslider_tour.main_tour.step3.message,attachTo:".metaslider-actions left",classes:"shepherd-theme-arrows shepherd-main-tour",tetherOptions:{offset:"0 5px"},buttons:[{text:metaslider_tour.main_tour.next_language,action:function(){main_tour.next()}}]}),main_tour.addStep("step_edit_settings",{title:metaslider_tour.main_tour.step4.title,text:metaslider_tour.main_tour.step4.message,attachTo:"#metaslider_configuration left",classes:"shepherd-theme-arrows shepherd-main-tour",scrollTo:!0,tetherOptions:{offset:"0 5px"},buttons:[{text:metaslider_tour.main_tour.next_language,action:function(){main_tour.next()}}]}),main_tour.addStep("step_view_shortcode",{title:metaslider_tour.main_tour.step5.title,text:metaslider_tour.main_tour.step5.message,attachTo:".metaslider-shortcode bottom",classes:"shepherd-theme-arrows shepherd-main-tour",when:{show:function(){window.scrollTo(0,0)}},tetherOptions:{offset:"-5px 0"},buttons:[{text:metaslider_tour.main_tour.step5.button,action:main_tour.cancel}]}),main_tour.addStep("step_show_ad",{title:metaslider_tour.main_tour.final_ad.title,text:metaslider_tour.main_tour.final_ad.message,classes:"shepherd-theme-arrows shepherd-main-tour super-index",showCancelLink:!1,buttons:[{text:metaslider_tour.main_tour.learn_more_language,action:function(){window.open(metaslider_tour.main_tour.upgrade_link,"_blank").focus()},classes:"btn-cta-gradient"},{text:metaslider_tour.main_tour.final_ad.button,action:function(){jQuery("#wpwrap, .media-modal").removeClass("blurred-out"),main_tour.hide()}}]}),main_tour.on("cancel",function(){main_tour.can_still_go_back=!1;var t={action:"set_tour_status",_wpnonce:metaslider_tour.main_tour.nonce,current_step:this.getCurrentStep().id};jQuery.ajax({url:metaslider.ajaxurl,data:t,type:"POST",error:function(t){console.log("Tour error: "+t.responseJSON.data.message)},success:function(t){}})}),jQuery(function(t){t(window).bind("load",function(){metaslider_tour.main_tour.show&&main_tour.start()})}),jQuery(function(t){metaslider_tour.main_tour.show&&(t("body").on("click",".add-slide.shepherd-target",function(e){window.setTimeout(function(){main_tour.can_still_go_back&&main_tour.show("step_show_slide_types");var e=function(){t(".media-button").on("click",function(t){main_tour.can_still_go_back&&main_tour.show("step_preview_slideshow"),main_tour.can_still_go_back=!1})};e(),metaslider_tour.main_tour.is_pro||t(".media-menu-item").on("click",function(a){e(),t(".media-menu-item").eq(0).is(this)?main_tour.show("step_add_media"):main_tour.hide()})},500)}),t("body").on("click",".media-modal-close, .media-modal-backdrop",function(e){var a=t(".metaslider-slides-container .slide").length;metaslider_tour.main_tour.is_pro&&a&&(main_tour.can_still_go_back&&main_tour.show("step_preview_slideshow"),main_tour.can_still_go_back=!1),main_tour.can_still_go_back&&main_tour.show("step_add_slide")}),t(document).keyup(function(t){27==t.keyCode&&"add-media"===main_tour.getCurrentStep().id&&main_tour.can_still_go_back&&main_tour.show("step_add_slide")}))});