(()=>{var e={184:(e,t)=>{var n;!function(){"use strict";var a={}.hasOwnProperty;function o(){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=o.apply(null,n);i&&e.push(i)}}else if("object"===r)if(n.toString===Object.prototype.toString)for(var s in n)a.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={exports:{}};return e[a](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 a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.domReady;var a=n.n(t);const o=window.React;var r=n.n(o);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,[n,a]=(0,o.useState)(!1),[l,p]=(0,o.useState)(!1),[u,d]=(0,o.useState)(""),[w,v]=(0,o.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.__)("Let's Get Started with Starter Templates","neve");n&&(g=(0,i.__)("Installing","neve")),l&&(g=(0,i.__)("Activating","neve"));const m=n||l,h=()=>{a(!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?y():d((0,i.__)("Could not activate plugin.","neve"))})):window.location.href=e.pluginsURL},y=()=>{(async(e,t="",n="")=>{const a=new FormData;a.append("nonce",n),a.append("action",t);const o={method:"POST",body:a};return await fetch(e,o).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?(a(!0),wp.updates.ajax("install-plugin",{slug:"templates-patterns-collection",success:()=>{h()},error:e=>{"folder_exists"===e.errorCode?h():d(e.errorMessage?e.errorMessage:(0,i.__)("Something went wrong while installing the plugin.","neve"))}})):h():y()},"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))};a()((()=>{const t=document.getElementById("neve-ss-install");t&&(0,e.render)((0,e.createElement)(p,null),t)}))})()})();