var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var h=(e,n,i)=>n in e?A(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,c=(e,n)=>{for(var i in n||(n={}))T.call(n,i)&&h(e,i,n[i]);if(u)for(var i of u(n))z.call(n,i)&&h(e,i,n[i]);return e};import{_ as s,j as t}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{B as _}from"./BackIcn.BFDZx8No.js";import{y as f,a9 as S}from"./Note.DalStCGz.js";import{i as w}from"./HubspotCommonFunc.6U9zlXn-.js";import{T as E}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function R({hubspotConf:e,setHubspotConf:n,step:i,setstep:j,isInfo:a,loading:r,setLoading:y}){const[o,k]=x.useState(!1),[m,d]=x.useState({name:"",api_key:""}),p=l=>{const b=c({},e),g=c({},m);g[l.target.name]="",b[l.target.name]=l.target.value,d(g),n(b)},N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),j(2)},v=`
    <h4>${s("Step of generating Access Token:","bit-integrations")}</h4>
    <ul>
      <li>${s("Login to your HubSpot account, click the <b>Settings</b> icon settings in the main navigation bar..","bit-integrations")}</li>
      <li>${s("In the left sidebar menu, navigate to <b>Integrations > Private App</b>.","bit-integrations")}</li>
      <li>${s("Give name and description and select all necessary scope.","bit-integrations")}</li>
      <li>${s("Then create Access token.","bit-integrations")}</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:i===1&&900,height:i===1&&"auto"},children:[t.jsx(E,{linkKey:"hubspot"}),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==null?void 0:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Hubspot Access Token:","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("Access Token...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red"},children:m.api_key}),!a&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>w(e,d,k,r,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),r.auth&&t.jsx(f,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>N(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[s("Next","bit-integrations"),t.jsx(_,{className:"ml-1 rev-icn"})]})]}),t.jsx(S,{note:v})]})}export{R as default};
