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