var v=Object.defineProperty;var u=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var g=(s,i,a)=>i in s?v(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,m=(s,i)=>{for(var a in i||(i={}))w.call(i,a)&&g(s,a,i[a]);if(u)for(var a of u(i))f.call(i,a)&&g(s,a,i[a]);return s};import{_ as e,j as t}from"./main.2.9.0.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as K,a9 as P}from"./Note.NSUdvR3c.js";import{h as I}from"./KlaviyoCommonFunc.D3b-o2lZ.js";import{T as z}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";import"./Integrations.DL8wqGct.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function D({klaviyoConf:s,setKlaviyoConf:i,step:a,setStep:y,isInfo:n,loading:r,setLoading:j}){const[o,N]=x.useState(!1),[l,b]=x.useState({name:"",authKey:""}),d=c=>{const h=m({},s),p=m({},l);p[c.target.name]="",h[c.target.name]=c.target.value,b(p),i(h)},k=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},A=`
  <h4>${e("Step of get API Key:","bit-integrations")}</h4>
  <ul>
    <li>${e("Goto Settings and click on","bit-integrations")} <a href="https://www.klaviyo.com/account#api-keys-tab" target='_blank'>${e("API Keys.","bit-integrations")}</a></li>
    <li>${e("Click on Create Private API key.","bit-integrations")}</li>
    <li>${e("Copy the <b>Private API Key</b> and paste into <b>API Key</b> field of your authorization form.","bit-integrations")}</li>
    <li>${e("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
</ul>
`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(z,{linkKey:"klaviyo"}),t.jsxs("div",{className:"mt-2",children:[t.jsx("div",{className:"my-1",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 my-1 mx-0",onChange:d,name:"name",value:s.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"my-1",children:t.jsx("b",{children:e("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 my-1 mx-0",onChange:d,name:"authKey",value:s.authKey,type:"text",placeholder:e("API Key...","bit-integrations"),disabled:n}),l.authKey&&t.jsx("div",{className:"mt-1 mb-2 error-msg",children:l.authKey}),t.jsxs("small",{className:"d-blk mt-1",children:[e("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://www.klaviyo.com/account#api-keys-tab",target:"_blank",rel:"noreferrer",children:e("here.","bit-integrations")})]}),!n&&t.jsxs("div",{className:"w-6 d-flx flx-between ",children:[t.jsxs("button",{onClick:()=>I(s,i,b,N,r,j),className:"btn btcd-btn-lg purple sh-sm",type:"button",disabled:o||r.auth,children:[o?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),r.auth&&t.jsx(K,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:k,className:"btn btcd-btn-lg purple sh-sm",type:"button",disabled:!o,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(P,{note:A})]})]})}export{D as default};
