var k=Object.defineProperty;var v=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var N=(a,t,s)=>t in a?k(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,m=(a,t)=>{for(var s in t||(t={}))D.call(t,s)&&N(a,s,t[s]);if(v)for(var s of v(t))S.call(t,s)&&N(a,s,t[s]);return a};import{k as Z,f as C,j as e,_ as i}from"./main.2.9.0.js";import{b as y}from"./react-router.DMwpH23k.js";import{B as T}from"./BackIcn._8Wofmn2.js";import{a2 as z,y as I}from"./Note.NSUdvR3c.js";import{k as _}from"./Integrations.DL8wqGct.js";import{d as $}from"./ZohoBiginCommonFunc.K2WQPoG_.js";import{T as f}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function W({formID:a,biginConf:t,setBiginConf:s,step:h,setstep:A,isLoading:p,setIsLoading:x,setSnackbar:r,redirectLocation:E,isInfo:n}){const[c,w]=y.useState(!1),[l,u]=y.useState({dataCenter:"",clientId:"",clientSecret:""}),j=Z(C),R="ZohoBigin.settings.modules.READ,ZohoBigin.settings.fields.READ,ZohoBigin.settings.tags.READ,ZohoBigin.users.READ,ZohoBigin.modules.ALL,ZohoBigin.settings.layouts.READ",B=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),A(2),$(a,t,s,x,r)},o=d=>{const g=m({},t),b=m({},l);b[d.target.name]="",g[d.target.name]=d.target.value,u(b),s(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:h===1&&900,height:h===1&&"auto"},children:[e.jsx(f,{linkKey:"zohoBigin"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:o,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:n,children:[e.jsx("option",{value:"",children:i("--Select a data center--","bit-integrations")}),e.jsx("option",{value:"com",children:"zoho.com"}),e.jsx("option",{value:"eu",children:"zoho.eu"}),e.jsx("option",{value:"com.cn",children:"zoho.com.cn"}),e.jsx("option",{value:"in",children:"zoho.in"}),e.jsx("option",{value:"com.au",children:"zoho.com.au"})]}),e.jsx("div",{style:{color:"red"},children:l.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(z,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(z,{value:E||`${j.api}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:n}),e.jsxs("small",{className:"d-blk mt-5",children:[i("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:`https://api-console.zoho.${(t==null?void 0:t.dataCenter)||"com"}/`,target:"_blank",rel:"noreferrer",children:i("Zoho API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientId",value:t.clientId,type:"text",placeholder:i("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:i("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("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:()=>_("zohoBigin","zbigin",R,t,s,u,w,x,r,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||p,children:[c?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),p&&e.jsx(I,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:B,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[i("Next","bit-integrations"),e.jsx(T,{className:"ml-1 rev-icn"})]})]})]})}export{W as default};
