var v=Object.defineProperty;var h=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var x=(e,a,i)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i,c=(e,a)=>{for(var i in a||(a={}))I.call(a,i)&&x(e,i,a[i]);if(h)for(var i of h(a))_.call(a,i)&&x(e,i,a[i]);return e};import{_ as s,j as t}from"./main.2.8.10.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as S,a9 as z}from"./Note.DalStCGz.js";import{d as K}from"./SalesflareCommonFunc.CSSJgQek.js";import{T as P}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function R({salesflareConf:e,setSalesflareConf:a,step:i,setStep:j,loading:n,setLoading:y,isInfo:r}){const[o,k]=g.useState(!1),[d,m]=g.useState({api_token:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},b=l=>{const p=c({},e),u=c({},d);u[l.target.name]="",p[l.target.name]=l.target.value,m(u),a(p)},A=`
            <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(P,{linkKey:"salesflare"}),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:b,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),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:b,name:"api_key",value:e.api_key,type:"text",placeholder:s("API Key...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.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",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>K(e,m,k,n,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||n.auth,children:[o?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),n.auth&&t.jsx(S,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:N,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(z,{note:A})]})}export{R as default};
