var z=Object.defineProperty;var u=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var x=(a,s,e)=>s in a?z(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e,b=(a,s)=>{for(var e in s||(s={}))F.call(s,e)&&x(a,e,s[e]);if(u)for(var e of u(s))C.call(s,e)&&x(a,e,s[e]);return a};import{j as t,_ as n,d as A}from"./main.2.8.1.js";import{d as p}from"./react-router-dom.9mCuUg3q.js";import{B as I}from"./BackIcn._kGL_vVw.js";import{t as S}from"./tutorialLinks.kMkIDzcD.js";import{z as j}from"./Note.BeM7sN-p.js";import{T as N}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function R({formID:a,fluentCartConf:s,setFluentCartConf:e,step:o,nextPage:g,isLoading:r,setIsLoading:d,setSnackbar:f}){const[l,v]=p.useState(!1),[m,k]=p.useState(!1),{fluentCart:i}=S,y=()=>{d("auth"),A({},"fluent_cart_authorize").then(c=>{c!=null&&c.success&&(v(!0),f({show:!0,msg:n("Connected with FluentCart Successfully","bit-integrations")})),d(!1),k(!0)})},w=c=>{const h=b({},s);h[c.target.name]=c.target.value,e(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[(i==null?void 0:i.youTubeLink)&&t.jsx(N,{title:"FluentCart",youTubeLink:i==null?void 0:i.youTubeLink}),(i==null?void 0:i.docLink)&&t.jsx(N,{title:"FluentCart",docLink:i==null?void 0:i.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:w,name:"name",value:s.name,type:"text",placeholder:n("Integration Name...","bit-integrations")}),r==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(j,{size:25,clr:"#022217",className:"mr-2"}),n("Checking if FluentCart is authorized!!!","bit-integrations")]}),m&&!l&&!r&&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:n("FluentCart is not activated or not installed","bit-integrations")})]})}),m&&l&&!r&&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:n("FluentCart is activated","bit-integrations")})]}),t.jsxs("button",{onClick:y,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r==="auth",children:[l?n("Connected","bit-integrations"):n("Connect to FluentCart","bit-integrations"),r==="auth"&&t.jsx(j,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>g(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[n("Next","bit-integrations"),t.jsx(I,{className:"ml-1 rev-icn"})]})]})}export{R as default};
