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