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