var T=Object.defineProperty;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var x=(e,s,a)=>s in e?T(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,m=(e,s)=>{for(var a in s||(s={}))_.call(s,a)&&x(e,a,s[a]);if(h)for(var a of h(s))I.call(s,a)&&x(e,a,s[a]);return e};import{_ as i,j as t}from"./main.2.9.0.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as P,a9 as z}from"./Note.NSUdvR3c.js";import{n as w}from"./NutshellCRMCommonFunc.DEdXNCHo.js";import{T as S}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function V({nutshellCRMConf:e,setNutshellCRMConf:s,step:a,setStep:j,loading:r,setLoading:N,isInfo:n}){const[o,k]=g.useState(!1),[l,p]=g.useState({api_token:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},c=d=>{const b=m({},e),u=m({},l);u[d.target.name]="",b[d.target.name]=d.target.value,p(u),s(b)},y="https://app.nutshell.com/setup/api-key",v=`
            <h4>${i("Get API Token","bit-integrations")}</h4>
            <ul>
                <li>${i("Go to your Nutshell CRM's user dashboard","bit-integrations")}</li>
                <li>${i('Then select "Settings"',"bit-integrations")}</li>
                <li>${i('Then go to "API Keys → Add API Key"',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(S,{linkKey:"nutshellCRM"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("User Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"user_name",value:e.user_name,type:"text",placeholder:i("User Name...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.user_name}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_token",value:e.api_token,type:"text",placeholder:i("API Token...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.api_token}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To Get User Name & API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:y,target:"_blank",children:i("NutshellCRM User Name & API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(e,s,p,k,r,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),r.auth&&t.jsx(P,{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:!o,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(z,{note:v})]})}export{V as default};
