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