var g=Object.defineProperty;var f=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var p=(a,e,t)=>e in a?g(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,u=(a,e)=>{for(var t in e||(e={}))x.call(e,t)&&p(a,t,e[t]);if(f)for(var t of f(e))h.call(e,t)&&p(a,t,e[t]);return a};import{u as j,r as l,j as i}from"./main-406.js";import{_ as k,I as N}from"./bi.394.85.js";import{S as _}from"./bi.68.941.js";import K from"./bi.246.277.js";import{n as S,b as C}from"./bi.554.814.js";import{K as q}from"./bi.874.815.js";import"./bi.150.760.js";import"./bi.968.816.js";import"./bi.704.707.js";import"./bi.701.708.js";function R({formFields:a,setFlow:e,flow:t,allIntegURL:c}){const b=j(),[v,y]=l.useState(!1),[n,m]=l.useState({list:!1,field:!1,auth:!1}),[o,d]=l.useState(1),[s,r]=l.useState({name:"Klaviyo",type:"Klaviyo",authKey:"",field_map:[{formField:"",klaviyoFormField:""}],klaviyoFields:[{key:"email",label:"Email",required:!0},{key:"first_name",label:"First Name",required:!1},{key:"last_name",label:"Last Name",required:!1},{key:"title",label:"Title",required:!1},{key:"organization",label:"Organization",required:!1},{key:"phone_number",label:"Phone Number",required:!1}],listId:"",actions:{}});return i.jsxs("div",{children:[i.jsx("div",{className:"txt-center mt-2",children:i.jsx(_,{step:3,active:o})}),i.jsx(K,{klaviyoConf:s,setKlaviyoConf:r,loading:n,setLoading:m,step:o,setStep:d}),i.jsxs("div",{className:"btcd-stp-page",style:u({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[i.jsx(q,{formFields:a,klaviyoConf:s,setKlaviyoConf:r,loading:n,setLoading:m}),i.jsxs("button",{onClick:()=>S(s,d,3),disabled:!s.listId||s.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[k("Next","bit-integrations")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),i.jsx(N,{step:o,saveConfig:()=>C(t,e,c,s,b,y),isLoading:v,dataConf:s,setDataConf:r,formFields:a})]})}export{R as default};
