var j=Object.defineProperty;var g=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var d=(o,e,t)=>e in o?j(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,v=(o,e)=>{for(var t in e||(e={}))S.call(e,t)&&d(o,t,e[t]);if(g)for(var t of g(e))D.call(e,t)&&d(o,t,e[t]);return o};import{j as s,_ as C}from"./main.2.9.0.js";import{u as G,e as w,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as k}from"./SnackMsg.DYSD96P4.js";import{S as I}from"./Steps.BYe8zHkm.js";import{s as N}from"./GoogleIntegrationHelpers.C5BmN2Z3.js";import{I as _,s as y}from"./Integrations.DL8wqGct.js";import L from"./GoogleDriveAuthorization.iS88baC1.js";import{G as E}from"./GoogleDriveIntegLayout.BAuzVmj5.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./GoogleDriveCommonFunc.CP1Ay2xG.js";import"./TutorialLink.CFG7bS5c.js";function W({formFields:o,setFlow:e,flow:t,allIntegURL:u}){const x=G(),{flowID:l}=w(),[m,p]=a.useState(!1),[r,f]=a.useState(1),[b,n]=a.useState({show:!1}),[i,c]=a.useState({name:"Google Drive",type:"Google Drive",clientId:"",clientSecret:"",field_map:[{formField:"",googleDriveFormField:""}],foldersList:[],actions:{}});a.useEffect(()=>{window.opener&&N("googleDrive")},[]);const h=()=>{y({flow:t,setFlow:e,allIntegURL:u,conf:i,navigate:x,setIsLoading:p,setSnackbar:n})};return s.jsxs("div",{children:[s.jsx(k,{snack:b,setSnackbar:n}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(I,{step:3,active:r})}),s.jsx(L,{flowID:l,googleDriveConf:i,setGoogleDriveConf:c,step:r,setStep:f,isLoading:m,setIsLoading:p,setSnackbar:n}),s.jsxs("div",{className:"btcd-stp-page",style:v({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(E,{flowID:l,formFields:o,googleDriveConf:i,setGoogleDriveConf:c}),s.jsxs("button",{onClick:()=>f(3),disabled:i.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[C("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(_,{step:r,saveConfig:()=>h(),isLoading:m,dataConf:i,setDataConf:c,formFields:o})]})}export{W as default};
