import{j as e,_ as m}from"./main.2.8.10.js";import{u as j,e as b,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as k}from"./BackIcn.BFDZx8No.js";import{S as v}from"./SnackMsg.7BjcJK1j.js";import{S as B}from"./Steps.B84Ui3GU.js";import{I,g as S}from"./Integrations.BFhED4ck.js";import _ from"./BenchMarkAuthorization.CioU6uUk.js";import{c as M}from"./BenchMarkCommonFunc.C4otc7zJ.js";import{B as N}from"./BenchMarkIntegLayout.CIdJNlB6.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";function K({formFields:c,setFlow:d,flow:u,allIntegURL:f}){const g=j(),{formID:l}=b(),[o,r]=i.useState(!1),[s,p]=i.useState(1),[h,a]=i.useState({show:!1}),[t,n]=i.useState({name:"BenchMark",type:"BenchMark",api_secret:"",field_map:[{formField:"",benchMarkField:""}],actions:{}}),x=w=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300);{if(!M(t)){a({show:!0,msg:m("Please map all required fields to continue.","bit-integrations")});return}if(!(t!=null&&t.listId)){a({show:!0,msg:m("Please select list to continue.","bit-integrations")});return}t.name!==""&&t.field_map.length>0&&p(3)}};return e.jsxs("div",{children:[e.jsx(v,{snack:h,setSnackbar:a}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(B,{step:3,active:s})}),e.jsx(_,{formID:l,benchMarkConf:t,setBenchMarkConf:n,step:s,setstep:p,isLoading:o,setIsLoading:r,setSnackbar:a}),e.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto"},children:[e.jsx(N,{formID:l,formFields:c,benchMarkConf:t,setBenchMarkConf:n,isLoading:o,setIsLoading:r,setSnackbar:a}),e.jsxs("button",{onClick:()=>x(),disabled:!(t!=null&&t.listId)||t.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[m("Next","bit-integrations"),"  ",e.jsx(k,{className:"ml-1 rev-icn"})]})]}),e.jsx(I,{step:s,saveConfig:()=>S(u,d,f,t,g,"","",r),isLoading:o,dataConf:t,setDataConf:n,formFields:c})]})}export{K as default};
