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.10.js";import{u as k,e as w,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{S as N}from"./Steps.B84Ui3GU.js";import{s as _}from"./GoogleIntegrationHelpers.CQstGYRP.js";import{I as y,s as F}from"./Integrations.BFhED4ck.js";import L from"./PCloudAuthorization.Dxd1ODwu.js";import{c as E}from"./PCloudCommonFunc.CgTQgi5q.js";import{P as A}from"./PCloudIntegLayout.DftN34Av.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";function X({formFields:o,setFlow:t,flow:s,allIntegURL:C}){const b=k(),{flowID:c}=w(),[p,l]=i.useState(!1),[a,m]=i.useState(1),[g,r]=i.useState({show:!1}),[n,d]=i.useState({name:"PCloud",type:"PCloud",clientId:"",clientSecret:"",field_map:[{formField:"",pCloudFormField:""}],foldersList:[],actions:{}});i.useEffect(()=>{window.opener&&_("pCloud")},[]);const h=()=>{F({flow:s,setFlow:t,allIntegURL:C,conf:n,navigate:b,setIsLoading:l,setSnackbar:r})};return e.jsxs("div",{children:[e.jsx(I,{snack:g,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:d,step:a,setStep:m,isLoading:p,setIsLoading:l,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:d}),e.jsxs("button",{onClick:()=>m(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:()=>h(),isLoading:p})]})}export{X as default};
