var T=Object.defineProperty;var v=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var N=(s,t,a)=>t in s?T(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a,m=(s,t)=>{for(var a in t||(t={}))k.call(t,a)&&N(s,a,t[a]);if(v)for(var a of v(t))C.call(t,a)&&N(s,a,t[a]);return s};import{k as S,f as I,j as e,_ as i}from"./main.2.9.0.js";import{b as y}from"./react-router.DMwpH23k.js";import{B as _}from"./BackIcn._8Wofmn2.js";import{a2 as z,y as P}from"./Note.NSUdvR3c.js";import{k as U}from"./Integrations.DL8wqGct.js";import{b as $}from"./ZohoDeskCommonFunc.D793YqQj.js";import{T as B}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:s,deskConf:t,setDeskConf:a,step:h,setstep:D,isLoading:p,setIsLoading:b,setSnackbar:r,redirectLocation:E,isInfo:n}){const[o,A]=y.useState(!1),[l,x]=y.useState({dataCenter:"",clientId:"",clientSecret:""}),w="Desk.settings.READ,Desk.basic.READ,Desk.search.READ,Desk.contacts.READ,Desk.contacts.CREATE,Desk.contacts.UPDATE,Desk.tickets.CREATE,Desk.tickets.UPDATE",u=S(I),R=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),D(2),$(s,t,a,b,r)},c=d=>{const g=m({},t),j=m({},l);j[d.target.name]="",g[d.target.name]=d.target.value,x(j),a(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:h===1&&900,height:h===1&&"auto"},children:[e.jsx(B,{linkKey:"zohoDesk"}),e.jsx("div",{className:"wdt-200 d-in-b mt-3",children:e.jsx("b",{children:i("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: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:c,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||`${u.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:c,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:c,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:()=>U("zohoDesk","zbigin",w,t,a,x,A,b,r,u),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||p,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),p&&e.jsx(P,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:R,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),e.jsx(_,{className:"ml-1 rev-icn"})]})]})]})}export{W as default};
