var L=Object.defineProperty;var g=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var p=(i,s,a)=>s in i?L(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a,m=(i,s)=>{for(var a in s||(s={}))S.call(s,a)&&p(i,a,s[a]);if(g)for(var a of g(s))I.call(s,a)&&p(i,a,s[a]);return i};import{r as j,j as t}from"./main-406.js";import{_ as n,L as z,N as y}from"./bi.394.85.js";import{d as P}from"./bi.389.905.js";import{T as k,t as w}from"./bi.150.760.js";function B({companyHubConf:i,setCompanyHubConf:s,step:a,setStep:N,loading:l,setLoading:v,isInfo:r}){const[o,A]=j.useState(!1),[d,b]=j.useState({sub_domain:"",api_key:""}),{companyHub:e}=w,_=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),i!=null&&i.default,N(2)},c=h=>{const u=m({},i),x=m({},d);x[h.target.name]="",u[h.target.name]=h.target.value,b(x),s(u)},T=`
            <h4>To Get Public Id & Secret Key</h4>
            <ul>
                <li>First go to your CompanyHub dashboard.</li>
                <li>Click go to "Settings" from Left Bottom corner</li>
                <li>Then Click "Integrations"</li>
                <li>Then Click "Generate Api key"</li>
                <li>Then copy "API Authorization Credentials"</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(k,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(k,{title:e==null?void 0:e.title,docLink:e==null?void 0:e.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("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:n("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("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:n("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:n("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:n("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:[n("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:n("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,b,A,l,v),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||l.auth,children:[o?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),l.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:_,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[n("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(y,{note:T})]})}export{B as default};
