var S=Object.defineProperty;var x=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var g=(e,n,i)=>n in e?S(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,d=(e,n)=>{for(var i in n||(n={}))T.call(n,i)&&g(e,i,n[i]);if(x)for(var i of x(n))_.call(n,i)&&g(e,i,n[i]);return e};import{_ as s,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z,a9 as L}from"./Note.BeM7sN-p.js";import{d as P}from"./SalesflareCommonFunc.D4IBx_yA.js";import{t as w}from"./tutorialLinks.kMkIDzcD.js";import{T as y}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function D({salesflareConf:e,setSalesflareConf:n,step:i,setStep:k,loading:r,setLoading:N,isInfo:o}){const[l,A]=j.useState(!1),[m,b]=j.useState({api_token:""}),{salesflare:a}=w,v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,k(2)},p=c=>{const u=d({},e),h=d({},m);h[c.target.name]="",u[c.target.name]=c.target.value,b(h),n(u)},I=`
            <h4>${s("Get API Key","bit-integrations")}</h4>
            <ul>
                <li>${s("Go to your Salesflare user dashboard","bit-integrations")}</li>
                <li>${s('Then click "Settings"',"bit-integrations")}</li>
                <li>${s('Then click "API Keys → Generates Keys"',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:i===1&&900,height:i===1&&"auto"},children:[t.jsx(y,{title:"Salesflare",youTubeLink:a==null?void 0:a.youTubeLink}),t.jsx(y,{title:"Salesflare",docLink:a==null?void 0:a.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:o}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"api_key",value:e.api_key,type:"text",placeholder:s("API Key...","bit-integrations"),disabled:o}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:m.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[s("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.salesflare.com/#/settings/apikeys",target:"_blank",children:s("Salesflare API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!o&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>P(e,b,A,r,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),r.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(L,{note:I})]})}export{D as default};
