var _=Object.defineProperty;var h=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=(e,s,a)=>s in e?_(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,p=(e,s)=>{for(var a in s||(s={}))A.call(s,a)&&g(e,a,s[a]);if(h)for(var a of h(s))w.call(s,a)&&g(e,a,s[a]);return e};import{_ as i,j as t}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as z,a9 as I}from"./Note.DalStCGz.js";import{m as S}from"./MoxieCRMCommonFunc.infuq_j2.js";import{T}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function B({moxiecrmConf:e,setMoxieCRMConf:s,step:a,setStep:j,loading:r,setLoading:y,isInfo:n}){const[l,k]=x.useState(!1),[o,b]=x.useState({api_key:"",api_url:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},c=d=>{const m=p({},e),u=p({},o);u[d.target.name]="",m[d.target.name]=d.target.value,b(u),s(m)},v=`
  <h4>${i("Get api secret key","bit-integrations")}</h4>
  <ul>
      <li>${i("First go to your Moxie dashboard.","bit-integrations")}</li>
      <li>${i("Then click Workspace Settings from bottom left corner.","bit-integrations")}</li>
      <li>${i('Click "Connneted Apps", Then click "Integrations"',"bit-integrations")}</li>
      <li>${i('Select "Custom Integrations"',"bit-integrations")}</li>
  </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(T,{linkKey:"moxiecrm"}),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("Your API URL:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_url",value:e.api_url,type:"text",placeholder:i("Your Client...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.api_url}),t.jsx("small",{className:"d-blk mt-3",children:i("Example: {name}.withmoxie.com","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_key",value:e.api_key,type:"text",placeholder:i("API Token...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.api_key}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>S(e,s,b,k,r,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),r.auth&&t.jsx(z,{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:!l,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(I,{note:v})]})}export{B as default};
