var S=Object.defineProperty;var N=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var y=(s,t,a)=>t in s?S(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a,h=(s,t)=>{for(var a in t||(t={}))k.call(t,a)&&y(s,a,t[a]);if(N)for(var a of N(t))L.call(t,a)&&y(s,a,t[a]);return s};import{k as I,g as _,j as e,_ as i}from"./main.2.8.1.js";import{d as z}from"./react-router-dom.9mCuUg3q.js";import{B as D}from"./BackIcn._kGL_vVw.js";import{a2 as A,z as M}from"./Note.BeM7sN-p.js";import{k as P}from"./Integrations.D2bgBas2.js";import{r as $}from"./ZohoMarketingHubCommonFunc.jxunAV-M.js";import{t as B}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function H({formID:s,marketingHubConf:t,setMarketingHubConf:a,step:p,setstep:E,isLoading:x,setIsLoading:u,setSnackbar:o,redirectLocation:T,isInfo:n}){const[d,Z]=z.useState(!1),[r,j]=z.useState({dataCenter:"",clientId:"",clientSecret:""}),b=I(_),C="ZohoMarketingHub.lead.READ,ZohoMarketingHub.lead.CREATE,ZohoMarketingHub.lead.UPDATE",{zohoMarketingHub:l}=B,R=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),E(2),$(s,t,a,u,o)},c=m=>{const g=h({},t),v=h({},r);v[m.target.name]="",g[m.target.name]=m.target.value,j(v),a(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(w,{title:"Zoho Marketing Automation (Zoho Marketing Hub)",youTubeLink:l==null?void 0:l.youTubeLink}),e.jsx(w,{title:"Zoho Marketing Automation (Zoho Marketing Hub)",docLink:l==null?void 0:l.docLink}),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: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:r.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(A,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:o}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(A,{value:T||`${b.api}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:o,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:r.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:r.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>P("zohoMarkatingHub","zmarketingHub",C,t,a,j,Z,u,o,b),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||x,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),x&&e.jsx(M,{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:!d,children:[i("Next","bit-integrations"),e.jsx(D,{className:"ml-1 rev-icn"})]})]})]})}export{H as default};
