import{r as m,j as t}from"./main-333.js";import{B as N}from"./bi.429.767.js";import{_ as a,L as k,b as y,z as v}from"./bi.636.93.js";import{a as w,b as z}from"./bi.307.905.js";import{T as h,t as A}from"./bi.318.783.js";function I({formID:L,mailMintConf:i,setMailMintConf:r,step:c,setStep:d,isLoading:l,setIsLoading:n,setSnackbar:b}){const[o,p]=m.useState(!1),[x,g]=m.useState(!1),{mailMint:e}=A,f=()=>{n("auth"),y({},"mailmint_authorize").then(s=>{s!=null&&s.success&&(p(!0),b({show:!0,msg:a("Connected with Mail Mint Successfully","bit-integrations")})),n(!1),g(!0),w(i,r,n),z(i,r,n)})},j=s=>{const u=v(i);u[s.target.name]=s.target.value,r(u)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:c===1&&900,height:c===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(h,{title:"Mail Mint",youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(h,{title:"Mail Mint",docLink:e==null?void 0:e.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:i.name,type:"text",placeholder:a("Integration Name...","bit-integrations")}),l==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(k,{size:25,clr:"#022217",className:"mr-2"}),"Checking if Mail Mint is active!!!"]}),x&&!o&&!l&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),"Mail Mint plugin must be activated to integrate with Bit Integrations."]}),!o&&t.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:a("Connect","bit-integrations")}),o&&t.jsxs("button",{onClick:()=>d(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!o,children:[a("Next","bit-integrations"),t.jsx(N,{className:"ml-1 rev-icn"})]})]})}export{I as default};
