!function(){"use strict";document.addEventListener("DOMContentLoaded",(()=>{!function(e){const{activating:t,installing:s,done:o,activationUrl:n,ajaxUrl:a,nonce:c,otterRefNonce:i,otterStatus:r}=forkData,d=e(".fork-welcome-notice #fork-install-otter"),l=e(".fork-welcome-notice .notice-dismiss"),u=e(".fork-welcome-notice"),f=d.find(".text"),m=d.find(".dashicons"),w=()=>{u.fadeTo(100,0,(()=>{u.slideUp(100,(()=>{u.remove()}))}))},k=async()=>{var s;f.text(t),await(s=n,new Promise((e=>{jQuery.get(s).done((()=>{e({success:!0})})).fail((()=>{e({success:!1})}))}))),await e.post(a,{nonce:i,action:"fork_set_otter_ref"}),m.removeClass("dashicons-update"),m.addClass("dashicons-yes"),f.text(o),setTimeout(w,1500)};e(d).on("click",(async()=>{m.removeClass("hidden"),d.attr("disabled",!0),"installed"!==r?(f.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 k()):await k()})),e(l).on("click",(()=>{e.post(a,{nonce:c,action:"fork_dismiss_welcome_notice",success:w})}))}(jQuery)}))}();