import{j as t,_ as u}from"./main.2.9.0.js";import{u as D,e as I,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as S}from"./BackIcn._8Wofmn2.js";import{S as w}from"./SnackMsg.DYSD96P4.js";import{I as C,g as k}from"./Integrations.DL8wqGct.js";import v from"./WeDocsAuthorization.B6PSyPnd.js";import{c as f}from"./WeDocsCommonFunc.DFNWidWd.js";import{W as N}from"./WeDocsIntegLayout.CYZ1wGf8.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./ProUtilHelpers.CHf_DzPf.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.B6YI8w_n.js";function K({formFields:m,setFlow:g,flow:x,allIntegURL:b}){const h=D(),{formID:p}=I(),[a,n]=i.useState(!1),[s,d]=i.useState(1),[j,o]=i.useState({show:!1}),[e,r]=i.useState({name:"weDocs",type:"weDocs",field_map:[],weDocsFields:[],actions:{},mainAction:"",selectedDocumentationId:"",selectedSectionId:"",documentations:[],sections:[]}),l=c=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),c===3){if(!f(e)){o({show:!0,msg:u("Please complete all required fields to continue.","bit-integrations")});return}e.name!==""&&d(c);return}d(c)};return t.jsxs("div",{children:[t.jsx(w,{snack:j,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(v,{formID:p,weDocsConf:e,setWeDocsConf:r,step:s,nextPage:l,isLoading:a,setIsLoading:n,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"500px"},children:[t.jsx(N,{formID:p,formFields:m,weDocsConf:e,setWeDocsConf:r,setSnackbar:o,setIsLoading:n,isLoading:a}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>l(3),disabled:!e.mainAction||!f(e),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[u("Next","bit-integrations"),t.jsx(S,{className:"ml-1 rev-icn"})]})]}),t.jsx(C,{step:s,saveConfig:()=>k(x,g,b,e,h,"","",n),isLoading:a,dataConf:e,setDataConf:r,formFields:m})]})}export{K as default};
