import{j as t,_ as e,s as f,b as j}from"./main.2.9.0.js";import{b as c}from"./react-router.DMwpH23k.js";import{B as N}from"./BackIcn._8Wofmn2.js";import{y,x as v}from"./Note.NSUdvR3c.js";import{T as w}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function I({formID:P,paidMembershipProConf:a,setPaidMembershipProConf:l,step:n,setStep:h,isLoading:r,setIsLoading:o,setSnackbar:p}){const[i,d]=c.useState(!1),[b,u]=c.useState(!1),x=()=>{o("auth"),j({},"paid_membership_pro_authorize").then(s=>{s!=null&&s.success&&(d(!0),p({show:!0,msg:e("Connected with Paid Membership Pro Successfully","bit-integrations")})),o(!1),u(!0)})},g=s=>{const m=v(a);m[s.target.name]=s.target.value,l(m)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[t.jsx(w,{linkKey:"paidMembershipPro"}),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:g,name:"name",value:a.name,type:"text",placeholder:e("Integration Name...","bit-integrations")}),r==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(y,{size:25,clr:"#022217",className:"mr-2"}),e("Checking if Paid Membership Pro is active!!!","bit-integrations")]}),b&&!i&&!r&&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:"×"}),f(e("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"Paid Membership Pro")]}),!i&&t.jsx("button",{onClick:x,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:e("Connect","bit-integrations")}),i&&t.jsxs("button",{onClick:()=>h(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!i,children:[e("Next","bit-integrations"),t.jsx(N,{className:"ml-1 rev-icn"})]})]})}export{I as default};
