import{j as s,_ as d}from"./main.2.8.1.js";import{u as j,h as P,d as i}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as I}from"./BackIcn._kGL_vVw.js";import{S as k}from"./SnackMsg.S8DrwLlT.js";import{I as v,g as N}from"./Integrations.D2bgBas2.js";import y from"./SeoPressAuthorization.B8oINpbI.js";import{S as C,c as f}from"./SeoPressIntegLayout.Dogrb8A5.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./ProUtilHelpers.fQlR3mWW.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";import"./GlobalIntegrationHelper.CgnhJgll.js";function J({formFields:g,setFlow:u,flow:x,allIntegURL:h}){const S=j(),{formID:m}=P(),[r,a]=i.useState(!1),[e,p]=i.useState(1),[b,o]=i.useState({show:!1}),[t,c]=i.useState({name:"SEOPress",type:"SeoPress",field_map:[{formField:"",seoPressField:""}],actions:{},mainAction:""}),l=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n!==3&&p(n),!f(t)){o({show:!0,msg:d("Please map all required fields to continue.","bit-integrations")});return}t.name!==""&&t.field_map.length>0&&p(n)};return s.jsxs("div",{children:[s.jsx(k,{snack:b,setSnackbar:o}),s.jsx("div",{className:"txt-center mt-2"}),s.jsx(y,{formID:m,seoPressConf:t,setSeoPressConf:c,step:e,nextPage:l,isLoading:r,setIsLoading:a,setSnackbar:o}),s.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"200px"},children:[s.jsx(C,{formID:m,formFields:g,seoPressConf:t,setSeoPressConf:c,setSnackbar:o,setIsLoading:a,isLoading:r}),s.jsx("br",{}),s.jsx("br",{}),s.jsx("br",{}),s.jsxs("button",{onClick:()=>l(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!f(t),children:[d("Next","bit-integrations"),s.jsx(I,{className:"ml-1 rev-icn"})]})]}),s.jsx(v,{step:e,saveConfig:()=>N(x,u,h,t,S,"","",a),isLoading:r})]})}export{J as default};
