var I=Object.defineProperty;var x=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var k=(e,i,a)=>i in e?I(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,d=(e,i)=>{for(var a in i||(i={}))_.call(i,a)&&k(e,a,i[a]);if(x)for(var a of x(i))z.call(i,a)&&k(e,a,i[a]);return e};import{_ as s,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as w,a9 as P}from"./Note.BeM7sN-p.js";import{n as L,g as E}from"./NimbleCommonFunc.CVIjJfHy.js";import{t as S}from"./tutorialLinks.kMkIDzcD.js";import{T as N}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function q({nimbleConf:e,setNimbleConf:i,step:a,setStep:y,loading:r,setLoading:p,isInfo:o}){const[l,A]=j.useState(!1),[m,u]=j.useState({api_key:""}),{nimble:n}=S,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,y(2),E(e,i,p)},b=c=>{const h=d({},e),g=d({},m);g[c.target.name]="",h[c.target.name]=c.target.value,u(g),i(h)},v=`
            <h4>${s("To Get API Token","bit-integrations")}</h4>
            <ul>
                <li>${s("First go to your Nimble dashboard.","bit-integrations")}</li>
                <li>${s('Click go to "Settings"',"bit-integrations")}</li>
                <li>${s('Then Click "API Tokens"',"bit-integrations")}</li>
                <li>${s('Then Click "Generate New Token',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(N,{title:"NimbleCRM",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(N,{title:"NimbleCRM",docLink:n==null?void 0:n.docLink}),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:o}),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:o}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:m.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.nimble.com/#app/settings/tokens",target:"_blank",children:s("Nimble API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!o&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>L(e,i,u,A,r,p),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),r.auth&&t.jsx(w,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:T,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(P,{note:v})]})}export{q as default};
