import{j as t,_ as u}from"./main.2.9.0.js";import{u as N,e as T,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as S}from"./BackIcn._8Wofmn2.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{I as C,g as k}from"./Integrations.DL8wqGct.js";import v from"./NinjaTablesAuthorization.Cm1uz9ax.js";import{N as y,c as d}from"./NinjaTablesIntegLayout.Cru2DSgx.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";function K({formFields:c,setFlow:b,flow:g,allIntegURL:j}){const x=N(),{formID:p}=T(),[n,o]=i.useState(!1),[e,l]=i.useState(1),[h,a]=i.useState({show:!1}),[s,r]=i.useState({name:"Ninja Tables",type:"Ninja Tables",field_map:[{formField:"",columnName:""}],actions:{},mainAction:"",default:{}}),f=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m===3){if(!d(s)){a({show:!0,msg:u("Please select all required options to continue.","bit-integrations")});return}s.name!==""&&l(m)}else l(m)};return t.jsxs("div",{children:[t.jsx(I,{snack:h,setSnackbar:a}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(v,{formID:p,ninjaTablesConf:s,setNinjaTablesConf:r,step:e,nextPage:f,isLoading:n,setIsLoading:o,setSnackbar:a}),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,ninjaTablesConf:s,setNinjaTablesConf:r,setSnackbar:a,setIsLoading:o,isLoading:n}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>f(3),disabled:!d(s),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:e,saveConfig:()=>k(g,b,j,s,x,"","",o),isLoading:n,dataConf:s,setDataConf:r,formFields:c})]})}export{K as default};
