var C=Object.defineProperty;var u=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var f=(s,e,t)=>e in s?C(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,p=(s,e)=>{for(var t in e||(e={}))S.call(e,t)&&f(s,t,e[t]);if(u)for(var t of u(e))v.call(e,t)&&f(s,t,e[t]);return s};import{G as _,r as o,a as G,j as a,S as I,U as N,h as w,_ as F,z as L}from"./main-343.js";import{B as P}from"./bf-649-79.js";import{S as z}from"./bf-149-261.js";import{a7 as B}from"./bf-659-81.js";import{I as E}from"./bf-58-184.js";import T from"./bf-887-127.js";import{G as M,h as R,c as A}from"./bf-741-206.js";import"./bf-974-82.js";import"./bf-713-109.js";import"./bf-594-113.js";function Z({formFields:s,setIntegration:e,integrations:t,allIntegURL:y}){const g=_(),[n,c]=o.useState(!1),[i,m]=o.useState(1),[h,b]=o.useState({show:!1}),{css:k}=G(),x=[{key:"name",label:"Name",required:!1},{key:"email",label:"Email",required:!0},{key:"phone",label:"Phone",required:!1},{key:"gender",label:"Gender",required:!1},{key:"country",label:"Country",required:!1},{key:"city",label:"City",required:!1},{key:"company_name",label:"Company Name",required:!1},{key:"industry",label:"Industry",required:!1},{key:"job_title",label:"Job Title",required:!1},{key:"last_name",label:"Last Name",required:!1},{key:"postal_code",label:"Postal Code",required:!1},{key:"state",label:"State",required:!1}],[r,l]=o.useState({name:"Getgist",type:"Getgist",api_key:"",field_map:[{formField:"",getgistFormField:""}],actions:{},gistFields:x}),j=()=>{B(t,e,y,r,g)},q=d=>{if(!A(r)){L.error("Please map mandatory fields");return}r.field_map.length>0&&m(d)};return document.querySelector(".btcd-s-wrp").scrollTop=0,a.jsxs("div",{children:[a.jsx(I,{snack:h,setSnackbar:b}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(z,{step:3,active:i})}),a.jsx(T,{getgistConf:r,setGetgistConf:l,step:i,setstep:m,isLoading:n,setIsLoading:c}),a.jsxs("div",{className:"btcd-stp-page",style:p({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(M,{formFields:s,handleInput:d=>R(d,r,l),getgistConf:r,setGetgistConf:l,isLoading:n,setIsLoading:c}),a.jsxs(N,{onClick:()=>q(3),className:k(w.ftRight),type:"button",children:[F("Next")," ",a.jsx(P,{className:"ml-1 rev-icn"})]})]}),a.jsx(E,{step:i,saveConfig:()=>j(),isLoading:n,dataConf:r,setDataConf:l,formFields:s})]})}export{Z as default};
