var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var j=(a,t,i)=>t in a?A(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,o=(a,t)=>{for(var i in t||(t={}))f.call(t,i)&&j(a,i,t[i]);if(u)for(var i of u(t))z.call(t,i)&&j(a,i,t[i]);return a};import{k as _,f as T,j as e,_ as s}from"./main.2.9.0.js";import{b as N}from"./react-router.DMwpH23k.js";import{a2 as E,y as P}from"./Note.NSUdvR3c.js";import{a as R,g as C}from"./PCloudCommonFunc.C4W2SJmV.js";import{T as D}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function V({flowID:a,pCloudConf:t,setPCloudConf:i,step:m,setStep:y,isLoading:b,setIsLoading:v,setSnackbar:S,redirectLocation:k,isInfo:r}){const[n,I]=N.useState(!1),[l,p]=N.useState({clientId:"",clientSecret:""}),h=_(T),w=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),C(t,i,"fetch"),y(2)},c=d=>{const x=o({},t),g=o({},l);g[d.target.name]="",x[d.target.name]=d.target.value,p(g),i(x)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[e.jsx(D,{linkKey:"pCloud"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(E,{value:k||`${h.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:S}),e.jsxs("small",{className:"d-blk mt-3",children:[s("To Get Client Id & Secret, Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://docs.pcloud.com/my_apps/",target:"_blank",rel:"noreferrer",children:s("pCloud API apps","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("PCloud Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red"},children:l.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("PCloud Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red"},children:l.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R(t,i,I,v,p,h),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:n||b,children:[n?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&e.jsx(P,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:w,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!n,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{V as default};
