| 1 |
var D=Object.defineProperty;var k=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var A=(i,t,s)=>t in i?D(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,b=(i,t)=>{for(var s in t||(t={}))R.call(t,s)&&A(i,s,t[s]);if(k)for(var s of k(t))E.call(t,s)&&A(i,s,t[s]);return i};import{u as I,$ as L,r as o,j as e,_ as a,C as w,F as T,g as F,S as Z}from"./main-96.js";/* empty css */import{c as _}from"./bf-13-42.js";import{t as C}from"./bf-374-48.js";import{T as $}from"./bf-60-114.js";import{A as P}from"./bf-490-110.js";import{f as U}from"./bf-562-83.js";import"./bf-825-45.js";import"./bf-781-46.js";import"./bf-551-68.js";import"./bf-894-52.js";import"./bf-331-47.js";import"./bf-798-54.js";import"./bf-425-69.js";import"./bf-533-49.js";import"./bf-531-50.js";import"./bf-128-51.js";import"./bf-681-53.js";import"./bf-20-55.js";import"./bf-570-115.js";function G({formID:i,deskConf:t,setDeskConf:s,step:z,setstep:N,isLoading:m,setisLoading:h,setSnackbar:p,redirectLocation:u,isInfo:r,authorizedAction:x}){const n=I(L),{siteURL:j}=n,[l,v]=o.useState(!1),[c,y]=o.useState({dataCenter:"",clientId:"",clientSecret:""}),d=g=>{const S=b({},t),f=b({},c);f[g.target.name]="",S[g.target.name]=g.target.value,y(f),s(S)};return o.useEffect(()=>{l&&x()},[l]),e.jsxs(e.Fragment,{children:[e.jsx($,{title:C.zohoDesk.title,youTubeLink:C.zohoDesk.link}),e.jsxs("div",{className:"btcd-stp-page",style:{width:900,height:"100%"},children:[e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Account Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:t.name,type:"text",placeholder:a("e.g. Marketing — work account"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Data Center:")})}),e.jsxs("select",{onChange:d,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:r,children:[e.jsx("option",{value:"",children:a("--Select a data center--")}),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:c.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Homepage URL:")})}),e.jsx(w,{value:j,className:"field-key-cpy w-6 ml-0",readOnly:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:")})}),e.jsx(w,{value:u||`${n.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:r}),e.jsxs("small",{className:"d-blk mt-5",children:[a("To get Client ID and SECRET , Please Visit")," ",e.jsx("a",{className:"btcd-link",href:`https://api-console.zoho.${(t==null?void 0:t.dataCenter)||"com"}/`,target:"_blank",rel:"noreferrer",children:a("Zoho API Console")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client id:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:a("Client id..."),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client secret:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:a("Client secret..."),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsx(P,{isAuthorized:l,isLoading:m,handleAuthorize:()=>U(t,s,y,v,h,p)}),e.jsx("br",{})]})]})]})}function ce({formFields:i,setIntegration:t,integrations:s,allIntegURL:z}){const N=T(),{formID:m}=F(),[h,p]=o.useState(!1),[u,r]=o.useState(1),[x,n]=o.useState({show:!1}),[j,l]=o.useState({name:"Zoho Desk API",type:"Zoho Desk",clientId:"",clientSecret:"",orgId:"",department:"",field_map:[{formField:"",zohoFormField:""}],actions:{}}),v=()=>{setTimeout(()=>{N(z)},1e3)};return o.useEffect(()=>{window.opener&&_("zohoDesk")},[]),e.jsxs("div",{children:[e.jsx(Z,{snack:x,setSnackbar:n}),e.jsx(G,{formID:m,deskConf:j,setDeskConf:l,step:u,setstep:r,isLoading:h,setisLoading:p,setSnackbar:n,authorizedAction:v})]})}export{ce as default}; |