var I=Object.defineProperty;var j=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var N=(n,t,i)=>t in n?I(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,m=(n,t)=>{for(var i in t||(t={}))S.call(t,i)&&N(n,i,t[i]);if(j)for(var i of j(t))k.call(t,i)&&N(n,i,t[i]);return n};import{j as e,_ as s}from"./main.2.8.10.js";import{b as y}from"./react-router.DMwpH23k.js";import{B as E}from"./BackIcn.BFDZx8No.js";import{a2 as v,y as T}from"./Note.DalStCGz.js";import{e as C,r as R}from"./MailChimpCommonFunc.BWlyyYbz.js";import{T as _}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function K({formID:n,mailChimpConf:t,setMailChimpConf:i,step:p,setstep:w,isLoading:h,setIsLoading:x,setSnackbar:r,redirectLocation:f,isInfo:a}){const[l,z]=y.useState(!1),[c,b]=y.useState({dataCenter:"",clientId:"",clientSecret:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),w(2),R(i,x,r)},o=d=>{const u=m({},t),g=m({},c);g[d.target.name]="",u[d.target.name]=d.target.value,b(g),i(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(_,{linkKey:"mailchimp"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(v,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(v,{value:f||`${window.location.href}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:r}),e.jsxs("small",{className:"d-blk mt-5",children:[s("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://us7.admin.mailchimp.com/account/oauth2/",target:"_blank",rel:"noreferrer",children:s("Mail Chimp API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientSecret}),!a&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>C("mailChimp","mChimp",t,i,b,z,x,r),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||h,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),h&&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:!l,children:[s("Next","bit-integrations"),e.jsx(E,{className:"ml-1 rev-icn"})]})]})]})}export{K as default};
