var I=Object.defineProperty;var b=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var f=(s,t,e)=>t in s?I(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,g=(s,t)=>{for(var e in t||(t={}))E.call(t,e)&&f(s,e,t[e]);if(b)for(var e of b(t))N.call(t,e)&&f(s,e,t[e]);return s};import{_ as o,j as a}from"./main.2.9.0.js";import{u as A,e as K,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as _}from"./SnackMsg.DYSD96P4.js";import{S as C}from"./Steps.BYe8zHkm.js";import{I as F,s as w}from"./Integrations.DL8wqGct.js";import{h as T,c as q}from"./KirimEmailCommonFunc.w54HbAPI.js";import{B}from"./BackIcn._8Wofmn2.js";import L from"./KirimEmailAuthorization.CCRHy-38.js";import{K as D}from"./KirimEmailIntegLayout.B-f4kwhY.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function it({formFields:s,setFlow:t,flow:e,allIntegURL:x}){const h=A(),{formID:v}=K(),[r,p]=c.useState(!1),[n,d]=c.useState(1),[k,m]=c.useState({show:!1}),j=[{key:"full_name",label:o("Full Name","bit-integrations"),required:!0},{key:"email",label:o("Email","bit-integrations"),required:!0},{key:"tags",label:o("Tags","bit-integrations"),required:!1}],S=[{key:"1",label:o("Add Subscriber","bit-integrations")},{key:"2",label:o("Remove Subscriber","bit-integrations")}],[i,l]=c.useState({name:"Kirim Email",type:"Kirim Email",mainAction:"",userName:"vaishak",api_key:"",field_map:[{formField:"",kirimEmailFormField:""}],subscriberFields:j,allActions:S,actions:{}}),y=u=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),d(3)};return a.jsxs("div",{children:[a.jsx(_,{snack:k,setSnackbar:m}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(C,{step:3,active:n})}),a.jsx(L,{formID:v,kirimEmailConf:i,setKirimEmailConf:l,step:n,setstep:d,isLoading:r,setIsLoading:p,setSnackbar:m}),a.jsxs("div",{className:"btcd-stp-page",style:g({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(D,{formFields:s,handleInput:u=>T(u,i,l),kirimEmailConf:i,setKirimEmailConf:l,isLoading:r,setIsLoading:p,setSnackbar:m}),a.jsxs("button",{onClick:()=>y(),disabled:!q(i==null?void 0:i.field_map)||i.mainAction===""||r||i.mainAction==="1"&&(i.listId===""||i.listId===void 0),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[o("Next","bit-integrations"),a.jsx(B,{className:"ml-1 rev-icn"})]})]}),a.jsx(F,{step:n,saveConfig:()=>w({flow:e,setFlow:t,allIntegURL:x,conf:i,navigate:h,setIsLoading:p,setSnackbar:m}),isLoading:r,dataConf:i,setDataConf:l,formFields:s})]})}export{it as default};
