var I=Object.defineProperty;var j=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var N=(a,t,i)=>t in a?I(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,o=(a,t)=>{for(var i in t||(t={}))_.call(t,i)&&N(a,i,t[i]);if(j)for(var i of j(t))f.call(t,i)&&N(a,i,t[i]);return a};import{k as T,f as E,j as e,_ as s}from"./main.2.8.10.js";import{b as y}from"./react-router.DMwpH23k.js";import{a2 as v,y as R}from"./Note.DalStCGz.js";import{a as G,g as C}from"./GoogleCalendarCommonFunc.Cg1hv4Pe.js";import{T as L}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function K({flowID:a,googleCalendarConf:t,setGoogleCalendarConf:i,step:m,setStep:w,isLoading:p,setIsLoading:k,setSnackbar:b,redirectLocation:S,isInfo:n}){const[r,A]=y.useState(!1),[l,h]=y.useState({clientId:"",clientSecret:""}),x=T(E),z=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),C(a,t,i),w(2)},c=d=>{const u=o({},t),g=o({},l);g[d.target.name]="",u[d.target.name]=d.target.value,h(g),i(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[e.jsx(L,{linkKey:"googleCalendar"}),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: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:b}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(v,{value:S||`${x.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:b}),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("GoogleCalendar 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:n}),e.jsx("div",{style:{color:"red"},children:l.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleCalendar 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:n}),e.jsx("div",{style:{color:"red"},children:l.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>G(t,i,A,k,h,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||p,children:[r?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),p&&e.jsx(R,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:z,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{K as default};
