var C=Object.defineProperty;var y=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var I=(a,t,s)=>t in a?C(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,N=(a,t)=>{for(var s in t||(t={}))E.call(t,s)&&I(a,s,t[s]);if(y)for(var s of y(t))O.call(t,s)&&I(a,s,t[s]);return a};import{j as i,_ as l,z as c}from"./main.2.8.1.js";import{u as P,d as o}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as z}from"./SnackMsg.S8DrwLlT.js";import{S as L}from"./Steps.1hz7v9Vj.js";import{I as M,g as A}from"./Integrations.D2bgBas2.js";import F from"./SystemeIOAuthorization.BVqXYm5v.js";import{b as q,c as k}from"./SystemeIOCommonFunc.8zywhAgK.js";import{S as B}from"./SystemeIOIntegLayout.w-D9vWnz.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function te({formFields:a,setFlow:t,flow:s,allIntegURL:g}){const u=P(),[f,m]=o.useState(!1),[b,S]=o.useState({}),[r,x]=o.useState(1),[_,p]=o.useState({show:!1}),h=[{label:"Email Address",key:"email",required:!0}],[e,d]=o.useState({name:"SystemeIO",type:"SystemeIO",api_key:"",field_map:q(h),actionName:"registerPeopletoWabinar",systemeIOFields:h,actions:{}}),w=()=>{m(!0),A(s,t,g,e,u,"","",m).then(n=>{var j;n.success?(c.success((j=n.data)==null?void 0:j.msg),u(g)):c.error(n.data||n)})},T=v=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!k(e)){c.error(l("Please map mandatory fields","bit-integrations"));return}if(!e.selectedTag){c.error(l("Please select a Tag","bit-integrations"));return}e.field_map.length>0&&x(v)};return i.jsxs("div",{children:[i.jsx(z,{snack:_,setSnackbar:p}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(L,{step:3,active:r})}),i.jsx(F,{systemeIOConf:e,setSystemeIOConf:d,step:r,setStep:x,loading:b,setLoading:S,setSnackbar:p}),i.jsxs("div",{className:"btcd-stp-page",style:N({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[i.jsx(B,{formFields:a,systemeIOConf:e,setSystemeIOConf:d,loading:b,setLoading:S,isLoading:f,setIsLoading:m,setSnackbar:p}),(e==null?void 0:e.actionName)&&i.jsxs("button",{onClick:()=>T(3),disabled:!k(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:r,saveConfig:()=>w(),isLoading:f,dataConf:e,setDataConf:d,formFields:a})]})}export{te as default};
