(()=>{"use strict";document.addEventListener("DOMContentLoaded",(()=>{!function(){const{activating:t,installing:e,done:s,activationUrl:c,ajaxUrl:n,pluginSlug:a,nonce:i,pluginStatus:o}=spectraOne;let r;const d=document.querySelector(".swt-welcome-notice .notice-dismiss"),u=document.querySelector(".swt-welcome-notice"),l=document.querySelector(".swt-welcome-notice #swt-install-spectra");l&&(r=l.querySelector(".text"));const w=()=>{u&&u.remove()},m=async()=>{r.textContent=t,await async function(t){try{if(200===(await fetch(t)).status)return{success:!0}}catch(t){return{success:!1}}}(c),l.classList.remove("updating-message"),l.classList.add("updated-message"),r.textContent=s,setTimeout(w,2e3)};l&&l.addEventListener("click",(async()=>{l.classList.add("updating-message"),l.classList.add("disabled"),"installed"!==o?(r.textContent=e,await async function(t){return new Promise((e=>{wp.updates.ajax("install-plugin",{slug:t,success:()=>{e({success:!0})},error:t=>{e({success:!1,code:t.errorCode})}})}))}(a),await m()):await m()})),d.addEventListener("click",(async()=>{const t={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:`action=swt_dismiss_welcome_notice&nonce=${i}`};try{200===(await fetch(n,t)).status&&w()}catch(t){}}))}()}))})();