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