(globalThis.webpackChunkbooktics=globalThis.webpackChunkbooktics||[]).push([[1887,8155],{4623:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Container:()=>u,StyledFilterSelection:()=>g,StyledItemCard:()=>b,StyledModal:()=>h,StyledSinglePage:()=>p});var n=a(52762),r=a(59e3),i=a(22564),l=a(75778);const o=n.css`
    .bkt-semi-bold-text {
        font-weight: 600;
        font-size: 16px;
    }
`,s=n.css`
    .bkt-hidden-input {
        height: 0;
        margin-top: -22px;

        .ant-form-item-control-input {
            display: none;
        }
    }
`,c=n.css`
    .ant-form-item .ant-form-item-label > label.ant-form-item-required {
        &::before {
            display: none;
        }

        &::after {
            display: inline-block;
            margin-inline-end: 4px;
            color: #ff4d4f;
            font-size: 14px;
            font-family: SimSun, sans-serif;
            line-height: 1;
            content: "*";
            visibility: visible;
        }
    }
`,d=n.css`
    @media (max-width: ${l.a?.xl}px) {
        padding: 20px;
    }
`,m=n.css`
    .bkt-container-row {
        max-width: 1200px;
    }
`,u=(0,r.A)(i.Flex)`
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 45px;
    color: ${({theme:e})=>e.colors.neutralLightDark};

    .bkt-row-layout {
        min-height: 600px;
    }

    ${m}
    ${o}
    ${d}
    ${s}
    ${c}
`,p=(0,r.A)(i.Flex)`
    min-height: 100%;
    margin: 0 auto;
    padding: 45px 100px;
    max-width: 1200px;
    color: ${({theme:e})=>e.colors.neutralLightDark};

    .bkt-row-layout {
        min-height: 500px;
    }

    ${m}
    ${o}
    ${d}
    ${s}
    ${c}
`,g=(0,r.A)(i.SelectInput)`
    min-width: 143px;
`,h=(0,r.A)(i.Modal)`
    &.ant-modal {
        width: 90% !important;
        max-width: 1100px;
    }

    .ant-modal-content {
        border: 1px solid ${({theme:e})=>e.colors.inputBorder};
        border-radius: 10px;
    }

    .ant-modal-body {
        padding: 0;

        .bkt-row-layout {
            min-height: 600px;

            @media (max-width: ${l.a?.xxl}px) {
                min-height: 500px;
            }
        }

        ${s}
        ${c}
    }
`,b=(0,r.A)(i.Card)`
    height: ${({height:e})=>e||"522px"};
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    box-shadow: none !important;

    .ant-card-body {
        height: 100%;
        padding: 20px;

        .bkt-${({context:e})=>e||"service"}-frontend-inner {
            height: 100% !important;
        }
    }

    .bkt-${({context:e})=>e||"service"}-img {
        border-radius: 10px;
        object-fit: cover;
    }

    .bkt-${({context:e})=>e||"service"}-text {
        color: #0e0f0c;
    }

    .bkt-${({context:e})=>e||"service"}-price {
        font-size: 20px;
        color: ${({theme:e})=>e.colors.neutralLightDark};
        font-weight: 700;
    }

    /* Additional styling for description text with ellipsis */
    .bkt-${({context:e})=>e||"service"}-description {
        display: -webkit-box;
        -webkit-line-clamp: ${({descriptionLines:e})=>e||3};
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
        margin-bottom: 10px;
    }

    /* Title text with ellipsis */
    .bkt-${({context:e})=>e||"service"}-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 8px;
        font-weight: 600;
    }
`},13722:(e,t,a)=>{var n={"./af.js":65662,"./am.js":82355,"./ar-dz.js":48361,"./ar-iq.js":13309,"./ar-kw.js":79865,"./ar-ly.js":85592,"./ar-ma.js":81289,"./ar-sa.js":40539,"./ar-tn.js":54405,"./ar.js":2338,"./az.js":51130,"./be.js":51532,"./bg.js":39990,"./bi.js":95944,"./bm.js":71092,"./bn-bd.js":64608,"./bn.js":92509,"./bo.js":59294,"./br.js":72745,"./bs.js":25530,"./ca.js":25993,"./cs.js":9751,"./cv.js":4780,"./cy.js":95681,"./da.js":20325,"./de-at.js":32878,"./de-ch.js":13672,"./de.js":50494,"./dv.js":82187,"./el.js":54072,"./en-au.js":59881,"./en-ca.js":21995,"./en-gb.js":72026,"./en-ie.js":17329,"./en-il.js":97690,"./en-in.js":60912,"./en-nz.js":35571,"./en-sg.js":12673,"./en-tt.js":2619,"./en.js":65826,"./eo.js":33713,"./es-do.js":61219,"./es-mx.js":64719,"./es-pr.js":3532,"./es-us.js":32498,"./es.js":47317,"./et.js":4288,"./eu.js":94007,"./fa.js":90292,"./fi.js":89964,"./fo.js":17674,"./fr-ca.js":86290,"./fr-ch.js":73433,"./fr.js":813,"./fy.js":59836,"./ga.js":54061,"./gd.js":68418,"./gl.js":33562,"./gom-latn.js":78660,"./gu.js":57409,"./he.js":92010,"./hi.js":52830,"./hr.js":15811,"./ht.js":8809,"./hu.js":38298,"./hy-am.js":94309,"./id.js":87420,"./is.js":15513,"./it-ch.js":19286,"./it.js":33900,"./ja.js":50952,"./jv.js":77741,"./ka.js":46481,"./kk.js":11335,"./km.js":36101,"./kn.js":6364,"./ko.js":88003,"./ku.js":16605,"./ky.js":34457,"./lb.js":88615,"./lo.js":73860,"./lt.js":34485,"./lv.js":76467,"./me.js":80623,"./mi.js":32739,"./mk.js":75877,"./ml.js":75376,"./mn.js":12698,"./mr.js":46462,"./ms-my.js":26400,"./ms.js":79677,"./mt.js":77083,"./my.js":46803,"./nb.js":7205,"./ne.js":40880,"./nl-be.js":60465,"./nl.js":69423,"./nn.js":23473,"./oc-lnc.js":70225,"./pa-in.js":39252,"./pl.js":63225,"./pt-br.js":92218,"./pt.js":72369,"./rn.js":34509,"./ro.js":24334,"./ru.js":62796,"./rw.js":35414,"./sd.js":63222,"./se.js":55285,"./si.js":65665,"./sk.js":46847,"./sl.js":39998,"./sq.js":95977,"./sr-cyrl.js":27439,"./sr.js":45616,"./ss.js":52487,"./sv-fi.js":9160,"./sv.js":21340,"./sw.js":2979,"./ta.js":77250,"./te.js":87406,"./tet.js":18928,"./tg.js":15012,"./th.js":47081,"./tk.js":62544,"./tl-ph.js":78142,"./tlh.js":60321,"./tr.js":4895,"./tzl.js":3187,"./tzm-latn.js":58804,"./tzm.js":95084,"./ug-cn.js":79911,"./uk.js":34173,"./ur.js":51750,"./uz-latn.js":80950,"./uz.js":54734,"./vi.js":40860,"./x-pseudo.js":83379,"./yo.js":87933,"./zh-cn.js":16033,"./zh-hk.js":87741,"./zh-tw.js":31349,"./zh.js":56007};function r(e){var t=i(e);return a(t)}function i(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=13722},21887:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s});var n=a(51609),r=a(47143),i=a(86087),l=a(98437),o=a(60532);const s=()=>{const{setFrontendState:e}=(0,r.useDispatch)(o.H);return(0,i.useEffect)(()=>{e({viewMode:"modal"})},[]),(0,n.createElement)(l.A,null)}},29174:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(47143),r=a(56580),i=a(60532);const l=()=>{const{setFrontendState:e}=(0,n.useDispatch)(i.H),t=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{selectedData:a=[],currentStep:l=0,viewMode:o,orderDetails:s,teamList:c,locationTeamList:d,currentSelectedData:m,frontendStepsOrder:u}=t,p=(0,r.useFrontendLicense)();return{goNext:()=>{e({currentStep:l+1})},goPrevious:()=>{e({currentStep:l-1})},handleTeamSelect:({team:t={}})=>{let n=[...a];n[n.length-1]={...n[n.length-1],team:t},e({currentStep:l+1,selectedData:n,currentSelectedData:n?.[n?.length-1]||{}})},handleServiceSelect:({service:t={}})=>{const n=t?.additional_durations,r=t?.extra_services?.length,i=t?.group_booking?.enable_group_booking,s=d||c,m=s?.filter(e=>!!Array.isArray(t?.team_member)&&t?.team_member?.includes(e.id)),g={open:"modal"===o,selectedData:[...a,{service:t}]};let h=[...g.selectedData],b=l,f=[...u];i||(f=f.filter(e=>"group_booking"!==e)),n?.length>1&&p?b=l+1:(h[h.length-1]={...h[h.length-1],additional_duration:n[0],total:n?.[0]?.charge_amount||0},p?r?(f=f.filter(e=>"multiple_pricing"!==e),b=f.indexOf("extra_service")):i?(f=f.filter(e=>"multiple_pricing"!==e&&"extra_service"!==e),b=f.indexOf("group_booking")):1===m?.length&&(!p||n.length<2)?(h[h.length-1]={...h[h.length-1],team:m[0]},f=f.filter(e=>"multiple_pricing"!==e&&"extra_service"!==e&&"group_booking"!==e&&"team"!==e),b=f.indexOf("time_slot")):(f=f.filter(e=>"multiple_pricing"!==e&&"extra_service"!==e&&"group_booking"!==e),b=f.indexOf("team")):p||1!==m?.length?(f=f.filter(e=>"multiple_pricing"!==e&&"extra_service"!==e&&"group_booking"!==e),b=f.indexOf("team")):(h[h.length-1]={...h[h.length-1],team:m[0]},f=f.filter(e=>"multiple_pricing"!==e&&"extra_service"!==e&&"group_booking"!==e&&"team"!==e),b=f.indexOf("time_slot"))),e({...g,currentStep:b,serviceTeamList:m,frontendStepsOrder:f,selectedData:h,currentSelectedData:h?.[h?.length-1]||{}})},shouldDisableNext:()=>{const e=u[l];return"team"===e?!m?.team:"time_slot"===e?!m?.date||!m?.start_time:"order_details"===e?!s?.length:"multiple_pricing"===e&&!m?.additional_duration}}}},38155:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>Q});var n=a(51609),r=a(47143),i=a(86087),l=a(22564),o=a(60532),s=a(4623),c=a(87927),d=a(27723);const m=({invoiceData:e})=>(0,n.createElement)(l.Flex,{vertical:!0,gap:"small"},(0,n.createElement)(l.Flex,{gap:8,align:"center"},(0,n.createElement)(l.Title,{level:3,text:(0,d.__)("Your booking confirmed","booktics")}),(0,n.createElement)(l.Text,{className:"bkt-invoice-status",text:e?.status})),(0,n.createElement)(l.Text,{className:"bkt-order-no",text:(0,d.__)("Booking ID: ","Booktics")+e?.order_no}),(0,n.createElement)(l.Space,{size:4},(0,n.createElement)(l.Text,{text:(0,d.__)("An email confirmation was sent to","booktics")}),(0,n.createElement)(l.Text,{className:"bkt-customer-email",text:e?.customer?.email})),(0,n.createElement)(c.TQ,null)),u=({invoiceData:e})=>{const{settings:t}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]);return(0,n.createElement)(l.Flex,{vertical:!0,gap:"small"},e?.items?.map(e=>(0,n.createElement)(l.SingleBookingBox,{key:e?.id,settings:t,bookingItem:e})))},p=({invoiceData:e})=>{const{settings:t}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]);return(0,n.createElement)(l.CostBreakdownReusableComp,{invoiceData:e,settings:t})};var g=a(47767),h=a(11534);var b=a(59e3);const f=(0,b.A)(l.Card)`
    max-width: 580px;
    width: 100%;
    height: 100%;
    font-size: 16px;
    min-height: 500px;

    .bkt-order-no {
        font-size: 18px;
        font-weight: 500;
    }

    .bkt-customer-email {
        font-weight: 500;
    }
    .bkt-custom-field-title {
        text-transform: capitalize;
    }

    .bkt-invoice-status {
        background-color: #d1fae5;
        min-width: 60px;
        border-radius: 100px;
        color: #065f46;
        height: 30px;
        display: flex;
        align-items: center;
        font-weight: 500;
        justify-content: center;
        margin-bottom: 2px;
    }
`,_=(0,b.A)(l.Flex)`
    font-size: 16px;

    .bkt-reschedule,
    .bkt-cancel {
        font-weight: 500;
    }

    .bkt-reschedule {
        color: #009959;
    }

    .bkt-cancel {
        color: #ed695e;
    }
`,x=(0,b.A)(l.Modal)`
    &.ant-modal {
        width: 90% !important;
        max-width: 600px;
    }
`;var k=a(60742),v=a(44512);const y=()=>(0,n.createElement)(l.Flex,{vertical:!0,align:"center",justify:"space-between"},(0,n.createElement)(l.Title,{level:5,text:(0,d.__)("Cancelled Appointment","booktics")}),(0,n.createElement)(l.Description,{text:(0,d.__)("Oops, it seems your booking was canceled.","booktics")}),(0,n.createElement)(l.PrimaryButton,{text:(0,d.__)("Book Again","booktics"),onClick:()=>{window.location.href=window.location.pathname}})),E=()=>{const[e]=k.A.useForm(),t=(0,g.Zp)(),{openCancelModal:a,cancelLoading:i,isCancelledSuccess:s}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),{setFrontendState:c}=(0,r.useDispatch)(o.H),{cancel:m}=(0,v.A)();return(0,n.createElement)(l.Modal,{onCancel:()=>{c({openCancelModal:!1}),t(`/${window.location?.pathname}`)},open:a,centered:!0,footer:null,maskClosable:!1,destroyOnHidden:!0},(0,n.createElement)(l.Flex,{gap:10,vertical:!0},s?(0,n.createElement)(y,null):(0,n.createElement)(n.Fragment,null,(0,n.createElement)(l.Title,{level:4,text:(0,d.__)("Give your information","booktics")}),(0,n.createElement)(k.A,{form:e,onFinish:m},(0,n.createElement)(l.FormItem,{name:"cancel_note"},(0,n.createElement)(l.TextArea,{placeholder:(0,d.__)("Please tell us the reason to cancel this Appointment","booktics"),rows:4}))),(0,n.createElement)("div",null,(0,n.createElement)(l.PrimaryButton,{text:(0,d.__)("Cancel Appointment","booktics"),onClick:e.submit,loading:i})))))};var w=a(74353),S=a.n(w),F=a(95358);const j=({invoiceData:e})=>{const t=(0,F.phpToDayjsFormat)(window?.booktics?.date_format)||"MMM D, YYYY",a=(0,F.phpToDayjsFormat)(window?.booktics?.time_format)||"h:mm A";return(0,n.createElement)(l.Row,{gutter:[20,20]},(0,n.createElement)(l.Col,{xs:12},(0,n.createElement)(l.Title,{level:5,text:(0,d.__)("Name","booktics")}),(0,n.createElement)(l.Text,{text:e?.customer?.name})),(0,n.createElement)(l.Col,{xs:12},(0,n.createElement)(l.Title,{level:5,text:(0,d.__)("Email","booktics")}),(0,n.createElement)(l.Text,{text:e?.customer?.email})),e?.total<1&&(0,n.createElement)(l.Col,{xs:12},(0,n.createElement)(l.Title,{level:5,text:(0,d.__)("Payment Gateway","booktics")}),(0,n.createElement)(l.Text,{text:e?.payment_gateway})),(0,n.createElement)(l.Col,{xs:12},(0,n.createElement)(l.Title,{level:5,text:(0,d.__)("Receive On","booktics")}),(0,n.createElement)(l.Text,{text:S()(e?.created_at).format(`${t}, ${a}`)})),Array.isArray(e.custom_fields)&&e?.custom_fields.map(e=>(0,n.createElement)(l.Col,{xs:12,key:e.name},(0,n.createElement)(l.Title,{level:5,text:e?.label,className:"bkt-custom-field-title"}),(0,n.createElement)(l.Text,{text:Array.isArray(e.value)?e.value.join(" "):e.value}))))},C=({cancellation_restriction:e,date:t,start_time:a})=>{const i=(0,F.isRestrictedToUpdateBooking)({date:t,start_time:a,settings:e}),{setFrontendState:s}=(0,r.useDispatch)(o.H);return(0,n.createElement)(l.Button,{disabled:i,type:"text",className:"bkt-cancel",text:(0,d.__)("Cancel","booktics"),size:"small",onClick:()=>s({openCancelModal:!0})})};var D=a(46079),A=a(57010);const T=()=>{const{invoiceData:e,selectedData:t,openRescheduleModal:a,availability:l}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),{setFrontendState:s}=(0,r.useDispatch)(o.H),{getTimeSlot:c}=(0,A.A)();return(0,i.useEffect)(()=>{if(!a)return;const n=e?.items?.[0]||{};t||s({selectedData:e?.items});const{service:r,team:i,date:o}=n;s({availability:{...l,timeSlots:{},service_id:null,team_member_id:null}}),i.id&&c({service_id:r?.id,team_member_id:i?.id,additional_duration_id:r?.additional_duration?.id})},[a]),(0,n.createElement)(x,{onCancel:()=>s({openRescheduleModal:!1}),open:a,centered:!0,footer:null,maskClosable:!1,destroyOnHidden:!0,className:"bkt-booking-modal"},(0,n.createElement)(D.A,null))},H=({reschedule_restriction:e,date:t,start_time:a})=>{const{setFrontendState:i}=(0,r.useDispatch)(o.H),s=(0,F.isRestrictedToUpdateBooking)({date:t,start_time:a,settings:e});return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(l.Button,{disabled:s,type:"text",className:"bkt-reschedule",text:(0,d.__)("Reschedule","booktics"),size:"small",onClick:()=>i({openRescheduleModal:!0})}),(0,n.createElement)(T,null))};var L=a(46714),$=a(90445),O=a.n($);S().extend(O());const N=e=>{const{calendarAddUrls:t}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),{getAllCalendarAddUrls:a}=function(){const{setFrontendState:e}=(0,r.useDispatch)(o.H);return{getAllCalendarAddUrls:async function(t={}){const{meeting_id:a,booking_date:n,start_time:r,end_time:i}=t,l=await(h.A?.addToCalendar?.getAllCalendarAddUrls({meeting_id:a,booking_date:n,start_time:r,end_time:i}));if(l?.success)return e({calendarAddUrls:l?.data?.calendars}),l?.data?.calendars||[];throw new Error("Failed to fetch calendar add URLs")}}}(),{id:n,date:l,start_time:s,end_time:c}=e?.items?.[0]||{},d=e=>{if(!e)return"";try{let t;return t=/am|pm/i.test(e)?S()(e,["h:mm A","hh:mm A","h:mm a","hh:mm a"]):e.includes(":")?S()(e,["HH:mm:ss","HH:mm"]):S()(e),t.isValid()?t.format("HH:mm"):(console.warn("Could not parse time:",e),"")}catch(e){return console.error("Error formatting time:",e),""}};(0,i.useEffect)(()=>{if(!t&&e&&n&&l){const e=d(s),t=d(c);a({meeting_id:n,booking_date:l,start_time:e,end_time:t})}},[e]);const m=e=>{if(!t||!Array.isArray(t))return null;const a=t.find(t=>t.id===e);return a?.url||null};return{hasGoogleCalendar:!!m("google"),hasOutlookCalendar:!!m("outlook"),handleGoogleCalendarClick:()=>{const e=m("google");e&&window.open(e,"_blank")},handleOutlookCalendarClick:()=>{const e=m("outlook");e&&window.open(e,"_blank")}}},z=(b.A.div`
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px;
    white-space: nowrap;
    color: #525266;
    font-size: 14px;
    font-weight: 500;

    span {
        width: 12px;
        height: 12px;
        border-radius: 50px;
        background-color: ${({color:e})=>e};
    }
`,(0,b.A)(l.PrimaryOutlinedButton)`
    &.ant-btn-lg {
        height: 36px !important;
    }
`,(0,b.A)(l.DatePicker)`
    height: 44px;
`,(0,b.A)(l.Title)`
    margin-block: 0px !important;
    white-space: nowrap;
`,(0,b.A)(l.Divider)`
    margin-block: 16px;
`),{Flex:M,Space:I,Text:P}=((0,b.A)(l.Card)`
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e2ecf4;
    position: relative;

    .ant-card-body {
        padding: 20px;
    }

    .bkt-booking-service-title {
        font-weight: 600;
        font-size: 16px;
    }

    .bkt-booking-service-date-time {
        color: #3161f1;
        font-weight: 500;
    }
`,window?.booktics?.components||{}),R=(0,l.wrapWithTheme)(({invoiceData:e,settingsData:t})=>{const{hasGoogleCalendar:a,hasOutlookCalendar:r,handleGoogleCalendarClick:i,handleOutlookCalendarClick:o}=N(e),{enable_google_calendar:s,enable_outlook_calendar:c}=t||{};return s||c?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(z,null),(0,n.createElement)(M,{gap:16,align:"center"},(0,n.createElement)(P,{text:(0,d.__)("Add to Calendar:","booktics")}),(0,n.createElement)(I,null,s&&(0,n.createElement)(l.SecondaryOutlineButton,{onClick:i,icon:(0,n.createElement)(L.GoogleCalendarIcon,null),disabled:!a},(0,d.__)("Google Calendar","booktics")),c&&window.wp?.hooks?.applyFilters("booktics_add_to_Outlook_calendar",null,{handleOutlookCalendarClick:o,hasOutlookCalendar:r})))):null}),B=()=>{const{settings:e,invoiceData:t}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),{allow_customer_cancellation:a,allow_customer_rescheduling:i,reschedule_restriction:s,cancellation_restriction:m}=e,{date:u,start_time:p}=t?.items?.[0]||{},g=a||i;return(0,n.createElement)("div",null,g&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.TQ,null),(0,n.createElement)(_,{gap:"small",wrap:!0,align:"center"},(0,n.createElement)(l.Text,{text:(0,d.__)("Need to make a change?","booktics")}),(0,n.createElement)(l.Space,{size:4},i&&(0,n.createElement)(H,{reschedule_restriction:s,date:u,start_time:p}),i&&a&&(0,n.createElement)(l.Text,{text:(0,d.__)("or","booktics")}),a&&(0,n.createElement)(C,{cancellation_restriction:m,date:u,start_time:p})))),(0,n.createElement)(R,{invoiceData:t,settingsData:e}))},Q=()=>{const{invoiceData:e}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),t=new URLSearchParams(window.location.search).get("booking_action"),{getInvoice:a}=function(){const{invoiceId:e}=(0,r.useSelect)(e=>e(o.H).getFrontendState(),[]),{setFrontendState:t}=(0,r.useDispatch)(o.H),{id:a}=(0,g.g)();return{getInvoice:async()=>{const n=new URLSearchParams(window.location.search),r=n.get("order_id"),i=a||e||r;if(!i)return;const l=n.get("order_key")||"undefined"!=typeof sessionStorage&&sessionStorage.getItem(`booktics_order_key_${i}`)||"";try{const e=await(h.A?.orders?.singleOrder(i,l?{order_key:l}:{}));e?.success&&t({invoiceData:e?.data})}catch(e){console.error("Error fetching services:",e)}}}}();return(0,i.useEffect)(()=>{a()},[]),(0,n.createElement)(s.Container,{vertical:!0,gap:24},(0,n.createElement)(l.Flex,{justify:"center"},"cancel"===t?(0,n.createElement)(E,null):(0,n.createElement)(f,null,(0,n.createElement)(l.RowSkeleton,{loading:!e},(0,n.createElement)(l.Flex,{vertical:!0,gap:"middle"},(0,n.createElement)(m,{invoiceData:e}),(0,n.createElement)(j,{invoiceData:e}),(0,n.createElement)(u,{invoiceData:e}),(0,n.createElement)(p,{invoiceData:e}),(0,n.createElement)(B,null))),(0,n.createElement)(E,null))))}},44512:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(47143),r=a(11534),i=a(60532);const l=function(){const{invoiceData:e}=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{setFrontendState:t,resetFrontend:a}=(0,n.useDispatch)(i.H),l=new URLSearchParams(window.location.search),o=l.get("booking_action"),s=l.get("appointment_token");return{reschedule:async(a={})=>{const{id:n,...i}=a;try{const a=await(r.A?.appointment?.appointmentReschedule(n,{...i,security_token:s||e?.items?.[e?.items?.length-1]?.appointment_token}));a?.success&&t({openRescheduleModal:!1,invoiceData:{...e,items:e?.items?.map(e=>e?.id===n?{...e,...i}:e)}})}catch(e){console.error(e)}},cancel:async n=>{const i=e?.items[0]?.id;t({cancelLoading:!0});const l={...n,security_token:s};try{const e=await(r.A?.appointment?.appointmentCancel(i,l));return e?.success&&("cancel"!==o&&a(),t({isCancelledSuccess:e.success})),e}catch(e){console.error("Error fetching services:",e)}finally{t({cancelLoading:!1})}}}}},46079:(e,t,a)=>{"use strict";a.d(t,{A:()=>D});var n=a(51609),r=a(86087),i=a(22564),l=a(57010),o=a(47143),s=a(60532),c=a(59e3),d=a(75778);const m=c.A.div`
    padding-right: 10px;

    .bkt-flatpickr-input {
        display: none;
    }

    .flatpickr-rContainer {
        width: 100%;
    }

    .flatpickr-calendar {
        width: 100%;
        box-shadow: none;
        background: transparent;

        .dayContainer {
            width: 100%;
            min-width: 100%;
            max-width: 100%;
        }

        .flatpickr-days,
        .flatpickr-day {
            width: 100%;
            max-width: 100%;
        }

        .flatpickr-day {
            height: 50px;
            line-height: 50px;
            border-radius: 6px;
            color: #0a1018;
            font-weight: 600;

            &.selected {
                color: #fff;
                border: none;
                background: ${({theme:e})=>e.colors.primary};
            }

            &.today {
                border-color: transparent;

                &::before {
                    content: "";
                    position: absolute;
                    bottom: 5px;
                    left: 50%;
                    transform: translateX(-50%);
                    background: ${({theme:e})=>e.colors.primary};
                    width: 5px;
                    height: 5px;
                    border-radius: 100vmax;
                }
            }

            &.flatpickr-disabled,
            &.flatpickr-disabled:hover {
                color: ${({theme:e})=>e.colors.secondary};
                opacity: 0.4;
            }
        }

        @media (max-width: ${d.a.xxl}px) {
            max-height: 380px;

            .flatpickr-day {
                height: 40px;
                line-height: 40px;
            }
        }
    }

    .flatpickr-disabled {
        opacity: 0.4;
    }

    .flatpickr-months {
        padding-bottom: 20px;
        border-bottom: 1px solid #eaeaea;
        margin-bottom: 20px;
        display: flex;
        align-items: center;

        .flatpickr-month,
        .flatpickr-current-month {
            text-align: left;
        }

        .flatpickr-current-month {
            display: flex;
            align-items: center;
            left: 0;
            padding-top: 0;
        }

        .flatpickr-prev-month,
        .flatpickr-next-month {
            display: flex;
            justify-content: center;
            align-items: center;
            top: 8px;
            height: 20px;
            width: 20px;
            padding: 0;
            line-height: 20px;
            border-radius: 100vmax;
            background-color: #0c274a;

            svg {
                stroke: #ffffff;
                stroke-width: 2px;
                fill: transparent;
                width: 10px;
                height: 10px;
            }

            &.flatpickr-disabled {
                cursor: no-drop;
            }
        }

        .flatpickr-prev-month.flatpickr-prev-month,
        .flatpickr-next-month.flatpickr-prev-month {
            left: auto;
            right: 40px;
        }

        .cur-year,
        .cur-month {
            font-weight: 600 !important;

            &:hover,
            &:focus {
                background: transparent;
            }
        }
    }
`;var u=a(74353),p=a.n(u),g=a(44512),h=a(95358),b=a(48602);const f=function(){const{setFrontendState:e}=(0,o.useDispatch)(s.H),t=(0,o.useSelect)(e=>e(s.H).getFrontendState(),[]),{currentStep:a,selectedData:n=[],availability:r,invoiceData:i,selectedLocation:c,use24h:d}=t,{getTimeSlot:m}=(0,l.A)(),{addToCart:u,editCartItem:f}=(0,b.A)(),{reschedule:_}=(0,g.A)();return{selectDate:(t,a)=>{const r=n.map((e,t)=>t===n.length-1?{...e,date:a}:e);e({selectedData:r,currentSelectedData:r?.[r?.length-1]||{}})},selectMonth:(e,__,t)=>{const a=p()().month(t.currentMonth),n=a.startOf("month").format("YYYY-MM-DD"),r=a.startOf("month").add(60,"day").format("YYYY-MM-DD");m({startDate:n,endDate:r})},toggleTimeFormat:t=>{e({availability:{...r,timeSlots:(0,h.convertScheduleTimeFormat)({timeSlots:r?.timeSlots,to24Hour:t})},use24h:t})},selectTime:({slot:t})=>{if(!t?.is_available)return;const r=e=>p()(e,["h:mm A","hh:mm A","HH:mm","H:mm"]).format("HH:mm"),l=r(t.start),o=r(t.end),s=[...n],m=s.length-1;m>=0&&(s[m]={...s[m],start_time:l,end_time:o});const g=s[m]||{},{service:h,additional_duration:b,team:x,date:k,total:v,extraServices:y,group_booking:E}=g;e({selectedData:s,currentSelectedData:g,...!i&&{currentStep:a+1}});const w={team_member_id:x?.id,service_id:h?.id,date:k,start_time:l,end_time:o,additional_duration_id:b?.id,extra_services:y,price:b?.charge_amount,total:v,group_booking:E,time_format:d?"24h":"12h",...c&&{location_id:c}};if(i)_({id:i?.items?.[i?.items?.length-1]?.id,date:k,start_time:l,end_time:o});else{let e=g?.uuid;if(e)return void f(e,w);u(w)}}}},_=window.booktics.locale_name;if(_)try{a(13722)(`./${_}.js`),p().locale(_)}catch(e){const t=_.split("-")[0];a(13722)(`./${t}.js`),p().locale(t)}const x=()=>{const{availability:e}=(0,o.useSelect)(e=>e(s.H).getFrontendState(),[]),{fp:t}=(()=>{const e=(0,o.useSelect)(e=>e(s.H).getFrontendState(),[]),{settings:t,currentSelectedData:a,availability:n}=e,{disabledDates:i=[]}=n||{},l=(0,r.useRef)(null),c=(0,r.useRef)(null),{date:d}=a||{},{selectDate:m,selectMonth:u}=f();return(0,r.useEffect)(()=>{if("undefined"!=typeof window&&window.flatpickr&&!c.current){const e=l.current;t?.calendar_locale&&window.flatpickr.localize(window.flatpickr.l10ns[t?.calendar_locale]),c.current=window.flatpickr(e,{defaultDate:d,inline:!0,altFormat:"F j, Y",dateFormat:"Y-m-d",minDate:"today",monthSelectorType:"static",disable:i,locale:{firstDayOfWeek:Number(window?.booktics?.start_of_week)},onChange:m,onMonthChange:u})}return()=>{c.current?.destroy(),c.current=null}},[]),(0,r.useEffect)(()=>{c.current&&c.current.set("disable",i)},[i]),{fp:l}})();return(0,n.createElement)(i.Spin,{spinning:!e||e?.loading},(0,n.createElement)(m,null,(0,n.createElement)("input",{ref:t,type:"text",className:"bkt-flatpickr-input"})))};var k=a(46714),v=a(27723);const y=(0,c.A)(i.Flex)`
    width: 100%;
    height: 450px;
    padding: 8px 16px;
    border-left: 1px solid #e2ecf4;
    font-weight: 500;
    ${({hasSlot:e})=>e?"justify-content: start;":"justify-content: center; align-items: center;"}

    .bkt-slot-heading {
        font-size: 16px;
    }

    @media (max-width: ${d.a.xxl}px) {
        height: 350px;
    }
`,E=(0,c.A)(i.Flex)`
    overflow-y: auto;
    max-height: 350px;
    padding-right: 8px;

    /* Optional custom scrollbar */
    &::-webkit-scrollbar {
        width: 6px;
    }
    &::-webkit-scrollbar-thumb {
        background-color: #d9d9d9;
        border-radius: 3px;
    }
`,w=(0,c.A)(i.Button)`
    &.ant-btn {
        border-radius: 4px;
        font-weight: 600;
    }

    width: 100%;
    padding: 10px 12px;
    border: ${({active:e,theme:t})=>`${e?"2px":"1px"} solid ${e?t.colors.primary:"#E2ECF4"}`};
    opacity: ${({disabled:e})=>e?.4:1};
    position: relative;
    font-size: 16px;
    justify-content: ${({active:e})=>e?"start":"center"};
    cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
    transition: 0.3s ease;

    &:hover {
        border-color: ${({disabled:e})=>e?"#d9d9d9":"#40a9ff"};
    }

    svg {
        position: absolute;
        right: 10px;
        color: ${({theme:e})=>e.colors.primary};
    }
`,S=(0,c.A)(i.Switch)`
    background: #f7f7f7;
    width: 36px;
    height: 18px;

    .ant-switch-handle::before {
        top: -7px;
        background-color: #fff;
        border-radius: 50%;
        border: 2px solid #e2ecf4;
        height: 22px;
        width: 22px;
    }
`,{CheckCircleFilled:F}=window?.booktics?.libraryIcons||{},j=({selectedTime:e,slot:t,showEndTime:a})=>{const{selectTime:r}=f(),{start:l,is_available:o,end:s,available_spots:c}=t||{},d=e===l;return(0,n.createElement)(i.Tooltip,{title:(0,v.__)(`Available Spaces: ${c}`),placement:"left"},(0,n.createElement)(w,{onClick:()=>r({slot:t}),disabled:!o,active:d,text:(0,n.createElement)(i.Flex,null,a?`${l} - ${s}`:l,d?(0,n.createElement)(F,null):null)}))},C=()=>{const e=(0,o.useSelect)(e=>e(s.H).getFrontendState(),[]),{availability:t,use24h:a,currentSelectedData:r,settings:l}=e,c=r?.start_time,d=t?.timeSlots?.[r?.date]||[],{toggleTimeFormat:m}=f();return(0,n.createElement)(y,{vertical:!0,gap:"large",hasSlot:!!d?.length},d?.length?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.Space,{align:"center"},(0,n.createElement)("span",null,(0,v.__)("12h","booktics")),(0,n.createElement)(S,{checked:a,onChange:m}),(0,n.createElement)("span",null,(0,v.__)("24h","booktics"))),(0,n.createElement)(E,{vertical:!0,gap:"small"},d?.filter(e=>e?.is_available)?.map(e=>(0,n.createElement)(j,{key:e?.start,slot:e,selectedTime:c,showEndTime:l?.show_end_time})))):(0,n.createElement)(k.EmptyGridIcon,null))},D=()=>{const{getTimeSlot:e}=(0,l.A)();return(0,r.useEffect)(()=>{e()},[]),(0,n.createElement)(i.Flex,{vertical:!0,gap:20},(0,n.createElement)(i.Title,{level:3,text:(0,v.__)("Select Date & Time","booktics")}),(0,n.createElement)(i.Row,null,(0,n.createElement)(i.Col,{xs:24,sm:24,md:16,lg:16},(0,n.createElement)(x,null)),(0,n.createElement)(i.Col,{xs:24,sm:24,md:8,lg:8},(0,n.createElement)(C,null))))}},48602:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(47143),r=a(11534),i=a(60532);const l=function(){const{setFrontendState:e}=(0,n.useDispatch)(i.H),t=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{selectedData:a=[],orderDetails:l=[],currentSelectedData:o,use24h:s}=t,c=e=>({...e,service:o?.service,extraServices:o?.extraServices,team:o?.team,time_format:s?"24h":"12h"});return{addToCart:async t=>{const n={...t,time_format:s?"24h":"12h"};try{const t=await(r.A?.cart?.addToCart(n));if(t?.success){const n=a.map((e,n)=>n===a.length-1?{...e,uuid:t?.data?.uuid}:e);e({orderDetails:[...l,c(t?.data)],selectedData:n,currentSelectedData:n?.[n?.length-1]||{}})}}catch(e){console.error("Error adding to cart:",e)}},removeFromCart:async t=>{try{const n=await(r.A?.cart?.deleteCartItem(t));if(n?.success){const n=a.map(e=>e?.uuid===t?{...e,uuid:null}:e);e({orderDetails:l?.filter(e=>e?.uuid!==t),selectedData:n,currentSelectedData:n?.[n?.length-1]||{}})}}catch(e){console.error("Error removing from cart:",e)}},getCartItems:async()=>{if(!l)try{const t=await(r.A?.cart?.getCartItems());t?.success&&e({orderDetails:t?.data?.items?.map(e=>c(e))})}catch(e){console.error("Error retrieving cart items:",e)}},editCartItem:async(t,a)=>{try{const n=await(r.A?.cart?.editCart(t,a));if(n?.success){const a=l.map(e=>e?.uuid===t?{...e,...c(n?.data)}:e);e({orderDetails:a})}}catch(e){console.error("Error editing cart item:",e)}}}}},56042:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(47143),r=a(86087),i=a(11534),l=a(60532),o=a(29174);const s=()=>{const{setFrontendState:e}=(0,n.useDispatch)(l.H),t=(0,n.useSelect)(e=>e(l.H).getFrontendState(),[]),{searchQuery:a,shortcodeType:s,selectedLocation:c,teamList:d,locationList:m,serviceList:u}=t,{handleServiceSelect:p}=(0,o.A)();(0,r.useEffect)(()=>{(()=>{if("booktics-single-location-wrapper"===s&&"booktics-single-location-wrapper"===s&&c&&d&&m&&u){const t=m?.find(e=>e.id===c);if(t){const a=t?.teams||[],n=u.filter(e=>(e?.team_member||[]).some(e=>a.includes(e))),r=d?.filter(e=>a.includes(e.id));e({locationServices:n,locationTeamList:r})}}})()},[s,c,d,m,u]);const g=async(t={})=>{Object.keys(t)?.length&&e({isFiltering:!0}),t?.resetFilter&&(t={search:"",category_id:"",paged:1,per_page:10});const n={...a,...t};try{const t=await(i.A?.service?.allServices(n));if(t?.success){const a=(t?.data?.items||[]).filter(e=>"active"===e.status),r=t?.data?.total||0,i=a.length<r;e({serviceList:a,total:r,searchQuery:n,currentPage:n.paged||1,hasMoreServices:i})}}catch(e){console.error("Error fetching services:",e)}finally{return e({isFiltering:!1}),{complete:!0}}};return{getServices:g,getSingleService:async e=>{try{const t=await(i.A?.service?.singleService(e));t?.success&&p({service:t?.data})}catch(e){console.error("Error fetching services:",e)}},onPaginationChange:(e,t)=>{g({paged:e,per_page:t})},getServicesInfinite:async()=>{const{currentPage:n=1,total:r=0,serviceList:l=[]}=t,o=n+1;e({isLoadingMore:!0});try{const t={...a,paged:o,per_page:10},n=await(i.A?.service?.allServices(t));if(n?.success){const t=(n?.data?.items||[]).filter(e=>"active"===e.status);if(0===t.length)return void e({hasMoreServices:!1,isLoadingMore:!1});const a=[...l,...t],i=n?.data?.total||r,s=a.length<i;e({serviceList:a,currentPage:o,total:i,hasMoreServices:s,isLoadingMore:!1})}}catch(t){console.error("Error fetching more services:",t),e({isLoadingMore:!1})}}}}},57010:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(47143),r=a(86087),i=a(11534),l=a(60532),o=a(95358);const s=function(){const{setFrontendState:e}=(0,n.useDispatch)(l.H),t=(0,n.useSelect)(e=>e(l.H).getFrontendState(),[]),a=(0,r.useRef)(t);return(0,r.useEffect)(()=>{a.current=t},[t.currentSelectedData,t.availability,t.calendarFilter,t.use24h]),{getTimeSlot:async t=>{const{currentSelectedData:n,calendarFilter:r,availability:l,use24h:s}=a.current,{service:c,additional_duration:d,team:m,extraServices:u,group_booking:p}=n||{},g=new URLSearchParams(window.location.search),h=g.get("team_member_id"),b=g.get("booking_action"),f=t?.startDate||r?.startDate,_=t?.endDate||r?.endDate,x=t?.service_id||c?.id,k="reschedule"===b?h:t?.team_member_id||m?.id,v=t?.additional_duration_id||d?.id,y={service_id:x,team_member_id:k,start_date:f,end_date:_,...p?.attendee_count?{total_attendees:p?.attendee_count}:{}};let E;v&&(y.additional_duration_id=v),Array.isArray(u)&&u.length>0&&u.forEach((e,t)=>{void 0!==e?.id&&void 0!==e?.quantity&&(y[`extra_services[${e.id}]`]=e.quantity)});try{e({availability:{...l,loading:!0}});const a=await(i.A?.appointment?.getTimeSlot(y));if(a?.success){let e=(0,o.convertScheduleTimeFormat)({timeSlots:a?.data?.slots,to24Hour:s});t&&(e={...l?.timeSlots,...e});const n=Object.entries(e).filter(([,e])=>Array.isArray(e)&&0===e.length).map(([e])=>e);E={...y,timeSlots:e,disabledDates:n}}}catch(e){console.error("Error fetching services:",e)}finally{e({availability:{...E||l,loading:!1}})}}}}},62259:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(47143),r=a(11534),i=a(60532);const l=function(){const{searchQuery:e}=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{setFrontendState:t}=(0,n.useDispatch)(i.H);return{getTeamList:async(a={})=>{Object.keys(a)?.length&&t({isFiltering:!0}),a?.resetFilter&&(a={search_key:"",paged:"",per_page:""});const n={...e,...a};try{const e=await(r.A?.team?.allTeamMembers(n));e?.success&&t({teamList:e?.data?.items,searchQuery:n})}catch(e){console.error("Error fetching services:",e)}finally{return t({isFiltering:!1}),{complete:!0}}}}}},87927:(e,t,a)=>{"use strict";a.d(t,{D7:()=>o,It:()=>d,QP:()=>l,TQ:()=>c,_1:()=>i,fq:()=>s});var n=a(59e3),r=a(22564);const i=(0,n.A)(r.Flex)`
    padding: 30px 20px;
    height: 100%;
    ${({hasBorder:e,theme:t})=>e&&`border-right: 1px solid ${t.colors.inputBorder};`}

    .bkt-booking-service-item {
        font-weight: 500;
    }
`,l=(0,n.A)(r.Text)`
    font-size: 14px;
    font-weight: 500;
`,o=n.A.p`
    font-size: 12px;
`,s=((0,n.A)(r.Text)`
    font-size: 14px;
    font-weight: 500;
`,(0,n.A)(l)`
    &::before {
        content: "•";
        margin-right: 8px;
    }
`),c=(0,n.A)(r.Divider)`
    && {
        margin: 12px 0;
    }
`,d=(0,n.A)(r.Flex)`
    font-weight: bold;
    font-size: 16px;
    color: #000;
`},98437:(e,t,a)=>{"use strict";a.d(t,{A:()=>ue});var n=a(51609),r=a(47143),i=a(22564),l=a(29174),o=a(87927),s=a(60532);const c=()=>{const{goNext:e,goPrevious:t,shouldDisableNext:a}=(0,l.A)(),c=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{currentStep:d,configureData:m={},frontendStepsOrder:u,bookingResponse:p}=c||{},{go_back_btn_label:g,go_next_btn_label:h}=m,b=u[d];if("customer_info"===b)return null;const f="payment"===b&&"stripe"===p?.paymentMethod;return(0,n.createElement)(i.Flex,{vertical:!0},(0,n.createElement)(o.TQ,null),(0,n.createElement)(i.Flex,{gap:"small",justify:"space-between"},(0,n.createElement)(i.SecondaryOutlineButton,{size:"middle",text:g,onClick:t,disabled:1===d}),!f&&(0,n.createElement)(i.PrimaryButton,{disabled:a(),size:"middle",text:h,onClick:e})))};var d=a(46714),m=a(27723);const u=({title:e,description:t})=>(0,n.createElement)(i.Flex,{vertical:!0,gap:16},(0,n.createElement)(i.Flex,{gap:"small"},(0,n.createElement)(d.ClockIcon,null),(0,n.createElement)(i.Text,{text:(0,m.__)("Service Information","booktics")})),(0,n.createElement)(i.Flex,{vertical:!0,gap:2},(0,n.createElement)(o.QP,{level:5,text:e}),(0,n.createElement)(o.D7,null,t))),p=({group_booking:e,data:t,settings:a})=>{const{charge_per_attendee:r,attendee_count:l}=e||{},s=r?1:l||1;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.Flex,{vertical:!0},(0,n.createElement)(o.D7,{text:(0,m.__)("Service","booktics")}),(0,n.createElement)(i.Flex,{gap:"small",justify:"space-between",className:"bkt-booking-service-item"},(0,n.createElement)(i.Flex,{gap:"small",wrap:!0},(0,n.createElement)(o.fq,{text:t.name||t?.title}),s>1&&(0,n.createElement)(i.Space,{size:2},"(",s," x",(0,n.createElement)(i.Pricing,{settings:a,price:t.charge_amount}),")")),(0,n.createElement)(i.Text,{text:(0,n.createElement)(i.Pricing,{settings:a,price:Number(t.charge_amount||0)*s})})),(0,n.createElement)(o.TQ,null)),window?.wp?.hooks?.applyFilters("booktics_show_selected_extra_services",null,{StyledText:o.D7,DotText:o.fq,StyledDivider:o.TQ,attendeeCount:s}))},g=({currentSelectedData:e,settings:t})=>{const{total:a}=e||{};return(0,n.createElement)(o.It,{justify:"space-between",align:"center",gap:"small"},(0,n.createElement)("span",null,(0,m.__)("Total","booktics")),(0,n.createElement)(i.Pricing,{settings:t,price:a}))},h=()=>{const{currentSelectedData:e,settings:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{service:a={},additional_duration:l,group_booking:c}=e||{};return(0,n.createElement)(o._1,{vertical:!0,justify:"space-between",className:"bkt-service-frontend-inner",hasBorder:!0},(0,n.createElement)("div",null,(0,n.createElement)(u,{title:a?.title,description:a?.description}),(0,n.createElement)(o.TQ,null)),(0,n.createElement)(i.Flex,{vertical:!0},(0,n.createElement)(p,{group_booking:c,data:l||a,settings:t}),(0,n.createElement)(g,{currentSelectedData:e,settings:t})))},b=({children:e})=>(0,n.createElement)(i.Row,{className:"bkt-row-layout"},(0,n.createElement)(i.Col,{xs:24,sm:24,md:8,lg:8},(0,n.createElement)(h,null)),(0,n.createElement)(i.Col,{xs:24,sm:24,md:16,lg:16},(0,n.createElement)(o._1,{vertical:!0,justify:"space-between",className:"bkt-service-frontend-inner"},e,(0,n.createElement)(c,null))));var f=a(4623),_=a(56580),x=a(60742),k=a(35371);var v=a(11534);var y=a(86087);const{Alert:E}=window?.booktics?.library||{},w=({handleSelect:e,form:t})=>{const a=!window?.wp?.hooks.hasFilter("booktics_select_stripe")&&!window?.wp?.hooks.hasFilter("booktics_select_paypal"),r=(0,_.useFrontendLicense)();return a?(0,n.createElement)(E,{message:(0,m.__)("No payment method is enabled","booktics-pro"),type:"warning"}):(0,n.createElement)(i.Flex,{gap:"small"},window?.wp?.hooks?.applyFilters("booktics_select_stripe",null,{handleSelect:e,form:t}),r&&window?.wp?.hooks?.applyFilters("booktics_select_paypal",null,{handleSelect:e,form:t}))},{Alert:S}=window?.booktics?.library||{},{CheckCircleFilled:F}=window?.booktics?.libraryIcons||{},j=({form:e})=>{const{settings:t,orderDetails:a,customerInfo:l}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),[o,c]=(0,y.useState)(l?"pay_later"!==l?.payment_method?"pay_now":l?.payment_method:""),d=t=>{"pay_now"!==t&&"pay_later"!==t||c(t),"pay_now"!==t&&e.setFieldsValue({payment_method:t})},u=a.reduce((e,t)=>e+Number(t.price),0);if(u<1)return;const p=[{key:"pay_later",text:(0,m.__)("Pay Later","booktics"),show:t?.enable_local_payment},{key:"pay_now",text:(0,m.__)("Pay Now","booktics"),show:t?.enable_stripe_payment||t?.enable_paypal_payment}],g=e=>{if(!e?.show)return null;const t=o===e.key,a=t?i.PrimaryOutlinedButton:i.SecondaryOutlineButton;return(0,n.createElement)(a,{key:e.key,text:e.text,onClick:()=>d(e.key),icon:t?(0,n.createElement)(F,null):null,iconPosition:"end",size:"large"})};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.FormItem,{shouldUpdate:!0},()=>(0,n.createElement)(n.Fragment,null,u>0&&!t?.enable_local_payment&&!t?.enable_stripe_payment&&!t?.enable_paypal_payment?(0,n.createElement)(S,{message:(0,m.__)("No payment method is enabled","booktics"),type:"warning"}):null,(0,n.createElement)(i.Flex,{vertical:!0,gap:"small"},(0,n.createElement)(i.Flex,{gap:"small"},p?.map(g)),"pay_now"===o?(0,n.createElement)(w,{handleSelect:d,form:e}):null))),(0,n.createElement)(i.FormItem,{name:"payment_method",rules:[{required:!0,message:(0,m.__)("Please select a payment method!","booktics")}],className:"bkt-hidden-input"},(0,n.createElement)(i.Input,{type:"hidden"})))},C=()=>{const{goPrevious:e}=(0,l.A)(),t=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{currentStep:a,viewMode:c,configureData:d={},customerInfo:u}=t||{},{go_back_btn_label:p}=d;return(0,n.createElement)(i.Flex,{vertical:!0},(0,n.createElement)(o.TQ,null),(0,n.createElement)(i.Flex,{gap:"small",justify:"space-between"},(0,n.createElement)(i.SecondaryOutlineButton,{size:"middle",text:p,onClick:e,disabled:1===a&&"modal"===c||0===a}),(0,n.createElement)(i.PrimaryButton,{htmlType:"submit",loading:u?.loading,size:"middle",text:(0,m.__)("Book Appointment",booktics)})))};var D=a(38155),A=a(48602);const{Empty:T}=window?.booktics?.library||{},{Alert:H}=window?.booktics?.library||{};var L=a(88802),$=a(56042),O=a(4581);const N=({handleSearch:e})=>{const[t,a]=(0,y.useState)(!1);return t?(0,n.createElement)("div",{className:"bkt-slide-in-from-right"},(0,n.createElement)(O.A,{searchFunc:e})):(0,n.createElement)(i.SecondaryOutlineButton,{onClick:()=>a(!0),icon:(0,n.createElement)(d.SearchIcon,null)})};var z=a(62259);const M=({getServices:e})=>{const t=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{isFiltering:a,serviceList:i,teamList:l=[]}=t,{getTeamList:o}=(0,z.A)();return(0,y.useEffect)(()=>{o()},[]),i?(0,n.createElement)(f.StyledFilterSelection,{allowClear:!0,options:l?.map(e=>({label:e?.display_name,value:e?.id})),placeholder:(0,m.__)("Team member","booktics"),disabled:a,onChange:t=>e({team_member_id:t||""})}):null},I=({getServices:e})=>(0,n.createElement)(i.Flex,{justify:"space-between",align:"center",gap:"small",wrap:!0,className:"bkt-frontend-header"},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("All Services","booktics")}),(0,n.createElement)(i.Space,null,(0,n.createElement)(N,{handleSearch:e}),(0,n.createElement)(M,{getServices:e})));var P=a(59e3);const R=(0,P.A)(i.Card)`
    height: 522px;
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    box-shadow: none !important;

    .ant-card-body {
        height: 100%;
        padding: 20px;

        .bkt-service-frontend-inner {
            height: 100%;
        }
    }

    .bkt-service-img {
        border-radius: 10px;
        object-fit: cover;
    }

    .bkt-service-text {
        color: #0e0f0c;
    }

    .bkt-service-price {
        font-size: 20px;
        color: ${({theme:e})=>e.colors.neutralLightDark};
        font-weight: 700;
    }
`,B=P.A.h4`
    color: #36364d;
    font-size: 14px;
    font-weight: normal;
`,Q=P.A.div`
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
    position: relative;
`,U=(0,P.A)(i.Flex)`
    text-align: center;
    border: 1px solid
        ${({theme:e,active:t})=>t?e.colors.primary:e.colors.neutralWhiteDark};
    color: ${({theme:e,active:t})=>t?e.colors.primary:e.colors.neutralLightDark};
    border-radius: 4px;
    background: #fff;
    padding: 4px 12px;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    transition: 0.5s ease-in;

    .bkt-check-icon {
        color: ${({theme:e,active:t})=>t&&e.colors.primary};
        opacity: ${({active:e})=>e?1:0};
    }

    &:hover {
        border-color: ${({theme:e})=>e.colors.primary};
        .bkt-check-icon {
            color: ${({theme:e})=>e.colors.primary};
        }
    }
`,Y=({service:e})=>{const{settings:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{handleServiceSelect:a}=(0,l.A)(),o=e.additional_durations[0]?.charge_amount||0;return(0,n.createElement)(R,{className:"bkt-frontend-service-card"},(0,n.createElement)(i.Flex,{vertical:!0,justify:"space-between",className:"bkt-service-frontend-inner"},(0,n.createElement)(i.Img,{className:"bkt-service-img",src:e?.image,alt:e?.title,shape:"square",height:280}),(0,n.createElement)(i.Space,{className:"bkt-service-text",size:"small",direction:"vertical"},(0,n.createElement)(i.Title,{text:e?.title,level:3}),(0,n.createElement)(i.TruncatedText,null,(0,n.createElement)(i.Description,{text:e?.description}))),(0,n.createElement)(i.Flex,{justify:"space-between",align:"center",gap:"small"},(0,n.createElement)(i.Title,{className:"bkt-service-price",text:(0,n.createElement)(i.Pricing,{settings:t,price:o}),level:3}),(0,n.createElement)(i.PrimaryOutlinedButton,{onClick:()=>a({service:e}),text:(0,m.__)("Book Now","booktics")}))))},q=({serviceList:e=[]})=>(0,n.createElement)(i.Row,{gutter:[30,30],align:"center",className:"bkt-container-row"},e?.map(e=>(0,n.createElement)(i.Col,{xs:24,sm:24,md:12,lg:8,key:e?.id},(0,n.createElement)(Y,{service:e})))),{Empty:G}=window?.booktics?.library||{},{__}=window?.wp?.i18n||{},V=()=>{const{serviceList:e,locationServices:t,shortcodeType:a,total:l,searchQuery:o}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getServices:c,onPaginationChange:d}=(0,$.A)();(0,y.useEffect)(()=>{e||c()},[]);const m="booktics-single-location-wrapper"===a,u=m?t:e,p=__(m?"Please assign a team member to this location to show services":"Create or publish a service to show it here","booktics"),g=l||0,h=o?.paged||1,b=o?.per_page||10;return(0,n.createElement)(f.Container,{vertical:!0,gap:24},(0,n.createElement)(I,{getServices:c}),u?null:(0,n.createElement)(i.RowSkeleton,null),0===u?.length?(0,n.createElement)(G,{description:(0,n.createElement)(i.Flex,{justify:"center",vertical:!0,align:"center",gap:16},(0,n.createElement)(i.Text,{text:__("No services found")}),(0,n.createElement)(i.Description,{text:p}))}):(0,n.createElement)(n.Fragment,null,(0,n.createElement)(q,{serviceList:u}),(0,n.createElement)(i.Flex,{justify:"flex-end",align:"center",style:{marginTop:"24px"}},(0,n.createElement)(i.Pagination,{total:g,current:h,pageSize:b,pageSizeOptions:L.pagination.pageSizeOptions,showSizeChanger:!0,onShowSizeChange:d,onChange:d}))))},{CheckCircleFilled:W}=window?.booktics?.libraryIcons||{},Z=()=>{const{categoryLists:e,selectedCategory:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getServices:a}=(0,$.A)(),{setFrontendState:l}=(0,r.useDispatch)(s.H);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(B,null,(0,m.__)("Category","booktics")),(0,n.createElement)(i.Flex,{gap:6,wrap:!0},e?.map(e=>(0,n.createElement)(U,{justify:"space-between",gap:5,active:t===e.id,key:e.id,size:"small",onClick:()=>{l({selectedCategory:e.id,currentPage:1,hasMoreServices:!1,isLoadingMore:!1}),a({category_id:e.id,per_page:10,paged:1})}},e?.name,(0,n.createElement)(W,{className:"bkt-check-icon"})))))},{CheckCircleFilled:X}=window?.booktics?.libraryIcons||{},J=({currentSelectedData:e,data:t={},onSelect:a})=>{const{settings:l}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),o=e?.service?.id===t.id;return(0,n.createElement)(i.StyledSelectionFlex,{active:o,justify:"space-between",align:"center",gap:window?.innerWidth<768?20:40,onClick:()=>a({service:t})},(0,n.createElement)(i.Flex,{gap:12,align:"start",wrap:!0},t?.image?(0,n.createElement)(i.Avatar,{shape:"square",size:window?.innerWidth<768?120:48,src:t.image}):null,(0,n.createElement)(i.Flex,{vertical:!0,gap:"small",align:"start",style:{textAlign:"left"},className:"bkt-selection-box-text-content"},(0,n.createElement)(i.Text,{text:t?.title||t?.name,level:5}),(0,n.createElement)("p",{className:"bkt-text-desc"},t.description))),(0,n.createElement)(i.Flex,{align:"center",gap:"small",style:{flexShrink:0}},(0,n.createElement)(i.Text,{className:"bkt-pricing-charge-amount",text:(0,n.createElement)(i.Pricing,{settings:l,price:t.additional_durations[0].charge_amount}),level:5}),(0,n.createElement)(X,{className:"bkt-check-icon"})))},{Empty:K}=window?.booktics?.library||{},ee=()=>{const{serviceList:e,isFiltering:t,currentSelectedData:a,shortcodeType:o,hasMoreServices:c,isLoadingMore:d}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),u="booktics-category-form"===o,{handleServiceSelect:p}=(0,l.A)(),{getServicesInfinite:g}=(0,$.A)(),{observerRef:h}=((e,t,a)=>{const n=(0,y.useRef)(null),[r,i]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!t||a)return;if(!r)return;const n=new IntersectionObserver(n=>{const[r]=n;r.isIntersecting&&t&&!a&&e()},{root:null,rootMargin:"0px",threshold:.8});return n.observe(r),()=>{r&&n.unobserve(r)}},[r,t,a,e]),{observerRef:e=>{n.current=e,i(e)}}})(g,c,d);return null===e?(0,n.createElement)(i.RowSkeleton,null):(0,n.createElement)(i.Flex,{vertical:!0,gap:10},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("Select Service","booktics")}),(0,n.createElement)(Z,null),(0,n.createElement)(Q,null,t?(0,n.createElement)(i.Flex,{justify:"center",align:"center",style:{height:"100%",minHeight:"400px"}},(0,n.createElement)(i.Spin,{size:"large"})):(0,n.createElement)(i.Flex,{vertical:!0,gap:16,...u&&{className:"bkt-category-service-list"}},0===e?.length?(0,n.createElement)(K,{description:(0,n.createElement)(i.Flex,{justify:"center",vertical:!0,align:"center",gap:16},(0,n.createElement)(i.Text,{text:(0,m.__)("No services found")}),(0,n.createElement)(i.Description,{text:(0,m.__)("Please assign a service to this category to display services.","booktics")}))}):(0,n.createElement)(n.Fragment,null,e?.map?.((e,t)=>(0,n.createElement)(J,{currentSelectedData:a,key:t,data:e,onSelect:p})),c&&(0,n.createElement)("div",{ref:h,style:{padding:"20px 0",textAlign:"center"}},d&&(0,n.createElement)(i.Spin,{size:"default"}))))))};var te=a(80650);const ae=()=>{const{serviceTeamList:e,currentSelectedData:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),a=t?.team?.id,{handleTeamSelect:o}=(0,l.A)();return(0,n.createElement)(i.Flex,{vertical:!0,gap:20},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("Select Team Members","booktics")}),(0,n.createElement)(i.Row,{gutter:[16,12]},e?.map(e=>(0,n.createElement)(i.Col,{key:e.id,xs:24,sm:12,md:8,lg:8,xl:6,onClick:()=>o({team:e})},(0,n.createElement)(te.l,{src:e?.image,name:e?.display_name,active:e?.id===a})))))};var ne=a(46079);const re=()=>(0,n.createElement)(i.Flex,{justify:"space-between",align:"center",gap:"small",className:"bkt-frontend-header"},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("All Category","booktics")})),ie=({category:e})=>{const{setFrontendState:t}=(0,r.useDispatch)(s.H),{viewMode:a,currentStep:l}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getServices:o}=(0,$.A)();return(0,n.createElement)(R,{className:"bkt-frontend-service-card"},(0,n.createElement)(i.Flex,{vertical:!0,justify:"space-between",className:"bkt-service-frontend-inner"},(0,n.createElement)(i.Img,{className:"bkt-service-img",src:e?.image,alt:e?.name,shape:"square",height:280}),(0,n.createElement)(i.Space,{className:"bkt-service-text",size:"small",direction:"vertical"},(0,n.createElement)(i.Title,{text:e?.name,level:3}),(0,n.createElement)(i.TruncatedText,null,(0,n.createElement)(i.Description,{text:e?.description}))),(0,n.createElement)(i.PrimaryOutlinedButton,{onClick:()=>{t({open:"modal"===a,currentStep:l+1,selectedCategory:e.id,currentPage:1,hasMoreServices:!1,isLoadingMore:!1}),o({category_id:e.id,per_page:10,paged:1})},text:(0,m.__)("Select Category","booktics")})))},le=({categoryLists:e})=>(0,n.createElement)(i.Row,{gutter:[30,30],align:"center",className:"bkt-container-row"},e.map(e=>(0,n.createElement)(i.Col,{xs:24,sm:24,md:12,lg:8},(0,n.createElement)(ie,{category:e})))),{Empty:oe}=window?.booktics?.library||{},{__:se}=window?.wp?.i18n||{},ce={categories:(0,n.createElement)(()=>{const{categoryLists:e}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getCategories:t}=(()=>{const{setFrontendState:e}=(0,r.useDispatch)(s.H),t=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{searchQuery:a}=t;return{getCategories:async(t={})=>{e({isCategoryLoading:!0}),t?.resetFilter&&(t={search:"",category_id:"",paged:1,per_page:10});const n={...a,...t};try{const t=await(v.A?.category?.allCategories(n));t?.success&&e({categoryLists:t?.data?.items||[],total:t?.data?.total,searchQuery:n})}catch(e){console.error("Error fetching services:",e)}finally{return e({isCategoryLoading:!1}),{complete:!0}}}}})();if((0,y.useEffect)(()=>{e||t()},[]),!e)return(0,n.createElement)(i.RowSkeleton,null);const a=se("Create or publish a category to show it here","booktics");return(0,n.createElement)(f.Container,{vertical:!0,gap:24},(0,n.createElement)(re,null),0===e?.length?(0,n.createElement)(oe,{description:(0,n.createElement)(i.Flex,{justify:"center",vertical:!0,align:"center",gap:16},(0,n.createElement)(i.Text,{text:se("No Category found")}),(0,n.createElement)(i.Description,{text:a}))}):(0,n.createElement)(le,{categoryLists:e}))},null),services:(0,n.createElement)(()=>{const{shortcodeType:e,teamList:t,selectedCategory:a}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getTeamList:i}=(0,z.A)();(0,y.useEffect)(()=>{t||i()},[]);const{handleServiceSelect:o}=(0,l.A)();return"booktics-booking-form"===e||"booktics-single-location-wrapper"===e?(0,n.createElement)(V,null):"number"==typeof a&&a>=0?(0,n.createElement)(ee,null):window?.wp?.hooks?.applyFilters("booktics_services_list_view",null,{handleServiceSelect:o,isAllLocationShortCode:!0})},null),team:(0,n.createElement)(()=>{const{currentStep:e}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]);return e?(0,n.createElement)(ae,null):(0,n.createElement)("div",null,"Team")},null),time_slot:(0,n.createElement)(ne.A,null),order_details:(0,n.createElement)(()=>{const{settings:e,orderDetails:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{removeFromCart:a,getCartItems:l}=(0,A.A)();return(0,y.useEffect)(()=>{l()},[]),t?(0,n.createElement)(i.Flex,{vertical:!0,gap:20},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("Verify Order Details","booktics")}),(0,n.createElement)(i.Flex,{vertical:!0,gap:"small"},t?.length?t?.map(t=>(0,n.createElement)(i.SingleBookingBox,{key:t?.uuid,settings:e,handleRemove:a,bookingItem:t})):(0,n.createElement)(T,{description:(0,m.__)("Your cart is empty!","booktics")}))):(0,n.createElement)(i.RowSkeleton,null)},null),customer_info:(0,n.createElement)(()=>{const{fields:e=[],renderField:t,getValidationRules:a}=function(){const{settings:e,currentSelectedData:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{fields:a,renderField:n,getValidationRules:i}=(0,k.A)({settings:e,currentSelectedData:t});return{fields:a,renderField:n,getValidationRules:i}}(),{createOrder:l}=function(){const{setFrontendState:e}=(0,r.useDispatch)(s.H),t=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{orderDetails:a=[],frontendStepsOrder:n,currentStep:i,selectedLocation:l,currentSelectedData:o,use24h:c}=t;return{createOrder:async(t,r)=>{try{e({customerInfo:{loading:!0}});const l=(e,t)=>Object.fromEntries(t.map(t=>[t,e[t]])),s=["uuid","team_member_id","service_id","group_booking","date","start_time","end_time","price","extra_services","additional_duration_id","subtotal","total","time_format","location_id","location"],d=a?.map(e=>l(e,s)),m=a.reduce((e,t)=>e+parseInt(t.total),0),u=t?.payment_method&&"pay_later"!==t?.payment_method,p=new URLSearchParams(window.location.search).get("dir_id"),g=r?.filter(e=>e.name&&t.custom_fields&&Object.hasOwnProperty.call(t.custom_fields,e.name))?.map(e=>({...e,value:t.custom_fields[e.name]})),h={...t,customer:{name:t?.name,email:t?.email},subtotal:m,total:m,items:d,pay_now:u,time_format:c?"24h":"12h",total_attendees:o?.group_booking?.attendee_count,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,custom_fields:g,...p&&{directorist_id:p}};delete h.name,delete h.email,delete h.customer_email,delete h.customer_name;const b=await(v.A?.orders?.createOrder(h));if(b?.success){if(b?.data?.id&&b?.data?.order_key)try{sessionStorage.setItem(`booktics_order_key_${b.data.id}`,b.data.order_key)}catch(e){}const t={currentStep:u?i+1:n?.length-1,invoiceId:b.data?.id,...u&&{bookingResponse:{...b.data,paymentMethod:h?.payment_method}}};e(t)}}catch(e){console.error("Error adding to cart:",e),window.wp?.hooks.doAction("notification",{type:"error",message:e?.message})}finally{e({customerInfo:{...t,loading:!1}})}}}}(),{customerInfo:o=null}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),[c]=x.A.useForm();return(0,n.createElement)(i.Flex,{vertical:!0,gap:20,className:"bkt-h-100"},(0,n.createElement)(i.Title,{level:3,text:(0,m.__)("Enter Information","booktics")}),(0,n.createElement)(x.A,{form:c,layout:"vertical",className:"bkt-h-100",onFinish:t=>l(t,e),initialValues:o},(0,n.createElement)(i.Flex,{vertical:!0,justify:"space-between",className:"bkt-h-100"},(0,n.createElement)(i.Flex,{vertical:!0,gap:"small"},(0,n.createElement)("div",null,e.map(e=>{if(!e?.name)return null;const r=["name","email"].includes(e.name)?e.name:["custom_fields",e.name];return(0,n.createElement)(i.FormItem,{key:e.name,...e,help:e?.additional_text,required:e?.is_required,rules:a(e),name:r},t(e))})),(0,n.createElement)(j,{form:c})),(0,n.createElement)(C,null))))},null),payment:(0,n.createElement)(()=>{const{bookingResponse:e}=(0,r.useSelect)(e=>e(s.H).getFrontendState()),{paymentMethod:t}=e||{};return"stripe"===t?window?.wp?.hooks?.applyFilters("booktics_stripe_payment",null):"paypal"===t?window?.wp?.hooks?.applyFilters("booktics_paypal_payment",null):(0,n.createElement)(H,{message:(0,m.__)("Something went wrong! Contact your administrator","booktics"),type:"warning"})},null),invoice:(0,n.createElement)(D.default,null)};function de(){return(0,_.useFrontendLicense)()?window?.wp?.hooks?.applyFilters?.("booktics_frontend_step_components",ce,{...f,Search:N}):ce}const me=({children:e})=>{const{resetFrontend:t}=(0,r.useDispatch)(s.H),a=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{frontendStepsOrder:i,open:l}=a,o=de();return(0,n.createElement)(n.Fragment,null,o[i[0]],(0,n.createElement)(f.StyledModal,{onCancel:t,open:l,centered:!0,footer:null,maskClosable:!1,destroyOnHidden:!0,className:"bkt-booking-modal"},e))},ue=()=>{const e=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{frontendStepsOrder:t,currentStep:a,viewMode:i,serviceId:l}=e,o=de();(()=>{const{setFrontendState:e}=(0,r.useDispatch)(s.H),{frontendStepsOrder:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),a=(0,y.useCallback)((e,t,a)=>e&&t&&a,[]),n=(0,y.useCallback)(a=>{e({[a]:!0,currentStep:t.length-1})},[e,t.length]),i=(0,y.useCallback)((e,t,r,i)=>{if(!a(t,r,i))return;const l={reschedule:()=>n("openRescheduleModal"),cancel:()=>n("openCancelModal")}[e];l&&l()},[a,n]);(0,y.useEffect)(()=>{if("undefined"==typeof window)return;const e=new URLSearchParams(window.location.search),t=e.get("booking_action"),a=e.get("service_id"),n=e.get("order_id"),r=e.get("appointment_token");t&&i(t,n,a,r)},[i])})();const c=o[t[null!=a?a:0]],d=(0,n.createElement)(n.Fragment,null,a===t?.length-1?c:(0,n.createElement)(b,null,c));return"modal"===i?(0,n.createElement)(me,null,d):l?(0,n.createElement)(f.StyledSinglePage,{vertical:!0,gap:24,justify:"center"},d):c||null}}}]);