import{j as t,_ as p}from"./main.2.9.0.js";import{u as b,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as j}from"./BackIcn._8Wofmn2.js";import{S}from"./SnackMsg.DYSD96P4.js";import{S as v}from"./Steps.BYe8zHkm.js";import{I,s as M}from"./Integrations.DL8wqGct.js";import k from"./MauticAuthorization.Df63fNPp.js";import{s as C,h as w,c as N}from"./MauticCommonFunc.wfqac_13.js";import{M as y}from"./MauticIntegLayout.ISNH2Wr4.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({formFields:c,setFlow:l,flow:u,allIntegURL:d}){const f=b(),[n,r]=i.useState(!1),[s,m]=i.useState(1),[g,a]=i.useState({show:!1}),[e,o]=i.useState({name:"Mautic",type:"Mautic",clientId:"",clientSecret:"",baseUrl:"",field_map:[{formField:"",mauticField:""}],actions:{}});i.useEffect(()=>{window.opener&&C("mautic")},[]);const h=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!N(e)){a({show:!0,msg:p("Please map fields to continue.","bit-integrations")});return}m(3)};return t.jsxs("div",{children:[t.jsx(S,{snack:g,setSnackbar:a}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(v,{step:3,active:s})}),t.jsx(k,{mauticConf:e,setMauticConf:o,step:s,setstep:m,isLoading:n,setIsLoading:r,setSnackbar:a}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto"},children:[t.jsx(y,{formFields:c,handleInput:x=>w(x,e,o),mauticConf:e,setMauticConf:o,isLoading:n,setIsLoading:r,setSnackbar:a}),t.jsxs("button",{onClick:()=>h(),disabled:e.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[p("Next","bit-integrations"),t.jsx(j,{className:"ml-1 rev-icn"})]})]}),t.jsx(I,{step:s,saveConfig:()=>M({flow:u,setFlow:l,allIntegURL:d,navigate:f,conf:e,setIsLoading:r,setSnackbar:a}),isLoading:n,dataConf:e,setDataConf:o,formFields:c})]})}export{O as default};
