import{v as y,w as j,r as o,j as s,S}from"./main-40.js";import{S as w}from"./bf-679-136.js";import{s as A,b as I}from"./bf-132-75.js";import{I as v}from"./bf-94-335.js";import{N as b}from"./bf-504-404.js";import k from"./bf-44-254.js";import{h as Z}from"./bf-414-336.js";import{Z as N}from"./bf-855-337.js";/* empty css          */import"./bf-860-126.js";import"./bf-892-199.js";import"./bf-141-80.js";import"./bf-586-70.js";import"./bf-541-403.js";import"./bf-528-128.js";import"./bf-620-81.js";import"./bf-135-338.js";import"./bf-200-122.js";import"./bf-689-131.js";function Q({formFields:c,setIntegration:l,integrations:d,allIntegURL:f}){const h=y(),{formID:i}=j(),[m,n]=o.useState(!1),[e,p]=o.useState(1),[g,a]=o.useState({show:!1}),[t,r]=o.useState({name:"Zoho Analytics API",type:"Zoho Analytics",field_map:[{formField:"",zohoFormField:""}],actions:{}});o.useEffect(()=>{window.opener&&A("zohoAnalytics")},[]);const u=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t.workspace!==""&&t.table!==""&&t.field_map.length>0&&p(3)};return s.jsxs("div",{children:[s.jsx(S,{snack:g,setSnackbar:a}),s.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:s.jsx(w,{step:3,active:e})}),s.jsx(k,{formID:i,analyticsConf:t,setAnalyticsConf:r,step:e,setStep:p,isLoading:m,setisLoading:n,setSnackbar:a}),s.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"100%"},children:[s.jsx(N,{formID:i,formFields:c,handleInput:x=>Z(x,t,r,i,n,a),analyticsConf:t,setAnalyticsConf:r,isLoading:m,setisLoading:n,setSnackbar:a}),s.jsx(b,{nextPageHandler:()=>u(),disabled:t.workspace===""||t.table===""||t.field_map.length<1})]}),s.jsx(v,{step:e,saveConfig:()=>I(d,l,f,t,h)})]})}export{Q as default};
