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