var S=Object.defineProperty;var x=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var g=(i,s,a)=>s in i?S(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a,b=(i,s)=>{for(var a in s||(s={}))T.call(s,a)&&g(i,a,s[a]);if(x)for(var a of x(s))z.call(s,a)&&g(i,a,s[a]);return i};import{_ as e,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as I,a9 as L}from"./Note.BeM7sN-p.js";import{d as P}from"./CompanyHubCommonFunc.CGm8nZRA.js";import{t as w}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function F({companyHubConf:i,setCompanyHubConf:s,step:a,setStep:y,loading:o,setLoading:N,isInfo:r}){const[l,v]=j.useState(!1),[d,u]=j.useState({sub_domain:"",api_key:""}),{companyHub:n}=w,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),i!=null&&i.default,y(2)},c=m=>{const h=b({},i),p=b({},d);p[m.target.name]="",h[m.target.name]=m.target.value,u(p),s(h)},_=`
            <h4>${e("To Get Public Id & Secret Key","bit-integrations")}</h4>
            <ul>
                <li>${e("First go to your CompanyHub dashboard.","bit-integrations")}</li>
                <li>${e('Click go to "Settings" from Left Bottom corner',"bit-integrations")}</li>
                <li>${e('Then Click "Integrations"',"bit-integrations")}</li>
                <li>${e('Then Click "Generate Api key"',"bit-integrations")}</li>
                <li>${e('Then copy "API Authorization Credentials"',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(k,{title:"CompanyHub",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(k,{title:"CompanyHub",docLink:n==null?void 0:n.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:i.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Sub Domain:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"sub_domain",value:i.sub_domain,type:"text",placeholder:e("Sub Domain...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.sub_domain}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_key",value:i.api_key,type:"text",placeholder:e("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:[e("To Get Sub Domain & API Key, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.companyhub.com/settings/integration",target:"_blank",children:e("CompanyHub Sub Domain & API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>P(i,s,u,v,o,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||o.auth,children:[l?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),o.auth&&t.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(L,{note:_})]})}export{F as default};
