var y=Object.defineProperty;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(a,s,e)=>s in a?y(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e,x=(a,s)=>{for(var e in s||(s={}))w.call(s,e)&&b(a,e,s[e]);if(h)for(var e of h(s))C.call(s,e)&&b(a,e,s[e]);return a};import{j as t,_ as i,b as M}from"./main.2.9.0.js";import{b as u}from"./react-router.DMwpH23k.js";import{B as k}from"./BackIcn._8Wofmn2.js";import{y as z}from"./Note.NSUdvR3c.js";import{T as P}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function F({formID:a,mailerPressConf:s,setMailerPressConf:e,step:l,nextPage:p,isLoading:c,setIsLoading:o,setSnackbar:j}){const[r,f]=u.useState(!1),[d,g]=u.useState(!1),N=()=>{o("auth"),M({},"mailer_press_authorize").then(n=>{n!=null&&n.success&&(f(!0),j({show:!0,msg:i("Connected with MailerPress Successfully","bit-integrations")})),o(!1),g(!0)})},v=n=>{const m=x({},s);m[n.target.name]=n.target.value,e(m)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[t.jsx(P,{linkKey:"mailerPress"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:v,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(z,{size:25,clr:"#022217",className:"mr-2"}),i("Checking if MailerPress is active!!!","bit-integrations")]}),d&&!r&&!c&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:i("MailerPress is not activated or not installed","bit-integrations")})]})}),d&&r&&!c&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:i("MailerPress is activated","bit-integrations")})]}),t.jsx("button",{onClick:N,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r,children:r?i("Connected","bit-integrations"):i("Connect to MailerPress","bit-integrations")}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>p(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]})}export{F as default};
