var C=Object.defineProperty;var k=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var A=(i,t,s)=>t in i?C(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,g=(i,t)=>{for(var s in t||(t={}))E.call(t,s)&&A(i,s,t[s]);if(k)for(var s of k(t))L.call(t,s)&&A(i,s,t[s]);return i};import{u as T,$ as F,r as n,j as e,_ as a,C as f,F as I,g as Z,S as _}from"./main-762.js";/* empty css */import{c as $}from"./bf-767-42.js";import{t as w}from"./bf-281-48.js";import{T as D}from"./bf-525-114.js";import{A as P}from"./bf-704-110.js";import{e as U}from"./bf-27-77.js";import"./bf-685-46.js";import"./bf-383-45.js";import"./bf-848-68.js";import"./bf-241-52.js";import"./bf-145-47.js";import"./bf-213-54.js";import"./bf-249-69.js";import"./bf-284-49.js";import"./bf-466-50.js";import"./bf-604-51.js";import"./bf-441-53.js";import"./bf-897-55.js";import"./bf-142-115.js";function G({formID:i,recruitConf:t,setRecruitConf:s,step:z,setstep:N,isLoading:h,setisLoading:p,setSnackbar:u,redirectLocation:x,isInfo:o,authorizedAction:j}){const l=T(F),{siteURL:S}=l,[c,b]=n.useState(!1),[r,d]=n.useState({dataCenter:"",clientId:"",clientSecret:""}),m=v=>{const y=g({},t),R=g({},r);R[v.target.name]="",y[v.target.name]=v.target.value,d(R),s(y)};return n.useEffect(()=>{c&&j()},[c]),e.jsxs(e.Fragment,{children:[e.jsx(D,{title:w.zohoRecruit.title,youTubeLink:w.zohoRecruit.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:m,name:"name",value:t.name,type:"text",placeholder:a("e.g. Marketing — work account"),disabled:o}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Data Center:")})}),e.jsxs("select",{onChange:m,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:o,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:r.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Homepage URL:")})}),e.jsx(f,{value:S,className:"field-key-cpy w-6 ml-0",readOnly:o}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:")})}),e.jsx(f,{value:x||`${l.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:o}),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:m,name:"clientId",value:t.clientId,type:"text",placeholder:a("Client id..."),disabled:o}),e.jsx("div",{style:{color:"red"},children:r.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:m,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:a("Client secret..."),disabled:o}),e.jsx("div",{style:{color:"red"},children:r.clientSecret}),!o&&e.jsxs(e.Fragment,{children:[e.jsx(P,{isAuthorized:c,isloading:h,handleAuthorize:()=>U(t,s,d,b,p,u)}),e.jsx("br",{})]})]})]})}function ce({formFields:i,setIntegration:t,integrations:s,allIntegURL:z}){const N=I(),{formID:h}=Z(),[p,u]=n.useState(!1),[x,o]=n.useState(1),[j,l]=n.useState({show:!1}),[S,c]=n.useState(0),[b,r]=n.useState({name:"Zoho Recruit API",type:"Zoho Recruit",clientId:"",clientSecret:"",module:"",field_map:[{formField:"",zohoFormField:""}],relatedlists:[],actions:{}}),d=()=>{setTimeout(()=>{N(z)},1e3)};return n.useEffect(()=>{window.opener&&$("zohoRecruit")},[]),e.jsxs("div",{children:[e.jsx(_,{snack:j,setSnackbar:l}),e.jsx(G,{formID:h,recruitConf:b,setRecruitConf:r,step:x,setstep:o,isLoading:p,setisLoading:u,setSnackbar:l,authorizedAction:d})]})}export{ce as default};