var j=Object.defineProperty;var d=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var v=(o,e,t)=>e in o?j(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,u=(o,e)=>{for(var t in e||(e={}))S.call(e,t)&&v(o,t,e[t]);if(d)for(var t of d(e))D.call(e,t)&&v(o,t,e[t]);return o};import{j as s,_ as O}from"./main.2.8.10.js";import{u as w,e as k,b as n}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"./OneDriveAuthorization.C1jgz3z5.js";import{O as E}from"./OneDriveIntegLayout.CXb9-51V.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./OneDriveCommonFunc.Czl9xOCp.js";import"./TutorialLink.D6K_DiHL.js";function W({formFields:o,setFlow:e,flow:t,allIntegURL:x}){const b=w(),{flowID:p}=k(),[c,m]=n.useState(!1),[r,f]=n.useState(1),[g,a]=n.useState({show:!1}),[i,l]=n.useState({name:"OneDrive",type:"OneDrive",clientId:"",clientSecret:"",field_map:[{formField:"",OneDriveFormField:""}],folder:"",folderMap:[],foldersList:[],actions:{}});n.useEffect(()=>{window.opener&&N("oneDrive")},[]);const h=()=>{y({flow:t,setFlow:e,allIntegURL:x,conf:i,navigate:b,setIsLoading:m,setSnackbar:a})};return s.jsxs("div",{children:[s.jsx(C,{snack:g,setSnackbar:a}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(I,{step:3,active:r})}),s.jsx(L,{flowID:p,oneDriveConf:i,setOneDriveConf:l,step:r,setStep:f,isLoading:c,setIsLoading:m,setSnackbar:a}),s.jsxs("div",{className:"btcd-stp-page",style:u({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(E,{flowID:p,formFields:o,oneDriveConf:i,setOneDriveConf:l,isLoading:c,setIsLoading:m,setSnackbar:a}),s.jsxs("button",{onClick:()=>f(3),disabled:!i.actions.attachments||!i.folder,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[O("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(_,{step:r,saveConfig:()=>h(),isLoading:c})]})}export{W as default};
