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