var w=Object.defineProperty;var m=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var u=(a,s,e)=>s in a?w(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e,b=(a,s)=>{for(var e in s||(s={}))y.call(s,e)&&u(a,e,s[e]);if(m)for(var e of m(s))z.call(s,e)&&u(a,e,s[e]);return a};import{j as t,_ as i,b as C}from"./main.2.9.0.js";import{b as x}from"./react-router.DMwpH23k.js";import{B as A}from"./BackIcn._8Wofmn2.js";import{y as p}from"./Note.NSUdvR3c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function M({sureDashConf:a,setSureDashConf:s,step:e,nextPage:j,isLoading:c,setIsLoading:l,setSnackbar:f,isInfo:h}){const[r,N]=x.useState(!1),[d,g]=x.useState(!1),v=()=>{l("auth"),C({},"sure_dash_authorize").then(n=>{n!=null&&n.success&&(N(!0),f({show:!0,msg:i("Connected with SureDash Successfully","bit-integrations")})),l(!1),g(!0)}).catch(()=>l(!1))},S=n=>{const o=b({},a);o[n.target.name]=n.target.value,s(o)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:e===1&&900,height:e===1&&"auto"},children:[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:S,name:"name",value:a.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:h}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(p,{size:25,clr:"#022217",className:"mr-2"}),i("Checking if SureDash is authorized!!!","bit-integrations")]}),d&&!r&&!c&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:i("SureDash is not activated or not installed","bit-integrations")})]})}),d&&r&&!c&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:i("SureDash is activated","bit-integrations")})]}),!h&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:v,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c==="auth",children:[r?i("Connected","bit-integrations"):i("Connect to SureDash","bit-integrations"),c==="auth"&&t.jsx(p,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>j(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx(A,{className:"ml-1 rev-icn"})]})]})]})}export{M as default};
