var j=Object.defineProperty;var g=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(s,t,i)=>t in s?j(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i,u=(s,t)=>{for(var i in t||(t={}))q.call(t,i)&&b(s,i,t[i]);if(g)for(var i of g(t))C.call(t,i)&&b(s,i,t[i]);return s};import{_ as e,j as a,z as _}from"./main.2.8.1.js";import{u as N,d}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S}from"./Steps.1hz7v9Vj.js";import{I as G,s as I}from"./Integrations.D2bgBas2.js";import w from"./GetgistAuthorization.CyEnW0bC.js";import{G as E,h as F,c as L}from"./GetgistIntegLayout.TsGpEwax.js";import"./CopyIcn.3gZpHton.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./BackIcn._kGL_vVw.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function Z({formFields:s,setFlow:t,flow:i,allIntegURL:f}){const y=N(),[m,r]=d.useState(!1),[o,c]=d.useState(1),[P,h]=d.useState({show:!1}),k=[{key:"name",label:e("Name","bit-integrations"),required:!1},{key:"email",label:e("Email","bit-integrations"),required:!0},{key:"phone",label:e("Phone","bit-integrations"),required:!1},{key:"gender",label:e("Gender","bit-integrations"),required:!1},{key:"country",label:e("Country","bit-integrations"),required:!1},{key:"city",label:e("City","bit-integrations"),required:!1},{key:"company_name",label:e("Company Name","bit-integrations"),required:!1},{key:"industry",label:e("Industry","bit-integrations"),required:!1},{key:"job_title",label:e("Job Title","bit-integrations"),required:!1},{key:"last_name",label:e("Last Name","bit-integrations"),required:!1},{key:"postal_code",label:e("Postal Code","bit-integrations"),required:!1},{key:"state",label:e("State","bit-integrations"),required:!1}],[n,l]=d.useState({name:"Getgist",type:"Getgist",api_key:"",field_map:[{formField:"",getgistFormField:""}],actions:{},gistFields:k}),x=()=>{r(!0),I({flow:i,setFlow:t,allIntegURL:f,conf:n,navigate:y,setIsLoading:r,setSnackbar:h})},v=p=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!L(n)){_.error(e("Please map mandatory fields","bit-integrations"));return}n.field_map.length>0&&c(p)};return a.jsxs("div",{children:[a.jsx("div",{className:"txt-center mt-2",children:a.jsx(S,{step:3,active:o})}),a.jsx(w,{getgistConf:n,setGetgistConf:l,step:o,setstep:c,isLoading:m,setIsLoading:r}),a.jsxs("div",{className:"btcd-stp-page",style:u({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:s,handleInput:p=>F(p,n,l),getgistConf:n,setGetgistConf:l,isLoading:m,setIsLoading:r}),a.jsxs("button",{onClick:()=>v(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[e("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(G,{step:o,saveConfig:()=>x(),isLoading:m,dataConf:n,setDataConf:l,formFields:s})]})}export{Z as default};
