var y=Object.defineProperty;var d=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var f=(t,s,e)=>s in t?y(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,u=(t,s)=>{for(var e in s||(s={}))N.call(s,e)&&f(t,e,s[e]);if(d)for(var e of d(s))I.call(s,e)&&f(t,e,s[e]);return t};import{G as b,r,a as F,j as a,S as w,U as C,h as _,_ as L,z as q}from"./main-343.js";import{B as z}from"./bf-649-79.js";import{S as B}from"./bf-149-261.js";import{a7 as M}from"./bf-659-81.js";import{I as P}from"./bf-58-184.js";import R from"./bf-938-118.js";import{h as T,c as A}from"./bf-628-173.js";import{E as G}from"./bf-182-207.js";import"./bf-974-82.js";import"./bf-713-109.js";import"./bf-594-113.js";function $({formFields:t,setIntegration:s,integrations:e,allIntegURL:E}){const h=b(),[n,m]=r.useState(!1),[l,p]=r.useState(1),[x,g]=r.useState({show:!1}),{css:j}=F(),v=[{key:"Email",label:"Email",required:!0},{key:"FirstName",label:"FirstName",required:!1},{key:"LastName",label:"LastName",required:!1}],[i,o]=r.useState({name:"ElasticEmail",type:"ElasticEmail",api_key:"",field_map:[{formField:"",elasticEmailField:""}],actions:{},elasticEmailFields:v}),S=()=>{M(e,s,E,i,h)},k=c=>{if(!A(i)){q.error("Please map mandatory fields");return}i.field_map.length>0&&p(c)};return document.querySelector(".btcd-s-wrp").scrollTop=0,a.jsxs("div",{children:[a.jsx(w,{snack:x,setSnackbar:g}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(B,{step:3,active:l})}),a.jsx(R,{elasticEmailConf:i,setElasticEmailConf:o,step:l,setstep:p,isLoading:n,setIsLoading:m}),a.jsxs("div",{className:"btcd-stp-page",style:u({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(G,{formFields:t,handleInput:c=>T(c,i,o),elasticEmailConf:i,setElasticEmailConf:o,isLoading:n,setIsLoading:m}),a.jsxs(C,{variant:"success",onClick:()=>k(3),className:j(_.ftRight),children:[L("Next"),a.jsx(z,{className:"ml-1 rev-icn"})]})]}),a.jsx(P,{step:l,saveConfig:()=>S()})]})}export{$ as default};
