PageSourceSearch

https://portomassage.com/static/js/async/6439.193cac1710.js

js portomassage.com collected 2026-10-06 03:23:30 UTC 110,715 bytes, 5 lines download raw bytes

1"use strict";(self.rspackChunkvagaro_websitebuilder_consumer=self.rspackChunkvagaro_websitebuilder_consumer||[]).push([[6439],{82531(e,t,a){a.d(t,{A:()=>n});let n={card:"card-K3SJos",contentContainer:"contentContainer-nNU6vj",imageContainer:"imageContainer-BoUxi5",textContainer:"textContainer-CZbv8z",statusAndPriceContainer:"statusAndPriceContainer-KX4RnV",amountContainer:"amountContainer-csa_wR",amountContainerText:"amountContainerText-aVFSBh",statusContainer:"statusContainer-qHIK0q",AppbuttonsContainer:"AppbuttonsContainer-UolcJR",appbuttonsContainer:"AppbuttonsContainer-UolcJR",buttonsContainer:"buttonsContainer-WePaRI",fullWidthMore:"fullWidthMore-n3EsZd",buttonsRightSpace:"buttonsRightSpace-VPAV9w",appointmentForContainer:"appointmentForContainer-Rf6hGi",appointmentForNameContainer:"appointmentForNameContainer-I73GhY",appointmentForWrapper:"appointmentForWrapper-tz6Nle",depositeIcon:"depositeIcon-uWflLw",dollarIcon:"dollarIcon-sZ7uX8",membershipPackageIcon:"membershipPackageIcon-lZaXYP",bundlePackageIcon:"bundlePackageIcon-dcNwUZ",vagaroDismissTag:"vagaroDismissTag-sZm2_o",vagaroDismissImg:"vagaroDismissImg-cArHxe",buttonsContainerforInvoice:"buttonsContainerforInvoice-taUuQf",cancelAppTextData:"cancelAppTextData-ZnNIhM",appointmentCardMain:"appointmentCardMain-AhDpih",appointmentCardBox:"appointmentCardBox-OJm4Qi",appointmentCardBoxCheckbox:"appointmentCardBoxCheckbox-SytnCe",appointmentCardBoxTitle:"appointmentCardBoxTitle-jsUeEG",allInactiveCheck:"allInactiveCheck-FYTWxw",refundPolicyText:"refundPolicyText-v3nYOU",checkBoxWrapper:"checkBoxWrapper-a0YFfO",canceltextContent:"canceltextContent-IKx8MJ",canceltextContentMore:"canceltextContentMore-k5E8X0",FFCardDeta:"FFCardDeta-R5olxx",ffCardDeta:"FFCardDeta-R5olxx",segmentData:"segmentData-zsXbxj",CheckForAgrement:"CheckForAgrement-JvXwvu",checkForAgrement:"CheckForAgrement-JvXwvu",checkForSaveCard:"checkForSaveCard-vMG5id",ffApptCardview:"ffApptCardview-Hj4Jmj",ffapptforCard:"ffapptforCard-cuu5iE",ffsubGrey:"ffsubGrey-D_41eH",divBlock519:"divBlock519-lAKS49",subBlack:"subBlack-E0Rxtv"}},6495(e,t,a){a.r(t),a.d(t,{default:()=>eC});var n,i,o,s,r=a(74848),l=a(96540),c=a(78692),p=a(98767),d=a(82531),u=a(86435),m=a(1210),h=a(8221),C=a(28733);function v(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,n=new Date;n.setTime(n.getTime()+24*a*36e5);let i="expires="+n.toUTCString();document.cookie=e+"="+t+";"+i+";path=/;domain=undefined"}class g{static async getAppointments(e){return(await h.Ay.post(C.kB.getAppointments(),{...e})).data.data}static async cancelAppointment(e){let t=(await h.Ay.post(C.kB.cancelAppointment(),e)).data.data;return t?.response}static async rebookClassAppointment(e){return(await h.Ay.post(C.kB.rebookClassAppointment(),e)).data.data.response}static async getHoursDiffbyAppid(e){return(await h.Ay.post(C.kB.gethoursdiffbyappid(),e)).data.data}static async rescheduleAppointment(e){let t=(await h.Ay.post(C.kB.rescheduleAppointment(),e)).data;return v("ProviderID",e.serviceProviderIdText?.toString()||""),v("ServiceID",e.serviceIdText?.toString()||""),v("AddonServicIds",e.addonServiceIds?.join(",")||""),v("AddonAppointmentIds",e.addonAppointmentIds?.join(",")||""),v("StyleID",e.styleId?.toString()||""),v("BookingDate",e.appointmentDate||""),v("BookingTime",e.appointmentTime||""),v("BusinessPackageID",e.businessPackageId||""),v("IsFromReschedual","true"),e.houseCallGroupId?v("OriginalPrice",e.originalPrice||""):v("OriginalPrice",e.serviceOriginalPrice||""),v("HouseCallGroupID",e.houseCallGroupId||""),!0===e.IsPaid?v("IsPaid","true"):document.cookie="IsPaid=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT",1===e.EventType||2===e.EventType?(v("EventSessionAttendeesI
1d",e.appointmentIdText||""),v("IsClassSelected","true")):(v("AppointmentID",e.appointmentIdText||""),v("IsClassSelected","false")),v("AppointmentUserID",e.appointmentUserId||""),v("AppointmentUserFullName",e.sharedAppUserName||""),v("AppointmentUserEmailId",e.appUserEmailId||""),v("AppointmentUserCellNo",e.appUserCellNo||""),t.data}static async iWillShowUp(e){return(await h.Ay.post(C.kB.iWillShowUp(),e)).data.data}static async updateWaitlist(e){return(await h.Ay.post(C.kB.updateWaitlist(),e)).data.data}static async getWaitlistDetail(e){return(await h.Ay.post(C.kB.getWaitlistDetail(),e)).data.data}static async removeWaitlist(e){return(await h.Ay.post(C.kB.removeWaitlist(),e)).data.data}static async getCustomerAppointment(e){return(await h.Ay.post(C.kB.getCustomerAppointment(),e)).data.data}static async getBusinessDetail(e){return(await h.Ay.post(C.kB.getBusinessDetail(),e)).data}static async checkChangeStatusForWorkshop(e){return(await h.Ay.post(C.kB.checkChangeStatusForWorkshop(),e)).data}static async getOnlinePaidAppintmentsData(e){return(await h.Ay.post(C.kB.getOnlinePaidAppintmentsData(),e)).data}static async getAppointmentStatus(e){return(await h.Ay.post(C.kB.getAppointmentStatusData(),e)).data}static async changeAppointmentStatusCheckin(e){return(await h.Ay.post(C.kB.changeAppointmentStatusCheckin(),e)).data.data}static async generateWaitlistReturnUrl(e){return(await h.Ay.post(C.kB.generateWaitlistReturnUrl(),e)).data}static async AddToCalendar(e){return(await h.Ay.post(C.kB.addToCalendarAppointment(),e)).data.data}}var y=a(24708),b=a(75563),f=a(58011),A=a(72834),I=a(61194),S=a(13689),x=a(49041),w=class extends x.${constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:a}=e,n=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:s,isRefetchError:r}=n,l=a.fetchMeta?.fetchMore?.direction,c=s&&"forward"===l,p=i&&"forward"===l,d=s&&"backward"===l,u=i&&"backward"===l;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,S.rB)(t,a.data),hasPreviousPage:(0,S.RQ)(t,a.data),isFetchNextPageError:c,isFetchingNextPage:p,isFetchPreviousPageError:d,isFetchingPreviousPage:u,isRefetchError:r&&!c&&!d,isRefetching:o&&!p&&!u}}},P=a(45964);a(67359);var T=a(80736);let k=function(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{resetOnUnmount:n=!0,initialVisiblePages:i=1}=a,o=(t={queryKey:[y.lH.appointments.getAppointments,e],queryFn:t=>{let{pageParam:a}=t;return g.getAppointments({...e,pageNumber:a,pageSize:12})},getNextPageParam:(e,t,a)=>{if(!(e.length<12))return a+1},initialPageParam:1,staleTime:6e5,refetchOnMount:!0,refetchOnReconnect:!0},(0,I.t)(t,w,void 0)),[s,r]=(0,l.useState)(i);(0,l.useEffect)(()=>()=>{n&&r(i)},[n,i]),(0,l.useEffect)(()=>{r(i)},[JSON.stringify(e),i,o.isRefetching]);let c=(0,l.useMemo)(()=>{if(o.data?.pages)return{pages:o.data.pages.slice(0,s),pageParams:o.data.pageParams?.slice(0,s)||[]}},[o.data,s]),p=(0,l.useMemo)(()=>c?.pages.flat()||[],[c]),d=(0,l.useMemo)(()=>!!o.data?.pages&&(s<o.data.pages.length||o.hasNextPage),[s,o.data?.pages.length,o.hasNextPage]),u=(0,l.useCallback)(async()=>{if(o.data?.pages){if(s<o.data.pages.length)return void r(e=>e+1);o.hasNextPage&&!o.isFetchingNextPage&&(await o.fetchNextPage(),r(e=>e+1))}},[s,o]);return{data:c,items:p,visiblePageCount:s,canLoadMore:d,loadMore:u,resetView:(0,l.useCallback)(()=>{r(i)},[i]),isLoading:o.isLoading,isRefetching:o.isRefetching,isError:o.isError,error:o.error,isSuccess:o.isSuccess,isFetchingNextPage:o.isFetchingNextPage,infiniteQuery:o}};var D=a(77215),N=a.n(D),B=a(79874),j=a(92656),F=a(60458),R=a(30479);let O={Anytime:"0",Morning:"1",Afternoon:"2",Evening:"3"},M=e=>{let t,{onClose:a,userWaitlistDetails:n,businessId:i,sGroup:o}=e,s=(0,R.jE)(),c=(0,F.G)(),{countryId:d}=(0,A.J)(),u=n[0]?.serviceID??"",m=n?.[0]?.waitlistID??"",{data:h,isLoading:C}=((e,t,a)=>{let{device:n,module:i}=(0,A.J)(),o={device:n,module:i,waitlistId:e,merchantId:t,groupId:a};return(0,P.I)({queryKey:[y.lH.appointments.getWaitlistDetail,o],queryFn:()=>g.getWaitlistDetail(o),staleTime:0})})(m,i,o),{mutate:v,isPending:I}=(0,b.n)({mutationFn:e=>g.updateWaitlist(e),onSuccess:()=>{f.oR.success("Successfully updated the waitlist"),s.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!1}]}),a(!0)},onError:()=>{f.oR.error("Unable to update the waitlist")}}),S=h?.waitlistProviderList?.map(e=>({value:e.spid,label:e.spName,spId:e.spid}))??[],x=[{value:"0",label:"Anytime (Open-Close)",serverLabel:"Anytime"},{value:"1",label:"Morning (Open-12pm)",serverLabel:"Morning"},{value:"2",label:"Afternoon (12pm-5pm)",serverLabel:"Afternoon"},{value:"3",label:"Evening (5pm-Close)",serverLabel:"Evening"}],w=e=>{let{waitlist:t,isNewEntry:a,FullDate:n}=e,i="";if(t)i=t?.reqStartTime||"";else{let e=new Date(k.length>0?k[k.length-1].FullDate:new Date);e.setDate(e.getDate()+1),i=k.length>0?(0,T.Zv)(e):(0,T.Zv)(new Date)}let o=(0,T.T2)(t?.timeSlots).map(e=>e.trim()).map(e=>O[e]);return{FullDate:n??i,TimeSlots:(0,T.lE)(o),hasInitialized:!1,isNewEntry:a}},k=n.filter(e=>{let t=new Date;return t.setHours(0,0,0,0),new Date(e.reqStartTime||"")>=t}).sort((e,t)=>
1{let a=new Date(e.reqStartTime||""),n=new Date(t.reqStartTime||"");return a.getTime()-n.getTime()}).filter(e=>void 0!==e.timeSlots).reduce((e,t)=>(e.some(e=>e.displayDate===t.displayDate)||e.push(t),e),[]).map(e=>w({waitlist:e,isNewEntry:!1})),[D,N]=(0,l.useState)(k.length>0?k:[w({isNewEntry:!0})]),B=(0,l.useMemo)(()=>{let e=new Set(D.map(e=>e.FullDate.split("T")[0]));return D.length===e.size},[D]),M=(0,l.useMemo)(()=>D.every(e=>""!==e.TimeSlots),[D]),[U,W]=(0,l.useState)((t={},n.forEach(e=>{if("duqGW~bhDOt26a2V~nJmvg=="!==e.serviceProviderID){let a=e.serviceProviderName?.trim().split(" or ")||[],n=1===a.length;a.forEach(a=>{t[a.trim()]={SPIdsText:n?e.serviceProviderID??"":"",ServiceIdText:u,ServiceAddOnIdText:"",spName:a}})}}),Object.values(t))),L=()=>{if(!M)return void f.oR.warning("Please update time for date");let e=new Date(0===D.length?(0,T.Zv)(new Date):D.reduce((e,t)=>{let a=new Date(e.FullDate||""),n=new Date(t.FullDate||"");return isNaN(a.getTime())?t:isNaN(n.getTime())?e:n>a?t:e}).FullDate||(0,T.Zv)(new Date));e.setDate(e.getDate()+1),N(t=>[...t,w({isNewEntry:!0,FullDate:(0,T.Zv)(e)})])},_=(e,t)=>{let a=[...D];a.splice(e,1,t),JSON.stringify(D[e])!==JSON.stringify(t)&&N(a)},E=e=>{W(e.selectedOptions.map(e=>({SPIdsText:e.value,ServiceIdText:u,ServiceAddOnIdText:"",spName:e.label}))),N([w({isNewEntry:!0,FullDate:(0,T.Zv)(new Date)})])};return((0,l.useEffect)(()=>{B||f.oR.warning("Please select unique dates.")},[D,B]),C||I)?(0,r.jsx)(j.A,{isLoading:C||I}):(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(j.A,{isLoading:!0}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"Edit Waitlist",ButtonSecondary:"Cancel",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,EnableBody:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{M&&B?v({WaitlistID:m,Comment:"",lstWaitlistDetail:D.map(e=>{let t=e.TimeSlots,a=(0,T.T2)(t).map(e=>String(parseInt(e)+1)),n=(0,T.lE)(a);return{FullDate:e.FullDate,TimeSlots:n}}),lstMasterSPServiceDetail:U.length>0?U.map(e=>({SPIdsText:e.SPIdsText,ServiceIdText:e.ServiceIdText,ServiceAddOnIdText:e.ServiceAddOnIdText})):[{SPIdsText:"0",ServiceIdText:u,ServiceAddOnIdText:""}],merchantId:i??"",groupId:o}):f.oR.warning("Please Select Date and Time for Waitlist.")},OnClickSecondary:a,PopupBody:()=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"emptyTopWhiteSpace-NOVp88"}),!c&&(0,r.jsx)("div",{className:"serviceTitle-QcSbLs",children:n[0].serviceTitle}),(0,r.jsxs)("div",{className:"container-d27m9y",children:[(0,r.jsx)("div",{className:"serviceProviderDropdown-NuAEj4",children:(0,r.jsx)(p.nM,{AddOptionButtonText:"",AutoFocus:!0,CallBackTimeCount:0,ChildCheckbox:!0,ClassNamePrefix:"vg-select2-dropdown",CloseCallback:()=>{},CustomClassNamePrefix:"custom-class",CustomPlaceholderName:"Selected",DefaultValue:S.filter(e=>U.some(t=>t.SPIdsText.includes(e.value))).map(e=>{let{value:t,label:a}=e;return{value:t,label:a}}),DropdownClosed:()=>{},DropdownClosingName:"",DropdownData:S,DropdownId:"serviceProviderDropDown",DropdownName:"",DropdownPlaceholder:"Any Service Provider",DropdownTitle:c?"Select Service Provider":"",GroupOptions:!0,InfoTooltipMessage:"",MenuPlacement:"auto",Multi:!0,NativeActionValue:13,OnClickOutside:()=>{},OnOptionButtonClick:()=>{},OnScrollPagination:()=>{},OnSearchForApi:()=>{},OnValidation:()=>{},OpenFromBody:!0,PrefixIconClick:()=>{},RecordsPerPage:10,RequiredMessage:"This field is required",RightSwipeEvent:!0,ScrollPagination:!0,SearchPlaceholder:"Search",Searchable:!0,SetBottomSheetDropdown:!0,SetCustomPlaceholder:!0,ShowCheckBoxInGroup:!0,ShowCustomMessage:"No results found. Please try another search.",ShowHideFooter:2,ShowSelectAllSelectNone:!0,TabIndex:0,VagaroToolkit:1,VirtualDropdownHeight:300,onChange:E})}),(0,r.jsx)("div",{className:"firstRowEmpty-gQchQy"}),D.map((e,t)=>{let a=(0,T.T2)(e.TimeSlots);return(0,r.jsxs)(l.Fragment,{children:[(0,r.jsx)("div",{className:"datePickerAndDeleteIcon-ayAxxY",children:(0,r.jsx)("div",{className:"datePicker-zYAySy",children:(0,r.jsx)(p.qs,{Country:(0,T.JJ)(d??1),DatePickerId:"",DatePickerName:"",DatePickerVariant:"small",DefaultDate:"today",Disableddates:[],EnvironmentUrlDp:window.CoreApiUrl??"https://api.vagaro.com/",Maxdate:new Date("2025-12-31T08:00:00.000Z"),Mindate:new Date,OnBlur:()=>{},Onchange:a=>{a&&_(t,{...e,FullDate:(0,T.Zv)(a)})},Placeholder:"Select Date",SetValue:e.FullDate||new Date,Title:"",prefixIcon:t>0,onPrefixIconClick:()=>{let e;(e=[...D]).splice(t,1),N(e)},DonotOpenNativeCal:!0})})}),(0,r.jsx)("div",{className:"timeSlot-Px7NFU",onClickCapture:e=>{B||(f.oR.warning("Please select unique dates."),e.stopPropagation(),e.preventDefault())},children:(0,r.jsx)(p.nM,{AddOptionButtonText:"",CustomPlaceholderName:"Selected",DropdownData:x,DropdownPlaceholder:"Select Time",DropdownId:"timeSlotDropdown",MenuPlacement:"auto",Multi:!0,OpenFromBody:!0,DefaultValue:""!==e.TimeSlots?x.filter(e=>a.includes(e.value)).map(e=>{let{value:t,label:a}=e;return{value:t,label:a}}):[{value:"0",label:"Anytime (Open-Close)",serverLabel:"Anytime"}],PrefixIconClick:()=>{},RecordsPerPage:10,RequiredMessage:"This field is required",RightSwipeEvent:!0,ScrollPagination:!0,SetBottomSheetDropdown:!0,SetCustomPlaceholder:!0,ShowCheckBoxInGroup:!0,ShowCustomMessage:"No results found. Please try another search.",ShowHideFooter:2,ShowSelectAllSelectNone:!1,TabIndex:0,VagaroToolkit:1,VirtualDropdownHeight:300,onChange:a=>{var n,i,o;let s,r;return n=a,i=t,o=e,s=n.selectedOptions.map(e=>e.value),r=(0,T.lE)(s),void(!o.hasInitialized?o.isNewEntry?_(i,{...o,TimeSlots:r,hasInitialized:!0}):_(i,{...o,hasInitialized:!0}):0===s.length?_(i,{...o,TimeSlots:r}):s.includes("0")?s.length>1&&0===s.indexOf("0")?_(i,{...o,TimeSlots:(0,T.lE)(s.slice(1))}):s.length>1&&s.indexOf("0")===s.length-1&&_(i,{...o,TimeSlots:"0"}):3===s.length?_(i,{...o,TimeSlots:"0"}):_(i,{...o,TimeSlots:r}))}})})]},`lstWaitlistDetail-${t}-${JSON.stringify(U.map(e=>e.SPIdsText))}`)})]}),D.length<5&&(0,r.jsx)("div",{className:"addWaitlistEntryButton-r35Jqv",children:(0,r.jsx)(p.YU,{ButtononClick:L,ButtonIcon:"plus",IconPlacement:"prefix",children:"Add Waitlist Date & Time"})})]}),PopupId:"edit-waitlist-popup",PopupTitle:"Edit Waitlist",Popupopen:!0,Size:"medium",ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:a,BodyClass:"vg-popup-open"})})};a(58431);var U=a(56283),W=a(7974),L=((n=L||{})[n.UnPaid=0]="UnPaid",n[n.Paid=1]="Paid",n[n.Deposits=2]="Deposits",n[n.PartiallyPaid=3]="Parti
1allyPaid",n[n.PaidClass=4]="PaidClass",n[n.DepositsClass=5]="DepositsClass",n[n.PartiallyPaidClass=6]="PartiallyPaidClass",n[n.OfflineDeposit=7]="OfflineDeposit",n[n.OfflineDepositPrepay=8]="OfflineDepositPrepay",n[n.NoShowCancellation=9]="NoShowCancellation",n),_=((i=_||{})[i.NoShow=3]="NoShow",i[i.Cancel=6]="Cancel",i),E=((o=E||{})[o.Appointment=1]="Appointment",o[o.Class=2]="Class",o[o.WorkShop=3]="WorkShop",o),V=((s=V||{})[s.Service=1]="Service",s[s.Product=2]="Product",s[s.GiftCertificate=3]="GiftCertificate",s[s.IOU=4]="IOU",s[s.Membership=7]="Membership",s[s.Class=8]="Class",s[s.IOUCleared=9]="IOUCleared",s[s.Package=15]="Package",s[s.ServiceInvoice=17]="ServiceInvoice",s[s.ServiceAddons=19]="ServiceAddons",s[s.ClassAddons=20]="ClassAddons",s),G=a(75538),Y=a(20669),H=a(68909),q=a(31123),Z=a.n(q),z=a(90053),J=a(82051);a(33120);let K="Anytime",Q="Morning",X="Afternoon",ee="Evening",et=e=>{var t,a;let n,{appointment:i,isUpcoming:o,onReviewClick:s,deleteItemInList:c,lstMyAccountWaitlistDetail:h,isStencil:C=!1,removeOneTimeSlot:v,invalidateUpcomingAppointments:I,onRescheduleReady:S,onRebookReady:x}=e,{device:w,module:P,version:k,googleKeyFormap:D,userAddress:F}=(0,A.J)(),[R,O]=(0,l.useState)(""),[q,et]=(0,l.useState)(!1),[ea,en]=(0,l.useState)(),[ei,eo]=(0,l.useState)(!1),[es,er]=(0,l.useState)(),[el,ec]=(0,l.useState)(""),[ep,ed]=(0,l.useState)(),[eu,em]=(0,l.useState)(null),[eh,eC]=(0,l.useState)(!1),[ev,eg]=(0,l.useState)(""),ey=(0,l.useRef)(!1);(0,l.useEffect)(()=>()=>{ey.current&&document.body.classList.remove("scrollhidden","VC-customerChatOpen","vc-open","chat-icon-bottom")},[]);let eb=new URLSearchParams(window.location.search).get("Type")??(window.IsMysite?"Builder":null),ef=new URLSearchParams(window.location.search).get("IsBusinessWidgetPage")||!1,eA=new URLSearchParams(window.location.search).get("b_themeID")||"0",eI=new URLSearchParams(window.location.search).get("MultiLocBusinessID")||"0",eS=new URLSearchParams(window.location.search).get("w_type")||"0",ex=new URLSearchParams(window.location.search).get("widgetversion")||"0",ew=new URLSearchParams(window.location.search).get("tabatlaunch")??"1",eP=new URLSearchParams(window.location.search).get("TabsIncluded")||"0",eT="Business is Under Maintenance. This won't take long",{openRescheduleFailedBusinessRulesPopup:ek,setOpenRescheduleFailedBusinessRulesPopup:eD,reScheduleAppConfirmation:eN,handleRescheduleClick:eB}=((e,t)=>{let a=new URLSearchParams(window.location.search).get("IsBusinessWidgetPage"),n=new Date,i=new URLSearchParams(window.location.search).get("TabsIncluded")||"0",{device:o,version:s,module:r}=(0,A.J)(),{mutate:c}=(0,b.n)({mutationFn:g.getHoursDiffbyAppid,meta:{invalidateQueries:[y.lH.appointments.getAppointments]},onSuccess:a=>{t.setcommonPopupAlert(null);let i=N()(n),o=N()(new Date),s="";s=(0,T.bG)(e.telephone)?" on "+e.telephone:" them ",e.hoursDiff=a.hoursDiff,e.allowCustRecurrenceApp?0!==e.recurrenceHours&&60*e.hoursDiff-o.diff(i,"minutes")<=60*e.recurrenceHours?2===e.eventType||3===e.eventType?t.setAlertAppointmentPopup({message:"The business that you have made this class with does not allow you to Re-Schedule the class online within {0} hours of the scheduled time. Please call {1} to Re-Schedule your class".replace("{0}",e.recurrenceHours.toString()).replace("{1}",s),title:"Oops!"}):t.setAlertAppointmentPopup({message:"The business that you have made this appointment with does not allow you to Re-Schedule the appointment online within {0} hours of the scheduled time. Please call {1} to Re-Schedule your appointment".replace("{0}",e.recurrenceHours.toString()).replace("{1}",s),title:"Oops!"}):null!=e.businessPackageId&&"duqGW~bhDOt26a2V~nJmvg=="!==e.businessPackageId?t.setBusinessPackageAlertPopup("rescheduling"):h():(2===e.eventType||e.eventType,t.setAlertAppointmentPopup({message:"The business that you have made this class with does not allow you to Re-Schedule the class online.Please call {0} to Re-Schedule your class".replace("{0}",s),title:"Oops!"}))},onError:()=>{f.oR.error("Sorry something went wrong, please try again!")}}),{mutate:p}=(0,b.n)({mutationFn:g.checkChangeStatusForWorkshop,onSuccess:e=>{if(1032==e.responseCode)t.setAlertAppointmentPopup({message:"Business is Under Maintenance. This won't take long",title:"Info"});else if(1001==e.responseCode)t.setAlertAppointmentPopup({message:"Sorry something went wrong, please try again!",title:"Oops!"});else if(1e3==e.responseCode)if(e&&e.data.length>0&&!1===e.data[0].statusValue)return void t.setAlertAppointmentPopup({title:"Info",message:"This workshop cannot be reschedule because it is already in progress. Workshops are a series of sessions that must be attended from the beginning."});else t.setcommonPopupAlert({popupBody:()=>"It will reschedule all your future workshop sessions by doing this. Please confirm",primaryButtonText:"OK",secondaryButtonText:"Cancel",confirm:()=>{c(C)}})},onError:()=>{f.oR.error("Some error occured.Please try again later.")}}),{mutate:d}=(0,b.n)({mutationFn:g.rescheduleAppointment,meta:{invalidateQueries:[y.lH.appointments.getAppointments]},onSuccess:a=>{let n=a.url;"0"===n?2===e.eventType||3===e.eventType?t.setAlertAppointmentPopup({message:'"'+e.businessName+'" does not accept online class, Please Call or Email to Re-Schedule your class.',title:"Oops!"}):t.setAlertAppointmentPopup({message:'"'+e.businessName+'" does not accept online appointment, Please Call or Email to Re-Schedule your appointment.',title:"Oops!"}):"1"===n?2===e.eventType||3===e.eventType?t.setAlertAppointmentPopup({message:"class is already checkedout. You cannot re-schedule it",title:"Oops!"}):t.setAlertAppointmentPopup({message:"Appointment is already checkedout. You cannot re-schedule it",title:"Oops!"}):(2===e.eventType||3===e.eventType)&&"2"===n?t.setAlertAppointmentPopup({message:"This class is no longer available online, Please Call or Email to Re-Schedule your class.",title:"Oops!"}):"-1"===n?t.setAlertAppointmentPopup({message:"Some Error occured.",title:"Oops!"}):t.onRescheduleReady(e)},onError:()=>{f.oR.error("Sorry something went wrong, please try again!"),m(!1)}}),[u,m]=(0,l.useState)(!1),h=()=>{d({serviceProviderId:e.serviceProviderId,serviceId:e.serviceId,styleId:"",appointmentDate:e.appointmentDate,appointmentTime:e.appointmentTime,appointmentId:e.appointmentId,vagaroURL:e.vagaroURL,businessPackageId:e.businessPackageId,IsWidget:!!(0,T.bG)(a)&&a?.toLocaleLowerCase()==="true",IsFacebook:!1,TabsIncluded:i,EventType:e.eventType,IsPaid:e.isPaid,appointmentUserId:e.appUserId,sharedAppUserName:e.sharedAppUserName,appUserEmailId:e.appUserEmailId,appUserCellNo:e.appUserCellNo,originalPrice
1:e.originalPrice?e.originalPrice.toString():"0",serviceOriginalPrice:e.serviceOriginalPrice?e.serviceOriginalPrice.toString():"0",houseCallGroupId:e.houseCallGroupID,addonServiceIds:e.strAddonServicIds,addonAppointmentIds:e.strAddonAppointmentIds,businessId:e.businessId,groupId:e.sGroup,serviceIdText:e.serviceIdText,appointmentIdText:e.appointmentIdText,serviceProviderIdText:e.serviceProviderIdText,device:o,version:s,module:r})},C={appointmentId:e.appointmentId,businessId:e.businessId,eventType:e.eventType,groupId:e.sGroup,device:o,module:r};return{openRescheduleFailedBusinessRulesPopup:u,setOpenRescheduleFailedBusinessRulesPopup:m,getHoursDiffbyAppidReschedule:c,reScheduleAppConfirmation:h,handleRescheduleClick:()=>{e.isWorkShop?p({merchantId:e.businessId,appId:e.appointmentId,operationType:3,isFrom:2,groupId:e.sGroup,device:o,module:r}):c(C)}}})(i,{alertAppointmentPopup:es,setAlertAppointmentPopup:er,businessPackageAlertPopup:el,setBusinessPackageAlertPopup:ec,setcommonPopupAlert:em,onRescheduleReady:S}),{mutate:ej}=(0,b.n)({mutationFn:g.rebookClassAppointment,meta:{invalidateQueries:[y.lH.appointments.getAppointments]},onSuccess:e=>{if("-9"===e)er({message:eT,title:"Info"});else{if("0"===e)return er({message:'"'+i.businessName+'" does not accept online class.',title:"Info"}),!1;if("2"===e)return er({message:"This class is no longer available online.",title:"Info"}),!1;if("-1"===e)return er({message:"Some Error occured.",title:"Oops!"}),!1;x(i)}},onError:()=>{f.oR.error("Failed to rebook appointment")}}),eF=()=>2===i.eventType?void ej({serviceProviderId:i.serviceProviderId,serviceId:i.serviceId,vagaroUrl:i.vagaroURL.toLowerCase(),widget:!!ef,facebook:!1,tabsIncluded:"0|1|2|3|4|5|6",device:w,moudle:P,businessId:i.businessId,groupId:i.sGroup}):!0!==i.isOnlineService?(f.oR.warning(`"${i.serviceTitle}" service is no longer available for online booking.`),!1):void x(i),{cancelAppWithCharge:eR,cancelWorkshop:eO,cancelAppointment:eM,cancelAppointmentSave:eU,openNoCancelAppointmentAllowedPopup:eW,openCancelAppointmentConfirmationPopup:eL,openCancelAppointmentValidationFailedPopup:e_,openCancellationPolicyPopup:eE,cancelMultipleAppoitmentPopup:eV,cancelCCCaptureAppoitmentModal:eG,setOpenNoCancelAppointmentAllowedPopup:e$,setOpenCancelAppointmentConfirmationPopup:eY,setOpenCancelAppointmentValidationFailedPopup:eH,setOpenCancellationPolicyPopup:eq,setCancelMultipleAppoitmentPopup:eZ,setonlineRefundDetailsForCancelAppt:ez,cancellationPolicyMessage:eJ,cancelAppointmentRequestDeprcted:eK}=((e,t,a)=>{var n=void 0;let i="Business is Under Maintenance. This won't take long",o="We ask that you please reschedule or cancel at least ##HOUR## hours before the beginning of your appointment or you may be charged a cancellation fee of ##AMT##.",s="We ask that you please reschedule or cancel at least ##HOUR## hours before the beginning of your appointment, or you may be charged a cancellation fee of ##AMT## of the price of your scheduled appointment. ",c="service bundle",{module:u,device:m,version:h,profileData:C}=(0,A.J)(),[v,I]=(0,l.useState)(!1),[S,x]=(0,l.useState)(!1),[w,P]=(0,l.useState)(!1),[k,D]=(0,l.useState)(!1),[B,j]=(0,l.useState)(""),[F,R]=(0,l.useState)(null),[O,M]=(0,l.useState)(null),[G,Y]=(0,l.useState)(null),H=(0,l.useRef)(!1),q=(0,l.useRef)(!1),Z=(0,l.useRef)(!0),z=(0,l.useRef)(""),J=(0,l.useRef)(""),K=(0,l.useRef)(""),Q=(0,l.useRef)(!1),X=(0,l.useRef)(!1),ee=(0,l.useRef)(!1),et={},ea={};window.onGetTokenCallback=e=>{e.data&&1e3==e.data.custom_code?a.setAppointmentLoader(!0):(a.setAppointmentLoader(!1),(0,T.bG)(e.data.Message)&&f.oR.error(e.data.Message))};let en=e=>{a.setAppointmentLoader(e)},ei=e=>{X.current=e,$("#divSaveCardToBusiness")&&(e?$("#divSaveCardToBusiness").show():($("#divSaveCardToBusiness").hide(),ee.current=!1))},eo={cancelApp(t,n,i,o,s,r,l,c){let p="";void 0!==es&&void 0!==es.cancelAppointmentCCCaptureDetails&&void 0!==es.cancelAppointmentCCCaptureDetails.AppointmentDetails&&void 0!==es.cancelAppointmentCCCaptureDetails.AppointmentDetails.appointmentId&&(p=es.cancelAppointmentCCCaptureDetails.AppointmentDetails.appointmentId),H.current=!1,a.setcommonPopupAlert(null),em({device:m,module:u,version:h,eventType:e.eventType,businessId:e.businessId,appointmentId:t,userPaymentId:e.userPaymentId,workShop:e.isWorkShop,startDepositNoSh
1ow:e.isStartDepositNoshow,businessPackageId:e.businessPackageId,paid:e.isPaid,refundOnline:e.isRefundOnline,houseCallGroupId:e.houseCallGroupID??"",apiCallCount:1,cancelledByCustomer:!0,fromMyAccount:!0,chargeAppointmentIds:p,denyComments:"Online Cancelled By Customer",groupId:o,checkoutRequest:c??null})}},es={cancelAppointmentCCCaptureDetails:{},IsCCChanged:!1,ZenSwipeCardDetails:{},PaidType:L,NewStatus:_,EventType:E,CheckoutType:V,CancelWorkshopWithCharge(e,t,n){let i,r,l=0,c="",p,d,u,m,h,C;Q.current=!1,e.forEach(function(e,t){0==t&&(c=e.currencySymbol,p=e.cutOffHours,d=e.isAmountChargeType,u=e.cancellationNoShowCharge,m=e.isSeprateMerchantAccount,h=e.cancellationPolityClass,C=e.currencyCode),e.isAmountChargeType?l+=e.amount*e.cancellationNoShowCharge/100:e.cancellationNoShowCharge>e.amount?l+=e.amount:l+=e.cancellationNoShowCharge}),l=l.toFixed(2),d?(i=c+l,r=s.replace("##HOUR##",p).replace("##AMT##",u+"%")):(i=c+parseFloat(l),r=o.replace("##HOUR##",p).replace("##AMT##",i));let v=""!==n.BusinessName,g=""!==n.Telephone,y="",b=" by "+n.BusinessName;!0==v?(y=" at "+n.BusinessName,b=" by "+n.BusinessName,!0==g&&(y+=" or call the business at "+n.Telephone+".")):y=".",!0==m?b+=" paid to "+n.ServiceProviderFirstName+" "+n.ServiceProviderLastName+".":b+=".";let f="Would you like to cancel this workshop? A cancellation fee of "+i+" will be charged to your card on file. It will cancel all your future workshop sessions by doing this "+y;1==parseFloat(p)&&(r=r.replace("hours","hour")),r+=" "+h,b="I acknowledge that by cancelling, I will be charged a late cancellation fee "+b,es.cancelAppointmentCCCaptureDetails.cancelAmount=l,es.cancelAppointmentCCCaptureDetails.currencyCode=C,es.cancelAppointmentCCCaptureDetails.AppointmentDetails=n,es.cancelAppointmentCCCaptureDetails.vcfFeeAmt=e[0].vcfFeeAmt,es.cancelAppointmentCCCaptureDetails.vcfFeeName=e[0].vcfFeeName,es.cancelAppointmentCCCaptureDetails.businessFeeID=e[0].businessFeeId;let A={};t.forEach(e=>{!0===e.isSelfCard&&(A={CreditCardNumber:e.creditCardNumber,BusinessID:e.businessId,CCFirstName:e.ccFirstName,CCLastName:e.ccFirstName,CCMiddleName:e.ccMiddleName,CardTokenId:e.cardTokenId,CreditCardType:e.creditCardType,FullName:e.fullName,SecurityCode:e.securityCode,isselfcard:e.isSelfCard})});let I=t.filter(e=>!0!==e.isSelfCard);if(null!=A&&null!=A.CreditCardNumber){Z.current=!0,et=A;let e=A.CreditCardNumber;e.length>0&&(e=A.CreditCardNumber),z.current=A.CreditCardType+" ending in "+e,es.ZenSwipeCardDetails={},ei(!1),ee.current=!1,es.IsCCChanged=!1,et.CCFirstName=A.CCFirstName,et.CCLastName=A.CCLastName,et.CCMiddleName=A.CCMiddleName,et.CardTokenId=A.CardTokenId,et.CreditCardNumber=A.CreditCardNumber,et.CreditCardType=A.CreditCardType,et.ExpMonth=A.ExpMonth,et.ExpYear=A.ExpYear,et.FullName=A.FullName,et.SecurityCode=A.SecurityCode,q.current=!0}else q.current=!1,(null==I||void 0===I||0==I.length)&&(Z.current=!1,es.UpdateCCSelection(this),es.LoadBlankCCFrame("CancleAppCCDetails"));if(null!=I&&void 0!==I&&I.length>0){let e=0;if(I.forEach((t,a)=>{t.index=e,e++}),(null==A||void 0===A||null==A.CreditCardNumber)&&(es.ZenSwipeCardDetails={},ei(!1),ee.current=!1,es.IsCCChanged=!1,I.length>0)){let e=I[0];et.CCFirstName=e.ccFirstName,et.CCLastName=e.ccLastName,et.CCMiddleName=e.ccMiddleName,et.CardTokenId=e.cardTokenId,et.CreditCardNumber=e.creditCardNumber,et.CreditCardType=e.creditCardType,et.ExpMonth=e.expMonth,et.ExpYear=e.expYear,et.FullName=e.fullName,et.SecurityCode=e.securityCode}}e.length>0&&(0,T.bG)(e[0].vcfFeeAmt)&&e[0].vcfFeeAmt>0?J.current=e[0].vcfFeeName+": "+c+e[0].vcfFeeAmt:J.current="",K.current="Cancel Appointment: "+(i=c+parseFloat(l+es.GetVCFCgarges(e[0]))),a.setcommonPopupAlert({title:"Cancel Workshop",decription:f,size:"medium",primaryButtonText:"Cancel Appointment: "+i,primaryButtonVariant:"Red",secondaryButtonText:"Back",popupBody:()=>es.CancelCCCaptureAppoitmentModal(I,r,b),confirm:()=>{es.validateCCCaptureCancellation()},back:()=>{es.ClearCCCaptureCancel()}})},GetVCFCgarges:e=>(0,T.bG)(e.vcfFeeAmt)&&e.vcfFeeAmt>0?e.vcfFeeAmt:0,LoadBlankCCFrame(e){et={},ei(!0),ee.current=!1,es.LoadCCFrame(e)},LoadCCMethodsCallBack(e){if(a.setAppointmentLoader(!0),e&&e.data&&e.data.data&&1e3===e.data.custom_code){let t=e?.data?.data;
1es.ZenSwipeCardDetails.cc_no=t.cc_no,es.ZenSwipeCardDetails.cvv=t.cvv,es.ZenSwipeCardDetails.first_name=t.first_name,es.ZenSwipeCardDetails.middle_name=t.middle_name,es.ZenSwipeCardDetails.last_name=t.last_name,es.ZenSwipeCardDetails.cc_type=t.cc_type,es.ZenSwipeCardDetails.card_token=t.card_token,es.validateCCCaptureCancellation()}else a.setAppointmentLoader(!1),(0,T.bG)(e.data.Message)&&f.oR.error(e.data.Message)},LoadCCFailedMethodsCallBack(e){if(a.setAppointmentLoader(!0),e&&e.data&&e.data.data&&1e3===e.data.custom_code){let t=e?.data?.data;es.ZenSwipeCardDetails.cc_no=t.cc_no,es.ZenSwipeCardDetails.cvv=t.cvv,es.ZenSwipeCardDetails.first_name=t.first_name,es.ZenSwipeCardDetails.middle_name=t.middle_name,es.ZenSwipeCardDetails.last_name=t.last_name,es.ZenSwipeCardDetails.cc_type=t.cc_type,es.ZenSwipeCardDetails.card_token=t.card_token,es.validatePaymentFailedCCCapture()}else a.setAppointmentLoader(!1),(0,T.bG)(e.data.Message)&&f.oR.error(e.data.Message)},LoadCCFrame(e){es.IsCCChanged=!0,window.vui.loader=en;let t=!!(0,T.bG)(window.userCountryId)&&2!=window.userCountryId,a=C?.countryID.toString()??"1";window.vui.ccCountryId=a,window.vui.width="100%",void 0!==es.cancelAppointmentCCCaptureDetails&&""!=es.cancelAppointmentCCCaptureDetails.merchantTokenId&&window.vui.getTypeWithoutButton(e,!0==t?272:160,es.cancelAppointmentCCCaptureDetails.merchantTokenId,"100%","","dvCustomerPaymentFailedCCDetail"===e?es.LoadCCFailedMethodsCallBack:es.LoadCCMethodsCallBack,"online website",!0,a,void 0,void 0,!0)},UpdateCCSelection(e){$(e).siblings(".w-tab-link").removeClass("w--current"),$(e).addClass("w--current"),es.ZenSwipeCardDetails={},ei(!1),ee.current=!1,es.IsCCChanged=!1,e?.id!="tabBooking2"&&void 0!==e?.dataset&&e?.dataset!=null&&(et.CCFirstName=e.dataset.ccfirstname,et.CCLastName=e.dataset.cclastname,et.CCMiddleName=e.dataset.ccmiddlename,et.CardTokenId=e.dataset.cardtokenid,et.CreditCardNumber=e.dataset.creditcardnumber,et.CreditCardType=e.dataset.creditcardtype,et.ExpMonth=e.dataset.expmonth,et.ExpYear=e.dataset.expyear,et.FullName=e.dataset.fullname,et.SecurityCode=e.dataset.securitycode)},validateCCCaptureCancellation(){if(!1===Q.current)return $("#lblCancelAppointmentPolicy").css("color","#FF0000"),!1;if($("#lblCancelAppointmentPolicy").css("color",""),(void 0==es.ZenSwipeCardDetails||es.ZenSwipeCardDetails?.card_token==void 0)&&es.IsCCChanged)return a.setAppointmentLoader(!0),window.vui.frame.zenswipe.submit(),!1;let e=es.getCancelAppointmentCCDetails();if(void 0!==e&&null!=e&&null!=e.cardTokenId){let t=es.createCheckoutRequest(e),a=es.cancelAppointmentCCCaptureDetails.AppointmentDetails;es.CancelApp(a.appointmentId,m,a.EventType,a.sGroup,a.IsRefundOnline,a.isWorkShop,a.strBusinessID,t)}else f.oR.error("Something went wrong, please try again!")},validatePaymentFailedCCCapture(){if((void 0==es.ZenSwipeCardDetails||void 0==es.ZenSwipeCardDetails.card_token)&&es.IsCCChanged)return a.setAppointmentLoader(!0),window.vui.frame.zenswipe.submit(),!1;let e=es.getCancelAppointmentCCDetails();if(void 0!==e&&null!=e&&null!=e.cardTokenId){let t=es.createCheckoutRequest(e),a=es.cancelAppointmentCCCaptureDetails.AppointmentDetails;es.CancelApp(a.appointmentId,m,a.EventType,a.sGroup,a.IsRefundOnline,a.isWorkShop,a.strBusinessID,t)}else f.oR.error("Something went wrong, please try again!")},getCancelAppointmentCCDetails(){let e={};return void 0!==es.ZenSwipeCardDetails&&null!=es.ZenSwipeCardDetails.card_token?(e.ccNo=es.ZenSwipeCardDetails.cc_no,e.ccSecurityCode=es.ZenSwipeCardDetails.cvv,e.ccFirstName=es.ZenSwipeCardDetails.first_name,e.ccMiddleName=(0,T.bG)(es.ZenSwipeCardDetails.middle_name)?es.ZenSwipeCardDetails.middle_name:"",e.ccLastName=es.ZenSwipeCardDetails.last_name,e.ccType=es.ZenSwipeCardDetails.cc_type,e.cardTokenId=es.ZenSwipeCardDetails.card_token):void 0!==et&&null!=et.CardTokenId&&(e.ccNo=et.CreditCardNumber,e.ccSecurityCode=et.SecurityCode,e.ccFirstName=et.CCFirstName,e.ccMiddleName=et.CCMiddleName,e.ccLastName=et.CCLastName,e.ccType=et.CreditCardType,e.cardTokenId=et.CardTokenId),e},createCheckoutRequest(e){es.cancelAppointmentCCCaptureDetails.currencyCode=(0,T.bG)(es.cancelAppointmentCCCaptureDetails.currencyCode)?es.cancelAppointmentCCCaptureDetails.currencyCode:"";let t=0;t=es.cancelAppointmentCCCaptureDetails.amountChargeType?parseFloat((e
1s.cancelAppointmentCCCaptureDetails.amount*es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge/100).toFixed(2)):es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge>es.cancelAppointmentCCCaptureDetails.amount?parseFloat(es.cancelAppointmentCCCaptureDetails.amount.toFixed(2)):parseFloat(es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge.toFixed(2));let a={strbusinessID:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.businessId,strloginUserID:"",ccAmt:es.cancelAppointmentCCCaptureDetails.cancelAmount,amtPaid:es.cancelAppointmentCCCaptureDetails.cancelAmount,strpayeeId:"",isSaveCard:ee.current,currencyCode:es.cancelAppointmentCCCaptureDetails.currencyCode,ccDetails:{ccDistribution:null,ccPropayCardDetails:null,swipeString:null,ccType:e.ccType,ccNo:e.ccNo,ccSecurityCode:e.ccSecurityCode,ccFirstName:e.ccFirstName,ccMiddleName:e.ccMiddleName,ccLastName:e.ccLastName,isCcSwipe:!1,signature:null,cardTokenId:e.cardTokenId,iframe_id:null,serialNumber:null},checkoutGridrow:[{uniqID:1,struserID:"",strserviceProviderID:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.serviceProviderId,itemName:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.serviceTitle,stritemID:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.serviceId,recordType:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.eventType==es.EventType.Appointment?es.CheckoutType.Service:es.CheckoutType.Class,price:t,discountedPrice:t,strappointmentID:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.appointmentId,startTime:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.StartTime,appType:null,quantity:1,CancelledByCustomer:!0,IsDeposit:!1,IsChargeFee:2,paidType:es.PaidType.NoShowCancellation,NewStatus:es.NewStatus.Cancel}]},n=2;if(es.cancelAppointmentCCCaptureDetails.AppointmentDetails.strAddonAppointmentIds&&Array.isArray(es.cancelAppointmentCCCaptureDetails.AppointmentDetails.strAddonAppointmentIds)&&es.cancelAppointmentCCCaptureDetails.AppointmentDetails.strAddonAppointmentIds.length>0&&""!==es.cancelAppointmentCCCaptureDetails.AppointmentDetails.strAddonAppointmentIds.join("").trim())try{let e=JSON.parse(es.cancelAppointmentCCCaptureDetails.addOnDetail);for(let t=0;t<e.length;t++){let i=e[t],o=0;o=es.cancelAppointmentCCCaptureDetails.amountChargeType?parseFloat((es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge*i.Price/100).toFixed(2)):es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge>i.Price?parseFloat(i.Price.toFixed(2)):parseFloat(es.cancelAppointmentCCCaptureDetails.cancellationNoShowCharge.toFixed(2)),a.checkoutGridrow.push({uniqID:n++,struserID:"",strserviceProviderID:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.serviceProviderId,itemName:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.addonNames.split("|~|")[t],stritemID:i.serviceId,recordType:es.cancelAppointmentCCCaptureDetails.AppointmentDetails.eventType==es.EventType.Appointment?es.CheckoutType.ServiceAddons:es.CheckoutType.ClassAddons,price:o,discountedPrice:o,strappointmentID:i.appointmentId,startTime:i.AppointmentDate,appType:null,quantity:1,CancelledByCustomer:!0,IsDeposit:!1,IsChargeFee:2,paidType:es.PaidType.NoShowCancellation,NewStatus:es.NewStatus.Cancel})}}catch(e){console.error("Failed to parse AddOnDetails",e)}if((0,T.bG)(es.cancelAppointmentCCCaptureDetails.vcfFeeAmt)&&(0,T.bG)(es.cancelAppointmentCCCaptureDetails.vcfFeeAmt)&&es.cancelAppointmentCCCaptureDetails.vcfFeeAmt>0){a.ccAmt=parseInt(a.ccAmt)+parseFloat(es.cancelAppointmentCCCaptureDetails.vcfFeeAmt),a.amtPaid=parseInt(a.amtPaid)+parseFloat(es.cancelAppointmentCCCaptureDetails.vcfFeeAmt);let e={};e.uniqID=n++,e.struserID="",e.strserviceProviderID=es.cancelAppointmentCCCaptureDetails.AppointmentDetails.serviceProviderId,e.itemName=es.cancelAppointmentCCCaptureDetails.vcfFeeName,e.stritemID=es.cancelAppointmentCCCaptureDetails.businessFeeId,e.recordType=21,e.price=es.cancelAppointmentCCCaptureDetails.vcfFeeAmt,e.discountedPrice=es.cancelAppointmentCCCaptureDetails.vcfFeeAmt,e.strappointmentID="",e.appType=null,e.quantity=1,e.CancelledByCustomer=!1,e.IsDeposit=!1,e.paidType=es.PaidType.NoShowCancellation,a.checkoutGridrow.push(e)}return a},ClearCCCaptureCancel(){es.cancelAppointmentCCCaptureDetails={}
1,es.ZenSwipeCardDetails={},es.IsCCChanged=!1,Q.current=!1,Z.current=!0,ee.current=!1,$("#lblCancelAppointmentPolicy").css("color",""),K.current=""},OpenRefundPolicyPopup(e,t){null==t&&(t="Terms and Conditions For Refund"),a.setRefundPolicyPopup(e)},getRefundText(e,t,a,n,i){let o="";o=2!==e||t?2===e&&t?"this workshop":i>1?"these appointments":"this appointment":i>1?"these classes":"this class";let s="";return a?s="Are you sure you want to cancel "+o+"? You will be issued a refund for "+o+".":(s="Are you sure you want to cancel "+o+"? A refund will not be issued for "+o+".",null!==n&&""!==n&&(s="Are you sure you want to cancel "+o+"? A refund will not be issued for "+o+".")),s},getNonRefundText:(e,t,a)=>e?"":(0,r.jsxs)("div",{className:"margin-bottom15 margin-top15",children:[t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsx)(l.Suspense,{children:(0,r.jsx)("div",{className:d.A.refundPolicyText,children:(0,r.jsx)(p.YU,{ButtonVariant:"ghost",ButtononClick:()=>{es.OpenRefundPolicyPopup(t)},ButtononHover:()=>{},DropdownClick:()=>{},children:"View Refund Policy"})})})]}),(0,r.jsx)("form",{children:(0,r.jsx)(l.Suspense,{children:(0,r.jsxs)("div",{className:d.A.checkBoxWrapper,children:[(0,r.jsx)(p.rM,{CheckBoxId:"chkAgree"+a,CheckboxVariation:"Checkbox-Simple",Name:"",OnChange:e=>{es.chkAgree(e)},OnHover:()=>{},PreOnChange:()=>{}}),(0,r.jsx)("label",{id:"lblAcknowledge",children:"I acknowledge that by cancelling, I will not receive a refund."})]})})})]}),getPopupAcknolegedTextSingle:(e,t,a,n,i,o)=>(0,r.jsxs)(r.Fragment,{children:[es.getRefundText(e,t,a,n,i),(0,r.jsx)("br",{}),es.getNonRefundText(a,n,o)]}),getPopupAcknolegedTextMulti(e,t,a,n,i,o){let s=es.getRefundText(e,t,a,n,i);return(0,r.jsxs)(r.Fragment,{children:[s,(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"It will cancel all your future workshop sessions by doing this.",(0,r.jsx)("br",{}),es.getNonRefundText(a,n,o)]})},ShowMultipleAppointmentPopup(e){a.setAppointmentLoader(!0),e.device=m,e.module=u,ec(e)},ConfirmCancellationSingleAppPopup(t,n,i,o,s,r){let l=es.getPopupAcknolegedTextSingle(t,s,i,o,1,"Single");2!=t,!0==i?a.setcommonPopupAlert({title:"Cancel Appointment?",primaryButtonText:"Cancel Appointment",secondaryButtonText:"Back",popupBody:()=>l,confirm:()=>{es.CancelApp(e.appointmentId,m,2===t?2:1,n,i,s,r)}}):a.setcommonPopupAlert({title:"Cancel Appointment?",primaryButtonText:"Cancel Appointment",secondaryButtonText:"Back",popupBody:()=>l,confirm:()=>{H.current?es.CancelApp(e.appointmentId,m,2===t?2:1,n,i,s,r):($("#lblAcknowledge").addClass("label-error").css("color","#d83f34"),$("#lblAcknowledge").attr("aria-checked","true"))}})},validateCancellation(){let e=$("#tableAppoitments").find("input[type=checkbox]:checked").length;if(ea.IsRefundOnline||H.current){if(e<=0)return void f.oR.warning("Please select atleast one appointment");let t=[];$.grep($("#tableAppoitments").find("input[type=checkbox]:checked"),function(e){return e&&t.push(e.id.replace("check-simple-chkAppoitment","")),!0}),es.CancelApp(t.join(),ea.isCallFrom,ea.EventType,ea.localsGroup,ea.IsRefundOnline,ea.IsWorkShop,ea.BusinessID)}else $("#lblAcknowledge").addClass("label-error").css("color","#d83f34")},chkAgree(e){H.current=e,e?$("#lblAcknowledge").removeClass("label-error").css("color","#333333"):$("#lblAcknowledge").addClass("label-error").css("color","#d83f34")},clickAnyCheckBox(e,t){if(void 0!=t){let a="check-simple-chkAllInactiveData",n=$("#tableAppoitments");if(t.id==a){let e=$(t).prop("checked");null!=n&&void 0!=n&&($("div.mp-appointment-box input[type='checkbox']",n).attr("checked",e),$("div.mp-appointment-box input[type='checkbox']",n).prop("checked",e))}else{let n=t.name;e?(0,T.bG)(n)&&$('input[name="'+t.name+'"]').prop("checked",!0):($("#"+a).prop("checked",!1),(0,T.bG)(n)&&($('input[data-housecallgroupid="'+$(t).data("housecallgroupid")+'"]').prop("checked",!1),f.oR.error("Multiple housecall appointments booked together will be cancelled together. They can't be cancelled separately.")))}$("input:checkbox:not('#"+a+"'):checked",n).length==$("input:checkbox:not('#"+a+"')",n).length?$("#"+a).prop("checked",!0):$("#"+a).prop("checked",!1)}},CancelApp(e,t,n,i,o,s,r,l){a.setAppointmentLoader(!0),eo.cancelApp(e,t,n,i,o,s,r,l)},CancelMultipleAppoitmentsModal(t){let a=t?.filter(e=>!(0,T.bG)(e.housecallGroupID));return(0,r.jsx)("div",{id:"CancelMultipleAppoitmentsModal",className:"modal fade mobile-fullpopup class-policy-popup appointment-poppup vagaro-modal",style:{zIndex:"99999999"},children:(0,r.jsx)("div",{className:"modal-dialog",children:(0,r.jsxs)("div",{className:"modal-content general-form-custom clearfix",children:[(0,r.jsx)("div",{className:"modal-header",children:!ea.IsWorkShop&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)("div",{className:d.A.allInactiveCheck,children:(0,r.jsx)(p.rM,{CheckBoxId:"chkAllInactiveData",CheckboxLabel:"Select All",CheckboxVariation:"Checkbox-Simple",Name:"",SetValue:a,OnChange:(e,t)=>
1{es.clickAnyCheckBox(e,t.target)},OnHover:()=>{},PreOnChange:()=>{}})})})}),(0,r.jsxs)("div",{className:"modal-body default-scrollbar",children:[(0,r.jsx)("div",{className:"mp-appointment-wrap",id:"tableAppoitments",children:(0,r.jsx)("div",{className:d.A.appointmentCardMain,children:t.map(e=>es.CancelMultipleAppoitmentTemplate(e))})}),es.getNonRefundText(e.isRefundOnline,e.refundPolicy,"Multiple")]})]})})})},CancelMultipleAppoitmentTemplate(t){let a=!0;return(0,T.bG)(t?.houseCallGroupID)&&(a=t?.houseCallGroupID===e.houseCallGroupID),(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:`${d.A.appointmentCardBox} mp-appointment-box`,children:[(0,r.jsx)("div",{className:`${d.A.appointmentCardBoxCheckbox} customcheck-box-singal small-check vagaro-checkbox`,children:(0,r.jsx)(p.rM,{CheckBoxId:"chkAppoitment"+t.appointmentId,CheckboxLabel:"",CheckboxVariation:"Checkbox-Simple",Name:t?.housecallGroupID??"",SetValue:a,Disable:ea.IsWorkShop,OnChange:(e,t)=>{es.clickAnyCheckBox(e,t.target)},OnHover:()=>{},PreOnChange:()=>{},value:t.appointemntId})}),(0,r.jsxs)("div",{className:`web-builder-font-color ${d.A.appointmentCardBoxTitle} `,children:["Sevice Name: ",(0,r.jsx)("span",{children:t.serviceName})]}),(0,r.jsxs)("div",{className:`web-builder-font-color ${d.A.appointmentCardBoxTitle} `,children:["Service Provider: ",(0,r.jsxs)("span",{children:[t.serviceProviderFirstName," ",t.serviceProviderLastName]})]}),(0,r.jsxs)("div",{className:`web-builder-font-color ${d.A.appointmentCardBoxTitle} `,children:["Service Time: ",(0,r.jsxs)("span",{children:[(0,U.c6)(t.strAppointmentDate,U._O.LargeDate,e.countryId)," "," "," ",t.strAppointmentTime]})]}),null!=t.sharedAppUserName&&""!=t.sharedAppUserName&&(0,r.jsx)("div",{className:d.A.ffApptCardview,children:(0,r.jsxs)("div",{className:d.A.ffapptforCard,children:[(0,r.jsx)("div",{className:` ${d.A.ffsubGrey} vg-body-font web-body-font web-builder-font-color`,children:"Appointment for:"}),(0,r.jsxs)("div",{className:d.A.divBlock519,children:[(0,r.jsx)("div",{id:"divShareAppUserName",className:` ${d.A.subBlack} web-builder-font-color`,children:t.sharedAppUserName}),(0,r.jsx)(W.f,{icon:"users",beakPoint:"Up"})]})]})})]})})},familyfriendsCCdetailTemplate(e){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=[{id:1,name:z.current}],n=t.map((e,t)=>{var a;return{id:t+3,name:(0,r.jsxs)("div",{className:d.A.segmentData,id:"tabBooking"+(t+3),"data-ccfirstname":e.ccFirstName,"data-cclastname":e.ccLastName,"data-ccmiddlename":e.ccMiddleName,"data-cardtokenid":e.cardTokenId,"data-creditcardnumber":e.creditCardNumber,"data-creditcardtype":e.creditCardType,"data-expmonth":e.expMonth,"data-expyear":e.expYear,"data-fullname":e.fullName,"data-securitycode":e.securityCode,"data-w-tab":"Tab "+(e.index+3),children:[e.creditCardType," ending in ",e.creditCardNumber,(0,r.jsx)(W.f,{icon:"users",beakPoint:"Up",tooltipText:(a=`Shared by ${e.fullName??""}`,`
2    <div class="tooltip-content">
3      <span>${a??""}</span><br/>
4    </div>
5  `)})]})}});return[...e.showBooking1?a:[],...t.length>0?n:[],...e.showBooking2?[{id:2,name:"Add New Credit Card"}]:[]]}({showBooking1:q.current,showBooking2:!0},e);return(0,r.jsx)(r.Fragment,{children:Z.current&&(0,r.jsx)("div",{id:"dvBookingTabs",className:"shipping-tabs w-tab-menu vagaro-segment-vertical",children:(0,r.jsx)("div",{className:d.A.FFCardDeta,children:(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.oN,{ActiveSegment:1,BeakPosition:"Left",Html:!0,Name:t??[],NoOfSegments:t?.length.toString()??"0",TabSegment:"vertical",TextAlignment:"left",Title:"Payment Method:",onClick:(e,t,a)=>{es.UpdateCCSelection(a.target.children[0]),2===e&&es.LoadBlankCCFrame("CancleAppCCDetails")},Disabled:[]})})})})})},CancelCCCaptureAppoitmentModal:(e,t,a)=>(0,r.jsx)("div",{id:"CancelCCCaptureAppoitmentModal",className:"modal fade mobile-fullpopup className-policy-popup",children:(0,r.jsx)("div",{className:"modal-dialog",children:(0,r.jsx)("div",{className:"modal-content general-form-custom clearfix",children:(0,r.jsxs)("div",{className:"modal-body default-scrollbar cancelPolicyContent",id:"divCancelCCCaptureAppoitmentModalBody",children:[(0,r.jsx)("div",{className:`vg-body-font web-body-font web-builder
5-font-color ${d.A.canceltextContent}`,children:"Cancellation Policy:"}),(0,r.jsx)("div",{id:"divCancellationPolicy",className:`vg-body-font web-body-font web-builder-font-color ${d.A.canceltextContentMore}`,children:t}),(0,r.jsx)("div",{className:"moreless-action",children:(0,r.jsx)("a",{className:"moreless-button",href:"#",style:{display:"none"},children:"More"})}),J.current&&(0,r.jsx)("div",{id:"dvVCFFee",children:J.current}),(0,r.jsxs)("div",{className:"w-tabs fullwidth-element","data-duration-in":"300","data-duration-out":"100",children:[es.familyfriendsCCdetailTemplate(e),(0,r.jsxs)("div",{className:"tabs-content w-tab-content",children:[(0,r.jsx)("div",{className:"w--tab-active w-tab-pane","data-w-tab":"Tab 1"}),(0,r.jsx)("div",{className:"w--tab-active w-tab-pane","data-w-tab":"Tab 3"}),(0,r.jsx)("div",{className:"w-tab-pane","data-w-tab":"Tab 2",children:(0,r.jsxs)("div",{className:"w-form",children:[(0,r.jsx)("div",{className:"dpdueTitle CCDetailField"}),(0,r.jsx)("div",{id:"CancleAppCCDetails",className:"payment-iframe w-clearfix"}),(0,r.jsx)("div",{id:"divSaveCardToBusiness",className:` ${d.A.checkForSaveCard} checkbox-custom-black cancellation-policy-checkbox vagaro-checkbox`,style:{display:"none"},children:(0,r.jsx)(p.rM,{CheckBoxId:"chkIsSaveCardToBusiness",CheckboxLabel:"Save card with business",CheckboxVariation:"Checkbox-Simple",Name:"",SetValue:ee.current,OnChange:e=>ee.current=e,OnHover:()=>{},PreOnChange:()=>{}})})]})})]})]}),(0,r.jsxs)("div",{className:`${d.A.CheckForAgrement} checkbox-custom-black cancellation-policy-checkbox vagaro-checkbox `,children:[(0,r.jsx)(p.rM,{CheckBoxId:"chkIsCancelAppointment",CheckboxLabel:"",CheckboxVariation:"Checkbox-Simple",Name:"",SetValue:Q.current,OnChange:e=>{Q.current=e},OnHover:()=>{},PreOnChange:()=>{}}),(0,r.jsx)("label",{htmlFor:"chkIsCancelAppointment",id:"lblCancelAppointmentPolicy",children:a})]})]})})})}),paymentFailedModal:()=>(0,r.jsx)("div",{className:"modal fade",id:"paymentFailedModal","data-keyboard":"false","data-backdrop":"static",children:(0,r.jsx)("div",{className:"modal-dialog modelCommanw600",children:(0,r.jsx)("div",{className:"modal-content general-form-custom",children:(0,r.jsx)("div",{className:"modal-body",children:(0,r.jsx)("div",{id:"dvCustomerPaymentFailedCCDetail"})})})})})},{mutate:er}=(0,b.n)({mutationFn:g.getHoursDiffbyAppid,meta:{invalidateQueries:[y.lH.appointments.getAppointments]},onSuccess:t=>{t&&(a.setAppointmentLoader(!1),e.allowCustCancelApp?!0===e.isStartDepositNoshow&&!0===t.canCancel&&t.cutOffHours>0&&!1===t.canCancelAppt?null!=e.businessPackageId&&"duqGW~bhDOt26a2V~nJmvg=="!==e.businessPackageId?a.setcommonPopupAlert({primaryButtonText:"OK",secondaryButtonText:"Cancel",popupBody:()=>"The appointment that you are canceling has been attached with a "+c+". Canceling the service will violate the "+c+" and it won't be the part of "+c+" anymore.\nAre you sure you want to continue?",confirm:()=>{el(t)}}):el(t):t.cancelHours>=0&&!1===t.canCancel?2===e.eventType||3===e.eventType?a.setAlertAppointmentPopup({message:"The business that you have made this class with does not allow you to cancel the class online within {0} hours of the scheduled time. Please call {1} to cancel your class".replace("{0}",t.cancelHours.toString()).replace("{1}",e.telephone),title:"Oops!"}):a.setAlertAppointmentPopup({message:"The business that you have made this appointment with does not allow you to cancel the appointment online within {0} hours of the scheduled time. Please call {1} to cancel your appointment".replace("{0}",t.cancelHours.toString()).replace("{1}",e.telephone),title:"Oops!"}):2===e.eventType||3===e.eventType?ed(t.appStatus):ep(t.appStatus):2===e.eventType||3===e.eventType?a.setAlertAppointmentPopup({message:"The business that you have made this class with does not allow you to cancel the class online. Please call {0} to cancel your class".replace("{0}",e.telephone),title:"Oops!"}):a.setAlertAppointmentPopup({message:"The business that you have made this appointment with does not allow you to cancel the appointment online. Please call {0} to cancel your appointment".replace("{0}",e.telephone),title:"Oops!"}))},onError:()=>{a.setAppointmentLoader(!1),f.oR.error("Sorry something went wrong, please try again!")}}),el=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=0,r="",l=0,c=null;void 0!==t.addOnDetail&&""!=t.addOnDetail&&null!=t.addOnDetail&&(c=JSON.parse(t.addOnDetail)),t.amountChargeType?(l=parseFloat((t.amount*t.cancellationNoShowCharge/100).toFixed(2)),null!=c&&c.forEac
5h(e=>{l+=parseFloat((e.Price*t.cancellationNoShowCharge/100).toFixed(2))}),i=t.currencySymbol+l,r=s.replace("##HOUR##",t.cutOffHours).replace("##AMT##",t.cancellationNoShowCharge+"%")):(l=t.cancellationNoShowCharge>t.amount?parseFloat(t.amount.toFixed(2)):parseFloat(t.cancellationNoShowCharge.toFixed(2)),null!=c&&c.forEach(e=>{t.cancellationNoShowCharge>e.Price?l+=parseFloat(e.Price.toFixed(2)):l+=parseFloat(t.cancellationNoShowCharge.toFixed(2))}),i=t.currencySymbol+l,r=o.replace("##HOUR##",t.cutOffHours).replace("##AMT##",i.toString()));let p=!!(0,T.bG)(e.businessName),d=!!(0,T.bG)(e.telephone),u="",m=" by "+e.businessName;!0==p?(u=" at "+e.businessName,m=" by "+e.businessName,!0==d&&(u+=" or call the business at "+e.telephone+".")):u=".",!0==t.seprateMerchantAccount?m+=" paid to "+e.serviceProviderFirstName+" "+e.serviceProviderLastName+".":m+=".";let h="Would you like to cancel this appointment? A cancellation fee of "+i+" will be charged to your card on file"+u;1==parseFloat(t.cutOffHours)&&(r=r.replace("hours","hour")),r=1===e.eventType?r+" "+t?.cancellationPolicy:r+" "+t.cancellationPolicyClass,m="I acknowledge that by cancelling, I will be charged a late cancellation fee "+m,es.cancelAppointmentCCCaptureDetails=t,es.cancelAppointmentCCCaptureDetails.cancelAmount=l,es.cancelAppointmentCCCaptureDetails.AppointmentDetails=e,es.cancelAppointmentCCCaptureDetails.AppointmentDetails.StartTime=N()(e.appointmentDateFormat+" "+e.appointmentTime,"ddd, MMM DD, YYYY hh:mm A").format("MMM DD, YYYY hh:mm A");let C={};t.lstCCDetails.forEach(e=>{!0===e.isSelfCard&&(C={CreditCardNumber:e.creditCardNumber,BusinessID:e.businessID,CCFirstName:e.ccFirstName,CCLastName:e.ccLastName,CCMiddleName:e.ccMiddleName,CardTokenId:e.cardTokenId,CreditCardType:e.creditCardType,FullName:e.fullName,SecurityCode:e.securityCode,isselfcard:e.isSelfCard})});let v=t.lstCCDetails.filter(e=>!0!==e.isSelfCard);if(null!=C&&null!=C.CreditCardNumber){Z.current=!0,et=C;let e=C.CreditCardNumber;e.length>0&&(e=C.CreditCardNumber),z.current=C.CreditCardType+" ending in "+e,es.ZenSwipeCardDetails={},ei(!1),ee.current=!1,es.IsCCChanged=!1,et.CCFirstName=C.CCFirstName,et.CCLastName=C.CCLastName,et.CCMiddleName=C.CCMiddleName,et.CardTokenId=C.CardTokenId,et.CreditCardNumber=C.CreditCardNumber,et.CreditCardType=C.CreditCardType,et.ExpMonth=C.ExpMonth,et.ExpYear=C.ExpYear,et.FullName=C.FullName,et.SecurityCode=C.SecurityCode,q.current=!0}else q.current=!1,(null==v||void 0===v||0==v.length)&&(Z.current=!1,es.UpdateCCSelection(n),es.LoadBlankCCFrame("CancleAppCCDetails"));if(null!=v&&void 0!==v&&v.length>0){let e=0;if(v.forEach((t,a)=>{t.index=e,e++}),(null==C||void 0===C||null==C.CreditCardNumber)&&(es.ZenSwipeCardDetails={},ei(!1),ee.current=!1,es.IsCCChanged=!1,v.length>0)){let e=v[0];et.CCFirstName=e.ccFirstName,et.CCLastName=e.ccLastName,et.CCMiddleName=e.ccMiddleName,et.CardTokenId=e.cardTokenId,et.CreditCardNumber=e.creditCardNumber,et.CreditCardType=e.creditCardType,et.ExpMonth=e.expMonth,et.ExpYear=e.expYear,et.FullName=e.fullName,et.SecurityCode=e.securityCode}}(0,T.bG)(t.vcfFeeAmt)&&t.vcfFeeAmt>0?J.current=t.vcfFeeName+": "+t.currencySymbol+t.vcfFeeAmt:J.current="",K.current="Cancel Appointment: "+(i=t.currencySymbol+(Number(l)+Number(es.GetVCFCgarges(t)))),a.setcommonPopupAlert({title:"Cancel Appointment",decription:h,size:"medium",primaryButtonText:"Cancel Appointment: "+i,primaryButtonVariant:"Red",secondaryButtonText:"Back",popupBody:()=>es.CancelCCCaptureAppoitmentModal(v,r,m),confirm:()=>{es.validateCCCaptureCancellation()},back:()=>{es.ClearCCCaptureCancel()}})},{mutate:ec}=(0,b.n)({mutationFn:g.getOnlinePaidAppintmentsData,onSuccess:t=>{if(a.setAppointmentLoader(!1),1032===t.responseCode)a.setAlertAppointmentPopup({message:i,title:"Info"});else if(1e3===t.responseCode){let n=t.data,i=es.getRefundText(e.eventType,e.isWorkShop,e.isRefundOnline,e.refundPolicy,n.lstOnlineRefundDetails.length);if(n.lstOnlineRefundDetails.length>1){ea.EventType=e.eventType,ea.IsRefundOnline=e.isRefundOnline,ea.IsWorkShop=e.isWorkShop,ea.BusinessID=e.businessId,ea.UserPaymentID=e.userPaymentId,ea.isCallFrom="Website",ea.localsGroup=e.sGroup,ea.IsWorkShop&&(i+="  It will cancel all your future workshop sessions by doing this.");let t="";t=e.isWorkShop?"Cancel Workshop?":2===e.eventType?"Cancel Class?":"Cancel Appointment?",a.setcommonPopupAlert({title:t,decription:i,size:"medium",primaryButtonText:"Cancel Appointment",secondaryButtonText:"Back",popupBody:()=>es.CancelMultipleAppoitmentsModal(n.lstOnlineRefundDetails),confirm:()=>{es.validateCancellation()}})}
5else if(e.isWorkShop){let t=n.lstCancellationDetails.filter(e=>!1===e.canCancelAppt&&e.cutOffHours>0);if(t.length>0&&!0===t[0].startDepositNoshow){let a=n.lstCancellationDetails[0].appointmentCancellationPolicy,i=n.lstCancellationDetails[0].merchantTokenId,o={strAppointmentID:e.appointmentId,EventType:e.eventType,IsCallFrom:m,sGroup:e.sGroup,IsRefundOnline:e.isRefundOnline,isWorkShop:e.isWorkShop,strBusinessID:e.businessId,StartTime:n?.lstCancellationDetails[0]?.appointmentDate_Date?N()(n?.lstCancellationDetails[0]?.appointmentDate_Date).format("ddd, MMM DD, YYYY hh:mm A"):"",AppointmentCancellationPolicy:a,MerchantTokenID:i,strServiceProviderID:e.serviceProviderId,ServiceTitle:e.serviceTitle,strServiceID:e.serviceId,BusinessName:e.businessName,ServiceProviderFirstName:e.serviceProviderFirstName,ServiceProviderLastName:e.serviceProviderLastName,Telephone:e.telephone};es.cancelAppointmentCCCaptureDetails={merchantTokenId:i},es.CancelWorkshopWithCharge(t,n.lstCCDetails,o)}else{let t=es.getPopupAcknolegedTextMulti(e.eventType,e.isWorkShop,e.isRefundOnline,e.refundPolicy,n.lstOnlineRefundDetails.length,"Multiple");a.setcommonPopupAlert({primaryButtonText:"OK",secondaryButtonText:"Cancel",popupBody:()=>t,confirm:()=>{es.CancelApp(e.appointmentId,m,2,e.sGroup,e.isRefundOnline,e.isWorkShop,e.businessId)}})}}else e.isWorkShop||es.ConfirmCancellationSingleAppPopup(e.eventType,e.sGroup,e.isRefundOnline,e.refundPolicy,e.isWorkShop,e.businessId)}},onError:()=>{a.setAppointmentLoader(!1),f.oR.error("Some error occured.Please try again later.")}}),ep=t=>{if(5!==t)if(null!=e.businessPackageId&&"duqGW~bhDOt26a2V~nJmvg=="!==e.businessPackageId)a.setcommonPopupAlert({title:"",size:"small",primaryButtonText:"OK",secondaryButtonText:"Cancel",popupBody:()=>(0,r.jsxs)("p",{children:["The appointment that you are canceling has been attached with a "+c+". Canceling the service will violate the "+c+" and it won't be the part of "+c+" anymore.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Are you sure you want to continue?"]}),confirm:()=>{if(!0===e.isPaid){let t={EventType:e.eventType,groupId:e.sGroup,IsRefundOnline:e.isRefundOnline,RefundPolicy:e.refundPolicy,isWorkShop:e.isWorkShop,merchantId:e.businessId,strUserPaymentID:e.userPaymentId??"duqGW~bhDOt26a2V~nJmvg==",strappointmentId:e.appointmentId};es.ShowMultipleAppointmentPopup(t)}else es.CancelApp(e.appointmentId,m,1,e.sGroup,e.isRefundOnline,e.isWorkShop,e.businessId)}});else if(!0===e.isPaid||(0,T.bG)(e.houseCallGroupID)){let t={EventType:e.eventType,groupId:e.sGroup,IsRefundOnline:e.isRefundOnline,RefundPolicy:e.refundPolicy,isWorkShop:e.isWorkShop,merchantId:e.businessId,strUserPaymentID:e.userPaymentId??"duqGW~bhDOt26a2V~nJmvg==",strappointmentId:e.appointmentId};es.ShowMultipleAppointmentPopup(t)}else a.setcommonPopupAlert({title:"Alert",primaryButtonText:"Cancel Appointment",secondaryButtonText:"Back",popupBody:()=>"Are you sure you want to cancel this appointment? ",confirm:()=>{es.CancelApp(e.appointmentId,m,1,e.sGroup,e.isRefundOnline,e.isWorkShop,e.businessId)}});else a.setAlertAppointmentPopup({message:"Appointment is already checkedout. You cannot cancel it",title:"Oops!"})},ed=t=>{if(5!==t)if(!0===e.isPaid){let t={EventType:e.eventType,groupId:e.sGroup,IsRefundOnline:e.isRefundOnline,RefundPolicy:e.refundPolicy,isWorkShop:e.isWorkShop,merchantId:e.businessId,strUserPaymentID:e.userPaymentId??"duqGW~bhDOt26a2V~nJmvg==",strappointmentId:e.appointmentId};es.ShowMultipleAppointmentPopup(t)}else a.setcommonPopupAlert({title:"Alert",primaryButtonText:"OK",secondaryButtonText:"Cancel",popupBody:()=>"Are you sure you want to cancel this class? ",confirm:()=>{es.CancelApp(e.appointmentId,m,2,e.sGroup,e.isRefundOnline,e.isWorkShop,e.businessId)}});else a.setAlertAppointmentPopup({message:"Class is already checkedout. You cannot cancel it",title:"Oops!"})},eu={device:m,module:u,version:h,eventType:e.eventType,businessId:e.businessId,appointmentId:e.appointmentId,workShop:e.isWorkShop,paid:e.isPaid,refundOnline:e.isRefundOnline,apiCallCount:1},{mutate:em}=(0,b.n)({mutationFn:e=>g.cancelAppointment(e),meta:{invalidateQueries:[y.lH.appointments.getAppointments]},onSuccess:(e,t)=>{if(void 0!==e&&null!=e){if("-10"==e.undermaintenanceStatus)return void window.location.reload();if("-9"==e.undermaintenanceStatus){a.setAppointmentLoader(!1),a.setAlertAppointmentPopup({message:i,title:"Info"});return}let n=[];null!=e.appointmentStatusChange&&4!=e.operationStatus&&(e.appointmentStatusChange.length>1&&a.invalidateUpcomingAppointments(),$.grep(e.appointmentStatusChange,function(e,t){let a={};return a.AppointmentID=e.strappointmentId,n.push(a),!0})),t.refundOnline||a.setAppointmentLoader(!1),null!=e&&e.length>0&&4==e[0].operationStatus?(es.IsCCChanged=!0,es.ZenSwipeCardDetail
5s={},et={},a.setcommonPopupAlert({title:"Payment Failed",decription:"It looks like a different card on file is needed for this business, please add a new payment method.",size:"medium",primaryButtonVariant:"Red",primaryButtonText:K.current,secondaryButtonText:"Back",popupBody:()=>es.paymentFailedModal(),confirm:()=>{es.validatePaymentFailedCCCapture()},back:()=>{es.ClearCCCaptureCancel()}}),es.LoadBlankCCFrame("dvCustomerPaymentFailedCCDetail")):(a.setAppointmentLoader(!1),es.ClearCCCaptureCancel(),a.invalidateUpcomingAppointments(),f.oR.success("Appointment Cancelled"))}else es.ClearCCCaptureCancel(),a.setAppointmentLoader(!1)},onError:e=>{a.setAppointmentLoader(!1),f.oR.error("Failed to cancel appointment")}}),{mutate:eh}=(0,b.n)({mutationFn:g.checkChangeStatusForWorkshop,onSuccess:t=>{if(a.setAppointmentLoader(!1),1032==t.responseCode)a.setAlertAppointmentPopup({message:i,title:"Info"});else if(1001==t.responseCode)a.setAlertAppointmentPopup({message:"Sorry something went wrong, please try again!",title:"Oops!"});else if(1e3==t.responseCode)if(t&&t.data.length>0&&!1===t.data[0].statusValue)return void a.setAlertAppointmentPopup({title:"Info",message:"This workshop cannot be reschedule because it is already in progress. Workshops are a series of sessions that must be attended from the beginning."});else{let t={EventType:e.eventType,groupId:e.sGroup,IsRefundOnline:e.isRefundOnline,RefundPolicy:e.refundPolicy,isWorkShop:e.isWorkShop,merchantId:e.businessId,strUserPaymentID:e.userPaymentId??"duqGW~bhDOt26a2V~nJmvg==",strappointmentId:e.appointmentId};es.ShowMultipleAppointmentPopup(t);return}},onError:()=>{a.setAppointmentLoader(!1),f.oR.error("Some error occured.Please try again later.")}});return(0,l.useEffect)(()=>{let t;G&&(t=es.getRefundText(e.eventType,e.isWorkShop,e.isRefundOnline,e.refundPolicy,G.length),e.isWorkShop&&(t+="\nIt will cancel all your future workshop sessions by doing this."),R({title:e.isWorkShop?"Cancel Workshop?":2===e.eventType?"Cancel Class?":"Cancel Appointment?",description:t,popupData:G}))},[G]),{cancelAppWithCharge:el,cancelWorkshop:()=>{a.setAppointmentLoader(!0),eh({merchantId:e.businessId,appId:e.appointmentId,operationType:3,isFrom:2,groupId:e.sGroup,device:m,module:u})},validateCancelAppointment:()=>{var t,a;e.allowCustCancelApp?(t=new Date(e.appointmentDate),a=new Date,Math.abs(Math.round((t.getTime()-a.getTime())/1e3/3600))<=e.cancelHours)?P(!0):x(!0):I(!0)},cancelAppointment:()=>{a.setAppointmentLoader(!0),er({appointmentId:e.appointmentId,businessId:e.businessId,eventType:e.eventType,groupId:e.sGroup,device:m,module:u})},cancelAppointmentSave:em,openNoCancelAppointmentAllowedPopup:v,openCancelAppointmentConfirmationPopup:S,openCancelAppointmentValidationFailedPopup:w,openCancellationPolicyPopup:k,cancelMultipleAppoitmentPopup:F,cancelCCCaptureAppoitmentModal:O,setOpenNoCancelAppointmentAllowedPopup:I,setOpenCancelAppointmentConfirmationPopup:x,setOpenCancelAppointmentValidationFailedPopup:P,setOpenCancellationPolicyPopup:D,setCancelMultipleAppoitmentPopup:R,setCancelCCCaptureAppoitmentModal:M,setonlineRefundDetailsForCancelAppt:Y,cancellationPolicyMessage:B,onlineRefundDetailsForCancelAppt:G,cancelAppointmentRequestDeprcted:eu}})(i,0,{businessPackageAlertPopup:el,setBusinessPackageAlertPopup:ec,businessPackageAlertPopupData:ep,setBusinessPackageAlertPopupData:ed,commonPopupAlert:eu,setcommonPopupAlert:em,alertAppointmentPopup:es,setAlertAppointmentPopup:er,invalidateUpcomingAppointments:I,setAppointmentLoader:eC,setRefundPolicyPopup:eg}),eQ=e=>{let{popupData:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{id:"divchkAllInactiveData",className:"customcheck-box-singal small-check selectall vagaro-checkbox",children:!i.isWorkShop&&(0,r.jsx)(p.rM,{CheckBoxId:"",CheckboxLabel:"Select All",CheckboxVariation:"Checkbox-Simple",Name:"",OnChange:()=>{},OnHover:()=>{},PreOnChange:()=>{},SetValue:t.filter(e=>null===e.housecallGroupID||""===e.housecallGroupID).length>0})}),(0,r.jsxs)("div",{children:[t.map(e=>(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"modal-body default-scrollbar",children:(0,r.jsx)("div",{className:"mp-appointment-wrap",id:"tableAppoitments",children:(0,r.jsxs)("div",{className:"mp-appointment-box",children:[(0,r.jsx)(p.rM,{CheckBoxId:"",CheckboxLabel:"",CheckboxVariation:"Checkbox-Simple",Disable:i.isWorkShop,Name:"",OnChange:()=>{},OnHover:()=>{},PreOnChange:()=>{},SetValue:e.housecallGroupID===i.houseCallGroupID}
5),(0,r.jsxs)("div",{className:"appointmnet-title web-builder-font-color",children:["Sevice Name: ",(0,r.jsx)("span",{children:e.serviceName})]}),(0,r.jsxs)("div",{className:"appointmnet-title web-builder-font-color",children:["Service Provider:"," ",(0,r.jsxs)("span",{children:[e.serviceProviderFirstName," ",e.serviceProviderLastName]})]}),(0,r.jsxs)("div",{className:"appointmnet-title web-builder-font-color",children:["Service Time:"," ",(0,r.jsx)("span",{children:e.strAppointmentTime})]}),null!==e.sharedAppUserName&&""!==e.sharedAppUserName&&(0,r.jsx)("div",{className:"ff-appt-cardview",children:(0,r.jsxs)("div",{className:"ffappt-for-card",children:[(0,r.jsx)("div",{className:"ffsub-grey web-builder-font-color",children:"Appointment for:"}),(0,r.jsxs)("div",{className:"div-block-519",children:[(0,r.jsx)("div",{id:"divShareAppUserName",className:"sub-black web-builder-font-color",children:e.sharedAppUserName}),(0,r.jsx)("div",{className:"shared-pkg-chip blue block vagaro-badge-icon",children:(0,r.jsx)("div",{className:"font-awesome-solid iconlineheight vagaro-badge-inner web-builder-font-color",children:""})})]})]})})]})})})})),!i.isRefundOnline&&(0,r.jsx)(p.rM,{CheckBoxId:"",CheckboxLabel:"I acknowledge that by cancelling, I will not receive a refund.",CheckboxVariation:"Checkbox-Simple",Name:"",OnHover:()=>{},PreOnChange:()=>{}})]})]})},eX=(e,t,a,n,i)=>{en({waitlistId:t,waitlistDetailId:e,waitlistRemove:a,waitlistDetailRemove:n,groupId:i,device:w,module:P,version:k}),et(!0)},{mutate:e0}=(0,b.n)({mutationFn:g.removeWaitlist,onSuccess:()=>{y.qQ.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!1}]}),f.oR.success("You have been removed from the waitlist.")},onError:()=>{f.oR.error("Some error occured.Please try again later.")}});function e1(e,t){let a=new Date(e);return 1===t?N()(a).format("ddd, MMM D, YYYY"):N()(a).format("h:mm A")}let{mutate:e2}=(0,b.n)({mutationFn:g.generateWaitlistReturnUrl,onSuccess:e=>{if(1032===e.responseCode)er({message:eT,title:"Info"});else if(1001===e.responseCode)f.oR.error("Sorry something went wrong, please try again!");else if(1e3===e.responseCode){let t=e.data;if("-1"!==t.url){let e=t.url+"&b_themeID="+eA+"&IsFromMultiLocation=true&MultiLocBusinessID="+eI+"&w_type="+eS+"&IsFromWidgetMenu=true&widgetversion="+ex;if(void 0!==ef&&null!=ef&&ef)try{e=1===i.eventType?e+"&tab=1&tabatlaunch="+ew:e+"&tab=6&tabatlaunch="+ew}catch(e){}location.href=e}}},onError:()=>{f.oR.error("Some error occured.Please try again later.")}}),e3=(0,l.useMemo)(()=>(e=>{var t;let a,n,i="",o="",s=[],l="",c=[],p=!1,d=!1,[u,m]=(a=[],n=[],void 0!==h&&h.length>0&&(a=h.filter(t=>(t.waitlistID===e.appointmentId&&!0==t.available&&t.available&&n.push(t),t.waitlistID===e.appointmentId))),[a,n]),C=!1;if(null!=u&&u.length>0){if(null!==m&&m.length>0&&(C=!0,1==u[0].eventType)){let a,n,i,o,s,r,c=(t=e.currentTimeFormat,n="",i=[...m],a=(o=N()(t).hours())<12?2:o>=12&&o<17?3:4,s=Array.from(new Map(i.map(e=>[e.reqStartTime,e])).values()),r=[],i.forEach(e=>{for(let i of s){let o=N()(i.startTimeDate).format("YYYY/MM/DD"),s=N()(t).format("YYYY/MM/DD");if(o>=s){let t=o>s,l=i.availableIntervals.split(","),c=[],p=l.includes("2"),d=l.includes("3"),u=l.includes("4");if(2===a||t?(p&&c.push(Q),d&&c.push(X),u&&c.push(ee)):3===a?(d&&c.push(X),u&&c.push(ee)):4===a&&u&&c.push(ee),c.length>0){let t=3===c.length?K:c.join(", ").trim();e.isSelectedAvailable=!0,e.IntervalsName=t,r.push(e),n=i.appointmentDate+" at "+t}}}}),{AvailableData:r,appTime:n}),p=c.AvailableData??[];l=c.appTime??"",null!==p&&p.length>0?u=p:C=!1}1!==u[0].eventType&&(C=u[0].available);let a=u[0].reqStartTime,n=$.grep(u,function(e){return e.reqStartTime===a});if(1===n.length){if(i="with "+u[0].serviceProviderName,o=u[0].serviceTitle,void 0!=u[0].addonNames&&null!=u[0].addonNames&&""!=u[0].addonNames.trim()){let e=u[0].addonNames.split("|~|");for(let t=0;t<e.length;t++)s.push(e[t])}}else i=n.map(e=>`${e.serviceTitle} with ${e.serviceProviderName} `).join("<br/>"),o=null!==e.businessPackageId?e.serviceTitle:"Multiple Services";if(!0==C)1!=u[0].eventType&&(l=u.map(e=>`${e1(e.startTimeDate,1)} ${e1(e.startTimeDate,2)} `).join("<br/>")),p=!1,d=!0;else if(p=!0===u[0].isWaitlistAvailable,d=!1,1===u[0].eventType){let e=Array.from(new Map(u.map(e=>[e.reqStartTime,e])).values());
5e.forEach(e=>{e.timeSlots="",e.reqIntervals.includes(1)?e.timeSlots=K:e.reqIntervals.split(",").forEach(t=>{2==t?e.timeSlots+=""==e.timeSlots?Q:`, ${Q} `:3==t?e.timeSlots+=""==e.timeSlots?X:`, ${X} `:4==t&&(e.timeSlots+=""==e.timeSlots?ee:`, ${ee} `)})}),c=e}else l=Array.from(new Map(u.map(e=>[e.reqStartTime,e])).values()).map(e=>`${e1(e.startTimeDate,1)} ${e1(e.startTimeDate,2)} `).join("<br/>"),p=!1}return{ServiceProviderName:i&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:i}}),ServiceTitle:o&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:o}}),AddonServiceHTML:s,AppTime:l&&(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:l}}),TimeSlotHtml:c,EditWaitlistButton:p,BookWaitlistButton:d,objWaitlistDetail:u}})(i),[i,h]),{mutate:e6,isPending:e5}=(0,b.n)({mutationFn:e=>g.iWillShowUp(e),onSuccess:e=>{f.oR.success("Appointment confirmed successfully"),y.qQ.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!1}]})},onError:e=>{f.oR.error("Failed to confirm appointment")}}),{mutate:e8}=(0,b.n)({mutationFn:e=>g.AddToCalendar(e),onSuccess:(e,t)=>{e&&(0,T.iX)(0,0,"","","0",'11|~|{"appointmentid":"'+e.ap+'", "businessId":"'+e.bs+'", "sGroup":"'+t.groupId+'", "eventType":"'+t.eventType+'"}')},onError:e=>{}}),{mutate:e9}=(0,b.n)({mutationFn:g.getBusinessDetail,meta:{},onSuccess:e=>{if(e.responseCode==T.SR.Success){let t=e.data;null!=t&&null!==t&&(0,T.iX)(0,0,"","","0",'23|~|{"businessLatitude":"'+t.latitude+'", "businessLongitude":"'+t.longitude+'", "businessStreetNo":"'+t.streetNo+'", "businessStreet":"'+t.street+'"}')}},onError:()=>{}}),e4=i.addonNames.split("|~|"),{mutate:e7}=(0,b.n)({mutationFn:g.changeAppointmentStatusCheckin,onSuccess:(e,t)=>{(eC(!1),e&&1===e.operationStatus)?(tt(),I()):er({message:(1===t.eventType?"Appointment":"Class")+" status not updated successfully.",title:"Oops!"})},onError:()=>{eC(!1),er({message:"Something went wrong, please try again!",title:"Oops!"})}}),{mutate:te}=(0,b.n)({mutationFn:g.getAppointmentStatus,onSuccess:e=>{if(eC(!1),1032===e.responseCode)er({message:eT,title:"Info"});else if(1e3==e.responseCode){let s=e.data;if(void 0!==s&&null!=s&&s.appointmentId)if(6===s.attendeeStatus||8===s.attendeeStatus||5===s.attendeeStatus||12===s.attendeeStatus||7===s.attendeeStatus)er({message:((e,t)=>{let a="";switch(+e){case 8:a="denied";break;case 12:a="deleted";break;case 6:a="cancelled";break;case 5:a="checkout";break;case 7:a="under need acceptance";break;default:a="Something went wrong, please try again!"}return(2==t?"class":"Appointment")+" is already "+a+". You cannot check-in it. Please contact business."})(s.attendeeStatus,s.appType),title:"Oops!"});else{var t,a,n,o;let e;if(void 0!==s.covidCustomMessage&&null!==s.covidCustomMessage&&""!==s.covidCustomMessage.toString().trim()){let e=s.covidCustomMessage.split("|~|");null!=e&&e.length>1&&e[1]}t=i.appointmentId,a=i.eventType,n=i.sGroup,o=i.isWorkShop,e={eventType:a,businessId:i.businessId,appointmentId:t,userPaymentId:i.userPaymentId??"duqGW~bhDOt26a2V~nJmvg==",workShop:o,startDepositNoShow:i.isStartDepositNoshow,businessPackageId:i.businessPackageId,cancelledByCustomer:!0,action:19,fromMyAccount:!0,chargeAppointmentIds:t,denyComments:"",groupId:n,sentCheckInMail:!0,device:w,module:P,version:k},eC(!0),e7(e)}}},onError:()=>{eC(!1),f.oR.error("Sorry something went wrong, please try again!")}}),tt=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1==e){let e="You're Checked in!";Z().fire({title:"",html:(0,T.bG)(i.covidCustomMessage)?`<p>${e}</p><p>${i.covidCustomMessage}</p>`:`<p>${e}</p>`,icon:"success",showCancelButton:!1,confirmButtonText:"Close",cancelButtonText:"Back",showCloseButton:!1,customClass:{}}).then(e=>{})}else Z().fire({title:"",html:"<p>You are already checked in.</p>",icon:"success",showCancelButton:!1,confirmButtonText:"Close",cancelButtonText:"Back",showCloseButton:!1,customClass:{}}).then(e=>{})},ta=e=>({shopName:e.businessName||"",businessCDNUrl:e.cdnUrl,businessImage:e.businessImage,businessId:e.businessId,serviceProviderName:`${e.serviceProviderFirstName} ${e.serviceProviderLastName}`,venueRank:e.venueRank??0,averageRank:e.averageRank??0,punctualityRank:e.punctualityRank??0,valueRank:e.valueRank??0,serviceProviderRank:e.serviceProviderRank??0,venueReview:e.venueReview??"",serviceProviderReview:e.serviceProviderReview??"",serviceProviderId:e?.serviceProviderId??"",reviewImages:e?.reviewImages||"",reviewId:e?.reviewId??"",reviewPoint:e?.reviewPoint??0,appointmentId:e.appointmentId,appointmentDate:e.appointmentDate,appointmentDateFormat:e.appointmentDateFormat,appointmentTimeText:e.appointmentDateFormat,sGroup:e.sGroup,vagaroURL:e.vagaroURL,eventType:e.eventType,sharedAppUserName:e.sharedAppUserName,appUserId:e.appUserId}),tn=function(e,t,a){arguments.length>3&&void 0!==arguments[3]&&arguments[3],a()},ti=(a=i.status,o?7===a?{class:"var(--text_neutral_secondary)",variation:"defaults"}:8===a?{class:"var(--text_green_default)",variation:"alert"}
5:6===a||8===a||13===a||6===a?{class:"var(--text_alert_default)",variation:"alert"}:2===a?{class:"var(--text_green_default)",variation:"alert"}:(1==a||7==a||11==a||10==a)&&(1==a||11==a||10==a)?{class:"var(--text_green_default)",variation:"positive"}:{class:"var(--text_green_default)",variation:"alert"}:7==a?{class:"var(--text_neutral_secondary)",variation:"defaults"}:6===a||8===a?{class:"var(--text_alert_default)",variation:"alert"}:(1==a||11==a||10==a,{class:"var(--text_green_default)",variation:"positive"})),to=10===i.status,ts=i?.showVagaroConnectMessagingInfo??!1,tr=i?.isZoomIntegrated??!1,tl=(0,G.op)(),tc=(i.isAllowtoBookApp&&(1===i.status||7===i.status||11===i.status||10===i.status)&&0===e3.objWaitlistDetail.length)??!1,tp=6!==i.status&&8!==i.status&&5!==i.status,td=o&&i.isShowCheckInButton&&i.isActive&&tp&&!i.isZoomIntegrated,tu=[{label:"Get Directions",id:"get_directions",show:!tr},{label:"Order Uber",id:"order_uber",show:(()=>{if((0,G.op)()&&i.appointmentDate&&i.appointmentTime){let e=(Math.floor(new Date(i.appointmentDate+" "+i.appointmentTime).getTime()/1e3)-Math.floor(new Date().getTime()/1e3))/3600;if(e>0&&e<=1)return!0}return!1})()},{label:"Add to Calendar",id:"add_to_calendar",show:tl},{label:"View Business",id:"view_business",show:!0},{label:"Message Business",id:"message_business",show:ts},{label:"I Will Show Up",id:"i_will_show_up",show:to},{label:"Cancel Appointment",id:"cancel_appointment",show:tc}];return(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(r.Fragment,{}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.A,{isLoading:eh||e5}),(0,r.jsxs)("div",{className:(0,B.A)(d.A.card,{stenciled:C}),children:[(0,r.jsxs)("div",{className:d.A.contentContainer,children:[(0,r.jsx)("div",{className:d.A.imageContainer,onClick:(0,G.gK)()||void 0!==ef&&null!=ef&&ef?void 0:()=>{tn("Waitlist"==i.appStatusTitle?i.waitlistSpList:i.serviceProviderId,i.businessId,()=>{"Builder"==eb||(window.location.href=`${T._z.SiteName}${i.vagaroURL}`)},"Waitlist"==i.appStatusTitle?2:1)},children:C?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{style:{height:"148px",minWidth:"220px"},className:"stencil-item"})}):(0,r.jsx)(m.A,{businessName:i.businessName,businessImage:i.businessImage})}),(0,r.jsxs)("div",{className:d.A.textContainer,children:[(0,r.jsx)("div",{style:C?{marginBottom:"var(--spacing_4)"}:{},className:"vg-display-small web-display-small web-builder-font-color",children:(0,r.jsx)("span",{className:(0,B.A)({"stencil-item":C}),children:i.businessName})}),(0,r.jsxs)("div",{className:"stencil-container",children:[(0,r.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:e3.ServiceTitle||i.serviceTitle}),o&&i.isZoomIntegrated&&(0,r.jsxs)("span",{children:[(0,r.jsx)("i",{className:"fa-solid fa-video"})," Live Stream"]}),""!==i.addonNames&&e4.length>0&&e4.map((e,t)=>(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:[(0,r.jsx)(p.qy,{name:"plus_circle",width:12,height:12})," ",e]},`${e}-${t}`)),e3.AddonServiceHTML&&e3.AddonServiceHTML.length>0&&e3.AddonServiceHTML.map((e,t)=>(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:[(0,r.jsx)(p.qy,{name:"plus_circle",width:12,height:12})," ",e]},`${e}-${t}`)),!1===i.isAutoAssignEmployee&&(0,r.jsx)("div",{className:"vg-body-font web-builder-font-color",children:e3.ServiceProviderName||`with ${i.serviceProviderFirstName} ${i.serviceProviderLastName}`}),e3.objWaitlistDetail.length>0?(0,r.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:e3.AppTime||""}):(e=>{if(2!==e.eventType&&1!==e.eventType||!e.isZoomIntegrated)return e.appointmentDateFormatTime;{let t=e.customerStartTimeDateFormatTime,a="";return null!==e.customerTimeZoneName&&"undefined"!==e.customerTimeZoneName&&""!==e.customerTimeZoneName&&(a="("+e.customerTimeZoneName.replace("(","").replace(")","").replace(" ","")+")"),t+" "+a}})(i),e3.TimeSlotHtml&&e3.TimeSlotHtml.length>0&&e3.TimeSlotHtml.reduce((e,t)=>(e.some(e=>e.displayDate===t.displayDate)||e.push(t),e),[]).sort((e,t)=>{let a=new Date(e.reqStartTime||""),n=new Date(t.reqStartTime||"");return a.getTime()-n.getTime()}).map((e,t)=>(0,r.jsxs)("a",{className:d.A.vagaroDismissTag,children:[(0,r.jsxs)("div",{className:"tag-text vagaro-dismiss-inner-txt",role:"contentinfo",children:[(0,r.jsxs)("span",{className:"month-date vagaro-dismiss-inner-txt","aria-hidden":"true",children:[e.displayDate,":"," "]}),(0,r.jsx)("span",{className:"schedule-time vagaro-dismiss-inner-txt","aria-hidden":"true",children:e.timeSlots})]}),(0,r.jsx)("span",{className:d.A.vagaroDismissImg,role:"link","aria-label":"Do You Want to Remove this Waitlist Time Slot?",onClick:()=>eX(e.waitlistDetailID,e.waitlistID,!1,!0,e.groupId),children:(0,r.jsx)("img",{src:"https://1a96a36bae7c8550901a-274b8a70320bb26e7a1e0ea7836ee429.ssl.cf2.rackcdn.com/PublicImages/Images/vagaro-tag-close-2.svg",className:"inner
5-bubble-x",title:"",alt:"",width:"10",height:"10"})})]},t))]})]}),(0,r.jsxs)("div",{className:(0,B.A)(d.A.statusAndPriceContainer,{"stencil-hide":C}),children:[(0,r.jsxs)("div",{children:[!!(t=i.businessPackageId)&&""!==t&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("i",{className:`fa-light fa-box-open ${d.A.bundlePackageIcon}`})}),(e=>{if(2==e.eventType||3==e.eventType){if(e?.isPaid&&(2==e.paidType||5==e.paidType))return(0,r.jsx)("div",{className:`vagaro - icons - deposit ${d.A.depositeIcon} `,children:""});else if(!0===e.isPaid&&(7==e.paidType||8==e.paidType)){if(7==e.paidType)return(0,r.jsx)("div",{className:` ${d.A.membershipPackageIcon} `,title:"Paid By Package",children:"P"});else if(8==e.paidType)return(0,r.jsx)("div",{className:` ${d.A.membershipPackageIcon} `,title:"Paid By Membership",children:"M"})}}else if(1==e.eventType&&!0===e.isPaid){if(1==e.paidType||3==e.paidType)return(0,r.jsx)("div",{className:d.A.dollarIcon,children:(0,r.jsx)("i",{className:"fa-solid fa-circle-dollar"})});else if(2==e.paidType)return(0,r.jsx)("div",{className:`vagaro-icons-deposit ${d.A.depositeIcon}`,children:""});else if(7==e.paidType)return(0,r.jsx)("div",{className:` ${d.A.membershipPackageIcon} `,title:"Paid By Package",children:"P"});else if(8==e.paidType)return(0,r.jsx)("div",{className:` ${d.A.membershipPackageIcon} `,title:"Paid By Membership",children:"M"})}return""})(i)]}),i.isShowPriceOnline&&(0,r.jsxs)("div",{className:(0,B.A)(d.A.amountContainerText,"vg-body-font web-body-font web-builder-font-color"),children:[5!==i.status&&i.isShowPriceAsStartingPoint?"Starting at ":"",(0,r.jsxs)("span",{className:(0,B.A)(d.A.amountContainer,"vg-display-small web-display-small "+("var(--text_neutral_secondary)"===ti.class?"web-builder-font-color":"var(--text_green_default)"===ti.class?"web-display-small-green":"var(--text_alert_default)"===ti.class?"web-display-small-alert":void 0)),style:{color:ti.class},children:[(0,T.Qn)(i.countryId),(o?(n=0!==i.finalAddOnPrice?(Math.round((i?.finalPrice+i?.finalAddOnPrice)*100)/100).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):(Math.round(i?.finalPrice*100)/100).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),i?.packageRedeemAmount!==0&&(n=i?.packageRedeemAmount)):n=(i?.finalPrice+i?.finalAddOnPrice)?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),n)]})]}),(0,r.jsx)("div",{className:(0,B.A)(d.A.statusContainer,"stencil-wrapper stencil-item"),children:(0,r.jsx)(p.jh,{BadgeSize:"inline",BadgeText:i.appStatusTitle,BadgeVariation:ti.variation})})]})]}),i.sharedAppUserName&&(0,r.jsx)("div",{className:d.A.appointmentForWrapper,children:(0,r.jsxs)("div",{className:d.A.appointmentForContainer,children:[(0,r.jsx)("div",{className:"vg-caption-text web-caption-text web-builder-font-color",children:"Appointment for:"}),(0,r.jsxs)("div",{className:d.A.appointmentForNameContainer,children:[(0,r.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:i.sharedAppUserName||""}),(0,r.jsx)("div",{className:u.A.vgBadgeIcon,children:(0,r.jsx)("div",{className:u.A.vgBadgeIconWrapper,children:(0,r.jsx)(p.qy,{name:"users"})})})]})]})}),(0,r.jsxs)("div",{className:(0,B.A)(d.A.buttonsContainer,{"stencil-wrapper":C}),children:[o&&6!==i.status&&8!==i.status&&i.isZoomIntegrated&&(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsxs)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{if((0,G.op)()){let e="38";(0,G.IN)()&&(e="39"),0>i.zoomURL.indexOf("?")&&(i.zoomURL=i.zoomURL+"?1=2"),(0,T.iX)(0,0,"","","0",e+"|~|"+i.zoomURL)}else window.open(i.zoomURL,"_blank")},IconPlacement:"prefix",children:[i.isZoomMeetingStarted?(0,r.jsx)("i",{className:"fa-solid fa-video"}):(0,r.jsx)("i",{className:"fa-regular fa-video"})," ","  Join Live Stream"]})}),i.isAllowtoBookApp&&13===i.status&&e3.objWaitlistDetail.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>eX("duqGW~bhDOt26a2V~nJmvg==",i.appointmentId,!0,!1,i.sGroup),children:"Remove from Waitlist"})}),e3.EditWaitlistButton&&(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{e3&&void 0!==e3.objWaitlistDetail&&0!==e3.objWaitlistDetail.length?eo(!0):f.oR.error("No waitlist detail found")},children:"Edit"})}),e3.BookWaitlistButton&&(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{e2({waitlistType:i.eventType,vagaroUrl:i.vagaroURL,isWidget:!!ef,isFacebook:!1,tabsIncluded:eP,waitlistIdText:i.appointmentId,groupId:i.sGroup,merchantId:i.businessId})},children:"Book"})})]}),td&&(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)(p.YU,{ButtonVariant:"link",IconPlacement:"prefix",ButtononClick:()=>{i.isCustomerCheckin?tt(!0):(eC(!0),te({appointmentUniqueId:i.appConfirmUniqueID,groupId:i.sGroup,eventType:i.eventType,merchantId:i.businessId,covidCheck:!0}))}
5,children:2!=i.status&&30!=i.status&&!1===i.isCustomerCheckin?"Check In":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("i",{className:"fa-regular fa-circle-check"}),"   Checked In"]})})}),i.isAllowtoBookApp&&0===e3.objWaitlistDetail.length&&(0,r.jsx)(l.Fragment,{children:o&&(1===i.status||7===i.status||11===i.status||13===i.status||10===i.status)?(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)("div",{className:"solaButtonParent",children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:eB,children:"Reschedule"})})}):(0,r.jsx)(l.Fragment,{children:6==i.status||8==i.status||3==i.status?(0,r.jsxs)(l.Fragment,{children:[(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)("div",{className:"solaButtonParent",children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{eF()},children:"Reschedule"})})}),(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)("div",{className:"solaButtonParent",children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{eF()},children:"Rebook"})})})]}):(0,r.jsx)("div",{className:d.A.buttonsRightSpace,children:(0,r.jsx)("div",{className:"solaButtonParent",children:(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{eF()},children:"Rebook"})})})})}),o?(0,r.jsx)("div",{className:"fullWidthMore",children:(0,r.jsx)(p.IG,{Items:tu.filter(e=>!!e?.show),MenuButtonPosition:"horizontal",ThreeDotMenuOpenPosition:"Right",MenuOpen:!0,TextValue:"More",MenuOptions:"CustomMenu",CustomMenuRender:(0,r.jsx)("div",{className:(0,B.A)({"stencil-wrapper":C}),children:(0,r.jsxs)(p.YU,{ButtonVariant:"secondary",children:["More   ",(0,r.jsx)("i",{className:"fa-solid fa-angle-down "})]})}),OnClick:e=>{let{id:t}=e;if("cancel_appointment"===t)i.isWorkShop?eO():eM();else if("get_directions"===t)i.latitude&&i.longitude&&(tl?(0,T.iX)(0,0,"","","0",'8|~|{"latitude": "'+i.latitude+'", "longitude": "'+i.longitude+'"}'):window.open(`https://maps.google.com/maps?key=${D}&saddr=${F}&daddr=${i.latitude},${i.longitude}&hl=en`,"_blank"));else if("order_uber"===t)e9({businessId:i.businessId,groupId:i.sGroup,device:w,module:P});else if("add_to_calendar"===t)e8({sap:i.appointmentId,sbs:i.businessId,eventType:i.eventType,groupId:i.sGroup,device:w,module:P});else if("view_business"===t){let e=(0,Y.Ri)("vg_biz_url").trim()||localStorage.getItem("VgBUrl");(0,G.gK)()?(0,H.K)(`${window.location.origin}/${e}`):window.location.href=`${T._z.SiteName}${i.vagaroURL}`}else if("message_business"===t){let e=(0,J.Wh)(),t=(0,z.A3)(),a=e??{businessId:i.businessId,encryptMID:i.businessId,staticencbid:i.businessId,accessToken:"",userId:0,encUserId:t,encryptUID:t,pages:[],imageMapping:[],cdnURL:i.cdnUrl||"",userType:0,isMysite:(0,G.gK)(),bidHash:i.businessId,vgurl:i.vagaroURL,MultilocationData:[{encBIDHash:i.businessId,businessID:i.businessId,encBID:i.businessId,businessName:i.businessName,businessImage:i.businessImage,cdnUrl:i.cdnUrl,staticEncBID:i.businessId,showVagaroConnectMessagingInfo:+!!i.showVagaroConnectMessagingInfo,vagaroConnectBeta:!0}]};window.SendMessage(!1,a,void 0),ey.current=!0}else"i_will_show_up"===t&&to&&e6({businessId:i.businessId,appointmentId:i.appointmentId,userPaymentId:i.userPaymentId,workShop:i.isWorkShop,startDepositNoShow:i.isPaid,businessPackageId:i.businessPackageId,paid:i.isPaid,refundOnline:i.isRefundOnline,eventType:i.eventType,apiCallCount:1,groupId:i.sGroup,module:P,device:w})}})}):i.reviewId?(0,r.jsxs)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{s(ta(i))},children:[(0,r.jsx)("span",{style:{marginRight:"var(--spacing_10)"},children:"Your Review"}),(0,r.jsx)(p.Bb,{SetRating:i.averageRank,RatingSize:"Small",ReadOnly:!0,OnClick:()=>{}})]}):(0,r.jsx)(p.YU,{ButtonVariant:"secondary",ButtononClick:()=>{s(ta(i))},children:"Write a Review"}),ek&&(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"Ok",ButtonSecondary:"Cancel",CloseBackTitle:"From Control",CloseButton:!0,Footer:1,FooterButton:"both",OnClickPrimary:()=>{eD(!1)},OnClickSecondary:()=>{eD(!1)},PopupId:"PopupId",PopupTitle:"Oops!",Popupopen:!0,Size:"small",EnableBody:!0,PopupBody:()=>(0,r.jsx)("div",{children:(0,r.jsxs)("p",{children:["The business that you have made this appointment with does not allow you to reschedule the appointment online with 1 hour of the scheduled time. Please call on ",(0,r.jsx)("strong",{children:i.telephone})," to reschedule your appointment."]})}),TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eD(!1)},BodyClass:"vg-popup-open"})}),eL&&(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"Cancel Appointment",ButtonSecondary:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:1,FooterButton:"both",OnClickPrimary:()=>{eU(eK),eY(!1)},OnClickSecondary:()=>{eY(!1)},PopupId:"cancel-appointment-popup",PopupTitle:"Alert",Popupopen:!0,Size:"small",EnableBody:!0,PopupBody:()=>(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Are you sure you want to cancel this appointment?"})}),TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eY(!1)},BodyClass:"vg-popup-open"})}),e_&&(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"Ok",ButtonSecondary:"Cancel",CloseBackTitle:"From Control",CloseButton:!0,Footer:1,FooterButton:"both",OnClickPrimary:()=>{eH(!1)},OnClickSecondary:()=>{eH(!1)},PopupId:"validation-failed-popup",PopupTitle:"Oops!",Popupopen:!0,Size:"small",EnableBody:!0,PopupBody:()=>(0,r.jsx)("div",{children:(0,r.jsxs)("p",{children:["The business that you have made this appointment with does not allow you to cancel the appointment online within ",i.cancelHours," hours of the scheduled time. Please call ",i.telephone," to cancel you appointment"]})}),TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eH(!1)},BodyClass:"vg-popup-open"})}),eW&&(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"Ok",ButtonSecondary:"Cancel",CloseBackTitle:"From Control",CloseButton:!0,Footer:1,FooterButton:"both",OnClickPrimary:()=>{e$(!1)},OnClickSecondary:()=>{e$(!1)},PopupId:"validation-failed-popup",PopupTitle:"Oops!",Popupopen:!0,Size:"small",EnableBody:!0,PopupBody:()=>(0,r.jsx)("div",{children:(0,r.jsxs)("p",{children:["The business does not allow you to cancel the appointment online. Please call ",i.telephone," to cancel you appointment."]})}),TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eH(!1)},BodyClass:"vg-popup-open"})}),eE&&(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(p.W_,{ButtonPrimary:"OK",CloseBackTitle:"From Control",CloseButton:!0,Footer:1,FooterButton:"primaryButton",OnClickPrimary:()=>{eq(!1)},PopupId:"cancellation-policy-popup",PopupTitle:"Oops!",Popupopen:!0,Size:"small",EnableBody:!0,PopupBody:()=>(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:eJ})}),TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>
5{eq(!1)},BodyClass:"vg-popup-open"})})]})]}),""!==R&&(0,r.jsx)(p.IH,{CancelText:"Close",ConfirmText:"Got it",Title:R,Icon:"success",OnCancel:()=>{O("")},OnClose:()=>{O("")},OnConfirm:()=>{O("")}}),q&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:"Remove",ButtonSecondary:"Cancel",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{ea&&(e0({waitlistId:ea.waitlistId,waitlistDetailId:ea?.waitlistDetailId,waitlistRemove:ea.waitlistRemove,waitlistDetailRemove:ea.waitlistDetailRemove,device:ea?.device,module:ea?.module,version:ea?.version,businessId:i.businessId,groupId:i.sGroup}),et(!1))},OnClickSecondary:()=>{et(!1)},PopupId:"PopupId",PopupSubTitle:"",PopupTitle:"Remove from Waitlist",Popupopen:!0,PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",Size:"small",TextDescription:"Are you sure you want to be removed from the waitlist? This action cannot be undone.",ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{et(!1)},BodyClass:"vg-popup-open"})}),es&&""!==es.message&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:"OK",ButtonSecondary:"Secondary",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:2,FooterButton:"primaryButton",OnClickPrimary:()=>{er({message:"",title:""})},PopupId:"PopupId",PopupSubTitle:"",PopupTitle:es.title,Popupopen:!0,PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",Size:"small",TextDescription:es.message,ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{er({message:"",title:""})},BodyClass:"vg-popup-open"})}),""!==el&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:"OK",ButtonSecondary:"Cancel",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{"rescheduling"===el?eN():eR(ep)},OnClickSecondary:()=>{ec("")},PopupId:"PopupId",PopupSubTitle:"",PopupTitle:`The appointment that you are ${el} has been attached with a service bundle. Changing the service will violate the service bundle and it won't be the part of service bundle anymore. Are you sure you want to continue?`,Popupopen:!0,PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",Size:"small",TextDescription:"",ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{ec("")},BodyClass:"vg-popup-open"})}),ei&&e3?.objWaitlistDetail?.length>0&&(0,r.jsx)(M,{businessId:i.businessId,sGroup:i.sGroup,onClose:()=>{eo(!1)},userWaitlistDetails:e3.objWaitlistDetail}),eV&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:"Cancel Appointment",ButtonSecondary:"Back",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,EnableBody:!0,Footer:2,FooterButton:"both",FooterLeftBody:()=>{},OnClickPrimary:()=>{},OnClickSecondary:()=>{eZ(null),ez(null)},PopupBody:()=>(0,r.jsx)(eQ,{popupData:eV.popupData}),PopupId:"PopupId",PopupSubTitle:eV.description,PopupTitle:eV.title,PopupType:"default",Popupopen:!0,PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",Size:"medium",ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eZ(null),ez(null)},BodyClass:"vg-popup-open"})}),eG&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:eG.buttonText,ButtonSecondary:"Back",ButtonThird:"Back",CloseBackTitle:"From Control",CloseButton:!0,EnableBody:!0,Footer:2,FooterButton:"both",FooterLeftBody:()=>{},OnClickPrimary:()=>{},OnClickSecondary:()=>{eZ(null),ez(null)},PopupBody:()=>eG.cancelCCCaptureAppoitmentModalBody(),PopupId:"PopupId",PopupSubTitle:eG.cancellationPolicy,PopupTitle:eG.title,PopupType:"default",Popupopen:!0,PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",Size:"medium",ThirdButtonVariant:"primary",TimerCount:0,VagaroToolkit:1,customClassName:"customPosition",onClose:()=>{eZ(null),ez(null)},BodyClass:"vg-popup-open"})}),eu&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:eu.primaryButtonText??"",ButtonSecondary:eu.secondaryButtonText??"",CloseBackTitle:"From Control",CloseButton:!0,DoNotSetTitle:!0,EnableBody:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>eu.confirm(),OnClickSecondary:()=>{eu.back&&eu.back(),em(null)},PopupBody:()=>eu.popupBody(),PopupTitle:eu.title??"",PopupSubTitle:eu.decription??"",PopupId:"PopupId1",PopupType:"default",Popupopen:!0,PrimaryButtonVariant:eu?.primaryButtonVariant?"Red":"primary",SecondaryButtonVariant:"secondary",Size:eu.size??"small",TimerCount:0,VagaroToolkit:1,onClose:()=>{em(null)},BodyClass:"vg-popup-open",customClassName:"customPosition"})}),ev&&(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(p.W_,{ButtonPrimary:"OK",CloseBackTitle:"From Control",CloseButton:!0,DoNotSetTitle:!0,Footer:2,FooterButton:"primaryButton",OnClickPrimary:()=>{eg("")},PopupId:"PopupId2",PopupTitle:"Terms and Conditions For Refund",PopupType:"default",Popupopen:!0,PrimaryButtonVariant:"primary",Size:"medium",TextDescription:ev,TimerCount:0,VagaroToolkit:1,onClose:()=>{eg("")},customClassName:"customPosition"})})]})})},ea={pageTitle:"pageTitle-ILMBfa",emptystate:"emptystate-a29LIM","vg-tk-btn":"vg-tk-btn-U5m6d8",vgTkBtn:"vg-tk-btn-U5m6d8","vg-btn-leave":"vg-btn-leave-exehBc",vgBtnLeave:"vg-btn-leave-exehBc",headingtext:"headingtext-xpgF66",subheadingtext:"subheadingtext-YjfYAg",emptystateFlex:"emptystateFlex-WYq0T6",iconSize:"iconSize-_fyAMo",filterContainerDorpdown:"filterContainerDorpdown-YW8FnC"};var en=a(75644),ei=a(55541),eo=a(51850);let es={appointmentId:"",startTime:"",status:0,businessPackageId:"",serviceId:"",serviceProviderId:"",businessId:"",businessName:"",vagaroURL:"",cancelHours:0,cdnUrl:"",allowCustCancelApp:!1,hoursDiff:0,allowCustRecurrenceApp:!1,recurrenceHours:0,telephone:"",businessImage:"",serviceTitle:"",serviceProviderFirstName:"",serviceProviderLastName:"",appStatusTitle:"",isActive:!1,eventType:0,originalPrice
5:0,countryId:0,reviewPoint:0,isOnlineService:!1,resourceName:"",isPaid:!1,isRefundOnline:!1,refundPolicy:"",latitude:0,longitude:0,isWorkShop:!1,isShowPriceOnline:!1,currentTime:"",totalPage:0,reviewId:"",paidType:0,isZoomIntegrated:!1,zoomURL:"",isZoomMeetingStarted:!1,startTimeUTC:"",customerStartTime:"",customerTimeZoneName:"",isDayLightSaving:!1,businessTimeZone:0,isShowCheckInButton:!1,covidCustomMessage:"",userPaymentId:"",isCustomerCheckin:!1,appConfirmUniqueID:"",isAllowtoBookApp:!1,isCharge:!1,chargeFee:0,isAmountType:!1,limitAmount:0,currencySymbol:"",cutOffHours:0,appointmentDate:"",appointmentDateFormat:"",appointmentDateFormatTime:"",appointmentTime:"",venueRank:null,punctualityRank:null,valueRank:null,serviceProviderRank:null,venueReview:null,serviceProviderReview:null,reviewImages:null,staticGID:null,merchantTokenID:null,houseCallGroupID:null,relationship:null,isShowPriceAsStartingPoint:null,customerStartTimeDateFormatTime:null,myAccountWaitlistDetail:null,lstCCDetails:null,appointmentCancellationPolicy:"",classCancellationPolicy:null,strAddonServicIds:[],strAddonAppointmentIds:[],addonNames:"",serviceOriginalPrice:0,finalPrice:0,finalAddOnPrice:0,sharedAppUserName:"",appUserId:"",appUserCellNo:"",appUserEmailId:"",averageRank:0,waitlistSpList:"",showVagaroConnectMessagingInfo:!1,isAutoAssignEmployee:!1,serviceIdText:"",serviceProviderIdText:"",appointmentIdText:"",sGroup:""};function er(){return(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(r.Fragment,{}),children:(0,r.jsxs)("div",{className:(0,B.A)(d.A.card,"stenciled"),children:[(0,r.jsxs)("div",{className:d.A.contentContainer,children:[(0,r.jsx)("div",{style:{height:200},className:d.A.imageContainer,children:(0,r.jsx)("div",{style:{height:"148px",minWidth:"220px"},className:"stencil-item"})}),(0,r.jsxs)("div",{className:d.A.textContainer,children:[(0,r.jsx)("div",{style:{marginBottom:"var(--spacing_4)"},className:"vg-display-small web-display-small web-builder-font-color",children:(0,r.jsx)("span",{className:"stencil-item",children:"Fake Training"})}),(0,r.jsx)("div",{className:"stencil-container",children:(0,r.jsx)("div",{className:"stencil-item vg-body-font web-body-font web-builder-font-color"})})]}),(0,r.jsx)("div",{className:(0,B.A)(d.A.statusAndPriceContainer,"stencil-hide"),children:(0,r.jsx)("div",{className:(0,B.A)(d.A.statusContainer,"stencil-wrapper stencil-item"),children:(0,r.jsx)(p.jh,{BadgeSize:"inline",BadgeText:"Badge Text Placeholder",BadgeVariation:"positive"})})})]}),(0,r.jsx)("div",{className:(0,B.A)(d.A.buttonsContainer,"stencil-wrapper"),children:(0,r.jsx)("div",{className:"stencil-wrapper stencil-item",children:(0,r.jsxs)(p.YU,{ButtonVariant:"secondary",children:["More   ",(0,r.jsx)("i",{className:"fa-solid fa-angle-down"})]})})})]})})}var el=a(99060),ec=a(90976),ep=a(75551),ed=a(28534);let eu=e=>{let{appointment:t,mode:a="reschedule"}=e,n=2===t.eventType||3===t.eventType,{setBookingCartOpen:i}=(0,el.KC)(),o=(0,l.useCallback)(e=>i(!e),[i]);(0,l.useEffect)(()=>()=>i(!1),[i]);let s=(0,l.useMemo)(()=>(0,z.A3)(),[]);(0,h.qJ)();let c=(0,l.useMemo)(()=>({businessId:t.businessId,encryptMID:t.businessId,staticencbid:t.businessId,accessToken:window.s_utkn,userId:0,encUserId:s,encryptUID:s,pages:[],imageMapping:[],MultilocationData:[],cdnURL:t.cdnUrl||"",userType:0,isMysite:(0,G.gK)(),bidHash:"",vgurl:t.vagaroURL,allowMultiLoc:!1,telephone:t.telephone,countryCode:t.countryId}),[t,s]),p=(0,l.useMemo)(()=>{let e=new URLSearchParams;return"reschedule"===a?(e.set("reschedule","true"),e.set("EventType",String(t.eventType)),e.set("V3ServiceId",t.serviceId??""),e.set("V3ServiceProviderId",t.serviceProviderId??""),e.set("V3AppointmentId",t.appointmentId??""),t.originalPrice&&e.set("OriginalPrice",String(t.originalPrice)),t.serviceOriginalPrice&&e.set("ServiceOriginalPrice",String(t.serviceOriginalPrice)),t.appUserId&&e.set("AppointmentUserID",t.appUserId),t.strAddonServicIds?.length&&e.set("strAddonServicIds",t.strAddonServicIds.join(",")),e.set("IsPaid",String(t.isPaid??!1)),e.set("PaidType",String(t.paidType??0)),e.set("IsZoomIntegrated",String(t.isZoomIntegrated??!1)),e):"rebook"===a?(e.set("rebook","true"),e.set("V3ServiceId",t.serviceId??""),e.set("V3ServiceProviderId",t.serviceProviderId??""),e):void 0},[t,a]),d=(0,l.useMemo)(()=>({appointmentId:t.appointmentId,appointmentDate:t.appointmentDate,originalPrice
5:t.originalPrice,serviceOriginalPrice:t.serviceOriginalPrice,isPaid:t.isPaid,paidType:t.paidType,businessPackageId:t.businessPackageId,strAddonServicIds:t.strAddonServicIds,strAddonAppointmentIds:t.strAddonAppointmentIds,appUserId:t.appUserId,sharedAppUserName:t.sharedAppUserName,houseCallGroupID:t.houseCallGroupID,businessName:t.businessName,telephone:t.telephone}),[t]);return(0,r.jsx)("div",{children:n?(0,r.jsx)("div",{style:{maxWidth:"1000px",margin:"0 auto",width:"100%"},children:(0,r.jsx)(ep.A,{data:{vagaroURL:t.vagaroURL,isShowClassTab:!0},layout:"1",root:"rebook"===a?"myaccount-rebook":"myaccount-reschedule",allowMultiLoc:!1,userContext:c,VgUrl:t.vagaroURL,rescheduleParams:p})}):(0,r.jsx)(ed.i,{children:(0,r.jsx)(ec.A,{userContext:c,businessData:{isShowServiceTab:!0},allowMultiLoc:!1,vagaroURL:t.vagaroURL,preSelectedServiceId:t.serviceId,preSelectedProviderId:t.serviceProviderId,preSelectedServiceName:t.serviceTitle,preSelectedProviderName:`${t.serviceProviderFirstName} ${t.serviceProviderLastName}`.trim(),isReschedule:"reschedule"===a,appointment:d,onBookingVisibleChange:o})})})};var em=a(90589),eh=a(29943);let eC=()=>{let e,t=(0,el.zy)(),a=(0,el.Zp)(),{device:n,module:i,version:o}=(0,A.J)();(0,eo.A)({onReset:()=>{u({isShowReviewPage:!1,partialReview:null})}});let s=[{value:1,label:"All Appointments"},{value:0,label:"My Appointments"},{value:2,label:"Family & Friend Appointment"}],[d,u]=(0,l.useState)({isShowReviewPage:!1,partialReview:null}),[m,h]=(0,l.useState)(null),[C,v]=(0,l.useState)(null),[g,b]=(0,l.useState)(null),{setFullScreenBooking:f}=(0,el.KC)();(0,l.useEffect)(()=>(f(!!m||!!C||!!g),()=>f(!1)),[m,C,g,f]);let[I,S]=(0,l.useState)(1),[x,w]=(0,l.useState)(s[0]),{items:P,canLoadMore:D,loadMore:N,isLoading:B,isRefetching:j,isError:F}=k({pageSize:12,pageNumber:1,pastAppointment:2===I,myOrSharedAppointments:x.value,device:n,module:i,version:o,brandedApp:(0,G.IN)()??!1,merchantId:(0,G.IN)()?"QX9p3jq6~mMP6js9ReeSqw==":(0,T.db)(),multiLocation:!!(0,G.gK)(),appNo:(0,G.IN)()?window.BrandedAppBID:null},{resetOnUnmount:!0,initialVisiblePages:1}),R=(0,l.useMemo)(()=>{let e=P.filter(e=>Array.isArray(e.myAccountWaitlistDetail)&&e.myAccountWaitlistDetail.length>0);return e.length>0?e.flatMap(e=>e.myAccountWaitlistDetail):[]},[P]),O=!B&&!j,M=()=>{y.qQ.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!1}]})},U=()=>{y.qQ.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!1}]}),window.scrollTo(0,0)},W=()=>{if(a("/myaccount/appointments"+(0,T.X_)()),u({isShowReviewPage:!1,partialReview:null}),!(0,T.fQ)("532","432")){let e=document.getElementById("mobileBack");e&&(e.style.display="none")}window.handleOperation="",window.scrollTo(0,0)};window.handleEventBack=W,(0,l.useEffect)(()=>{t.pathname.endsWith("/appointments")?S(1):t.pathname.endsWith("/appointments/past")?(S(2),u({isShowReviewPage:!1,partialReview:null})):t.pathname.endsWith("/appointments/reviews")&&u(t.state)},[t]),(0,l.useEffect)(()=>{if(!(0,T.fQ)("532","432")){let e=document.getElementById("mobileBack");e&&(e.style.display="none")}},[]),(0,l.useEffect)(()=>{window.scrollTo(0,0)},[x,I]);let L=0===P.length&&!D,_=new URLSearchParams(window.location.search).get("IsBusinessWidgetPage")||!1,E=L?(0,r.jsx)("div",{className:`EmptyStateContainer ${ea.emptystateFlex}`,children:(0,r.jsxs)("div",{className:`EmptyStateContainer ${ea.emptystate}`,children:[(0,r.jsx)("i",{className:`fa-light fa-calendar web-builder-font-color ${ea.iconSize}`}),1===I?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:ea.headingtext,children:"Your Schedule is Open"}),(0,r.jsx)("div",{className:ea.subheadingtext,children:"You don't have any upcoming appointments."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:ea.headingtext,children:"No Past Appointments"}),(0,r.jsx)("div",{className:ea.subheadingtext,children:"You don't have any past appointments. Let's get you started by booking an appointment nearby."})]}),(0,r.jsx)("div",{children:2===I&&_?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(p.YU,{ButtonVariant:"Red",ButtononClick:()=>{1===I?S(2):(()=>
5{if((0,G.op)())(0,T.iX)(0,0,"","",0,"26");else if((0,G.gK)()){let e=window.MysiteBusinessId??"",t=window.location.pathname,a=(0,eh.x7)(t);if(e&&(a>0||0===a&&!(0,eh.oP)()))return b({merchantId:e,vagaroURL:a>0?t.substring(1,a):""});let n=T._z.SiteName+"listings";return T.dM._postMessage('{"eventType": "openpagenewtab","newtaburl":"'+n+'"}')}else window.location.href=T._z.SiteName+"listings"})()},children:1===I?"View Past Appointments":"Start Booking now"})})]})}):(0,r.jsx)("p",{style:{textAlign:"center"},children:(0,r.jsx)(ei.A,{})});if(m)return(0,r.jsx)(eu,{appointment:m,mode:"reschedule"});if(C)return(0,r.jsx)(eu,{appointment:C,mode:"rebook"});if(g)return(0,r.jsx)(em.A,{bookmark:g});if(d.isShowReviewPage)return(0,r.jsx)(en.A,{review:d.partialReview,onClose:e=>{W(),e&&y.qQ.invalidateQueries({queryKey:[y.lH.appointments.getAppointments,{pastAppointment:!0}]})}});let V=e=>{},Y=O?P:Array(12).fill({...es});return window.scrollEventBack=function(e){!B&&D&&N()},(0,r.jsxs)("div",{className:`vg-body-font web-body-font web-builder-font-color MyaccountWrapper ${ea.appointmentsPage}`,children:[(0,r.jsx)("div",{className:`${ea.pageTitle} vg-display-large web-display-large web-builder-font-color`,children:"Appointments"}),(0,r.jsx)("div",{className:ea.filterContainerDorpdown,children:(0,r.jsx)(p.nM,{Placeholder:"Select Filter",VirtualDropdownHeight:300,CloseMenuOnSelect:!0,DropdownData:s,onChange:e=>{w(e.selectedOptions[0])},SetDefault:!0,DefaultValue:[x],SetBottomSheetDropdown:!0})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.hg,{ActiveTab:I,BottomBorder:!0,Name:[{id:1,name:"Upcoming"},{id:2,name:"Past"}],NoOfTab:"2",TabPosition:"center",TabSize:"large",TabVariant:"horizontal",onClick:e=>{a(1===e?"/myaccount/appointments"+(0,T.X_)():"/myaccount/appointments/past"+(0,T.X_)()),S(e)},FullWidth:!0}),(e=[...Y].sort((e,t)=>{let a=new Date(e.startTime||"").getTime(),n=new Date(t.startTime||"").getTime();return 1===I?a-n:n-a}),(0,r.jsx)(c.A,{dataLength:Y.length,next:()=>{N()},scrollableTarget:"html",hasMore:D,loader:!F&&(0,r.jsx)(er,{}),endMessage:E,children:(0,r.jsx)("ul",{children:e.map((e,t)=>(0,r.jsx)("li",{children:(0,r.jsx)(et,{isStencil:!O,onReviewClick:e=>{if((0,T.fQ)("532","432")){let e=document.getElementById("mobileBack");e&&(e.style.display="block")}u({isShowReviewPage:!0,partialReview:e}),a("/myaccount/appointments/reviews"+(0,T.X_)(),{state:{isShowReviewPage:!0,partialReview:e}})},appointment:e,isUpcoming:1===I,deleteItemInList:M,lstMyAccountWaitlistDetail:R,removeOneTimeSlot:V,invalidateUpcomingAppointments:U,onRescheduleReady:h,onRebookReady:v})},`${I}-${e.appointmentId}-${t}`))})}))]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.