var q=Object.defineProperty;var f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(s,e,i)=>e in s?q(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,g=(s,e)=>{for(var i in e||(e={}))v.call(e,i)&&b(s,i,e[i]);if(f)for(var i of f(e))C.call(e,i)&&b(s,i,e[i]);return s};import{_ as t,j as a}from"./main.2.8.10.js";import{u as _,e as I,b as u}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as N}from"./SnackMsg.7BjcJK1j.js";import{S as w}from"./Steps.B84Ui3GU.js";import{I as E,s as L}from"./Integrations.BFhED4ck.js";import T from"./FluentSupportAuthorization.Dhj5uHU4.js";import{h as D,c as S}from"./FluentSupportCommonFunc.BqpnS96O.js";import{F as P}from"./FluentSupportIntegLayout.Dysp7rqt.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./ActionProFeatureLabels.BzMNdAoD.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function tt({formFields:s,setFlow:e,flow:i,allIntegURL:y}){const h=_(),{formID:d}=I(),[o,m]=u.useState(!1),[l,c]=u.useState(1),[x,n]=u.useState({show:!1}),k=[{key:"title",label:t("Title","bit-integrations"),required:!0},{key:"content",label:t("Content","bit-integrations"),required:!0},{key:"first_name",label:t("First Name","bit-integrations"),required:!0},{key:"last_name",label:t("Last Name","bit-integrations"),required:!0},{key:"email",label:t("Email","bit-integrations"),required:!0},{key:"city",label:t("City","bit-integrations"),required:!1},{key:"zip",label:t("Zip","bit-integrations"),required:!1},{key:"state",label:t("State","bit-integrations"),required:!1},{key:"country",label:t("Country","bit-integrations"),required:!1},{key:"note",label:t("Note","bit-integrations"),required:!1},{key:"description",label:t("Description","bit-integrations"),required:!1}],[r,p]=u.useState({name:"Fluent Support",type:"Fluent Support",field_map:[{formField:"",fluentSupportFormField:""}],basicFields:k,fluentSupportFields:[],address_field:[],actions:{}}),F=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!S(r)){n({show:!0,msg:t("Please map fields to continue.","bit-integrations")});return}if(!r.actions.support_staff){n({show:!0,msg:t("Support Staff is required!","bit-integrations")});return}r.listId!==""&&c(3)};return a.jsxs("div",{children:[a.jsx(N,{snack:x,setSnackbar:n}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(w,{step:3,active:l})}),a.jsx(T,{formID:d,fluentSupportConf:r,setFluentSupportConf:p,step:l,setstep:c,isLoading:o,setIsLoading:m,setSnackbar:n}),a.jsxs("div",{className:"btcd-stp-page",style:g({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(P,{formID:d,formFields:s,handleInput:j=>D(j,r,p),fluentSupportConf:r,setFluentSupportConf:p,isLoading:o,setIsLoading:m,setSnackbar:n}),a.jsxs("button",{onClick:()=>F(),disabled:o||r.field_map.length<1||!S(r),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[t("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(E,{step:l,saveConfig:()=>L({flow:i,setFlow:e,allIntegURL:y,navigate:h,conf:r,setIsLoading:m,setSnackbar:n}),isLoading:o,dataConf:r,setDataConf:p,formFields:s})]})}export{tt as default};
