import{_ as t,j as i}from"./main.2.8.10.js";import{u as j,e as v,b as o}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as S}from"./BackIcn.BFDZx8No.js";import{S as C}from"./SnackMsg.7BjcJK1j.js";import{S as I}from"./Steps.B84Ui3GU.js";import _ from"./ZoomWebinarAuthorization.DOEoTxI9.js";import{I as q,s as N}from"./Integrations.BFhED4ck.js";import{s as W,h as Z,c as d}from"./ZoomCommonFunc.DA-mU_Ge.js";import{Z as w}from"./ZoomWebinarIntegLayout.DoSeBJgo.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./TutorialLink.D6K_DiHL.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function O({formFields:m,setFlow:u,flow:b,allIntegURL:f}){const g=j(),{formID:c}=v(),[n,l]=o.useState(!1),[s,p]=o.useState(1),[h,a]=o.useState({show:!1}),y=[{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:"country",label:t("Country","bit-integrations"),required:!1},{key:"phone",label:t("Phone","bit-integrations"),required:!1},{key:"job_title",label:t("Job Title","bit-integrations"),required:!1},{key:"zip",label:t("Zip","bit-integrations"),required:!1}],[e,r]=o.useState({name:"Zoom Webinar",type:"Zoom Webinar",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomWebinarFields:y,allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});o.useEffect(()=>{window.opener&&W("zoom")},[]);const k=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!d(e)){a({show:!0,msg:t("Please map fields to continue.","bit-integrations")});return}e.field_map.length>0&&p(3)};return i.jsxs("div",{children:[i.jsx(C,{snack:h,setSnackbar:a}),i.jsx("div",{className:"txt-center w-9 mt-2",children:i.jsx(I,{step:3,active:s})}),i.jsx(_,{formID:c,zoomWebinarConf:e,setZoomWebinarConf:r,step:s,setStep:p,setSnackbar:a,isLoading:n,setIsLoading:l}),i.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"100%"},children:[i.jsx(w,{formID:c,formFields:m,handleInput:x=>Z(x,e,r),zoomWebinarConf:e,setZoomWebinarConf:r,isLoading:n,setIsLoading:l,setSnackbar:a}),i.jsxs("button",{onClick:()=>k(),disabled:e.field_map.length<2||n||!e.id||!d(e)||e.selectedActions==null,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[t("Next","bit-integrations"),i.jsx(S,{className:"ml-1 rev-icn"})]})]}),i.jsx(q,{step:s,saveConfig:()=>N({flow:b,setFlow:u,allIntegURL:f,navigate:g,conf:e,setIsLoading:l,setSnackbar:a}),isLoading:n,dataConf:e,setDataConf:r,formFields:m})]})}export{O as default};
