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.9.0.js";import{u as P,b as o}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as z}from"./SnackMsg.DYSD96P4.js";import{S as L}from"./Steps.BYe8zHkm.js";import{I as M,g as A}from"./Integrations.DL8wqGct.js";import F from"./SystemeIOAuthorization.KmuxQ-vw.js";import{b as q,c as k}from"./SystemeIOCommonFunc.DDFI0rCr.js";import{S as B}from"./SystemeIOIntegLayout.DJlMq9jG.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.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};
