var v=Object.defineProperty;var f=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var u=(o,t,s)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s,x=(o,t)=>{for(var s in t||(t={}))j.call(t,s)&&u(o,s,t[s]);if(f)for(var s of f(t))S.call(t,s)&&u(o,s,t[s]);return o};import{j as e,_ as P}from"./main.2.8.1.js";import{u as k,h as w,d as i}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as I}from"./SnackMsg.S8DrwLlT.js";import{S as N}from"./Steps.1hz7v9Vj.js";import{s as _}from"./GoogleIntegrationHelpers.BGadhjz3.js";import{I as y,s as F}from"./Integrations.D2bgBas2.js";import L from"./PCloudAuthorization.BhtPBCsi.js";import{c as E}from"./PCloudCommonFunc.Cqma_rgn.js";import{P as A}from"./PCloudIntegLayout.CAylrS1f.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function X({formFields:o,setFlow:t,flow:s,allIntegURL:C}){const g=k(),{flowID:c}=w(),[p,d]=i.useState(!1),[a,l]=i.useState(1),[h,r]=i.useState({show:!1}),[n,m]=i.useState({name:"PCloud",type:"PCloud",clientId:"",clientSecret:"",field_map:[{formField:"",pCloudFormField:""}],foldersList:[],actions:{}});i.useEffect(()=>{window.opener&&_("pCloud")},[]);const b=()=>{F({flow:s,setFlow:t,allIntegURL:C,conf:n,navigate:g,setIsLoading:d,setSnackbar:r})};return e.jsxs("div",{children:[e.jsx(I,{snack:h,setSnackbar:r}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(N,{step:3,active:a})}),e.jsx(L,{flowID:c,pCloudConf:n,setPCloudConf:m,step:a,setStep:l,isLoading:p,setIsLoading:d,setSnackbar:r}),e.jsxs("div",{className:"btcd-stp-page",style:x({},a===2&&{width:900,height:"auto",overflow:"visible"}),children:[e.jsx(A,{flowID:c,formFields:o,pCloudConf:n,setPCloudConf:m}),e.jsxs("button",{onClick:()=>l(3),disabled:!E(n),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[P("Next","bit-integrations")," ",e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),e.jsx(y,{step:a,saveConfig:()=>b(),isLoading:p})]})}export{X as default};
