!function(t){var e=t(document.getElementById("envira-admin-menu-tooltip")),n=(t(document.getElementById("adminmenuwrap")),t(document.querySelector(".menu-icon-envira")));if(0!==n.length){n.length&&n.append(e),e.css({top:-1*e.innerHeight()/2+"px"}),t("#envira-admin-menu-launch-tooltip-button").click(function(e){e.preventDefault(),t("#envira-admin-menu-tooltip").hide(),t.ajax({url:ajaxurl,type:"POST",data:{action:"envira_redirect_to_add_new_gallery"},success:function(t){if(t.success){let e=new URL(t.data.redirect_url);e.searchParams.append("hideTooltip","true"),window.location.href=e.toString()}else console.error("Error:",t.data)},error:function(e,t,n){console.error("AJAX request failed:",t,n)}})}),t(".envira-admin-menu-tooltip-close").on("click",function(e){e.preventDefault(),t(this).parent().parent().hide(),t.ajax({url:ajaxurl,type:"POST",data:{action:"envira_hide_admin_menu_tooltip"}})});const a=new URLSearchParams(window.location.search);"true"!==a.get("hideTooltip")&&"envira"!==a.get("post_type")||(t("#envira-admin-menu-tooltip").hide(),t(".menu-icon-envira .wp-submenu-wrap").css("display","block")),("envira"===a.get("post_type")&&"envira-gallery-settings"===a.get("page")||"envira"===a.get("post_type")&&"envira-gallery-addons"===a.get("page")||"envira"===a.get("post_type")&&"envira-gallery-get-started"===a.get("page")||"envira"===a.get("post_type")&&"envira-gallery-tools"===a.get("page"))&&t("#envira-admin-menu-tooltip").show()}}(jQuery);