var j=Object.defineProperty;var p=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var v=(n,e,t)=>e in n?j(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,u=(n,e)=>{for(var t in e||(e={}))S.call(e,t)&&v(n,t,e[t]);if(p)for(var t of p(e))D.call(e,t)&&v(n,t,e[t]);return n};import{u as O,k,r as o,j as s}from"./main-333.js";import{d as w,_ as C,I,s as N}from"./bi.636.93.js";import{S as _}from"./bi.563.969.js";import{s as y}from"./bi.864.754.js";import L from"./bi.622.244.js";import{O as E}from"./bi.522.737.js";import"./bi.380.736.js";import"./bi.318.783.js";function B({formFields:n,setFlow:e,flow:t,allIntegURL:x}){const g=O(),{flowID:d}=k(),[c,l]=o.useState(!1),[a,f]=o.useState(1),[b,r]=o.useState({show:!1}),[i,m]=o.useState({name:"OneDrive",type:"OneDrive",clientId:"",clientSecret:"",field_map:[{formField:"",OneDriveFormField:""}],folder:"",folderMap:[],foldersList:[],actions:{}});o.useEffect(()=>{window.opener&&y("oneDrive")},[]);const h=()=>{N({flow:t,setFlow:e,allIntegURL:x,conf:i,navigate:g,setIsLoading:l,setSnackbar:r})};return s.jsxs("div",{children:[s.jsx(w,{snack:b,setSnackbar:r}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(_,{step:3,active:a})}),s.jsx(L,{flowID:d,oneDriveConf:i,setOneDriveConf:m,step:a,setStep:f,isLoading:c,setIsLoading:l,setSnackbar:r}),s.jsxs("div",{className:"btcd-stp-page",style:u({},a===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(E,{flowID:d,formFields:n,oneDriveConf:i,setOneDriveConf:m,isLoading:c,setIsLoading:l,setSnackbar:r}),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:[C("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(I,{step:a,saveConfig:()=>h(),isLoading:c})]})}export{B as default};
