var A=Object.defineProperty;var h=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var x=(e,s,a)=>s in e?A(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,m=(e,s)=>{for(var a in s||(s={}))y.call(s,a)&&x(e,a,s[a]);if(h)for(var a of h(s))T.call(s,a)&&x(e,a,s[a]);return e};import{j as t,_ as n}from"./main.2.8.10.js";import{b as j}from"./react-router.DMwpH23k.js";import{y as _}from"./Note.DalStCGz.js";import{k as z}from"./AgiledCommonFunc.DH0yg7tz.js";import{T as w}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function f({agiledConf:e,setAgiledConf:s,step:a,setStep:g,loading:i,setLoading:k,isInfo:r}){const[l,N]=j.useState(!1),[o,b]=j.useState({auth_token:"",brand:""}),v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,g(2)},c=d=>{const p=m({},e),u=m({},o);u[d.target.name]="",p[d.target.name]=d.target.value,b(u),s(p)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(w,{linkKey:"agiled"}),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:c,name:"name",value:e.name,type:"text",placeholder:n("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Brand (Your Account URL):","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"brand",value:e.brand,type:"text",placeholder:n("Your Account...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.brand}),t.jsx("small",{className:"d-blk mt-3",children:n("Example: name.agiled.app","bit-integrations")}),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:c,name:"auth_token",value:e.auth_token,type:"text",placeholder:n("API Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.auth_token}),e.brand&&t.jsxs("small",{className:"d-blk mt-3",children:[n("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://${e.brand}/admin/settings/api-settings`,target:"_blank",rel:"noreferrer",children:n("Agiled API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>z(e,s,b,N,i,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||i.auth,children:[l?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),i.auth&&t.jsx(_,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[n("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{f as default};
