import{j as t,_ as e,s as N,d as y}from"./main.2.8.1.js";import{d as u}from"./react-router-dom.9mCuUg3q.js";import{B as k}from"./BackIcn._kGL_vVw.js";import{z as v,y as w}from"./Note.BeM7sN-p.js";import{a as z,b as A}from"./MailMintCommonFunc.CI78okJ9.js";import{t as S}from"./tutorialLinks.kMkIDzcD.js";import{T as h}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function F({formID:T,mailMintConf:a,setMailMintConf:o,step:c,setStep:d,isLoading:l,setIsLoading:n,setSnackbar:p}){const[r,b]=u.useState(!1),[g,x]=u.useState(!1),{mailMint:s}=S,f=()=>{n("auth"),y({},"mailmint_authorize").then(i=>{i!=null&&i.success&&(b(!0),p({show:!0,msg:e("Connected with Mail Mint Successfully","bit-integrations")})),n(!1),x(!0),z(a,o,n),A(a,o,n)})},j=i=>{const m=w(a);m[i.target.name]=i.target.value,o(m)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:c===1&&900,height:c===1&&"auto"},children:[t.jsx(h,{title:"Mail Mint",youTubeLink:s==null?void 0:s.youTubeLink}),t.jsx(h,{title:"Mail Mint",docLink:s==null?void 0:s.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:a.name,type:"text",placeholder:e("Integration Name...","bit-integrations")}),l==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(v,{size:25,clr:"#022217",className:"mr-2"}),e("Checking if Mail Mint is active!!!","bit-integrations")]}),g&&!r&&!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:"×"}),N(e("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"Mail Mint")]}),!r&&t.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:e("Connect","bit-integrations")}),r&&t.jsxs("button",{onClick:()=>d(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!r,children:[e("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]})}export{F as default};
