var I=Object.defineProperty;var h=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=(e,n,a)=>n in e?I(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,m=(e,n)=>{for(var a in n||(n={}))T.call(n,a)&&g(e,a,n[a]);if(h)for(var a of h(n))v.call(n,a)&&g(e,a,n[a]);return e};import{_ as i,j as t,q as w}from"./main.2.9.0.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as _,a9 as z}from"./Note.NSUdvR3c.js";import{p as L}from"./PerfexCRMCommonFunc.G_UNPdBU.js";import{T as S}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function F({perfexCRMConf:e,setPerfexCRMConf:n,step:a,setStep:j,loading:o,setLoading:A,isInfo:s}){const[r,k]=x.useState(!1),[l,b]=x.useState({api_token:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},d=c=>{const p=m({},e),u=m({},l);u[c.target.name]="",p[c.target.name]=c.target.value,b(u),n(p)},y=()=>{e.domain?window.open(`${e.domain}/admin/api/api_management`,"_blank","noreferrer"):w.error(i("Access API URL is required!","bit-integrations"))},P=`
            <h4>${i("Get API Token","bit-integrations")}</h4>
            <ul>
                <li>${i("Go to your Perfex CRM's Admin area and select the following menu item: <b>SETUP → MODULES</b>.","bit-integrations")}</li>
                <li>${i("Select the extracted upload.zip at Module installation selection prompt and press <b>INSTALL</b>.","bit-integrations")}</li>
                <li>${i("Find the newly installed module in the list, press <b>ACTIVATE</b> and enter your license key.","bit-integrations")}</li>
                <li>${i("Go to your Perfex's CRM backend as an admin, go to <b>API → API Management</b>, and create a 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(S,{linkKey:"perfexCRM"}),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:d,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Access API URL:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"domain",value:e.domain,type:"text",placeholder:i("Access API URL...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.domain}),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:d,name:"api_token",value:e.api_token,type:"text",placeholder:i("API Token...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.api_token}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",onClick:y,children:i("PerfexCRM API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!s&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>L(e,n,b,k,o,A),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||o.auth,children:[r?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),o.auth&&t.jsx(_,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:N,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(z,{note:P})]})}export{F as default};
