import{j as t,_ as p}from"./main.2.9.0.js";import{u as j,e as S,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as k}from"./BackIcn._8Wofmn2.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{S as y}from"./Steps.BYe8zHkm.js";import C from"./ZoomAuthorization.B2TyyUZ6.js";import{I as A,s as Z}from"./Integrations.DL8wqGct.js";import{s as w,h as z,c as d}from"./ZoomCommonFunc.B30i7U7J.js";import{Z as N}from"./ZoomIntegLayout.C8t7AJeU.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./TutorialLink.CFG7bS5c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({formFields:l,setFlow:f,flow:u,allIntegURL:g}){const h=j(),{formID:m}=S(),[n,i]=a.useState(!1),[o,c]=a.useState(1),[x,s]=a.useState({show:!1}),[e,r]=a.useState({name:"Zoom",type:"Zoom",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomFields:[],allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});a.useEffect(()=>{window.opener&&w("zoom")},[]);const v=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!d(e)){s({show:!0,msg:p("Please map fields to continue.","bit-integrations")});return}e.field_map.length>0&&c(3)};return t.jsxs("div",{children:[t.jsx(I,{snack:x,setSnackbar:s}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(y,{step:3,active:o})}),t.jsx(C,{formID:m,zoomConf:e,setZoomConf:r,step:o,setStep:c,setSnackbar:s,isLoading:n,setIsLoading:i}),t.jsxs("div",{className:"btcd-stp-page",style:{width:o===2&&900,height:o===2&&"100%"},children:[t.jsx(N,{formID:m,formFields:l,handleInput:b=>z(b,e,r,m,i,s),zoomConf:e,setZoomConf:r,isLoading:n,setIsLoading:i,setSnackbar:s}),t.jsxs("button",{onClick:()=>v(),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:[p("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]}),t.jsx(A,{step:o,saveConfig:()=>Z({flow:u,setFlow:f,allIntegURL:g,navigate:h,conf:e,setIsLoading:i,setSnackbar:s}),isLoading:n,dataConf:e,setDataConf:r,formFields:l})]})}export{O as default};
