var z=Object.defineProperty;var N=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var y=(n,t,i)=>t in n?z(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,h=(n,t)=>{for(var i in t||(t={}))D.call(t,i)&&y(n,i,t[i]);if(N)for(var i of N(t))S.call(t,i)&&y(n,i,t[i]);return n};import{r as A,h as C,j as e}from"./main-333.js";import{j as I,_ as s,X as k,Y as _,L as B}from"./bi.636.93.js";import{B as $}from"./bi.429.767.js";import{d as P}from"./bi.450.733.js";import{T as E,t as O}from"./bi.318.783.js";function Y({formID:n,biginConf:t,setBiginConf:i,step:u,setstep:w,isLoading:p,setIsLoading:x,setSnackbar:r,redirectLocation:L,isInfo:l}){const[d,R]=A.useState(!1),[o,b]=A.useState({dataCenter:"",clientId:"",clientSecret:""}),j=C(I),T="ZohoBigin.settings.modules.READ,ZohoBigin.settings.fields.READ,ZohoBigin.settings.tags.READ,ZohoBigin.users.READ,ZohoBigin.modules.ALL,ZohoBigin.settings.layouts.READ",{zohoBigin:a}=O,Z=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),w(2),P(n,t,i,x,r)},c=m=>{const g=h({},t),v=h({},o);v[m.target.name]="",g[m.target.name]=m.target.value,b(v),i(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:u===1&&900,height:u===1&&"auto"},children:[(a==null?void 0:a.youTubeLink)&&e.jsx(E,{title:"Zoho Bigin",youTubeLink:a==null?void 0:a.youTubeLink}),(a==null?void 0:a.docLink)&&e.jsx(E,{title:"Zoho Bigin",docLink:a==null?void 0:a.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:c,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:c,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:l,children:[e.jsx("option",{value:"",children:s("--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:o.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(k,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(k,{value:L||`${j.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:l}),e.jsxs("small",{className:"d-blk mt-5",children:[s("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:s("Zoho API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("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:l}),e.jsx("div",{style:{color:"red"},children:o.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("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:l}),e.jsx("div",{style:{color:"red"},children:o.clientSecret}),!l&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>_("zohoBigin","zbigin",T,t,i,b,R,x,r,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||p,children:[d?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),p&&e.jsx(B,{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:!d,children:[s("Next","bit-integrations"),e.jsx($,{className:"ml-1 rev-icn"})]})]})]})}export{Y as default};
