var v=Object.defineProperty;var h=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var g=(i,s,e)=>s in i?v(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,l=(i,s)=>{for(var e in s||(s={}))k.call(s,e)&&g(i,e,s[e]);if(h)for(var e of h(s))f.call(s,e)&&g(i,e,s[e]);return i};import{j as t,_ as a}from"./main.2.9.0.js";import{b as x}from"./react-router.DMwpH23k.js";import{B as z}from"./BackIcn._8Wofmn2.js";import{y as I,a9 as _}from"./Note.NSUdvR3c.js";import{i as w}from"./HefflCRMCommonFunc.CnwvFLUw.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function D({hefflCRMConf:i,setHefflCRMConf:s,step:e,setStep:y,isLoading:c,setIsLoading:j,isInfo:n}){const[r,N]=x.useState(!1),[m,d]=x.useState({name:"",api_key:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},p=o=>{const b=l({},i),u=l({},m);u[o.target.name]="",b[o.target.name]=o.target.value,d(u),s(b)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:e===1&&900,height:e===1&&"auto"},children:[t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"name",value:i.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"api_key",value:i.api_key||"",type:"text",placeholder:a("Heffl CRM API Key...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:m.api_key}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(i,d,N,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c,children:[r?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),c&&t.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[a("Next","bit-integrations"),t.jsx(z,{className:"ml-1 rev-icn"})]})]}),t.jsx(_,{note:P})]})}const P=`
    <h4>${a("Steps to generate API Key:","bit-integrations")}</h4>
    <ul>
      <li>${a("Log in to your Heffl CRM account.","bit-integrations")}</li>
      <li>${a("Go to Settings → Developers / API Keys and generate a new key.","bit-integrations")}</li>
      <li>${a("Copy the API key and paste it into the field above, then click Authorize.","bit-integrations")}</li>
    </ul>
  `;export{D as default};
