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