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{D as b,r,a as F,j as a,S as w,W as C,h as _,_ as L,V as q}from"./main-634.js";import{m as B}from"./bf-25-81.js";import{S as M}from"./bf-54-258.js";import{a7 as P}from"./bf-746-82.js";import{I as R}from"./bf-942-184.js";import T from"./bf-229-119.js";import{h as V,c as z}from"./bf-993-173.js";import{E as A}from"./bf-244-207.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-123-109.js";import"./bf-438-114.js";function ss({formFields:t,setIntegration:s,integrations:e,allIntegURL:E}){const h=b(),[m,n]=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=()=>{P(e,s,E,i,h)},k=c=>{if(!z(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(M,{step:3,active:l})}),a.jsx(T,{elasticEmailConf:i,setElasticEmailConf:o,step:l,setstep:p,isLoading:m,setIsLoading:n}),a.jsxs("div",{className:"btcd-stp-page",style:u({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(A,{formFields:t,handleInput:c=>V(c,i,o),elasticEmailConf:i,setElasticEmailConf:o,isLoading:m,setIsLoading:n}),a.jsxs(C,{variant:"success",onClick:()=>k(3),className:j(_.ftRight),children:[L("Next"),a.jsx(B,{className:"ml-1 rev-icn"})]})]}),a.jsx(R,{step:l,saveConfig:()=>S()})]})}export{ss as default};
