!function(){"use strict";document.addEventListener("DOMContentLoaded",(()=>{!function(e){const{activating:s,installing:t,done:a,activationUrl:n,ajaxUrl:o,nonce:c,otterStatus:i}=jaxonData,d=e(".jaxon-welcome-notice #jaxon-install-otter"),l=e(".jaxon-welcome-notice .notice-dismiss"),r=e(".jaxon-welcome-notice"),u=d.find(".text"),m=d.find(".dashicons"),x=()=>{r.fadeTo(100,0,(()=>{r.slideUp(100,(()=>{r.remove()}))}))},w=async()=>{var e;u.text(s),await(e=n,new Promise((s=>{jQuery.get(e).done((()=>{s({success:!0})})).fail((()=>{s({success:!1})}))}))),m.removeClass("dashicons-update"),m.addClass("dashicons-yes"),u.text(a),setTimeout(x,1500)};e(d).on("click",(async()=>{m.removeClass("hidden"),d.attr("disabled",!0),"installed"!==i?(u.text(t),await new Promise((e=>{wp.updates.ajax("install-plugin",{slug:"otter-blocks",success:()=>{e({success:!0})},error:s=>{e({success:!1,code:s.errorCode})}})})),await w()):await w()})),e(l).on("click",(()=>{e.post(o,{nonce:c,action:"jaxon_dismiss_welcome_notice",success:x})}))}(jQuery)}))}();