(()=>{var e={184:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=a.apply(null,n);i&&e.push(i)}}else if("object"===r)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.domReady;var o=n.n(t);const a=window.React;var r=n.n(a);const i=window.wp.i18n,s=window.wp.components;var l=n(184),c=n.n(l);const p=()=>{const e=window.tpcPluginData,t=e.adminURL+"&onboarding=yes",[n,o]=(0,a.useState)(!1),[l,p]=(0,a.useState)(!1),[u,d]=(0,a.useState)(""),[w,v]=(0,a.useState)((null==e?void 0:e.cta)||"install"),f=c()(["button","button-primary","button-hero","install-now",n||l?"is-loading":""]);let g=(0,i.__)("Try one of our ready to use Starter Sites","neve");n&&(g=(0,i.__)("Installing","neve")),l&&(g=(0,i.__)("Activating","neve"));const m=n||l,y=()=>{o(!1),p(!0),v("activate");const t=(null==e?void 0:e.activate)||"";t?(async(e,t="")=>{const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","x-wp-nonce":t}};return await fetch(e,n).then((e=>e))})(t,e.nonce).then((e=>{e.ok?h():d((0,i.__)("Could not activate plugin.","neve"))})):window.location.href=e.pluginsURL},h=()=>{(async(e,t="",n="")=>{const o=new FormData;o.append("nonce",n),o.append("action",t);const a={method:"POST",body:o};return await fetch(e,a).then((()=>!0))})(e.ajaxURL,"neve_dismiss_welcome_notice",e.ajaxNonce).then((()=>{window.location.href=t}))};return r().createElement(r().Fragment,null,r().createElement(s.Button,{disabled:m,isPrimary:!m,isSecondary:m,className:f,icon:m&&"update",onClick:()=>{"deactivate"!==w?"activate"!==w?(o(!0),wp.updates.ajax("install-plugin",{slug:"templates-patterns-collection",success:()=>{y()},error:e=>{"folder_exists"===e.errorCode?y():d(e.errorMessage?e.errorMessage:(0,i.__)("Something went wrong while installing the plugin.","neve"))}})):y():h()},"data-is-react":!0,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",minWidth:"300px"}},g),u&&r().createElement("p",{className:"error",style:{margin:0,textAlign:"center",color:"#ff0000",backgroundColor:"#ff00000a",width:"330px"}},u))};o()((()=>{const t=document.getElementById("neve-ss-install");t&&(0,e.render)((0,e.createElement)(p,null),t)}))})()})();