var L=Object.defineProperty;var N=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var y=(a,t,i)=>t in a?L(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,m=(a,t)=>{for(var i in t||(t={}))_.call(t,i)&&y(a,i,t[i]);if(N)for(var i of N(t))f.call(t,i)&&y(a,i,t[i]);return a};import{k as C,g as G,j as e,_ as s}from"./main.2.8.1.js";import{d as k}from"./react-router-dom.9mCuUg3q.js";import{a2 as v,z as E}from"./Note.BeM7sN-p.js";import{a as R,g as P}from"./GoogleDriveCommonFunc.CvKuNgzJ.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import{t as $}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function K({flowID:a,googleDriveConf:t,setGoogleDriveConf:i,step:b,setStep:S,isLoading:p,setIsLoading:z,setSnackbar:h,redirectLocation:A,isInfo:n}){const[l,I]=k.useState(!1),[c,x]=k.useState({clientId:"",clientSecret:""}),u=C(G),{googleDrive:r}=$,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),P(a,t,i),S(2)},d=o=>{const j=m({},t),g=m({},c);g[o.target.name]="",j[o.target.name]=o.target.value,x(g),i(j)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[e.jsx(w,{title:"Google Drive",youTubeLink:r==null?void 0:r.youTubeLink}),e.jsx(w,{title:"Google Drive",docLink:r==null?void 0:r.docLink}),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:d,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(v,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:h}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(v,{value:A||`${u.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:h}),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://console.developers.google.com/apis/credentials",target:"_blank",rel:"noreferrer",children:s("Google API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleDrive Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleDrive Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("Client Secret.....","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R(t,i,I,z,x,u),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||p,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),p&&e.jsx(E,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:T,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{K as default};
