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