var U=Object.defineProperty;var j=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var u=(t,s,a)=>s in t?U(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,m=(t,s)=>{for(var a in s||(s={}))k.call(s,a)&&u(t,a,s[a]);if(j)for(var a of j(s))E.call(s,a)&&u(t,a,s[a]);return t};import{j as e,_ as i}from"./main.2.9.0.js";import{b as N}from"./react-router.DMwpH23k.js";import{B as S}from"./BackIcn._8Wofmn2.js";import{a2 as y,y as T}from"./Note.NSUdvR3c.js";import{d as I,b as R}from"./MauticCommonFunc.wfqac_13.js";import{T as f}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function O({mauticConf:t,setMauticConf:s,step:a,setstep:v,isLoading:b,setIsLoading:p,setSnackbar:r,redirectLocation:w,isInfo:l}){const[d,z]=N.useState(!1),[n,h]=N.useState({baseUrl:"",clientId:"",clientSecret:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),v(2),R(t,s,p,r)},c=o=>{const x=m({},t),g=m({},n);g[o.target.name]="",x[o.target.name]=o.target.value,h(g),s(x)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[e.jsx(f,{linkKey:"mautic"}),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:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(y,{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(y,{value:w||`${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:c,name:"baseUrl",value:t.baseUrl,type:"text",placeholder:i("User Name...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red"},children:n.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:c,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:n.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:l}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:n.clientSecret}),!l&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>I("mautic",t,s,h,z,p,r),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||b,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),b&&e.jsx(T,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!d,children:[i("Next","bit-integrations"),e.jsx(S,{className:"ml-1 rev-icn"})]})]})]})}export{O as default};
