var T=Object.defineProperty;var j=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(a,t,s)=>t in a?T(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,I=(a,t)=>{for(var s in t||(t={}))C.call(t,s)&&y(a,s,t[s]);if(j)for(var s of j(t))E.call(t,s)&&y(a,s,t[s]);return a};import{u as O,r as n,j as i}from"./main-406.js";import{d as P,_ as L,I as M,G as A,c}from"./bi.394.85.js";import{S as F}from"./bi.68.941.js";import q from"./bi.762.336.js";import{b as z,c as N}from"./bi.145.928.js";import{S as B}from"./bi.594.929.js";import"./bi.150.760.js";function V({formFields:a,setFlow:t,flow:s,allIntegURL:p}){const g=O(),[u,d]=n.useState(!1),[f,x]=n.useState({}),[o,S]=n.useState(1),[k,l]=n.useState({show:!1}),b=[{label:"Email Address",key:"email",required:!0}],[e,m]=n.useState({name:"SystemeIO",type:"SystemeIO",api_key:"",field_map:z(b),actionName:"registerPeopletoWabinar",systemeIOFields:b,actions:{}}),_=()=>{d(!0),A(s,t,p,e,g,"","",d).then(r=>{var v;r.success?(c.success((v=r.data)==null?void 0:v.msg),g(p)):c.error(r.data||r)})},w=h=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!N(e)){c.error("Please map mandatory fields");return}if(!e.selectedTag){c.error("Please select a Tag");return}e.field_map.length>0&&S(h)};return i.jsxs("div",{children:[i.jsx(P,{snack:k,setSnackbar:l}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(F,{step:3,active:o})}),i.jsx(q,{systemeIOConf:e,setSystemeIOConf:m,step:o,setStep:S,loading:f,setLoading:x,setSnackbar:l}),i.jsxs("div",{className:"btcd-stp-page",style:I({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[i.jsx(B,{formFields:a,systemeIOConf:e,setSystemeIOConf:m,loading:f,setLoading:x,isLoading:u,setIsLoading:d,setSnackbar:l}),(e==null?void 0:e.actionName)&&i.jsxs("button",{onClick:()=>w(3),disabled:!N(e),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[L("Next","bit-integrations")," "," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),(e==null?void 0:e.actionName)&&i.jsx(M,{step:o,saveConfig:()=>_(),isLoading:u,dataConf:e,setDataConf:m,formFields:a})]})}export{V as default};
