var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var N=(s,l,n)=>l in s?A(s,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[l]=n,m=(s,l)=>{for(var n in l||(l={}))U.call(l,n)&&N(s,n,l[n]);if(u)for(var n of u(l))E.call(l,n)&&N(s,n,l[n]);return s};import{r as y,j as e}from"./main-406.js";import{B as S}from"./bi.46.744.js";import{_ as i,X as v,L as C}from"./bi.394.85.js";import{b as R,a as I}from"./bi.36.768.js";import{T as k,t as f}from"./bi.150.760.js";function O({mauticConf:s,setMauticConf:l,step:n,setstep:w,isLoading:p,setIsLoading:h,setSnackbar:a,redirectLocation:z,isInfo:r}){const[c,L]=y.useState(!1),[d,x]=y.useState({baseUrl:"",clientId:"",clientSecret:""}),{mautic:t}=f,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),w(2),I(s,l,h,a)},o=b=>{const g=m({},s),j=m({},d);j[b.target.name]="",g[b.target.name]=b.target.value,x(j),l(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(k,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(k,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.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:o,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),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:r,setSnackbar:a}),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:r,setSnackbar:a}),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://${s.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:o,name:"baseUrl",value:s.baseUrl,type:"text",placeholder:i("User name...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red"},children:d.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:o,name:"clientId",value:s.clientId,type:"text",placeholder:i("Client id...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.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:o,name:"clientSecret",value:s.clientSecret,type:"text",placeholder:i("Client secret...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R("mautic",s,l,x,L,h,a),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||p,children:[c?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),p&&e.jsx(C,{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:!c,children:[i("Next","bit-integrations"),e.jsx(S,{className:"ml-1 rev-icn"})]})]})]})}export{O as default};
