(()=>{"use strict";const e=window.wp.element;function t(){const{currentProduct:t,logoUrl:a,strings:n,links:l}=window.tiSDKAboutData;return(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"head"},(0,e.createElement)("div",{className:"container"},(0,e.createElement)("img",{src:a,alt:t.name}),(0,e.createElement)("p",null,"by ",(0,e.createElement)("a",{href:"https://themeisle.com"},"Themeisle")))),l.length>0&&(0,e.createElement)("div",{className:"container"},(0,e.createElement)("ul",{className:"nav"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:window.location},n.aboutUs)),l.map(((t,a)=>(0,e.createElement)("li",{key:a},(0,e.createElement)("a",{href:t.url},t.text)))))))}const a=window.wp.components;function n(){const{strings:t,teamImage:n,homeUrl:l,pageSlug:c}=window.tiSDKAboutData,{heroHeader:s,heroTextFirst:r,heroTextSecond:i,teamImageCaption:o,newsHeading:m,emailPlaceholder:u,signMeUp:d}=t,[E,p]=(0,e.useState)(""),[h,v]=(0,e.useState)(!1),[g,w]=(0,e.useState)(!1);return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"story-card"},(0,e.createElement)("div",{className:"body"},(0,e.createElement)("div",null,(0,e.createElement)("h2",null,s),(0,e.createElement)("p",null,r),(0,e.createElement)("p",null,i)),(0,e.createElement)("figure",null,(0,e.createElement)("img",{src:n,alt:o}),(0,e.createElement)("figcaption",null,o))),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("h2",null,m),(0,e.createElement)("form",{onSubmit:e=>{var t;e.preventDefault(),v(!0),null===(t=fetch("https://api.themeisle.com/tracking/subscribe",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, */*;q=0.1","Cache-Control":"no-cache"},body:JSON.stringify({slug:"about-us",site:l,from:c,email:E})}).then((e=>e.json())).then((e=>{v(!1),"success"===e.code&&w(!0)})))||void 0===t||t.catch((e=>{v(!1)}))}},(0,e.createElement)("input",{disabled:h||g,type:"email",value:E,onChange:e=>{p(e.target.value)},placeholder:u}),!h&&!g&&(0,e.createElement)(a.Button,{isPrimary:!0,type:"submit"},d),h&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"}),g&&(0,e.createElement)("span",{className:"dashicons dashicons-yes-alt"})))))}function l(t){let{product:n,slug:l}=t;const{icon:c,name:s,description:r,status:i,premiumUrl:o,activationLink:m}=n,{strings:u}=window.tiSDKAboutData,{installNow:d,installed:E,notInstalled:p,active:h,activate:v,learnMore:g}=u,w=!!o,[N,y]=(0,e.useState)(i),[b,f]=(0,e.useState)(!1);return(0,e.createElement)("div",{className:"product-card"},(0,e.createElement)("div",{className:"header"},c&&(0,e.createElement)("img",{src:c,alt:s}),(0,e.createElement)("h2",null,s)),(0,e.createElement)("div",{className:"body"},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:r}})),(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("p",null,"Status:"," ",(0,e.createElement)("span",{className:N},"installed"===N&&E,"not-installed"===N&&p,"active"===N&&h)),"active"!==N&&!b&&(0,e.createElement)(e.Fragment,null,"not-installed"===N&&w&&(0,e.createElement)(a.Button,{isLink:!0,icon:"external",href:o,target:"_blank"},g),"not-installed"===N&&!w&&(0,e.createElement)(a.Button,{isPrimary:!0,onClick:async()=>{f(!0),await function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((a=>{wp.updates.ajax(!0===t?"install-theme":"install-plugin",{slug:e,success:()=>{a({success:!0})},error:e=>{a({success:!1,code:e.errorCode})}})}))}(l,"neve"===l).then((e=>{e.success&&y("installed")})),f(!1)}},d),"installed"===N&&(0,e.createElement)(a.Button,{isSecondary:!0,onClick:async()=>{f(!0),window.location.href=m}},v)),b&&(0,e.createElement)("span",{className:"dashicons dashicons-update spin"})))}function c(){const{products:t}=window.tiSDKAboutData;return(0,e.createElement)("div",{className:"container"},(0,e.createElement)("div",{className:"product-cards"},Object.keys(t).map(((a,n)=>(0,e.createElement)(l,{key:a,slug:a,product:t[a]})))))}document.addEventListener("DOMContentLoaded",(()=>{const a=document.querySelector("#ti-sdk-about");a&&(0,e.render)((0,e.createElement)("div",{className:"ti-about"},(0,e.createElement)(t,null),(0,e.createElement)(n,null),(0,e.createElement)(c,null)),a)}))})();