var U=Object.defineProperty;var j=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var N=(t,s,a)=>s in t?U(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,b=(t,s)=>{for(var a in s||(s={}))E.call(s,a)&&N(t,a,s[a]);if(j)for(var a of j(s))S.call(s,a)&&N(t,a,s[a]);return t};import{j as e,_ as i}from"./main.2.8.1.js";import{d as y}from"./react-router-dom.9mCuUg3q.js";import{B as L}from"./BackIcn._kGL_vVw.js";import{a2 as v,z as f}from"./Note.BeM7sN-p.js";import{d as I,b as R}from"./MauticCommonFunc.9NjHUbhi.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import{t as B}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function V({mauticConf:t,setMauticConf:s,step:a,setstep:k,isLoading:p,setIsLoading:x,setSnackbar:r,redirectLocation:z,isInfo:l}){const[o,A]=y.useState(!1),[c,h]=y.useState({baseUrl:"",clientId:"",clientSecret:""}),{mautic:n}=B,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),k(2),R(t,s,x,r)},d=m=>{const g=b({},t),u=b({},c);u[m.target.name]="",g[m.target.name]=m.target.value,h(u),s(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[e.jsx(w,{title:"Mautic",youTubeLink:n==null?void 0:n.youTubeLink}),e.jsx(w,{title:"Mautic",docLink:n==null?void 0:n.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:d,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(v,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:l,setSnackbar:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(v,{value:z||`${window.location.href}`,className:"field-key-cpy w-6 ml-0",readOnly:l,setSnackbar:r}),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:`${t.baseUrl}/s/credentials/s/credentials`,target:"_blank",rel:"noreferrer",children:i("Mautic API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Mautic Base URL:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"baseUrl",value:t.baseUrl,type:"text",placeholder:i("User Name...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red"},children:c.baseUrl}),e.jsx("small",{className:"d-blk mt-3",children:i("Example: https://mautic.bit-integration.pro","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:d,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.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:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientSecret}),!l&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>I("mautic",t,s,h,A,x,r),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(f,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:T,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),e.jsx(L,{className:"ml-1 rev-icn"})]})]})]})}export{V as default};
