var g=Object.defineProperty;var N=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var y=(n,i,s)=>i in n?g(n,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[i]=s,b=(n,i)=>{for(var s in i||(i={}))_.call(i,s)&&y(n,s,i[s]);if(N)for(var s of N(i))f.call(i,s)&&y(n,s,i[s]);return n};import{r as v,h as E,j as e}from"./main-406.js";import{k as R,_ as r,X as k,L as G}from"./bi.394.85.js";import{a as P}from"./bi.41.807.js";import{T as w,t as $}from"./bi.150.760.js";function H({flowID:n,googleContactsConf:i,setGoogleContactsConf:s,step:o,setStep:I,isLoading:p,setIsLoading:L,setSnackbar:h,redirectLocation:S,isInfo:a}){const[l,T]=v.useState(!1),[c,x]=v.useState({clientId:"",clientSecret:""}),z=E(R),{googleContacts:t}=$,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),I(2)},d=m=>{const u=b({},i),j=b({},c);j[m.target.name]="",u[m.target.name]=m.target.value,x(j),s(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(w,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(w,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:i.name,type:"text",placeholder:r("Integration Name...","bit-integrations"),disabled:a}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Homepage URL:","bit-integrations")})}),e.jsx(k,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:h}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(k,{value:S||`${z.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:h}),e.jsxs("small",{className:"d-blk mt-3",children:[r("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:r("Google API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("GoogleContacts Client Id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:i.clientId,type:"text",placeholder:r("Client Id...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("GoogleContacts Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:i.clientSecret,type:"text",placeholder:r("Client Secret...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!a&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>P(i,s,T,L,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||p,children:[l?r("Authorized ✔","bit-integrations"):r("Authorize","bit-integrations"),p&&e.jsx(G,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[r("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{H as default};
