var f=Object.defineProperty;var d=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var h=(s,e,t)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,b=(s,e)=>{for(var t in e||(e={}))j.call(e,t)&&h(s,t,e[t]);if(d)for(var t of d(e))N.call(e,t)&&h(s,t,e[t]);return s};import{j as a,_ as i,b as z}from"./main.2.8.10.js";import{b as w}from"./react-router.DMwpH23k.js";import{B as y}from"./BackIcn.BFDZx8No.js";import{y as v}from"./Note.DalStCGz.js";import{T as C}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function T({wordPressConf:s,setWordPressConf:e,step:t,nextPage:p,isLoading:r,setIsLoading:c,setSnackbar:m}){const[o,u]=w.useState(!1),x=()=>{c("auth"),z({},"wordpress_authorize").then(n=>{n!=null&&n.success?(u(!0),m({show:!0,msg:i("WordPress connected","bit-integrations")})):m({show:!0,msg:(n==null?void 0:n.data)||i("Authorization failed","bit-integrations")}),c(!1)})},g=n=>{const l=b({},s);l[n.target.name]=n.target.value,e(l)};return a.jsxs("div",{className:"btcd-stp-page",style:{width:t===1&&900,height:t===1&&"auto"},children:[a.jsx(C,{linkKey:"wordPress"}),a.jsx("div",{className:"mt-3",children:a.jsx("b",{children:i("Integration Name:","bit-integrations")})}),a.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:g,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),a.jsxs("button",{onClick:x,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r==="auth",children:[o?i("Connected","bit-integrations"):i("Connect to WordPress","bit-integrations"),r==="auth"&&a.jsx(v,{size:20,clr:"#022217",className:"ml-2"})]}),a.jsx("br",{}),a.jsxs("button",{onClick:()=>p(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),a.jsx(y,{className:"ml-1 rev-icn"})]})]})}export{T as default};
