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