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