1"use strict";(self.webpackChunklanding_page=self.webpackChunklanding_page||[]).push([[4521],{1987:()=>{},2404:()=>{},2895:(e,o,n)=>{n.r(o),n.d(o,{default:()=>I});var l=n(5043),i=n(8601),t=n(8241),a=n(8984),d=n(7478),r=n(5346),s=n(7368),c=n(7950),u=n(7669),v=n(4117);const m="HotelAddonDetailsModal_overlay__Wg9uv",p="HotelAddonDetailsModal_modal_container__8vHaw",h="HotelAddonDetailsModal_closeButton__vdVwb",g="HotelAddonDetailsModal_image_container__+2o1N",_="HotelAddonDetailsModal_image__-9V4r",x="HotelAddonDetailsModal_modal_body__Yt8hs",f="HotelAddonDetailsModal_modal_header__3U3Ar",y="HotelAddonDetailsModal_description__5UE+m",b="HotelAddonDetailsModal_priceBox__Igf51",j="HotelAddonDetailsModal_price_wrapper__mx9O5",k="HotelAddonDetailsModal_addButton__8vLWH",C="HotelAddonDetailsModal_addonActionBtn__ECSRs",A="HotelAddonDetailsModal_addonIcon__oHWET";var N=n(579);const P=e=>{var o,n,i,t;let{addon:a,selected:r,count:s,selectAddon:P,deSelectAddon:I,closeModal:S}=e;const w=(0,l.useRef)(null),{t:D}=(0,v.Bd)(),M=null===(o=(null===a||void 0===a?void 0:a.HotelAddonImages)||(null===a||void 0===a||null===(i=a.Addon)||void 0===i?void 0:i.url))||void 0===o||null===(n=o[0])||void 0===n?void 0:n.cdnImageUrl,R=(0,l.useCallback)(()=>{S()},[S]);(0,l.useEffect)(()=>{const e=e=>{"Escape"===e.key&&R()};document.addEventListener("keydown",e);const o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=o}},[R]);return c.createPortal((0,N.jsx)("div",{className:m,ref:w,onClick:e=>{e.target===w.current&&R()},children:(0,N.jsxs)("div",{className:p,role:"dialog","aria-modal":"true","aria-label":null===a||void 0===a?void 0:a.name,children:[(0,N.jsx)("button",{type:"button",className:h,onClick:R,"aria-label":"Close",children:(0,N.jsx)(u.A,{size:20,"aria-hidden":"true"})}),M&&(0,N.jsx)("div",{className:g,children:(0,N.jsx)("img",{src:M,alt:null===a||void 0===a?void 0:a.name,className:_})}),(0,N.jsxs)("div",{className:x,children:[(0,N.jsx)("h3",{className:f,children:null===a||void 0===a?void 0:a.name}),(0,N.jsx)("div",{className:y,dangerouslySetInnerHTML:{__html:null===a||void 0===a?void 0:a.description}}),(0,N.jsxs)("div",{className:b,children:[(0,N.jsxs)("div",{className:j,children:[(0,N.jsxs)("p",{children:[(0,N.jsx)(d.A,{amount:null===a||void 0===a?void 0:a.price})," ","per_day"===(null===a||void 0===a||null===(t=a.Addon)||void 0===t?void 0:t.multiplier)?"/ day":""]}),(0,N.jsx)("span",{children:D("incl_of_taxes")})]}),r?(0,N.jsxs)("div",{className:C,role:"group","aria-label":"Quantity controls for ".concat(null===a||void 0===a?void 0:a.name),children:[(0,N.jsx)("span",{className:A,onClick:I,"aria-label":"Decrease ".concat(null===a||void 0===a?void 0:a.name," quantity"),children:"-"}),(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",children:s}),(0,N.jsx)("span",{className:A,onClick:P,"aria-label":"Increase ".concat(null===a||void 0===a?void 0:a.name," quantity"),children:"+"})]}):(0,N.jsx)("button",{type:"button",className:k,onClick:P,"aria-label":"Add ".concat(null===a||void 0===a?void 0:a.name),children:D("add")})]})]})]})}),document.getElementById("root"))};n(2404);const I=e=>{var o;let{addon:n,isCheckout:c=!1}=e;const[u,m]=(0,l.useState)(!1),[p,h]=(0,l.useState)(0),[g,_]=(0,l.useState)(!1),[x,f]=(0,l.useState)(!1),y=(0,l.useRef)(null),{hotelData:b,selectedHotelAddons:j,dateCount:k}=(0,i.d4)(e=>e.hotelInfo),{width:C}=(0,s.A)(),A=!c;(0,l.useEffect)(()=>{var e;h(null===j||void 0===j?void 0:j.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===n||void 0===n?void 0:n.id)).length),(null===j||void 0===j||null===(e=j.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===n||void 0===n?void 0:n.id))[0])||void 0===e?void 0:e.id)===(null===n||void 0===n?void 0:n.id)?m(!0):m(!1)},[j]),(0,l.useLayoutEffect)(()=>{if(!A)return;const e=y.current;e&&_(e.scrollHeight>e.clientHeight+1)},[null===n||void 0===n?void 0:n.description,A]);const I=(0,i.wA)(),S=()=>{var e,o,l;p<10&&(I((0,a.qO)(n)),(0,r.fireGtmEvent)("hotel_addon_selected",{addon_id:null===n||void 0===n?void 0:n.addonId,addon_name:null===n||void 0===n||null===(e=n.Addon)||void 0===e?void 0:e.name,is_hotel_addon_images:(null===n||void 0===n||null===(o=n.HotelAddonImages)||void 0===o?void 0:o.length)>0,hotel_addon_images_count:null===n||void 0===n||null===(l=n.HotelAddonImages)||void 0===l?void 0:l.length,value:null===n||void 0===n?void 0:n.price}))},w=()=>{var e,o,l;p>0&&(I((0,a.xy)(n)),(0,r.fireGtmEvent)("hotel_addon_removed",{addon_id:null===n||void 0===n?void 0:n.addonId,addon_name:null===n||void 0===n||null===(e=n.Addon)||void 0===e?void 0:e.name,is_hotel_addon_images:(null===n||void 0===n||null===(o=n.HotelAddonImages)||void 0===o?void 0:o.length)>0,hotel_addon_images_count:null===n||void 0===n||null===(l=n.HotelAddonImages)||void 0===l?void 0:l.length,value:null===n||void 0===n?void 0:n.price}))},{t:D}=(0,v.Bd)();return(0,N.jsxs)("div",{className:c&&C>900?"checkoutAddon":A?"hotelAddonCard":"hAddon",id:"hAddon",children:[(0,N.jsx)("div",{className:"hAddonImage",children:(0,N.jsx)(t.A,{name:n.Addon.name,hotelImages:(null===n||void 0===n?void 0:n.HotelAddonImages)||(null===n||void 0===n||null===(o=n.Addon)||void 0===o?void 0:o.url),isAddon:!0})}),(0,N.jsxs)("div",{className:c&&C>900?"newCheckoutAdon":A?"hotelAddonCardBody":"",children:[(0,N.jsx)("h3",{className:"hAddonName",children:null===n||void 0===n?void 0:n.name}),(0,N.jsx)("div",{className:"hAddonDescription",ref:y,style:{border:c&&C>900&&"none"},dangerouslySetInnerHTML:{__html:n.description}}),A&&g&&(0,N.jsx)("span",{className:"hAddonViewMore",onClick:()=>f(!0),children:D("view_more")}),(0,N.jsxs)("div",{className:"hAddonPrice",children:[(0,N.jsxs)("div",{className:A?"hAddonPriceBox":"",children:[(0,N.jsxs)("p",{children:[(0,N.jsx)(d.A,{amount:null===n||void 0===n?void 0:n.price})," ","per_day"===n.Addon.multiplier?"/ day":"",!A&&(0,N.jsxs)("span",{style:{fontWeight:"400",fontSize:"0.7rem"},children:[" ","(",D("incl_of_taxes"),")"]})]}),A&&(0,N.jsx)("span",{className:"hAddonUnit",children:D("incl_of_taxes")})]}),u?(0,N.jsxs)("div",{className:A?"hotelAddonAddedBtn":"hAddonAdded",children:[(0,N.jsx)("span",{className:A?"hotelAddonQtyIcon":"hAddonIcon",onClick:w,children:"-"}),p,(0,N.jsx)("span",{className:A?"hotelAddonQtyIcon":"hAddonIcon",onClick:S,children:"+"})]}):(0,N.jsx)("div",{className:A?"hotelAddonAddBtn":"hAddonAdd hAddonAddHotel",onClick:()=>S(),children:D("add")})]}),p>0&&"per_day"===n.Addon.multiplier&&!c&&(0,N.jsxs)("div",{className:"hAddonNote",children:[p," ",null===n||void 0===n?void 0:n.name," ",D("is_selected_for")," ",(0,N.jsxs)("b",{children:[k," ",D("days")]})]})]}),A&&x&&(0,N.jsx)(P,{addon:n,selected:u,count:p,selectAddon:S,deSelectAddon:w,closeModal:()=>f(!1)})]})}},4392:(e,o,n)=>{n.d(o,{A:()=>l});const l={checkoutPage:"CheckoutPage_checkoutPage__-O5PY",boxContainer:"CheckoutPage_boxContainer__TIkOP",leftBoxContainer:"CheckoutPage_leftBoxContainer__dd8n1",rightBoxContainer:"CheckoutPage_rightBoxContainer__Z0XqB",roomPreviewCard:"CheckoutPage_roomPreviewCard__gA3uY",roomPreviewImage:"CheckoutPage_roomPreviewImage__yl2uo",roomPreviewInfo:"CheckoutPage_roomPreviewInfo__Ehw8P",roomPreviewHotelName:"CheckoutPage_roomPreviewHotelName__Xvygi",roomPreviewAddress:"CheckoutPage_roomPreviewAddress__SVRec",roomPreviewRooms:"CheckoutPage_roomPreviewRooms__V7KgJ",roomPreviewChip:"CheckoutPage_roomPreviewChip__R99of",roomPreviewChipImage:"CheckoutPage_roomPreviewChipImage__2eS9W",roomPreviewChipText:"CheckoutPage_roomPreviewChipText__AGNlJ",leftTopBox:"CheckoutPage_leftTopBox__cxIwJ",timeContainer:"CheckoutPage_timeContainer__xRKPi",time:"CheckoutPage_time__2UL3S",dateCount:"CheckoutPage_dateCount__95UVP",previewRoomContainer:"CheckoutPage_previewRoomContainer__GuD6e",previewRoom:"CheckoutPage_previewRoom__4iI0C",previewRoomName:"CheckoutPage_previewRoomName__7PfC4",previewRoomimage:"CheckoutPage_previewRoomimage__9BZIf",previewRoomInfo:"CheckoutPage_previewRoomInfo__tWSNt",leftBottomBox:"CheckoutPage_leftBottomBox__uCt2n",guestFormBox:"CheckoutPage_guestFormBox__lZFQ8",cancellationPolicyBox:"CheckoutPage_c
1ancellationPolicyBox__UuYPh",paymentsMethodBox:"CheckoutPage_paymentsMethodBox__xHXM5",guestInfoContainer:"CheckoutPage_guestInfoContainer__fqsCK",customerInput:"CheckoutPage_customerInput__lT2eO",rightBottomContainer:"CheckoutPage_rightBottomContainer__dsRX6",checkoutPage__selectedRoomsHeading:"CheckoutPage_checkoutPage__selectedRoomsHeading__jGrXK",checkoutPage__bill:"CheckoutPage_checkoutPage__bill__6VWjq",finalBill:"CheckoutPage_finalBill__9+aUX",checkoutPage__warningContainer:"CheckoutPage_checkoutPage__warningContainer__wDYIJ",paymentMethods:"CheckoutPage_paymentMethods__-QWHn",paymentTitle:"CheckoutPage_paymentTitle__OEjsW",paymentOptions:"CheckoutPage_paymentOptions__jVxfG",bnplMessageContainer:"CheckoutPage_bnplMessageContainer__0ukfI","blur-in":"CheckoutPage_blur-in__MNdWM",paymentOption:"CheckoutPage_paymentOption__YpvBa",selectedPaymentOption:"CheckoutPage_selectedPaymentOption__npqLc",selectedPay:"CheckoutPage_selectedPay__r7hDv",paymentContainer:"CheckoutPage_paymentContainer__E6ld7",paymentBtn:"CheckoutPage_paymentBtn__5nul9",displayPromo:"CheckoutPage_displayPromo__Blu6K",bnplMessage:"CheckoutPage_bnplMessage__VzfLj",summaryHeadingContainer:"CheckoutPage_summaryHeadingContainer__pxEVI",summaryWrapper:"CheckoutPage_summaryWrapper__3uHga",summaryHeading:"CheckoutPage_summaryHeading__6XXrH",formInputContainer:"CheckoutPage_formInputContainer__aAvud",formRowBox:"CheckoutPage_formRowBox__0et4A",formFieldCol:"CheckoutPage_formFieldCol__Tvcph",guestPhoneInput:"CheckoutPage_guestPhoneInput__PUKw9",guestRequestBox:"CheckoutPage_guestRequestBox__j63kw",guestEmailInput:"CheckoutPage_guestEmailInput__d1UWR",emailChipsContainer:"CheckoutPage_emailChipsContainer__Z4Ffu",emailChips:"CheckoutPage_emailChips__Yu3EY",emailChip:"CheckoutPage_emailChip__Gw1PZ",chipFadeIn:"CheckoutPage_chipFadeIn__BPCep",chipRemove:"CheckoutPage_chipRemove__jGgrj",emailChipInput:"CheckoutPage_emailChipInput__2GqDs",paymentHeaderBox:"CheckoutPage_paymentHeaderBox__yzwWA",securePaymentBox:"CheckoutPage_securePaymentBox__opIT2",totalSummaryBox:"CheckoutPage_totalSummaryBox__w8IAm",rowContainer:"CheckoutPage_rowContainer__sD1jK",flash_sale:"CheckoutPage_flash_sale__9VoVi",addons_section:"CheckoutPage_addons_section__gSYgZ",paymentSummary_section:"CheckoutPage_paymentSummary_section__9aTWb",AddonSection:"CheckoutPage_AddonSection__CpQXs",customerRow:"CheckoutPage_customerRow__7E4en",bnplSuccessIcon:"CheckoutPage_bnplSuccessIcon__uqExN",b
1nplLineBreak:"CheckoutPage_bnplLineBreak__Mnl5d",checkoutProgress:"CheckoutPage_checkoutProgress__Ukp7D",progressStep:"CheckoutPage_progressStep__KmN8q",progressStep__circle:"CheckoutPage_progressStep__circle__gekrp",progressStep__label:"CheckoutPage_progressStep__label__32vnn",progressStep__done:"CheckoutPage_progressStep__done__Kks+j",progressStep__active:"CheckoutPage_progressStep__active__JIQKr",progressConnector:"CheckoutPage_progressConnector__Jxc1r",progressConnector__filled:"CheckoutPage_progressConnector__filled__N8PjE",verticalProgress:"CheckoutPage_verticalProgress__40i9b",vProgressStep:"CheckoutPage_vProgressStep__YhgFG",vProgressStep__circle:"CheckoutPage_vProgressStep__circle__JX1G1",vProgressStep__label:"CheckoutPage_vProgressStep__label__Cyl5w",vProgressStep__done:"CheckoutPage_vProgressStep__done__P5fnk",vProgressStep__active:"CheckoutPage_vProgressStep__active__Hur7h",vProgressConnector:"CheckoutPage_vProgressConnector__Vjgvc",vProgressConnector__filled:"CheckoutPage_vProgressConnector__filled__BIX9t",petTnc:"CheckoutPage_petTnc__+WoJ7",petTncTitle:"CheckoutPage_petTncTitle__p+95X",petTncText:"CheckoutPage_petTncText__-JB2M"}},8198:(e,o,n)=>{n.r(o),n.d(o,{default:()=>Dn});var l=n(9379),i=n(446),t=n.n(i),a=n(5043);const d=[{min:"minAdultCount",max:"maxAdultCount",label:"adult",plural:"adults"},{min:"minChildCount",max:"maxChildCount",label:"child",plural:"children"},{min:"minGuestCount",max:"maxGuestCount",label:"guest",plural:"guests"}],r=(e,o)=>{const n=null===e||void 0===e?void 0:e[o];if(null===n||void 0===n||""===n)return null;const l=Number(n);return Number.isFinite(l)?l:null},s=(e,o,n)=>{if(!(e=>d.some(o=>null!==r(e,o.min)||null!==r(e,o.max)))(e))return null;const l=Number(o);if(!Number.isFinite(l))return null;const i=Number.isFinite(Number(n))?Number(n):0,t={minAdultCount:l,maxAdultCount:l,minChildCount:i,maxChildCount:i,minGuestCount:l+i,maxGuestCount:l+i};for(const a of d){const o=r(e,a.min);if(null!==o&&t[a.min]<o)return"This coupon requires at least ".concat(o," ").concat(1===o?a.label:a.plural);const n=r(e,a.max);if(null!==n&&t[a.max]>n)return"This coupon allows at most ".concat(n," ").concat(1===n?a.label:a.plural)}return null},c=e=>{let{selectedRooms:o,selectedRatePlans:n,totalAdult:l,totalChild:i}=e;const t=null!==n&&void 0!==n&&n.length?n:null!==o&&void 0!==o&&o.length?o:null;if(!t)return{adultCount:l,childrenCount:i};let a=0,d=0;return t.forEach(e=>{a+=(null===e||void 0===e?void 0:e.sAdult)||0,d+=(null===e||void 0===e?void 0:e.sChild)||0}),{adultCount:a,childrenCount:d}};var u=n(1591),v=n(7100),m=n(270),p=(n(4927),n(8601)),h=n(3751),g=n(3716),_=n.n(g),x=(n(1029),n(2895),n(1987),n(6713),n(5658),n(4117));const f="RetargetingPopup_overlay__1wqbV",y="RetargetingPopup_card__d8lMq",b="RetargetingPopup_magstripe__9BBzn",j="RetargetingPopup_closeButton__B-QD2",k="RetargetingPopup_body__3dhf4",C="RetargetingPopup_chipRow__5mW8A",A="RetargetingPopup_chip__OXsSl",N="RetargetingPopup_keyMeta__8Witm",P="RetargetingPopup_eyebrow__n440q",I="RetargetingPopup_headline__pPV1M",S="RetargetingPopup_message__FAaZj",w="RetargetingPopup_ctaButton__WwpdX",D="RetargetingPopup_ctaArrow__BfEtR",M="RetargetingPopup_feedbackPanel__Dkm7E",R="RetargetingPopup_textarea__YY9G0",B="RetargetingPopup_submitButton__GDm6c";var E=n(579);const T=e=>{var o,n;let{show:l,onClose:i,retargetingPopupConfig:t,feedbackText:a,onFeedbackTextChange:d,onFeedbackSubmit:r}=e;const{t:s}=(0,x.Bd)();if(!l)return null;const c=null===t||void 0===t||null===(o=t.header)||void 0===o?void 0:o.trim(),u=null===t||void 0===t||null===(n=t.content)||void 0===n?void 0:n.trim();return Boolean(c&&u)?(0,E.jsx)("div",{className:f,onClick:i,children:(0,E.jsxs)("div",{className:y,onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":c,children:[(0,E.jsx)("div",{className:b}),(0,E.jsx)("button",{type:"button",className:j,onClick:i,"aria-label":"Close and return to checkout",children:(0,E.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:(0,E.jsx)("path",{d:"M1 1L12 12M12 1L1 12",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}),(0,E.jsxs)("div",{className:k,children:[(0,E.jsxs)("div",{className:C,children:[(0,E.jsx)("div",{className:A}),(0,E.jsx)("div",{className:N,children:(0,E.jsx)("span",{className:P,children:"Your key \xb7 still active"})})]}),(0,E.jsx)("h2",{className:I,children:c}),(0,E.jsx)("p",{className:S,children:u}),(0,E.jsxs)("button",{type:"button",className:w,onClick:i,children:["Continue booking",(0,E.jsx)("svg",{className:D,width:"15",height:"11",viewBox:"0 0 15 11",fill:"none",children:(0,E.jsx)("path",{d:"M1 5.5H14M14 5.5L9.5 1M14 5.5L9.5 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,E.jsxs)("div",{className:M,children:[(0,E.jsx)("textarea",{className:R,value:a,onChange:e=>d(e.target.value),name:"requests",placeholder:s("improvement_feedback")}),(0,E.jsx)("button",{type:"button",className:B,onClick:r,children:s("submit")})]})]})]})}):(0,E.jsx)("div",{className:"checkoutPageModal",children:(0,E.jsxs)("div",{className:"checkoutPageContainer",children:[(0,E.jsx)("div",{className:"checkoutPageClose",onClick:i,children:"X"}),(0,E.jsxs)("div",{className:"checkoutPageContainerHeader",children:[(0,E.jsx)("p",{style:{fontSize:"1.2rem"},children:s("what_went_wrong")}),(0,E.jsx)("img",{src:"https://hotelzify-dev-images-bucket.s3.ap-south-1.amazonaws.com/61165f76-efc4-4fbf-8aa6-9b34d7848a4b.gif",alt:"can we ask why?"}),(0,E.jsxs)("p",{children:[s("share_feedback")," "]}),(0,E.jsxs)("p",{style:{color:"#1A7971"},children:[s("win_voucher")," \ud83c\udf89"]})]}),(0,E.jsxs)("div",{className:"checkoutPageContainerBody",children:[(0,E.jsx)("textarea",{value:a,onChange:e=>d(e.target.value),name:"requests",placeholder:s("improvement_feedback"),cols:"20",rows:"5"}),(0,E.jsx)("div",{className:"checkoutPageContainerFooter",children:(0,E.jsx)("button",{onClick:r,children:s("submit")})})]})]})})};var O=n(8984),Y=n(4849),F=n(3976),z=n(5989);function G(e,o){const n=null!=(null===o||void 0===o?void 0:o.id)&&String(o.id)===String(e)?o.publicId:null;return"/bookings/confirmation/".concat(n||e)}var H=n(6471),L=n(475),W=n(7478),V=(n(9368),n(5346)),q=n(6491),U=n(1469),J=n(7368),K=n(7343);n(9280),n(5493);var X=n(2064);n(2015);n(8978);var Q=n(8780),Z=n(6099),$=n(6851),ee=n(1683),oe=n(8838);const ne=e=>{let{coupon:o,onComplete:n,isRetargeting:l}=e;const i=1e3,t=(0,a.useRef)(null);(0,a.useEffect)(()=>
1{(0,V.fireGtmEvent)("coupon_animation_shown",{coupon_code:(null===o||void 0===o?void 0:o.name)||(null===o||void 0===o?void 0:o.code),coupon_discount:null===o||void 0===o?void 0:o.discount,coupon_discount_type:null===o||void 0===o?void 0:o.discountType,is_retargeting:l,event_category:"Coupon",event_label:l?"Retargeting Coupon Animation":"Coupon Applied Animation"});const e=Date.now()+i,a=document.createElement("canvas");a.className="confetti-canvas",document.body.appendChild(a);const d=oe.A.create(a,{resize:!0,useWorker:!0}),r=()=>{const o=Date.now(),t=Math.max(0,e-o),s=t/i*10;d({particleCount:Math.ceil(s/2),spread:200,origin:{y:.5},disableForReducedMotion:!0,colors:l?["#ffa726","#ff9800","#ff6f00"]:["#065af3","#0078d4"]}),t>0?requestAnimationFrame(r):(document.body.contains(a)&&document.body.removeChild(a),setTimeout(()=>{n&&!l&&n()},500))};r();const s=e=>{t.current&&!t.current.contains(e.target)&&n&&n()};return document.addEventListener("mousedown",s),()=>{document.body.contains(a)&&document.body.removeChild(a),document.removeEventListener("mousedown",s)}},[n,l,i]),console.log("Coupon Applied Animation",o);return(0,E.jsx)("div",{className:"coupon-applied-animation ".concat(l?"retargeting":""),children:(0,E.jsxs)("div",{className:"coupon-success-container",ref:t,children:[(0,E.jsx)("button",{className:"close-animation-btn",onClick:()=>{(0,V.fireGtmEvent)("coupon_animation_closed",{coupon_code:(null===o||void 0===o?void 0:o.name)||(null===o||void 0===o?void 0:o.code),coupon_discount:null===o||void 0===o?void 0:o.discount,coupon_discount_type:null===o||void 0===o?void 0:o.discountType,is_retargeting:l,event_category:"Coupon",event_label:"Close Button Clicked"}),n&&n()},"aria-label":"Close",children:"\xd7"}),(0,E.jsx)("div",{className:"coupon-success-icon",children:l?"\ud83c\udf81":"\u2713"}),(0,E.jsxs)("div",{className:"coupon-success-message",children:[(0,E.jsx)("h2",{children:l?"Special Offer!":"Congratulations!"}),(0,E.jsx)("h3",{children:l?"We've applied a special discount for you!":"".concat(null===o||void 0===o?void 0:o.name," applied successfully")}),(0,E.jsx)("div",{className:"discount-badge ".concat(l?"retargeting-badge":""),children:"percentage"===o.discountType?"".concat(o.discount,"% OFF"):"fixed_amount"===o.discountType?"\u20b9".concat(o.discount," OFF"):"nights"===o.discountType?"".concat(o.discount," ").concat(1===o.discount?"NIGHT":"NIGHTS"," FREE"):"".concat(o.discount,"% OFF")}),l&&(0,E.jsx)("p",{className:"retargeting-note",children:"This exclusive offer has been automatically applied to your booking."})]})]})})},le=e=>{var o,n,l,i;let{coupon:d,onApply:r,isApplying:s,ineligibleReason:c}=e;const{t:u}=(0,x.Bd)(),[v,m]=(0,a.useState)(!1);return console.log("CouponCard",d),(0,E.jsxs)("div",{className:"coupon-card".concat(c?" coupon-card-ineligible":""),children:[(0,E.jsxs)("div",{className:"coupon-main",children:[(0,E.jsxs)("div",{className:"coupon-left",children:[(0,E.jsx)("div",{className:"coupon-discount",children:"percentage"===d.discountType?"".concat(d.discount,"% OFF"):"fixed_amount"===d.discountType?"\u20b9".concat(d.discount," OFF"):"nights"===d.discountType?"".concat(d.discount," ").concat(1===d.discount?"NIGHT":"NIGHTS"," FREE"):"".concat(d.discount,"% OFF")}),(0,E.jsx)("div",{className:"coupon-code",children:null!==(o=null===d||void 0===d||null===(n=d.PromotionsExtraConfigs)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.value)||void 0===i?void 0:i[0])&&void 0!==o?o:d.name})]}),(0,E.jsx)("div",{className:"coupon-right",children:s===d.id?(0,E.jsx)("div",{className:"coupon-applying",children:(0,E.jsx)($.A,{})}):c?(0,E.jsx)("button",{className:"coupon-apply-btn",disabled:!0,children:u("APPLY")}):(0,E.jsx)("button",{className:"coupon-apply-btn",onClick:()=>r(d),children:u("APPLY")})})]}),c&&(0,E.jsx)("div",{className:"coupon-ineligible-reason",children:c}),(0,E.jsxs)("div",{className:"coupon-details",children:[(0,E.jsx)("div",{className:"coupon-terms-toggle",onClick:()=>m(!v),children:u(v?"Hide Details":"View Details")}),v&&(0,E.jsxs)("div",{className:"coupon-terms",children:[(0,E.jsx)("div",{className:"coupon-description",children:d.name}),d.validUntil&&(0,E.jsxs)("div",{className:"coupon-validity",children:[u("Valid till"),":"," ",t()(d.validUntil).format("DD MMM YYYY")]}),d.termsAndConditions&&(0,E.jsxs)("div",{className:"coupon-tnc",children:[(0,E.jsxs)("div",{className:"coupon-tnc-title",children:[u("Terms & Conditions"),":"]}),(0,E.jsx)("ul",{children:d.termsAndConditions.split("\n").map((e,o)=>(0,E.jsx)("li",{children:e},o))})]})]})]})]})},ie=e=>
1{let{totalPrice:o,bookingAmountBeforeCoupon:n=0}=e;const i=(0,p.wA)(),[d,r]=(0,a.useState)([]),{t:u}=(0,x.Bd)(),{hotelData:v,dateRange:{startDate:m,endDate:h},totalAdult:g,totalChild:_,selectedRooms:f,selectedRatePlans:y,couponCode:b}=(0,p.d4)(e=>e.hotelInfo),j=e=>null!==e&&void 0!==e&&e.id&&null!==b&&void 0!==b&&b.id&&e.id===b.id?n:o,{adultCount:k,childrenCount:C}=c({selectedRooms:f,selectedRatePlans:y,totalAdult:g,totalChild:_});(0,a.useEffect)(()=>{null!==v&&void 0!==v&&v.id&&m&&h&&(async()=>{I(!0);try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;(0,K.Aq)(e)||(e=null);const o={hotelId:null===v||void 0===v?void 0:v.id,checkInDate:t()(m).format("DD/MM/YYYY"),checkOutDate:t()(h).format("DD/MM/YYYY"),shouldApplyFilter:!0,isMembership:!1};e&&(o.timezone=e);const n=await(0,F.DE)(o);null!==n&&void 0!==n&&n.data&&r(n.data)}catch(e){console.error("Error fetching promotions:",e)}finally{I(!1)}})()},[v,m,h]);const[A,N]=(0,a.useState)([]),[P,I]=(0,a.useState)(!1),[S,w]=(0,a.useState)(""),[D,M]=(0,a.useState)(null),[R,B]=(0,a.useState)(!1),[T,O]=(0,a.useState)(null),[z,G]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e=[...d.filter(e=>"coupon"===e.type&&("percentage"===e.discountType||"fixed_amount"===e.discountType)&&!s(e,k,C)).map(e=>(0,l.A)((0,l.A)({},e),{},{ineligibleReason:(0,ee.s)(e,j(e))}))].sort((e,n)=>{if(!e.ineligibleReason!==!n.ineligibleReason)return e.ineligibleReason?1:-1;if("nights"===e.discountType&&"nights"!==n.discountType)return-1;if("nights"!==e.discountType&&"nights"===n.discountType)return 1;if("nights"===e.discountType&&"nights"===n.discountType)return n.discount-e.discount;const l=e=>"percentage"===e.discountType?o*e.discount/100:(e.discountType,e.discount),i=l(e),t=l(n);if(i!==t)return t-i;const a=e.name||"",d=n.name||"";return a.localeCompare(d)});console.log("Sorted Promotions:",e),N(e)},[d,o,n,b,k,C]);const H=async e=>{M(e.id),B(!1);try{const o=d.find(o=>o.id===e.id),n=o?s(o,k,C):null;if(n)return void w(n);const l=o?(0,ee.s)(o,j(o)):null;if(l)return void w(l);null!==o&&void 0!==o&&o.id?(i({type:Y.A.SET_COUPON_CODE,payload:o}),O(e),B(!0),w(u("Coupon applied successfully!")),(0,V.fireGtmEvent)("coupon_applied",{coupon:e}),setTimeout(()=>{G(!1)},1500)):w(u("This coupon cannot be applied"))}catch(o){(0,V.fireGtmEvent)("api_error",{api:"promocode_api"}),w(u("Failed to apply coupon"))}finally{M(null)}},L=()=>{G(!z),(0,V.fireGtmEvent)("view_coupons_clicked",{showDrawer:z,availableCoupons:A}),w("")};return null!==A&&void 0!==A&&A.length?(0,E.jsxs)("div",{className:"coupon-list-container",children:[(0,E.jsxs)("button",{className:"view-coupons-btn",onClick:L,children:[(0,E.jsx)("span",{className:"coupon-icon",children:"\ud83c\udff7\ufe0f"}),u("VIEW COUPONS & OFFERS")]}),z&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"coupon-overlay",onClick:L}),(0,E.jsxs)("div",{className:"coupon-drawer",children:[(0,E.jsxs)("div",{className:"coupon-drawer-header",children:[(0,E.jsx)("h3",{children:u("Available Offers")}),(0,E.jsx)("button",{className:"coupon-close-btn",onClick:L,children:"\xd7"})]}),S&&(0,E.jsx)("div",{className:"coupon-message ".concat(R?"success":"error"),children:S}),(0,E.jsx)("div",{className:"coupon-list",children:P?(0,E.jsxs)("div",{className:"coupon-loading",children:[(0,E.jsx)($.A,{}),(0,E.jsx)("p",{children:u("Loading available coupons...")})]}):A.length>0?A.map(e=>(0,E.jsx)(le,{coupon:e,onApply:H,isApplying:D===e.id,ineligibleReason:e.ineligibleReason},e.id)):(0,E.jsx)("div",{className:"no-coupons",children:(0,E.jsx)("p",{children:u("No coupons available at the moment")})})}),(0,E.jsx)("div",{className:"coupon-footer",children:(0,E.jsx)("small",{children:u("* Some coupons may have restrictions based on dates, minimum price, or room type")})})]})]}
1),R&&T&&(0,E.jsx)(ne,{coupon:T,onComplete:()=>B(!1)})]}):null},te=()=>(0,E.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),(0,E.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),ae=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,E.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),de=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,E.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,E.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),re=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,E.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),se=e=>{let{totalPrice:o,bookingAmountBeforeCoupon:n=0,couponCutoffReason:l=null}=e;const i=(0,p.wA)(),{t:d}=(0,x.Bd)(),{hotelData:r,dateRange:{startDate:u,endDate:v},couponCode:m,couponName:h,Retargeting:g,totalAdult:f,totalChild:y,selectedRooms:b,selectedRatePlans:j}=(0,p.d4)(e=>e.hotelInfo),{adultCount:k,childrenCount:C}=c({selectedRooms:b,selectedRatePlans:j,totalAdult:f,totalChild:y}),[A,N]=(0,a.useState)(""),[P,I]=(0,a.useState)(!1),[S,w]=(0,a.useState)(""),[D,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{h?(N(h),M(!(null===m||void 0===m||!m.id))):M(!1)},[h,m]),(0,a.useEffect)(()=>{if(null===m||void 0===m||!m.id)return;const e=s(m,k,C);e&&(i({type:Y.A.SET_COUPON_CODE,payload:{}}),M(!1),N(""),w(e))},[m,k,C,i]),(0,a.useEffect)(()=>{l&&(M(!1),N(""),w(l))},[l]);const R=async()=>{if(null!==m&&void 0!==m&&m.id)return N(""),M(!1),void i({type:Y.A.SET_COUPON_CODE,payload:{}});if(A.trim().length){I(!0);try{let e={hotelId:null===r||void 0===r?void 0:r.id,couponCode:A,checkInDate:t()(u).format("DD/MM/YYYY"),checkOutDate:t()(v).format("DD/MM/YYYY"),isRetargeting:g,adultCount:k,childrenCount:C,bookingAmount:o};const n=await(0,F.uB)(e);if(200===(null===n||void 0===n?void 0:n.status))(0,V.fireGtmEvent)("promocode_applied",{response:n,obj:e}),M(!0),w("Coupon Code Applied Successfully!"),i({type:Y.A.SET_COUPON_CODE,payload:null===n||void 0===n?void 0:n.data}),i({type:Y.A.SET_RETARGETING,payload:!1});else{(0,V.fireGtmEvent)("promocode_failed",{response:n,obj:e}),M(!1),i({type:Y.A.SET_COUPON_CODE,payload:{}}),i({type:Y.A.SET_RETARGETING,payload:!1});const o=null===n||void 0===n?void 0:n.message;w("string"===typeof o&&o&&"failure"!==o?o:"Invalid Coupon!")}}catch(e){(0,V.fireGtmEvent)("api_error",{api:"promocode_api"}),w("Invalid Coupon!")}finally{I(!1)}}else _().error("Please enter valid promocode!")};(0,a.useEffect)(()=>{setTimeout(()=>{S.length>0&&w("")},4e3)},[D,S]);const B=!(null===m||void 0===m||!m.id);return(0,E.jsxs)("div",{className:"promocode_wrapper",children:[(0,E.jsx)(ie,{totalPrice:o,bookingAmountBeforeCoupon:n}),(0,E.jsxs)("div",{className:"promocode_container ".concat(B?"applied":""),children:[(0,E.jsx)("div",{className:"promocode_icon",children:(0,E.jsx)(te,{})}),(0,E.jsx)("input",{type:"text",placeholder:d("Enter Promocode"),value:A,disabled:B,onChange:e=>{w(""),N(e.target.value)},onKeyPress:e=>"Enter"===e.key&&!B&&R()}),(0,E.jsx)("button",{onClick:R,className:"promocode_action_btn ".concat(B?"remove":"apply"),"aria-label":B?"Remove coupon":"Apply coupon",children:P?(0,E.jsx)($.A,{}):B?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(re,{})," ",d("Remove")]}):d("Apply")})]}),S&&(0,E.jsxs)("div",{className:"coupon-message ".concat(D?"success":"error"),children:[D?(0,E.jsx)(ae,{}):(0,E.jsx)(de,{})," ",S]})]})};var ce=n(6230),ue=(n(7155),n(4392)),ve=n(6572),me=n(4443),pe=n.n(me),he=n(7950);const ge={modal_container:"CheckoutDetailsModal_modal_container__sP3Uw",headerBox:"CheckoutDetailsModal_headerBox__rXUC2",modal_header:"CheckoutDetailsModal_modal_header__BUfTP",carousel_container:"CheckoutDetailsModal_carousel_container__oQFwd",image_container:"CheckoutDetailsModal_image_container__9dMEp",slider_img_cont:"CheckoutDetailsModal_slider_img_cont__w7DBg",slider_image:"CheckoutDetailsModal_slider_image__f6wYC",description:"CheckoutDetailsModal_description__GmCV0",priceBox:"CheckoutDetailsModal_priceBox__JTWQk",price_wrapper:"CheckoutDetailsModal_price_wrapper__yQTWR",price_amount:"CheckoutDetailsModal_price_amount__Wmmut",addButton:"CheckoutDetailsModal_addButton__2GTIe",addonActionBtn:"CheckoutDetailsModal_addonActionBtn__MvPS0","carousel-btn":"CheckoutDetailsModal_carousel-btn__1vVmH",prev_styles:"CheckoutDetailsModal_prev_styles__EzfFF",next_styles:"CheckoutDetailsModal_next_styles__Qhd4R",carousel_wrapper:"CheckoutDetailsModal_carousel_wrapper__scty8"};var _e=n(5945);
1const xe={emblaCarousel:"CarouselWrapper_emblaCarousel__dt-BW",emblaViewport:"CarouselWrapper_emblaViewport__9zBvB",emblaContainer:"CarouselWrapper_emblaContainer__6fhPp",emblaSlide:"CarouselWrapper_emblaSlide__qDQQR",emblaSlideInner:"CarouselWrapper_emblaSlideInner__55Jg0",emblaButton:"CarouselWrapper_emblaButton__oh2r1",emblaButtonPrev:"CarouselWrapper_emblaButtonPrev__-KJEl",emblaButtonNext:"CarouselWrapper_emblaButtonNext__3wSMI",emblaButtonOutside:"CarouselWrapper_emblaButtonOutside__YeV8E",emblaButtonDefault:"CarouselWrapper_emblaButtonDefault__QexJw",emblaButtonRounded:"CarouselWrapper_emblaButtonRounded__ENavG"};var fe=n(8438),ye=n(225);const be=(0,a.forwardRef)((e,o)=>{let{children:n,slidesToShow:l=1,spacing:i=16,loop:t=!0,showArrows:d=!0,navPosition:r="inside",navStyle:s="rounded",hidePrevButton:c=!1,hideNextButton:u=!1,smallScreenSlidesToShow:v=1,mediumScreenSlidesToShow:m=2,mediumScreenSpacing:p=null,smallScreenSpacing:h=null}=e;const[g,_]=(0,_e.A)({loop:t,align:"start",containScroll:"trimSnaps",dragFree:!1});(0,a.useImperativeHandle)(o,()=>({scrollPrev:()=>_&&_.scrollPrev(),scrollNext:()=>_&&_.scrollNext(),scrollTo:e=>_&&_.scrollTo(e)}));const[x,f]=(0,a.useState)("".concat(100/l,"%"));(0,a.useEffect)(()=>{const e=()=>{const e=window.innerWidth;let o=l;e<480?o=v:e<768&&(o=Math.min(m,l)),f("".concat(100/o,"%"))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[l]);const y=(0,a.useCallback)(()=>_&&_.scrollPrev(),[_]),b=(0,a.useCallback)(()=>_&&_.scrollNext(),[_]);return(0,E.jsxs)("div",{className:"".concat(xe.emblaCarousel," ").concat("outside"===r?xe.withOutsideNav:""),children:[(0,E.jsx)("div",{className:xe.emblaViewport,ref:g,children:(0,E.jsx)("div",{className:xe.emblaContainer,children:a.Children.map(n,e=>(0,E.jsx)("div",{className:xe.emblaSlide,style:{flexBasis:x,marginRight:"".concat(h||(p||i),"px")},children:(0,E.jsx)("div",{className:xe.emblaSlideInner,children:e})}))})}),d&&(0,E.jsxs)(E.Fragment,{children:[!c&&(0,E.jsx)("button",{className:"".concat(xe.emblaButton," ").concat(xe.emblaButtonPrev," ").concat("outside"===r?xe.emblaButtonOutside:""," ").concat("rounded"===s?xe.emblaButtonRounded:xe.emblaButtonDefault),onClick:y,"aria-label":"Previous",children:(0,E.jsx)(fe.A,{})}),!u&&(0,E.jsx)("button",{className:"".concat(xe.emblaButton," ").concat(xe.emblaButtonNext," ").concat("outside"===r?xe.emblaButtonOutside:""," ").concat("rounded"===s?xe.emblaButtonRounded:xe.emblaButtonDefault),onClick:e=>{e.stopPropagation(),b()},"aria-label":"Next",children:(0,E.jsx)(ye.A,{})})]})]})}),je="CheckOutModalWrapper_modal_container__8eq0c",ke="CheckOutModalWrapper_modal__XnQhA",Ce="CheckOutModalWrapper_mob_modal__WBSbg",Ae="CheckOutModalWrapper_mob_container__VqNjo",Ne="CheckOutModalWrapper_navBackBox__gG4wN",Pe="CheckOutModalWrapper_backIcon__s89O8",Ie="CheckOutModalWrapper_closing__vJiA2",Se="CheckOutModalWrapper_mob_navBox__xMCrH";var we=n(3412);const De=e=>{let{children:o,closeModal:n,mob_modal:l=!1}=e;const[i,t]=(0,a.useState)(!1),d=()=>{t(!0),setTimeout(()=>{n()},300),(0,V.fireGtmEvent)("checkout_go_back_clicked")};return(0,a.useEffect)(()=>{const e=e=>{e.target.classList.contains(l?Ae:je)&&d()};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[n]),he.createPortal((0,E.jsx)("div",{className:"".concat(l?Ae:je," ").concat(i?Ie:""),children:(0,E.jsx)("div",{className:"".concat(l?Ce:ke," ").concat(i?Ie:""),children:(0,E.jsxs)(E.Fragment,{children:[o,(0,E.jsxs)("div",{className:l?Se:Ne,onClick:d,children:[(0,E.jsx)(we.A,{className:Pe}),(0,E.jsx)("span",{children:"Go Back"})]})]})})}),document.getElementById("root"))};var Me=n(7125),Re=n(6637);const Be=e=>{var o,n,l,i,t,d;let{addon:r,closeModal:s}=e;const{selectedHotelAddons:c}=(0,p.d4)(e=>e.hotelInfo),u=(0,p.wA)(),[v,m]=(0,a.useState)(null===c||void 0===c?void 0:c.some(e=>(null===e||void 0===e?void 0:e.addonId)===(null===r||void 0===r?void 0:r.addonId)));(0,a.useEffect)(()=>{var e;(0,V.fireGtmEvent)("checkout_addon_modal_viewed",{addon_id:null===r||void 0===r?void 0:r.addonId,addon_name:(null===r||void 0===r||null===(e=r.Addon)||void 0===e?void 0:e.name)||(null===r||void 0===r?void 0:r.name),addon_price:null===r||void 0===r?void 0:r.price,addon_currency:null===r||void 0===r?void 0:r.currency})},[]);const h=()=>{var e,o;(null===(e=c.filter(e=>e.addonId===(null===r||void 0===r?void 0:r.addonId)))||void 0===e?void 0:e.length)<10&&(u((0,O.qO)(r)),(0,V.fireGtmEvent)("hotel_addon_selected",{addon_id:null===r||void 0===r?void 0:r.addonId,addon_name:null===r||void 0===r||null===(o=r.Addon)||void 0===o?void 0:o.name,value:null===r||void 0===r?void 0:r.price}),v||m(!0))};return he.createPortal((0,E.jsx)(De,{closeModal:s,showBackNav:!1,mob_modal:!0,children:(0,E.jsxs)("div",{className:ge.modal_container,children:[(0,E.jsx)("h3",{className:ge.modal_header,children:null===r||void 0===r?void 0:r.name}),(0,E.jsxs)("div",{className:ge.carousel_container,children:[(0,E.jsxs)("div",{className:ge.carousel_wrapper,children:[(0,E.jsx)(be,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===r||void 0===r||null===(o=r.HotelAddonImages)||void 0===o?void 0:o.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(0,E.jsx)("div",{className:ge.image_container,children:(null===r||void 0===r||null===(n=r.HotelAddonImages)||void 0===n?void 0:n.map((e,o)=>(0,E.jsx)("div",{className:ge.slider_img_cont,children:(0,E.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:ge.slider_image})},o)))||[]})}),(0,E.jsx)("p",{className:ge.description,children:null===r||void 0===r?void 0:r.description})]}),(0,E.jsx)("div",{className:ge.modal_content,children:(0,E.jsxs)("div",{className:ge.priceBox,children:[(0,E.jsxs)("div",{className:ge.price_wrapper,children:[(0,E.jsxs)("p",{children:[(0,L.Gl)(null===r||void 0===r?void 0:r.currency)," ",null===(l=Number(null===r||void 0===r?void 0:r.price))||void 0===l?void 0:l.toFixed()]}),(0,E.jsx)("span",{children:"Incl. of all taxes"})]}),(null===(i=c.filter(e=>e.addonId===(null===r||void 0===r?void 0:r.addonId)))||void 0===i?void 0:i.length)>0&&v?(0,E.jsxs)("div",{className:ge.addonActionBtn,role:"group","aria-label":"Quantity controls for ".concat(null===r||void 0===r?void 0:r.name),children:[(0,E.jsx)("button",{type:"button",onClick:()=>(()=>{var e,o;(null===(e=c.filter(e=>e.addonId===(null===r||void 0===r?void 0:r.addonId)))||void 0===e?void 0:e.length)>0&&(u((0,O.xy)(r)),(0,V.fireGtmEvent)("hotel_addon_removed",{addon_id:null===r||void 0===r?void 0:r.addonId,addon_name:null===r||void 0===r||null===(o=r.Addon)||void 0===o?void 0:o.name,value:null===r||void 0===r?void 0:r.price}))})(),"aria-label":"Decrease ".concat(null===r||void 0===r?void 0:r.name," quantity"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Me.A,{size:16,"aria-hidden":"true"})}),(0,E.jsx)("span",{"aria-live":"polite","aria-atomic":"true",children:null!==(t=null===(d=c.filter(e=>e.addonId===(null===r||void 0===r?void 0:r.addonId)))||void 0===d?void 0:d.length)&&void 0!==t?t:0}),(0,E.jsx)("button",{type:"button",onClick:()=>h(),"aria-label":"Increase ".concat(null===r||void 0===r?void 0:r.name," quantity"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Re.A,{size:16,"aria-hidden":"true"})})]}):(0,E.jsx)("button",{type:"button",className:ge.addButton,onClick:()=>h(),"aria-label":"Add ".concat(null===r||void 0===r?void 0:r.name," to booking"),children:"Add"})]})})]})]})}),document.getElementById("root"))},Ee=e=>{var o,n,l,i,t;let{addon:d,key:r}=e;const[s,c]=(0,a.useState)({isOpen:!1,data:null}),{selectedHotelAddons:u}=(0,p.d4)(e=>e.hotelInfo),v=(0,p.wA)(),[m,h]=(0,a.useState)(null===u||void 0===u?void 0:u.some(e=>(null===e||void 0===e?void 0:e.id)===(null===d||void 0===d?void 0:d.id))),g=()=>{var e,o,n,l;(null===(e=u.filter(e=>e.id===(null===d||void 0===d?void 0:d.id)))||void 0===e?void 0:e.length)<10&&(v((0,O.qO)(d)),(0,V.fireGtmEvent)("hotel_addon_selected",{addon_id:null===d||void 0===d?void 0:d.addonId,addon_name:null===d||void 0===d||null===(o=d.Addon)||void 0===o?void 0:o.name,is_hotel_addon_images:(null===d||void 0===d||null===(n=d.HotelAddonImages)||void 0===n?void 0:n.length)>0,hotel_addon_images_count:null===d||void 0===d||null===(l=d.HotelAddonImages)||void 0===l?void 0:l.length,value:null===d||void 0===d?void 0:d.price}),m||h(!0))};return(0,E.jsxs)("div",{className:"addonCardContainer",children:[(0,E.jsxs)("div",{className:"addonImage",children:[(0,E.jsx)("img",{src:null===d||void 0===d||null===(o=d.HotelAddonImages)||void 0===o||null===(n=o[0])||void 0===n?void 0:n.cdnImageUrl,alt:null===d||void 0===d?void 0:d.name}),(0,E.jsx)("span",{onClick:()=>c({isOpen:!0,data:d}),className:"addon_view_btn_mob",children:"View Details"})]}),(0,E.jsxs)("div",{className:"addonContentBox",children:[(0,E.jsxs)("div",{className:"addonContent",children:[(0,E.jsx)("h4",{className:"truncatedTitle",children:null===d||void 0===d?void 0:d.name}),(0,E.jsx)("p",{className:"truncatedDescription",children:null===d||void 0===d?void 0:d.description}),(0,E.jsx)("span",{onClick:()=>c({isOpen:!0,data:d}),className:"addon_view_btn",children:"View Details"})]}),(0,E.jsxs)("div",{className:"addonActionContainer",children:[(0,E.jsxs)("span",{children:[(0,L.Gl)(null===d||void 0===d?void 0:d.currency),null===d||void 0===d?void 0:d.price]}),(null===(l=u.filter(e=>e.id===(null===d||void 0===d?void 0:d.id)))||void 0===l?void 0:l.length)>0&&m?(0,E.jsxs)("button",{type:"button",className:"addAddonActionBtn",children:[(0,E.jsx)(Me.A,{size:16,onClick:()=>(()=>{var e,o;(null===(e=u.filter(e=>e.addonId===(null===d||void 0===d?void 0:d.addonId)))||void 0===e?void 0:e.length)>0&&(v((0,O.xy)(d)),(0,V.fireGtmEvent)("hotel_addon_removed",{addon_id:null===d||void 0===d?void 0:d.addonId,addon_name:null===d||void 0===d||null===(o=d.Addon)||void 0===o?void 0:o.name,value:null===d||void 0===d?void 0:d.price}))})()}),null!==(i=null===(t=u.filter(e=>e.id===(null===d||void 0===d?void 0:d.id)))||void 0===t?void 0:t.length)&&void 0!==i?i:0,(0,E.jsx)(Re.A,{size:16,onClick:()=>g()})]}):(0,E.jsx)("button",{type:"button",className:"addAddonBtn",onClick:()=>g(),children:"Add"})]})]}),(null===s||void 0===s?void 0:s.isOpen)&&(0,E.jsx)(Be,{addon:null===s||void 0===s?void 0:s.data,closeModal:()=>c({isOpen:!1,data:null})})]},r)},Te={flashSaleContainer:"FlashSaleCard_flashSaleContainer__l2Bkv",flashSaleBanner:"FlashSaleCard_flashSaleBanner__Id5TU",flashSaleContent:"FlashSaleCard_flashSaleContent__DRZPH",flashSaleTitle:"FlashSaleCard_flashSaleTitle__PNKPY",flashCountContainer:"FlashSaleCard_flashCountContainer__voOOz",flashSaleTime:"FlashSaleCard_flashSaleTime__6e6T6",flashSaleTimer:"Flas
1hSaleCard_flashSaleTimer__luMst",falshSaleTime:"FlashSaleCard_falshSaleTime__jGL0G",hotelCarousel:"FlashSaleCard_hotelCarousel__fWT2F",hotelCarouselImg:"FlashSaleCard_hotelCarouselImg__8Ky5B",carouselNav:"FlashSaleCard_carouselNav__VH52A",carouselPrev:"FlashSaleCard_carouselPrev__BvIqW",carouselNext:"FlashSaleCard_carouselNext__G91Nc",carouselDots:"FlashSaleCard_carouselDots__ysTDz",carouselDot:"FlashSaleCard_carouselDot__Hlv52",carouselDotActive:"FlashSaleCard_carouselDotActive__vDh5s",checkinContainer:"FlashSaleCard_checkinContainer__rcCS8",checkInContent:"FlashSaleCard_checkInContent__X9vcV",hotelTitle:"FlashSaleCard_hotelTitle__dnxO-",checkInDateContainer:"FlashSaleCard_checkInDateContainer__ksWUQ",checkDateBox:"FlashSaleCard_checkDateBox__N0KFg",checkDateLabel:"FlashSaleCard_checkDateLabel__oSV2W",checkDateValue:"FlashSaleCard_checkDateValue__SJapT",nightCountContainer:"FlashSaleCard_nightCountContainer__JirAY",checkDateBoxTextAlign:"FlashSaleCard_checkDateBoxTextAlign__IDS7X",reviewsContainer:"FlashSaleCard_reviewsContainer__sR3DP"};var Oe=n(9449);const Ye=e=>{var o;let{hotelData:n,isHourlyRoom:l,hourlyTime:i,hourlyDate:d,hourlyHour:r,dateRange:s,dateCount:c,addHoursToTime:u}=e;const[v,m]=(0,a.useState)(900),[g,_]=(0,a.useState)(0),x=(0,h.useHistory)(),f=(null===n||void 0===n||null===(o=n.HotelImages)||void 0===o?void 0:o.filter(e=>null===e||void 0===e?void 0:e.cdnImageUrl))||[],{reviews:y}=(0,p.d4)(e=>e.hotelInfo);(0,a.useEffect)(()=>{if(v<=0)return void x.goBack();const e=setInterval(()=>{m(e=>e-1)},1e3);return()=>clearInterval(e)},[v,x]);const b=Math.floor(v/60),j=v%60,k="".concat(b,":").concat(j.toString().padStart(2,"0"));return(0,E.jsxs)("div",{className:Te.flashSaleContainer,children:[(0,E.jsxs)("div",{className:Te.flashSaleContent,children:[(0,E.jsxs)("div",{className:Te.flashSaleBanner,children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/flash_sale.svg",alt:"flash sale"}),(0,E.jsx)("span",{className:Te.flashSaleTitle,children:"Flash Sale"})]}),(0,E.jsxs)("div",{className:Te.flashCountContainer,children:[(0,E.jsx)("p",{children:"We have saved your booking for "}),(0,E.jsxs)("div",{className:Te.flashSaleTime,children:[(0,E.jsx)("span",{className:Te.flashSaleTimer,children:k}),(0,E.jsx)("p",{children:"Mins"})]})]})]}),(0,E.jsxs)("div",{className:Te.checkinContainer,children:[f.length>0&&(0,E.jsxs)("div",{className:Te.hotelCarousel,children:[(0,E.jsx)("img",{src:"".concat(f[g].cdnImageUrl,"?tr=w-600,h-260,fo-auto,q-80"),alt:null===n||void 0===n?void 0:n.name,className:Te.hotelCarouselImg,loading:"lazy"}),f.length>1&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:"".concat(Te.carouselNav," ").concat(Te.carouselPrev),onClick:e=>{e.stopPropagation(),_(e=>(e-1+f.length)%f.length)},"aria-label":"Previous image",children:"\u2039"}),(0,E.jsx)("button",{className:"".concat(Te.carouselNav," ").concat(Te.carouselNext),onClick:e=>{e.stopPropagation(),_(e=>(e+1)%f.length)},"aria-label":"Next image",children:"\u203a"}),(0,E.jsx)("div",{className:Te.carouselDots,children:f.slice(0,5).map((e,o)=>(0,E.jsx)("div",{className:"".concat(Te.carouselDot," ").concat(o===g%5?Te.carouselDotActive:""),onClick:e=>{e.stopPropagation(),_(o)}},o))})]})]}),(0,E.jsxs)("div",{className:Te.checkInContent,children:[(null===y||void 0===y?void 0:y.rating)>0&&(0,E.jsxs)("div",{className:Te.reviewsContainer,children:[(0,E.jsx)("p",{children:null===y||void 0===y?void 0:y.rating}),(0,E.jsx)("span",{className:Te.reviewStar,children:Array.from({length:Math.round(Number(null===y||void 0===y?void 0:y.rating)||0)}).map((e,o)=>(0,E.jsx)(Oe.A,{color:"#FCE340",fill:"#FCE340"},o))})]}),(0,E.jsx)("h2",{className:Te.hotelTitle,children:null===n||void 0===n?void 0:n.name})]}),(0,E.jsxs)("div",{className:Te.checkInDateContainer,children:[(0,E.jsxs)("div",{className:Te.checkDateBox,children:[(0,E.jsx)("div",{className:Te.checkDateLabel,role:"heading","aria-level":"3",children:"Check-In"}),(0,E.jsx)("div",{className:Te.checkDateValue,children:l?t()(d).format("ddd, DD MMM'YY"):t()(null===s||void 0===s?void 0:s.startDate).format("ddd, DD MMM'YY")}),(0,E.jsx)("p",{children:l?i:z.A.get("checkin")||"12PM"})]}),(0,E.jsx)("div",{className:Te.nightCountContainer,children:(0,E.jsxs)("span",{children:[c," night"]})}),(0,E.jsxs)("div",{className:"".concat(Te.checkDateBox," ").concat(Te.checkDateBoxTextAlign),children:[(0,E.jsx)("div",{className:Te.checkDateLabel,role:"heading","aria-level":"3",children:"Check-Out"}),(0,E.jsx)("div",{className:Te.checkDateValue,children:l?u(d,i,r):t()(null===s||void 0===s?void 0:s.endDate).format("ddd, DD MMM'YY")}),(0,E.jsx)("p",{children:l?i:z.A.get("checkout")||"12PM"})]})]})]})]})};var Fe=n(7821),ze=n(3804),Ge=n(4978);const He={flashSaleContainer:"PaymentSummary_flashSaleContainer__utXxU",flashSaleBanner:"PaymentSummary_flashSaleBanner__yrVes",flashSaleContent:"PaymentSummary_flashSaleContent__8Vnw1",flashSaleTitle:"PaymentSummary_flashSaleTitle__oDe3+",flashCountContainer:"PaymentSummary_flashCountContainer__hl3Q8",flashSaleTime:"PaymentSummary_flashSaleTime__cPBbV",flashSaleTimer:"PaymentSummary_flashSaleTimer__WGoL4",falshSaleTime:"PaymentSummary_falshSaleTime__6KPWz",checkinContainer:"PaymentSummary_checkinContainer__u9pfU",checkInContent:"PaymentSummary_checkInContent__2iyz5",reviewsContainer:"PaymentSummary_reviewsContainer__GPdom",hotelTitle:"PaymentSummary_hotelTitle__cXG+e",reviewStar:"PaymentSummary_reviewStar__ADtIp",checkInDateContainer:"PaymentSummary_checkInDateContainer__6a2Q5",checkDateBox:"PaymentSummary_checkDateBox__oTnQM",nightCountContainer:"PaymentSummary_nightCountContainer__1fUQl",checkDateBoxTextAlign:"PaymentSummary_checkDateBoxTextAlign__LLnZV",bookingActionsBox:"PaymentSummary_bookingActionsBox__IzrYI",roomBox:"PaymentSummary_roomBox__uhKul",roomThumbnail:"PaymentSummary_roomThumbnail__vxNTO",roomDetailContainer:"PaymentSummary_roomDetailContainer__94GD4",roomItemPrice:"PaymentSummary_roomItemPrice__VaAQz",discountContainer:"PaymentSummary_discountContainer__EMCSY",amountContainer:"PaymentSummary_amountContainer__lRkq1",amountBox:"PaymentSummary_amountBox__KFERY",totalAmountBox:"PaymentSummary_totalAmountBox__lkOu7",lowestPriceBox:"PaymentSummary_lowestPriceBox__YPnxT",promoContainer:"PaymentSummary_promoContainer__Dbuwx",addonLabel:"PaymentSummary_addonLabel__fvfAk",lowestPriceGuranteeBox:"PaymentSummary_lowestPriceGuranteeBox__5FzXs",lowestPriceItems:"PaymentSummary_lowestPriceItems__eMoFS",lowestPriceOtaBox:"PaymentSummary_lowestPriceOtaBox__DgfHV",otaPriceBox:"PaymentSummary_otaPriceBox__yRowx",lowestPriceOfficial:"PaymentSummary_lowestPriceOfficial__r7NaI",lowestPriceOfficialNameBox:"PaymentSummary_lowestPriceOfficialNameBox__Tsw3I",priceTaxBox:"PaymentSummary_priceTaxBox__J+g8s",displayNone:"PaymentSummary_displayNone__tHNjv",summarySkeleton:"PaymentSummary_summarySkeleton__QwIbF",skeletonRow:"PaymentSummary_skeletonRow__mp1Xt",skeletonBlock:"PaymentSummary_skeletonBlock__cVL34",skeletonShimmer:"PaymentSummary_skeletonShimmer__k4RN3"},Le=()=>(0,E.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,E.jsx)("path",{d:"M2 4l3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14"})}),We=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,E.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),Ve=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,E.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),qe=()=>(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,E.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,E.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Ue=e=>{let{totalPrice:o,hotelId:n}=e;const l=(0,p.wA)(),i=(0,p.d4)(e=>e.hotelInfo.maharajaId),t=(0,p.d4)(e=>e.hotelInfo.maharajaIdError),[d,r]=(0,a.useState)(""),[s,c]=(0,a.useState)(""),[u,v]=(0,a.useState)(!1),m=!!i,h=!m&&(!!s||!!t);(0,a.useEffect)(()=>{i&&r(i)},[i]);const g=async()=>{var e;const i=d.trim();if(!i)return void c("Please enter your Maharaja Club ID.");v(!0),c(""),t&&l({type:Y.A.SET_MAHARAJA_ID_ERROR,payload:!1});const a=await(0,F.RU)("maharajaclub",i,o,n);var r;(v(!1),null!==a&&void 0!==a&&null!==(e=a.data)&&void 0!==e&&e.valid)?l({type:Y.A.SET_MAHARAJA_ID,payload:i}):c((null===a||void 0===a||null===(r=a.data)||void 0===r?void 0:r.message)||"Invalid Maharaja Club ID.")};return(0,E.jsxs)("div",{className:"maharajaclub_wrapper",id:"maharaja-club-section",children:[(0,E.jsxs)("div",{className:"maharajaclub_container ".concat(m?"applied":""," ").concat(h?"has-error":""),children:[(0,E.jsx)("div",{className:"maharajaclub_icon",children:(0,E.jsx)(Le,{})}),(0,E.jsx)("input",{type:"text",placeholder:"Enter Maharaja Club ID",value:d,disabled:m||u,maxLength:9,onChange:e=>{c(""),t&&l({type:Y.A.SET_MAHARAJA_ID_ERROR,payload:!1}),r(e.target.value.replace(/\D/g,""))},onKeyPress:e=>"Enter"===e.key&&!m&&!u&&g()}),(0,E.jsx)("button",{onClick:m?()=>{r(""),c(""),l({type:Y.A.SET_MAHARAJA_ID,payload:null})}:g,className:"maharajaclub_action_btn ".concat(m?"remove":"apply"),disabled:u,"aria-label":m?"Remove Maharaja Club ID":"Apply Maharaja Club ID",children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(We,{})," ",(0,E.jsx)("span",{className:"maharajaclub_btn_text",children:"Remove"})]}):u?"...":"Apply"})]}),h&&(0,E.jsxs)("div",{className:"maharajaclub_message error",children:[(0,E.jsx)(qe,{})," ",s||"Air India Maharaja Club ID is required"]}),!m&&(0,E.jsx)("div",{className:"maharajaclub_info",children:(0,E.jsx)("span",{children:"Please enter your Air India Maharaja Club ID to earn 10 Points on every INR 100 Spent."})}),m&&(0,E.jsxs)("div",{className:"maharajaclub_message success",children:[(0,E.jsx)(Ve,{})," Valid Air India Maharaja Club ID."]})]})},Je="RoomDetailsModal_modal_container__X7ALz",Ke="RoomDetailsModal_modal_header__u5Yj1",Xe="RoomDetailsModal_roomCardContainer__TelyQ",Qe="RoomDetailsModal_roomTitle__tDxr1",Ze="RoomDetailsModal_roomTitleBox__fGM5k",$e="RoomDetailsModal_carouselContainer__qspja",eo="RoomDetailsModal_slider_img_cont__rhOfe",oo="RoomDetailsModal_slider_image__QMrvv",no="ImageFullViewModal_modal_container__ioPI2",lo="ImageFullViewModal_carouselContainer__xSjhS",io="ImageFullViewModal_slider_img_cont__Wgug-",to="ImageFullViewModal_slider_image__zaX0w",ao=e=>{let{data:o,closeModal:n}=e;return(0,V.fireGtmEvent)("checkout_full_image_viewed"),(0,E.jsx)(De,{closeModal:n,children:(0,E.jsx)("div",{className:no,children:(0,E.jsx)("div",{className:lo,children:(0,E.jsx)(be,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===o||void 0===o?void 0:o.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(null===o||void 0===o?void 0:o.map((e,o)=>(0,E.jsx)("div",{className:io,children:(0,E.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:to})},o)))||[]})})})})},ro=e=>{var o,n;let{closeModal:l,oldPriceCalculator:i,priceCalculator:t}=e;const d=null!==i&&void 0!==i&&null!==(o=i.roomObjects)&&void 0!==o&&o.length?null===i||void 0===i?void 0:i.roomObjects:null===t||void 0===t?void 0:t.selectedRooms,[r,s]=(0,a.useState)({isOpen:!1,data:null});(0,V.fireGtmEvent)("checkout_opened_room_details_modal",{selectedRooms:d});const c=e=>{var o,n,l;let{roomDetails:i}=e;return(0,E.jsxs)("div",{className:Xe,children:[(0,E.jsx)("div",{className:Ze,children:(0,E.jsx)("h1",{className:Qe,children:null===i||void 0===i?void 0:i.roomName})}),(0,E.jsx)("span",{children:null===i||void 0===i||null===(o=i.rpObject)||void 0===o?void 0:o.name}),(0,E.jsx)("span",{children:[(null===i||void 0===i?void 0:i.sAdult)>0?"".concat(i.sAdult," ").concat((0,K.g3)(i.sAdult,(0,Ge.t)("Adult"))):null,(null===i||void 0===i?void 0:i.sChild)>
10?"".concat(i.sChild," ").concat((0,K.g3)(i.sChild,(0,Ge.t)("Child"))):null,(null===i||void 0===i?void 0:i.sInfant)>0?"".concat(i.sInfant," ").concat((0,K.g3)(i.sInfant,(0,Ge.t)("Infant"))):null].filter(Boolean).join(", ")}),(0,E.jsx)("button",{type:"button",className:$e,onClick:e=>{e.stopPropagation(),s({isOpen:!0,data:null===i||void 0===i?void 0:i.RoomImages})},"aria-label":"View full screen images for ".concat(null===i||void 0===i?void 0:i.roomName),style:{border:"none",padding:0,background:"none",cursor:"pointer",width:"100%"},children:(0,E.jsx)(be,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===i||void 0===i||null===(n=i.RoomImages)||void 0===n?void 0:n.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(null===i||void 0===i||null===(l=i.RoomImages)||void 0===l?void 0:l.map((e,o)=>(0,E.jsx)("div",{className:eo,children:(0,E.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:oo})},o)))||[]})})]})};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(De,{closeModal:l,children:(0,E.jsxs)("div",{className:Je,children:[(0,E.jsx)("h3",{className:Ke,children:"Room Photos"}),null===(n=(0,K.m9)(d))||void 0===n?void 0:n.map((e,o)=>(0,E.jsx)(c,{roomDetails:e},o))]})}),(null===r||void 0===r?void 0:r.isOpen)&&(0,E.jsx)(ao,{data:null===r||void 0===r?void 0:r.data,closeModal:()=>s({isOpen:!1,data:null})})]})},so="ModifyBookingModal_modal_container__cRsHg",co="ModifyBookingModal_modal_header__CJRK7",uo="ModifyBookingModal_datePickerContainer__b1uIV",vo="ModifyBookingModal_selectedRoomsContainer__OkCuE",mo="ModifyBookingModal_selectedRoomsBox__6w+eh",po="ModifyBookingModal_roomContainer__HksAl",ho="ModifyBookingModal_roomBox__y0Jao",go="ModifyBookingModal_roomImgBox__n2dUw",_o="ModifyBookingModal_roomContentContainer__RCWER",xo="ModifyBookingModal_roomTitleBox__YgZNu",fo="ModifyBookingModal_actionBox__iT1J5",yo="ModifyBookingModal_actionBoxSep__7eHEm",bo="ModifyBookingModal_ratePlanName__ueABR",jo="ModifyBookingModal_guestCountBox__ZcTAo",ko="ModifyBookingModal_datePickerBox__5pszS",Co="ModifyBookingModal_actionButtonBox__kgKOR",Ao="ModifyBookingModal_addMoreBtn__dV7WB",No="ModifyBookingModal_editRoomContainer__3zqA+",Po="ModifyBookingModal_guestCountContainer__Po5so",Io="ModifyBookingModal_guestCountBtnBox__VPACL",So="ModifyBookingModal_guestActionBtn__zTR9V",wo="ModifyBookingModal_cancelChng__4pTyM",Do="ModifyBookingModal_countActnBtn__Jb4Xv",Mo="ModifyBookingModal_saveBtn__ujE3E",Ro="ModifyBookingModal_dateLabelContainer__G0pxZ",Bo=e=>{let{style:o}=e;const n=(0,a.useRef)(),{dateRange:l,hotelData:i}=(0,p.d4)(e=>e.hotelInfo);(0,a.useEffect)(()=>{n.current&&(n.current.value="".concat(t()((null===i||void 0===i?void 0:i.checkInDate)||l.startDate).format("DD MMM YY")," - ").concat(t()((null===i||void 0===i?void 0:i.checkOutDate)||l.endDate).format("DD MMM YY")))},[i,l]);const{t:d}=(0,x.Bd)();return(0,E.jsx)("div",{className:"dates",style:o,children:(0,E.jsx)("div",{className:ko,children:(0,E.jsx)("input",{type:"text",id:"date-input",placeholder:d("checkin_checkout"),readOnly:!0,ref:n})})})};var Eo=n(863);const To={wrapper:{position:"relative",width:"100%",maxWidth:"400px"},button:{width:"100%",padding:"12px 16px",background:"white",border:"1px solid #ddd",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",textAlign:"left",fontSize:"13px",color:"#494545"},dropdown:{position:"absolute",top:"100%",left:"0",right:"0",background:"white",border:"1px solid #D7D2D2",borderRadius:"4px",marginTop:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:"99"},option:{padding:"12px 14px",cursor:"pointer",color:"#494545",fontSize:"13px"}},Oo=e=>{let{options:o,onChange:n,selectedValue:i,additional:t}=e;const[d,r]=(0,a.useState)(!1),[s,c]=(0,a.useState)(i||{});return console.log({options:o},"==== options ==="),null!==o&&void 0!==o&&o.length?(0,E.jsxs)("div",{style:To.wrapper,children:[(0,E.jsxs)("button",{style:To.button,onClick:()=>{const e=!d;(0,V.fireGtmEvent)("custom_dropdown_toggle",{action:e?"open":"close",selected_value:(null===s||void 0===s?void 0:s.name)||"",dropdown_context:t||""}),r(e)},children:[(0,E.jsx)("span",{children:null===s||void 0===s?void 0:s.name}),(0,E.jsx)(Eo.A,{size:20,style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"}})]}),d&&(0,E.jsx)("div",{style:To.dropdown,children:null===o||void 0===o?void 0:o.map(e=>(0,E.jsx)("div",{style:(0,l.A)((0,l.A)({},To.option),{},{backgroundColor:e===s?"#f5f5f5":"white"}),onMouseEnter:e=>e.target.style.backgroundColor="#f5f5f5",onMouseLeave:o=>o.target.style.backgroundColor=e===s?"#f5f5f5":"white",onClick:()=>{(0,V.fireGtmEvent)("custom_dropdown_option_selected",{option_name:null===e||void 0===e?void 0:e.name,option_value:null===e||void 0===e?void 0:e.value,previous_selection:(null===s||void 0===s?void 0:s.name)||"",dropdown_context:t||""}),c((0,l.A)({name:null===e||void 0===e?void 0:e.name,value:null===e||void 0===e?void 0:e.value},e)),(e=>{n(e,t)})(e),r(!1)},children:null===e||void 0===e?void 0:e.name},null===e||void 0===e?void 0:e.value))})]}):(0,E.jsx)(E.Fragment,{})},Yo=e=>{var o;let{closeModal:n,priceCalculator:i,oldPriceCalculator:t}=e;const{hotelData:d,isHourlyRoom:r,isRatePlans:s}=(0,p.d4)(e=>e.hotelInfo),c=(0,p.wA)(),u=(0,h.useHistory)(),v=null!==t&&void 0!==t&&null!==(o=t.roomObjects)&&void 0!==o&&o.length?null===t||void 0===t?void 0:t.roomObjects:null===i||void 0===i?void 0:i.selectedRooms,[m]=(0,a.useState)({startDate:null===d||void 0===d?void 0:d.checkInDate,endD
1ate:null===d||void 0===d?void 0:d.checkOutDate}),[g,_]=(0,a.useState)([]),[x,f]=(0,a.useState)([]),[y,b]=(0,a.useState)([]),[j,k]=(0,a.useState)({isOpen:!1,data:null});let C=0;const A=(e,o)=>{f(s?n=>{var l,i,t,a;const d=[...n],r=d.findIndex(e=>(null===e||void 0===e?void 0:e.id)===o);if(-1===r)return n;const s=d[r],c=null===s||void 0===s||null===(l=s.room)||void 0===l?void 0:l.maxGuestCount,u=null===s||void 0===s||null===(i=s.room)||void 0===i?void 0:i.maxAdultCount,v=null===s||void 0===s||null===(t=s.room)||void 0===t?void 0:t.maxChildCount,m=null===s||void 0===s||null===(a=s.room)||void 0===a?void 0:a.maxInfantCount;if("sAdult"===e&&(null===s||void 0===s?void 0:s.sAdult)>=u)return n;if("sChild"===e&&(null===s||void 0===s?void 0:s.sChild)>=v)return n;if("sInfant"===e&&(null===s||void 0===s?void 0:s.sInfant)>=m)return n;return((null===s||void 0===s?void 0:s.sAdult)||1)+((null===s||void 0===s?void 0:s.sChild)||0)+((null===s||void 0===s?void 0:s.sInfant)||0)>=c?n:(s[e]=(s[e]||0)+1,d)}:n=>{const l=[...n],i=l.findIndex(e=>(null===e||void 0===e?void 0:e.idx)===o);if(-1===i)return n;const t=l[i],a=null===t||void 0===t?void 0:t.maxGuestCount;if(((null===t||void 0===t?void 0:t.sAdult)||1)+((null===t||void 0===t?void 0:t.sChild)||0)+((null===t||void 0===t?void 0:t.sInfant)||0)>=a)return n;if("sAdult"===e){const e=(null===t||void 0===t?void 0:t.maxAdultCount)||a;if((null===t||void 0===t?void 0:t.sAdult)>=e)return n}if("sChild"===e){const e=(null===t||void 0===t?void 0:t.maxChildCount)||a;if((null===t||void 0===t?void 0:t.sChild)>=e)return n}if("sInfant"===e){const e=(null===t||void 0===t?void 0:t.maxInfantCount)||a;if((null===t||void 0===t?void 0:t.sInfant)>=e)return n}return t[e]=(t[e]||0)+1,l}),(0,V.fireGtmEvent)("checkout_incremented_guest_count",{roomId:o,guest:"sAdult"===e?"Adult":"sChild"===e?"Child":"sInfant"===e?"Infant":""})},N=(e,o)=>{f(s?n=>{const l=[...n],i=l.findIndex(e=>(null===e||void 0===e?void 0:e.id)===o);if(-1===i)return n;const t=l[i];return"sAdult"===e&&1===(null===t||void 0===t?void 0:t.sAdult)||0===t[e]?n:(t[e]=t[e]-1,l)}:n=>{var l;const i=[...n],t=i.findIndex(e=>(null===e||void 0===e?void 0:e.idx)===o);if(-1===t)return n;const a=i[t];return("sAdult"!==e||1!==(null===a||void 0===a?void 0:a.sAdult)&&void 0!==(null===a||void 0===a?void 0:a.sAdult))&&("sChild"!==e&&"sInfant"!==e||0!==a[e]&&void 0!==a[e])?(a[e]=(null!==(l=a[e])&&void 0!==l?l:0)-1,i):n}),(0,V.fireGtmEvent)("checkout_decremented_guest_count",{roomId:o,guest:"sAdult"===e?"Adult":"sChild"===e?"Child":"sInfant"===e?"Infant":""})},P=(e,o)=>{b(n=>[...n,{selectedRoom:o,rp:e}]),(0,V.fireGtmEvent)("checkout_selected_rate_plan_changed",{selectedRoom:o,rp:e})};return(0,E.jsx)(De,{closeModal:n,children:(0,E.jsxs)("div",{className:so,children:[(0,E.jsx)("h3",{className:co,children:"Modify Booking"}),(0,E.jsxs)("div",{className:uo,children:[(0,E.jsxs)("div",{className:Ro,children:[(0,E.jsx)("p",{children:"Selected Dates"}),(0,E.jsx)("button",{type:"button",onClick:()=>u.goBack(),style:{background:"none",border:"none",cursor:"pointer",textDecoration:"underline",color:"inherit"},"aria-label":"Go back to modify booking dates",children:"Modify Date"})]}),(0,E.jsx)(Bo,{style:{display:"flex",flexDirection:"column",padding:"20px !important"},dateRange:m})]}),(0,E.jsxs)("div",{className:vo,children:[(0,E.jsx)("h4",{children:"You have selected"}),(0,E.jsx)("div",{className:mo,children:null===v||void 0===v?void 0:v.map(e=>{var o,n,i,t,a,m,p,h,y,b,j,I,S,w,D,M,R,B,T,F,G;const{cost:H}=(e=>{var o;const n=null===e||void 0===e||null===(o=e.HotelRoomAmenities)||void 0===o?void 0:o.some(e=>{var o,n;return"Bunk Beds"===(null===e||void 0===e||null===(o=e.Amenity)||void 0===o?void 0:o.name)&&"bed_type"===(null===e||void 0===e||null===(n=e.Amenity)||void 0===n?void 0:n.category)});let l=0,i=0;return v.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)).forEach(e=>{l+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),r&&(C=0,i=0),l+=i,z.A.set("tax",parseFloat(C.toFixed((0,K.S2)(null===d||void 0===d?void 0:d.currency)))),{isDorm:n,cost:(1*l).toFixed((0,K.S2)(null===d||void 0===d?void 0:d.currency))}})(e),L=s?(null===x||void 0===x?void 0:x.find(o=>o.id===e.id))||e:(null===x||void 0===x?void 0:x.find(o=>o.idx===e.idx))||e,q=["Adult"];return null!==e&&void 0!==e&&e.extraChildPrice&&q.push("Child"),null!==e&&void 0!==e&&e.extraInfantPrice&&q.push("Infant"),(0,E.jsxs)("div",{className:po,children:[(0,E.jsxs)("div",{className:ho,children:[(0,E.jsx)("button",{type:"button",className:go,onClick:()=>{k({isOpen:!0,data:null===e||void 0===e?void 0:e.RoomImages}),(0,V.fireGtmEvent)("checkout_clicked_to_view_room_image",e)},"aria-label":"View full screen images for ".concat(null===e||void 0===e?void 0:e.roomName),style:{border:"none",padding:0,background:"none",cursor:"pointer"},children:(0,E.jsx)("img",{src:null===e||void 0===e||null===(o=e.RoomImages)||void 0===o||null===(n=o[0])||void 0===n?void 0:n.cdnImageUrl,alt:"".concat(null===e||void 0===e?void 0:e.roomName," preview")})}),(0,E.jsxs)("div",{className:_o,children:[(0,E.jsxs)("div",{className:xo,children:[(0,E.jsx)("h3",{children:null===e||void 0===e?void 0:e.roomName}),(0,E.jsxs)("div",{className:fo,children:[!(null!==g&&void 0!==g&&g.includes(s?null===e||void 0===e?void 0:e.id:null===e||void 0===e?void 0:e.idx))&&
1(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{type:"button",onClick:()=>(e=>{if(!s){_(o=>[...o,null===e||void 0===e?void 0:e.idx]);const o=JSON.parse(JSON.stringify(e));return f(e=>[...e,o]),void(0,V.fireGtmEvent)("checkout_clicked_edit_room",e)}const o=JSON.parse(JSON.stringify(e));f(e=>[...e,o]),_(o=>[...o,null===e||void 0===e?void 0:e.id]),(0,V.fireGtmEvent)("checkout_clicked_edit_room",e)})(e),"aria-label":"Edit ".concat(null===e||void 0===e?void 0:e.roomName," details"),style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"inline-flex"},children:(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/edit_btn.svg",alt:"","aria-hidden":"true"})}),(0,E.jsx)("div",{className:yo})]}),(0,E.jsx)("button",{type:"button",onClick:()=>(e=>{if(1!==(null===v||void 0===v?void 0:v.length))if((0,V.fireGtmEvent)("checkout_removed_selected_room",e),s)c((0,O.A9)(null===e||void 0===e?void 0:e.id)),_(o=>o.filter(o=>o!==e.id)),f(o=>o.filter(o=>o.id!==e.id));else{const o=v.filter(o=>o.idx!==e.idx);c({type:Y.A.DESET_ROOM,payload:o}),_(o=>o.filter(o=>o!==e.idx)),f(o=>o.filter(o=>o.idx!==e.idx))}else u.goBack()})(e),"aria-label":"Remove ".concat(null===e||void 0===e?void 0:e.roomName," from booking"),style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"inline-flex"},children:(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/delete_btn.svg",alt:"","aria-hidden":"true"})})]})]}),(0,E.jsx)("p",{className:bo,children:null===e||void 0===e||null===(i=e.rpObject)||void 0===i?void 0:i.name}),(0,E.jsxs)("div",{className:jo,children:[(0,E.jsx)("p",{children:[(null===L||void 0===L?void 0:L.sAdult)>0?"".concat(L.sAdult," ").concat((0,K.g3)(L.sAdult,(0,Ge.t)("Adult"))):null,(null===L||void 0===L?void 0:L.sChild)>0?"".concat(L.sChild," ").concat((0,K.g3)(L.sChild,(0,Ge.t)("Child"))):null,(null===L||void 0===L?void 0:L.sInfant)>0?"".concat(L.sInfant," ").concat((0,K.g3)(L.sInfant,(0,Ge.t)("Infant"))):null].filter(Boolean).join(", ")}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:Number(H)})})]})]})]}),s&&g.includes(null===e||void 0===e?void 0:e.id)?(0,E.jsxs)("div",{className:No,children:[(0,E.jsxs)("div",{className:Po,children:[(0,E.jsx)("div",{className:jo,children:["Adult","Child","Infant"].map(o=>(0,E.jsxs)("div",{className:Io,role:"group","aria-labelledby":"".concat(o,"-").concat(null===e||void 0===e?void 0:e.id,"-label"),children:[(0,E.jsx)("label",{id:"".concat(o,"-").concat(null===e||void 0===e?void 0:e.id,"-label"),htmlFor:o.toLowerCase(),children:(0,Ge.t)(o.toLowerCase()+"s")}),(0,E.jsxs)("div",{className:So,children:[(0,E.jsx)("button",{type:"button",onClick:()=>N("s".concat(o),null===e||void 0===e?void 0:e.id),"aria-label":"Decrease ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Me.A,{size:16,className:Do,"aria-hidden":"true"})}),(0,E.jsx)("span",{"aria-live":"polite",children:L["s".concat(o)]||0}),(0,E.jsx)("button",{type:"button",onClick:()=>A("s".concat(o),null===e||void 0===e?void 0:e.id),"aria-label":"Increase ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Re.A,{size:16,className:Do,"aria-hidden":"true"})})]})]},o))}),(0,E.jsx)(Oo,{options:null===d||void 0===d||null===(t=d.HotelRooms)||void 0===t||null===(a=t.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===a||null===(m=a.pricing)||void 0===m?void 0:m.map(o=>{var n,i,t;const a=null===d||void 0===d||null===(n=d.HotelRooms)||void 0===n||null===(i=n.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===i?void 0:i.ratePlans[o];return a?(0,l.A)({name:null===(t=JSON.parse(null===a||void 0===a?void 0:a.ratePlanConfig))||void 0===t?void 0:t.name,value:null===a||void 0===a?void 0:a.ratePlanCode},a):null}).filter(Boolean),onChange:P,selectedValue:(null===d||void 0===d||null===(p=d.HotelRooms)||void 0===p||null===(h=p.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===h?void 0:h.ratePlans)&&(null===(y=Object.entries(null===d||void 0===d||null===(j=d.HotelRooms)||void 0===j||null===(I=j.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===I?void 0:I.ratePlans))||void 0===y||null===(b=y.map(e=>{var o;let[,n]=e;return(0,l.A)({name:null===(o=JSON.parse(null===n||void 0===n?void 0:n.ratePlanConfig))||void 0===o?void 0:o.name,value:null===n||void 0===n?void 0:n.ratePlanCode},n)}))||void 0===b?void 0:b.find(o=>{var n;return o.id===(null===e||void 0===e||null===(n=e.rpObject)||void 0===n?void 0:n.id)})),additional:e})]}),(0,E.jsx)("button",{type:"button",className:wo,onClick:()=>{_(o=>o.filter(o=>o!==e.id)),f(o=>o.filter(o=>o.id!==e.id)),(0,V.fireGtmEvent)("checkout_cancel_editing_room",e)},"aria-label":"Cancel changes to ".concat(null===e||void 0===e?void 0:e.roomName),style:{cursor:"pointer"},children:"Cancel changes"})]}):!s&&g.includes(null===e||void 0===e?void 0:e.idx)?(0,E.jsxs)("div",{className:No,children:[(0,E.jsxs)("div",{className:Po,children:[(0,E.jsx)("div",{className:jo,children:q.map(o=>(0,E.jsxs)("div",{className:Io,role:"group","aria-labelledby":"".concat(o,"-").concat(null===e||void 0===e?void 0:e.idx,"-label"),children:[(0,E.jsx)("label",{id:"".concat(o,"-").concat(null===e||void 0===e?void 0:e.idx,"-label"),htmlFor:o.toLowerCase(),children:(0,Ge.t)(o.toLowerCase()+"s")}),(0,E.jsxs)("div",{className:So,children:[(0,E.jsx)("button",{type:"button",onClick:()=>N("s".concat(o),null===e||void 0===e?void 0:e.idx),"aria-label":"Decrease ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Me.A,{size:16,className:Do,"aria-hidden":"true"})}),(0,E.jsx)("span",{"aria-live":"polite",children:L["s".concat(o)]||0}),(0,E.jsx)("button",{type:"button",onClick:()=>A("s".concat(o),null===e||void 0===e?void 0:e.idx),"aria-label":"Increase ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,E.jsx)(Re.A,{size:16,className:Do,"aria-hidden":"true"})})]})]},o))}),(0,E.jsx)(Oo,{options:null===d||void 0===d||null===(S=d.HotelRooms)||void 0===S||null===(w=S.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===w||null===(D=w.pricing)||void 0===D?void 0:D.map(o=>{var n,i,t;const a=null===d||void 0===d||null===(n=d.HotelRooms)||void 0===n||null===(i=n.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===i?void 0:i.ratePlans[o];return a?(0,l.A)({name:null===(t=JSON.parse(null===a||void 0===a?void 0:a.ratePlanConfig))||void 0===t?void 0:t.name,value:null===a||void 0===a?void 0:a.ratePlanCode},a):null}
1).filter(Boolean),onChange:P,selectedValue:(null===d||void 0===d||null===(M=d.HotelRooms)||void 0===M||null===(R=M.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===R?void 0:R.ratePlans)&&(null===(B=Object.entries(null===d||void 0===d||null===(F=d.HotelRooms)||void 0===F||null===(G=F.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===G?void 0:G.ratePlans))||void 0===B||null===(T=B.map(e=>{var o;let[,n]=e;return(0,l.A)({name:null===(o=JSON.parse(null===n||void 0===n?void 0:n.ratePlanConfig))||void 0===o?void 0:o.name,value:null===n||void 0===n?void 0:n.ratePlanCode},n)}))||void 0===T?void 0:T.find(o=>{var n;return o.id===(null===e||void 0===e||null===(n=e.rpObject)||void 0===n?void 0:n.id)})),additional:e})]}),(0,E.jsx)("span",{className:wo,onClick:()=>{_(o=>o.filter(o=>o!==e.idx)),f(o=>o.filter(o=>o.idx!==e.idx))},children:"Cancel changes"})]}):null]},e.id)})})]}),(0,E.jsxs)("div",{className:Co,children:[(0,E.jsx)("button",{type:"button",className:Ao,onClick:()=>{u.goBack(),(0,V.fireGtmEvent)("checkout_add_more_rooms")},children:"Add More Rooms"}),null!==g&&void 0!==g&&g.length?(0,E.jsx)("button",{type:"button",className:Mo,onClick:()=>{s?c({type:Y.A.EDIT_RP,payload:(0,l.A)({},null===x||void 0===x?void 0:x[0])}):x.forEach(e=>{const o=(0,l.A)((0,l.A)({},e),{},{sAdult:e.sAdult,sChild:e.sChild,sInfant:e.sInfant});c({type:Y.A.SET_ROOM,payload:o})}),null!==y&&void 0!==y&&y.length&&(y.forEach(e=>{var o;const{rp:n,selectedRoom:i}=e,t=(0,l.A)((0,l.A)({},JSON.parse(null===n||void 0===n?void 0:n.ratePlanConfig)),{},{ratePlanId:null===n||void 0===n?void 0:n.ratePlanId,ratePlanCode:null===n||void 0===n?void 0:n.ratePlanCode,id:null===n||void 0===n?void 0:n.id}),a=null===v||void 0===v||null===(o=v.filter(e=>(null===e||void 0===e?void 0:e.roomId)===(null===i||void 0===i?void 0:i.roomId)))||void 0===o?void 0:o.length;let d={sAdult:null===i||void 0===i?void 0:i.sAdult,sChild:null===i||void 0===i?void 0:i.sChild,sInfant:null===i||void 0===i?void 0:i.sInfant,code:null===t||void 0===t?void 0:t.ratePlanCode,roomId:null===i||void 0===i?void 0:i.roomId,rpObject:t,id:"".concat(null===i||void 0===i?void 0:i.roomId,"_").concat(null===t||void 0===t?void 0:t.ratePlanCode,"_").concat(null===i||void 0===i?void 0:i.idx),idx:null===i||void 0===i?void 0:i.idx,RoomImages:null===i||void 0===i?void 0:i.RoomImages,roomName:null===i||void 0===i?void 0:i.roomName,roomCount:a};c((0,O.h)({obj:d,rmRpId:null===i||void 0===i?void 0:i.id}))}),b([])),_([]),f([]),(0,V.fireGtmEvent)("checkout_saved_room_edits",(0,l.A)({},null===x||void 0===x?void 0:x[0]))},children:"Save"}):null]}),(null===j||void 0===j?void 0:j.isOpen)&&(0,E.jsx)(ao,{data:null===j||void 0===j?void 0:j.data,closeModal:()=>k({isOpen:!1,data:null})})]})})};var Fo=n(6177);const zo=e=>{var o,n,l,i,d,r,s,c,u,v,m,h,g,_,x,f;let{priceCalculator:y,oldPriceCalculator:b,extraPrice:j,localExtraValue:k=1,giftCardApplied:C=!1,giftCard:A={}}=e;const{hotelData:N,selectedRooms:P,selectedAddons:I,dateCount:S,selectedHotelAddons:w,isHourlyRoom:D,isRatePlans:M,couponName:R,couponCode:B,dateRange:T}=(0,p.d4)(e=>e.hotelInfo),{hotelCurrency:O,displayCurrency:Y}=(0,Fo.A)(),G=z.A.get("promo")||{},H=z.A.get("utmObj")||{},q="maharajaclub"===(null===H||void 0===H?void 0:H.utmSource)||"maharaja"===(null===H||void 0===H?void 0:H.utmSource),U=1===(null===N||void 0===N?void 0:N.chainId),[J,X]=(0,a.useState)({isOpen:!1,data:null}),[Q,Z]=(0,a.useState)({isOpen:!1,data:null}),[$,ee]=(0,a.useState)(!1),[oe,ne]=(0,a.useState)([]),[le,ie]=(0,a.useState)({isActive:!1,name:""}),[te,ae]=(0,a.useState)(null),de=(e=>{const o=new Map;return null===(e=y.selectedRooms)||void 0===e||e.forEach(e=>{var n;null===e||void 0===e||null===(n=e.promosApplied)||void 0===n||n.forEach(e=>{let{promo:n}=e;null===n||void 0===n||n.forEach(e=>{if(null===e||void 0===e||!e.id)return;if(null!==B&&void 0!==B&&B.id&&e.id===B.id)return;const n=(null===e||void 0===e?void 0:e.name)||"Promotion";o.set(n,(o.get(n)||0)+(e._reducedPrice||0))})})}),Array.from(o.entries()).map(e=>{let[o,n]=e;return{name:o,discount:n}})})(),re=sessionStorage.getItem("searchParams"),ce=z.A.get("lowestAmount");(0,a.useEffect)(()=>{var e;const o=JSON.parse(re||"null");var n;null!==o&&void 0!==o&&null!==(e=o.promotionSelected)&&void 0!==e&&e.isMembership&&ie({isActive:!0,name:null===o||void 0===o||null===(n=o.promotionSelected)||void 0===n?void 0:n.name});return()=>{ie({isActive:!1,name:""})}},[re]),(0,a.useEffect)(()=>{(async()=>{var e;if(null===ce||void 0===ce||!ce.lowestPrice)return ne([]);const o=await(0,F.uR)({hotelId:null===N||void 0===N?void 0:N.id,checkInDate:t()(null===T||void 0===T?void 0:T.startDate).format("YYYY-MM-DD"),checkOutDate:t()(null===T||void 0===T?void 0:T.endDate).format("YYYY-MM-DD")}),n=["_id","hotelId","hotelName","checkInDate","checkOutDate","isLowest","isActive","
1isExist","soldOut","officialExist","checkedDate","createdDt"],l=(null===o||void 0===o||null===(e=o.data)||void 0===e?void 0:e[0])||[];if(console.log(Object.keys(l)),!l.officialExist)return ne([]);if(ae(l.checkedDate),l["hotelzify.com"]||l["www.hotelzify.com"]||l.isLowest||l.officialExist){const e=Object.keys(l).filter(e=>!n.includes(e)).map(e=>l[e]>=(null===ce||void 0===ce?void 0:ce.lowestPrice)?{name:e,value:l[e]}:null).filter(Boolean).sort((e,o)=>o.value-e.value);ne(e)}})()},[]);let ue=0;const ve=C?parseFloat(A.amount||0):0,me=M&&!D?Math.max(0,y.appliedDiscount.discount>0?y.priceAfterDiscount+(null===y||void 0===y?void 0:y.totalAddonCost)+(null!==N&&void 0!==N&&N.isTaxIncluded?0:y.rpTax)+(null===(o=y.taxObj)||void 0===o?void 0:o.totalBookingTax):y.rpPrice+(null!==N&&void 0!==N&&N.isTaxIncluded?0:y.rpTax)+(null===(n=y.taxObj)||void 0===n?void 0:n.totalBookingTax)).toFixed(2):Math.max(0,b.totalPrice+Math.abs(b.totalTax+(null===(l=b.taxObj)||void 0===l?void 0:l.totalBookingTax))).toFixed(2),pe=M&&!D?y.appliedDiscount.discount>0?y.priceAfterDiscount:y.rpPrice:b.totalPrice,he=e=>{var o;if(e)return M&&y.appliedDiscount.discount-y.couponValue>0&&(e-=(y.appliedDiscount.discount-y.couponValue)*j),b.couponValue>0&&(e-=b.couponValue*j),y.couponValue>0&&(e-=y.couponValue*j),null===(o=Number(e))||void 0===o?void 0:o.toFixed(2)},ge=()=>{(0,V.fireGtmEvent)("checkout_see_photos",{selectedRooms:P}),X({isOpen:!0,data:P})};return(0,E.jsxs)("div",{className:He.flashSaleContainer,children:[(0,E.jsx)("div",{className:He.flashSaleContent,children:(0,E.jsxs)("div",{className:He.bookingActionsBox,children:[(0,E.jsx)("span",{onClick:()=>((0,V.fireGtmEvent)("checkout_modify_booking",{selectedRooms:P}),void Z({isOpen:!0,data:P})),children:"Modify Booking"}),(0,E.jsx)("div",{}),(0,E.jsx)("span",{onClick:()=>ge(),children:"See Photos"})]})}),(0,E.jsx)("div",{className:He.checkinContainer,children:(0,E.jsxs)("div",{className:He.checkInContent,children:[(0,E.jsx)("div",{className:He.flashSaleBanner,children:(0,E.jsx)("span",{className:He.flashSaleTitle,children:(0,Ge.t)("bill_details")})}),null===(i=y.selectedRooms)||void 0===i?void 0:i.map(e=>{var o,n,l,i,t,a,d,r;let s=0,c=0;return y.selectedRooms.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)&&(null===o||void 0===o?void 0:o.idx)===(null===e||void 0===e?void 0:e.idx)).forEach(e=>{s+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),z.A.set("tax",parseFloat(ue.toFixed((0,K.S2)(null===N||void 0===N?void 0:N.currency)))),D&&(ue=0,c=0),s+=c,(0,E.jsxs)("div",{className:He.roomBox,children:[(null===e||void 0===e||null===(o=e.room)||void 0===o||null===(n=o.RoomImages)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.cdnImageUrl)&&(0,E.jsx)("img",{src:"".concat(e.room.RoomImages[0].cdnImageUrl,"?tr=w-104,h-104,ar-1-1,fo-auto,q-80"),alt:null===e||void 0===e||null===(i=e.room)||void 0===i?void 0:i.roomName,className:He.roomThumbnail,loading:"lazy",onClick:ge,style:{cursor:"pointer"}}),(0,E.jsxs)("div",{className:He.roomDetailContainer,children:[(0,E.jsx)("h3",{onClick:ge,style:{cursor:"pointer"},children:null===e||void 0===e||null===(t=e.room)||void 0===t?void 0:t.roomName}),(null===e||void 0===e||null===(a=e.rpObject)||void 0===a?void 0:a.name)&&(0,E.jsx)("span",{className:!(null!==e&&void 0!==e&&null!==(d=e.rpObject)&&void 0!==d&&d.name)&&"displayNone",children:null===e||void 0===e||null===(r=e.rpObject)||void 0===r?void 0:r.name}),(0,E.jsx)("span",{children:[(null===e||void 0===e?void 0:e.sAdult)>0?"".concat(e.sAdult," ").concat((0,K.g3)(e.sAdult,(0,Ge.t)("Adult"))):null,(null===e||void 0===e?void 0:e.sChild)>0?"".concat(e.sChild," ").concat((0,K.g3)(e.sChild,(0,Ge.t)("Child"))):null,(null===e||void 0===e?void 0:e.sInfant)>0?"".concat(e.sInfant," ").concat((0,K.g3)(e.sInfant,(0,Ge.t)("Infant"))):null].filter(Boolean).join(", ")})]}),(0,E.jsx)("div",{children:(0,E.jsx)("div",{children:(0,E.jsx)("span",{className:He.roomItemPrice,children:(0,E.jsx)(W.A,{amount:s*k})})})})]},null===e||void 0===e?void 0:e.id)}),null===(d=(0,K.m9)(b.roomObjects))||void 0===d?void 0:d.map(e=>{var o,n,l,i,t,a,d,r,s,c;let u=!1;null!==e&&void 0!==e&&null!==(o=e.HotelRoomAmenities)&&void 0!==o&&o.some(e=>{var o,n;return"Bunk Beds"===(null===e||void 0===e||null===(o=e.Amenity)||void 0===o?void 0:o.name)&&"bed_type"===(null===e||void 0===e||null===(n=e.Amenity)||void 0===n?void 0:n.category)})&&(u=!0);let v=null===(n=b.roomObjects)||void 0===n||null===(l=n.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===l?void 0:l.length,m=S,p=0,h=0;return b.roomObjects.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)).forEac
1h(e=>{p+=(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant),h+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),z.A.set("tax",parseFloat(ue.toFixed((0,K.S2)(null===N||void 0===N?void 0:N.currency)))),("INR"!==(null===N||void 0===N?void 0:N.currency)||D||null!==P&&void 0!==P&&P.some(e=>K.hm.includes(null===e||void 0===e?void 0:e.id)))&&(ue=0),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:He.roomBox,children:[(null===e||void 0===e||null===(i=e.RoomImages)||void 0===i||null===(t=i[0])||void 0===t?void 0:t.cdnImageUrl)&&(0,E.jsx)("img",{src:"".concat(e.RoomImages[0].cdnImageUrl,"?tr=w-104,h-104,ar-1-1,fo-auto,q-80"),alt:null===e||void 0===e?void 0:e.roomName,className:He.roomThumbnail,loading:"lazy",onClick:ge,style:{cursor:"pointer"}}),(0,E.jsxs)("div",{className:He.roomDetailContainer,children:[(0,E.jsx)("h3",{onClick:ge,style:{cursor:"pointer"},children:null===e||void 0===e?void 0:e.roomName}),(null===e||void 0===e||null===(a=e.rpObject)||void 0===a?void 0:a.name)&&(0,E.jsx)("span",{className:!(null!==e&&void 0!==e&&null!==(d=e.rpObject)&&void 0!==d&&d.name)&&"displayNone",children:null===e||void 0===e||null===(r=e.rpObject)||void 0===r?void 0:r.name}),M?(0,E.jsx)("span",{children:[(null===e||void 0===e?void 0:e.sAdult)>0?"".concat(e.sAdult," ").concat((0,K.g3)(e.sAdult,(0,Ge.t)("Adult"))):null,(null===e||void 0===e?void 0:e.sChild)>0?"".concat(e.sChild," ").concat((0,K.g3)(e.sChild,(0,Ge.t)("Child"))):null,(null===e||void 0===e?void 0:e.sInfant)>0?"".concat(e.sInfant," ").concat((0,K.g3)(e.sInfant,(0,Ge.t)("Infant"))):null].filter(Boolean).join(", ")}):(0,E.jsxs)("p",{children:[v," ",u?(0,Ge.t)("bed"):(0,Ge.t)("room")," x"," ","".concat(m," ").concat((0,Ge.t)("night"))," (",p," ",p>1?(0,Ge.t)("guests"):(0,Ge.t)("guest"),")"]})]}),(0,E.jsx)("div",{children:(0,E.jsx)("span",{className:He.roomItemPrice,children:(0,E.jsx)(W.A,{amount:h*k})})})]},null===e||void 0===e?void 0:e.id),null===(s=[...new Set(I)])||void 0===s||null===(c=s.filter(o=>{var n;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"person"!==(null===o||void 0===o||null===(n=o.Addon)||void 0===n?void 0:n.category)}))||void 0===c?void 0:c.map(e=>{var o,n;let l=null===I||void 0===I||null===(o=I.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===o?void 0:o.length;return(0,E.jsx)("div",{className:He.addonContainer,children:(0,E.jsxs)("div",{className:He.roomDetailContainer,children:[(0,E.jsx)("h3",{children:(0,Ge.t)("addons")}),(0,E.jsxs)("div",{className:He.roomBox,children:[(0,E.jsx)("div",{className:He.roomDetailContainer,children:(0,E.jsxs)("span",{className:He.addonLabel,children:[l," x ",null===e||void 0===e||null===(n=e.Addon)||void 0===n?void 0:n.name," x ",m," ",(0,Ge.t)("night")]})}),(0,E.jsx)("span",{className:He.roomItemPrice,children:(0,E.jsx)(W.A,{amount:(null===e||void 0===e?void 0:e.price)*m*l*k})})]})]})},null===e||void 0===e?void 0:e.id)})]})}),(null===w||void 0===w?void 0:w.length)>0&&(0,E.jsx)("div",{className:He.roomDetailContainer,children:(0,E.jsx)("h3",{children:(0,Ge.t)("addons")})}),null===(r=[...new Set(w)])||void 0===r?void 0:r.map(e=>{var o;let n=null===w||void 0===w||null===(o=w.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===o?void 0:o.length;return"per_day"===e.Addon.multiplier?(0,E.jsxs)("div",{className:He.roomBox,children:[(0,E.jsx)("div",{className:He.roomDetailContainer,children:(0,E.jsx)("span",{className:He.addonLabel,children:"".concat(null===e||void 0===e?void 0:e.name," (x ").concat(n,")")})},null===e||void 0===e?void 0:e.id),(0,E.jsx)("span",{className:He.roomItemPrice,children:(0,E.jsx)(W.A,{amount:Number((null===e||void 0===e?void 0:e.price)*n*S*j)})})]}):(0,E.jsxs)("div",{className:He.roomBox,children:[(0,E.jsx)("div",{className:He.roomDetailContainer,children:(0,E.jsx)("span",{className:He.addonLabel,children:"".concat(null===e||void 0===e?void 0:e.name," (x ").concat(n,")")})},null===e||void 0===e?void 0:e.id),(0,E.jsx)("span",{className:He.roomItemPrice,children:(0,E.jsx)(W.A,{amount:Number((null===e||void 0===e?void 0:e.price)*n*j)})})]})}),(0,E.jsxs)("div",{className:He.amountContainer,children:[(0,E.jsxs)("div",{className:He.rightBottomContainer,children:[b.appliedDiscount.discount-b.couponValue>0&&(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("div",{style:{display:"block"},children:[(0,E.jsx)("span",{style:{color:"var(--green)"},children:K.GS.includes(null===N||void 0===N?void 0:N.id)&&"bulk"!==(null===G||void 0===G?void 0:G.type)?"code MOUNT applied":"Promotion Applied"}),le.isActive&&(0,E.jsx)("p",{children:null===le||void 0===le?void 0:le.name})]}),(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,E.jsx)(W.A,{amount:(b.appliedDiscount.discount-b.couponValue)*j})]})]}),M&&de.length>0&&de.map(e=>{let{name:o,discount:n}=e;return(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("span",{style:{color:"var(--green)"},children:[o," Applied"]}),(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,E.jsx)(W.A,{amount:Number(n*j)})]})]},o)}),M&&0===de.length&&y.appliedDiscount.discount-y.couponValue>0&&(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("div",{style:{display:"block"},children:[(0,E.jsx)("span",{style:{color:"var(--green)"},children:K.GS.includes(null===N||void 0===N?void 0:N.id)?"code MOUNT applied":"Promotion Applied"}),le.isActive&&(0,E.jsx)("p",{children:null===le||void 0===le?void 0:le.name})]}),(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,E.jsx)(W.A,{amount:Number((y.appliedDiscount.discount-y.couponValue)*j)})]})]}),b.couponValue>0&&(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["`","".concat(R),"` Applied"]}),(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,E.jsx)(W.A,{amount:Number(b.couponValue*j)})]})]}
1),y.couponValue>0&&(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["`","".concat(R),"` Applied"]}),(0,E.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,E.jsx)(W.A,{amount:Number(y.couponValue*j)})]})]}),C&&ve>0&&(0,E.jsxs)("div",{className:He.discountContainer,children:[(0,E.jsxs)("span",{style:{color:"var(--green)",display:"flex",alignItems:"center",gap:"6px"},children:[(0,E.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("rect",{x:"3",y:"8",width:"18",height:"12",rx:"2",ry:"2"}),(0,E.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"20"}),(0,E.jsx)("path",{d:"M19 8c-1.5-1.5-3.5-1.5-5-1.5s-2.5 1-2 2.5h7z"}),(0,E.jsx)("path",{d:"M5 8c1.5-1.5 3.5-1.5 5-1.5s2.5 1 2 2.5H5z"})]}),"Gift Card (****",null===(s=A.cardNumber)||void 0===s?void 0:s.slice(-4),")"]}),(0,E.jsx)("span",{style:{color:"var(--green)"},children:(0,E.jsx)(W.A,{amount:ve})})]})]}),(0,E.jsxs)("div",{style:{borderBottom:"1px dashed #D7D2D2",display:"flex",flexDirection:"column"},className:He.priceTaxBox,children:[(0,E.jsxs)("div",{className:He.amountBox,children:[(0,E.jsx)("span",{children:"Price"}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:Number(he(M&&!D?null===(c=(Number(y.totalRoomCost)+Number(y.appliedDiscount.discount))*j+Number(null!==(u=null===y||void 0===y?void 0:y.totalAddonCost)&&void 0!==u?u:0))||void 0===c?void 0:c.toFixed(2):null===(v=(b.roomPriceNoDisc+b.totalFoodPrice+(null!==N&&void 0!==N&&N.isTaxIncluded?b.totalTax:0))*j+Number(null!==(m=null===y||void 0===y?void 0:y.totalAddonCost)&&void 0!==m?m:0))||void 0===v?void 0:v.toFixed(2)))})})]}),y.rpTax>0&&(0,E.jsxs)("div",{className:He.amountBox,children:[(0,E.jsx)("span",{children:(0,Ge.t)("taxes")}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:Number(y.rpTax)})})]}),Math.abs(b.totalTax)>0&&(0,E.jsxs)("div",{className:He.amountBox,children:[(0,E.jsx)("span",{children:(0,Ge.t)("taxes")}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:Number(Math.abs(b.totalTax))})})]}),null===(h=y.taxObj)||void 0===h||null===(g=h.taxes)||void 0===g?void 0:g.map((e,o)=>(null===e||void 0===e?void 0:e.totalTax)>0&&"booking"===(null===e||void 0===e?void 0:e.level)&&(0,E.jsxs)("div",{className:He.amountBox,children:[(0,E.jsx)("span",{children:null===e||void 0===e?void 0:e.name}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:Number(null===e||void 0===e?void 0:e.totalTax)})})]},"tax-".concat(o))),null===(_=b.taxObj)||void 0===_||null===(x=_.taxes)||void 0===x?void 0:x.map((e,o)=>(null===e||void 0===e?void 0:e.totalTax)>0&&"booking"===(null===e||void 0===e?void 0:e.level)&&(0,E.jsxs)("div",{className:He.amountBox,children:[(0,E.jsx)("span",{children:null===e||void 0===e?void 0:e.name}),(0,E.jsxs)("span",{children:["+ ",(0,E.jsx)(W.A,{amount:Number((null===e||void 0===e?void 0:e.totalTax)*j)})]})]},"old-tax-".concat(o)))]}),(0,E.jsx)("div",{className:He.totalAmountBox,children:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"20px"},children:[(0,Ge.t)("final_price")," "]}),(0,E.jsx)(W.A,{amount:Number(me)})]})}),O&&Y&&Y!==O&&(0,E.jsxs)("p",{style:{fontSize:"11px",color:"#888",margin:"6px 0 0",textAlign:"right"},children:["* Payment will be in ",O," (",(0,L.Gl)(O),")"]})]}),(null===oe||void 0===oe?void 0:oe.length)>1&&(null===ce||void 0===ce?void 0:ce.lowestPrice)&&(0,E.jsx)("div",{className:He.lowestPriceBox,children:(0,E.jsxs)("div",{className:He.lowestPriceGuranteeBox,onMouseEnter:()=>{ee(!0),(0,V.fireGtmEvent)("checkout_lowest_price_viewed",{lowestPrices:oe})},onMouseLeave:()=>ee(!1),children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/lowest_price.svg",alt:"lowest_price_gurantee"}),(0,E.jsx)("span",{children:"Lowest Price Guarantee"}),$&&(0,E.jsxs)("div",{className:He.lowestPriceItems,children:[(0,E.jsx)("div",{className:He.lowestPriceOtaBox,children:null===oe||void 0===oe||null===(f=oe.filter(e=>"hotelzify.com"!==(null===e||void 0===e?void 0:e.name)&&"www.hotelzify.com"!==(null===e||void 0===e?void 0:e.name)))||void 0===f?void 0:f.map(e=>(0,E.jsxs)("div",{className:He.otaPriceBox,children:[(0,E.jsx)("p",{children:null===e||void 0===e?void 0:e.name}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:null===e||void 0===e?void 0:e.value})})]}))}),(0,E.jsxs)("div",{className:He.lowestPriceOfficial,children:[(0,E.jsxs)("div",{className:He.lowestPriceOfficialNameBox,children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/official_blue_logo.svg",alt:"lowest_price"}),(0,E.jsx)("p",{children:"Official Website"})]}),(0,E.jsx)("span",{children:(0,E.jsx)(W.A,{amount:null===ce||void 0===ce?void 0:ce.lowestPrice})})]}),(null===ce||void 0===ce?void 0:ce.adultCount)&&(0,E.jsxs)("p",{style:{padding:"2px",color:"gray",fontSize:"12px",display:"flex",gap:"2px",justifyContent:"space-between",whiteSpace:"normal",wordBreak:"break-word"},children:["Price for ",null===ce||void 0===ce?void 0:ce.adultCount," ",(null===ce||void 0===ce?void 0:ce.adultCount)>1?"adults":"adult"," for room:"," ",null===ce||void 0===ce?void 0:ce.roomName]}),(0,E.jsx)("p",{style:{padding:"2px",color:"gray",fontSize:"12px",display:"flex",gap:"2px",justifyContent:"space-between"},children:(0,E.jsx)("span",{style:{textDecoration:"none"},children:(()=>{const e=t()(),o=t()(te);return e.diff(o,"days")>2?"Last updated : Yesterday":"Last updated : ".concat(o.format("DD MMM YYYY"))})()})})]})]})}),(0,E.jsxs)("div",{className:He.promoContainer,children:[(0,E.jsx)("p",{className:He.promoTitle,children:"Have a promo code?"}),(0,E.jsx)(se,{totalPrice:me})]}),U&&q?(0,E.jsxs)("div",{className:He.promoContainer,children:[(0,E.jsx)("p",{className:He.promoTitle,style:{lineHeight:0},children:(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/Maharaja Club_AI_RGB_Positive.svg",alt:"Maharaja Club",style:{height:"65px",width:"auto"}})}),(0,E.jsx)(Ue,{totalPrice:pe,hotelId:null===N||void 0===N?void 0:N.id})]}):null]})}),(null===J||void 0===J?void 0:J.isOpen)&&(0,E.jsx)(ro,{closeModal:()=>X({isOpen:!1,data:null}),priceCalculator:y,oldPriceCalculator:b}),(null===Q||void 0===Q?void 0:Q.isOpen)&&(0,E.jsx)(Yo,{closeModal:()=>Z({isOpen:!1,data:null}),priceCalculator:y,oldPriceCalculator:b})]})};var Go=n(575);const Ho="Addons_addonBox__vSTXq",Lo="Addons_addonHeaderContainer__JxPfz",Wo="Addons_headerRight__eJdA3",Vo="Addons_externalNavigation__2bV
1Iq",qo="Addons_externalNavButton__dt+NK",Uo="Addons_carouselContainer__tOs+s",Jo="Addons_cardWrapper__J9fui",Ko="Addons_addonRowBox__h14zn",Xo=e=>{let{HotelAddons:o=[]}=e;const n=(0,a.useRef)(null);if((0,a.useEffect)(()=>{(null===o||void 0===o?void 0:o.length)>0&&(0,V.fireGtmEvent)("addon_section_viewed",{addon_count:o.length,addon_names:o.map(e=>(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.title)||"").filter(Boolean)})},[o]),null===o||void 0===o||!o.length)return null;return(0,E.jsxs)("div",{className:Ho,children:[(0,E.jsxs)("div",{className:Lo,children:[(0,E.jsx)("h2",{children:"Add-Ons"}),(0,E.jsxs)("div",{className:Wo,children:[(0,E.jsx)("p",{children:"*Prices include all taxes"}),(null===o||void 0===o?void 0:o.length)>3&&(0,E.jsx)("div",{className:Vo,children:(0,E.jsx)("button",{onClick:()=>{n.current&&n.current.scrollNext(),(0,V.fireGtmEvent)("addons_moved_right")},className:qo,"aria-label":"Next slides",children:(0,E.jsx)(ye.A,{size:20})})})]})]}),(0,E.jsx)("div",{className:Uo,children:(null===o||void 0===o?void 0:o.length)>0?(0,E.jsx)(be,{ref:n,slidesToShow:3,spacing:11,loop:!0,showArrows:!1,navPosition:"outside",navStyle:"rounded",smallScreenSlidesToShow:2,mediumScreenSlidesToShow:3,smallScreenSpacing:20,children:null===o||void 0===o?void 0:o.map((e,o)=>(0,E.jsx)("div",{className:Jo,children:(0,E.jsx)(Ee,{addon:e})},o))}):(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("div",{className:Ko,children:null===o||void 0===o?void 0:o.map((e,o)=>(0,E.jsx)("div",{className:Jo,children:(0,E.jsx)(Ee,{addon:e})},o))})})})]})};var Qo=n(9265);const Zo="CustomMessageDisplay_container__5BTDS",$o="CustomMessageDisplay_wrapper__NSoQ6",en="CustomMessageDisplay_globalHeader__ztC1v",on="CustomMessageDisplay_heading__qka96",nn="CustomMessageDisplay_subheading__EGUoV",ln="CustomMessageDisplay_messageCard__rrcGV",tn="CustomMessageDisplay_firstCard__60MeU",an="CustomMessageDisplay_cardContent__G3GOW",dn="CustomMessageDisplay_leftSection__8zS5g",rn="CustomMessageDisplay_badge__20oxC",sn="CustomMessageDisplay_title__-o3MM",cn="CustomMessageDisplay_description__Lthw0",un="CustomMessageDisplay_knowMore__6db-s",vn="CustomMessageDisplay_rightSection__t8BWf",mn="CustomMessageDisplay_priceGroup__Cida5",pn="CustomMessageDisplay_price__AjS7S",hn="CustomMessageDisplay_priceSubtext__p8dIv",gn="CustomMessageDisplay_taxInfo__3Y612",_n="CustomMessageDisplay_expandedContent__Ej7rv",xn="CustomMessageDisplay_fullContent__3tZuX",fn="CustomMessageDisplay_details__j-c9l",yn="CustomMessageDisplay_detailItem__5oDDW",bn="CustomMessageDisplay_detailLabel__M2qVN",jn="CustomMessageDisplay_detailValue__T0cGK",kn=e=>{let{messages:o,childCount:n}=e;const[i,t]=(0,a.useState)({}),d=(0,p.d4)(e=>e.hotelInfo);if(!o||0===o.length)return null;const r=o;if(0===r.length)return null;return(0,E.jsx)("div",{className:Zo,children:(0,E.jsxs)("div",{className:$o,children:[(0,E.jsxs)("div",{className:en,children:[(0,E.jsx)("h3",{className:on,children:"Important information"}),(0,E.jsx)("p",{className:nn,children:"Extra charges to be paid directly at the hotel"})]}),r.map((e,o)=>{var a,r,s,c,u,v,m,p,h,g,_,x,f,y,b,j,k,C,A,N,P,I,S,w,D,M,R,B,T;const O=(e=>{if(!e)return null;if(e.price_amount&&e.price_amount>0)return e.price_amount;const o=e.price_per_adult||0,n=e.price_per_child||0;return o>0?o:n})(e.config),Y=i[e.id];return(0,E.jsxs)("div",{className:"".concat(ln," ").concat(0===o?tn:""),children:[(0,E.jsxs)("div",{className:an,children:[(0,E.jsxs)("div",{className:dn,children:[(0,E.jsx)("span",{className:rn,children:"mandatory"===e.type?"MANDATORY CHARGES":"OPTIONAL"}),(0,E.jsx)("h4",{className:sn,children:e.title}),(null===(a=e.config)||void 0===a?void 0:a.content)&&(0,E.jsxs)("div",{className:cn,children:[(null===(r=e.config)||void 0===r?void 0:r.price_applicable_for)&&(0,E.jsx)("span",{children:"Charges for "}),(0,E.jsx)("span",{children:(null===(s=e.config)||void 0===s?void 0:s.occasion)||(null===(c=e.config)||void 0===c?void 0:c.meal_service_type)||"special service"}),(0,E.jsx)("button",{className:un,onClick:()=>((e,o)=>{const n=!i[e];(0,V.fireGtmEvent)("custom_message_toggle",{action:n?"expand":"collapse",message_id:e,message_title:o}),t(o=>(0,l.A)((0,l.A)({},o),{},{[e]:!o[e]}))})(e.id,e.title),children:Y?"Show less":"Know more"})]})]}),O>0&&(0,E.jsxs)("div",{className:vn,children:[null!==(u=e.config)&&void 0!==u&&null!==(v=u.price_applicable_for)&&void 0!==v&&v.includes("person")&&(null===(m=e.config)||void 0===m?void 0:m.price_per_adult)>0&&(null===(p=e.config)||void 0===p?void 0:p.price_per_child)>0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:mn,children:[(0,E.jsxs)("div",{className:pn,
1children:[(0,L.Gl)(null!==(h=null===d||void 0===d||null===(g=d.hotelData)||void 0===g?void 0:g.currency)&&void 0!==h?h:"INR")," ",e.config.price_per_adult]}),(0,E.jsx)("div",{className:hn,children:"Per adult"})]}),n>0&&(0,E.jsxs)("div",{className:mn,children:[(0,E.jsxs)("div",{className:pn,children:[(0,L.Gl)(null!==(_=null===d||void 0===d||null===(x=d.hotelData)||void 0===x?void 0:x.currency)&&void 0!==_?_:"INR")," ",e.config.price_per_child]}),(0,E.jsx)("div",{className:hn,children:"Per child"})]})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:pn,children:[" ",(0,L.Gl)(null!==(f=null===d||void 0===d||null===(y=d.hotelData)||void 0===y?void 0:y.currency)&&void 0!==f?f:"INR")," ",O]}),(0,E.jsx)("div",{className:hn,children:null!==(b=e.config)&&void 0!==b&&b.price_applicable_for?"".concat(e.config.price_applicable_for.replace("per_","Per ").replace("_"," ")):"Per person"})]}),void 0!==(null===(j=e.config)||void 0===j?void 0:j.is_tax_inclusive)&&(0,E.jsx)("div",{className:gn,children:e.config.is_tax_inclusive?"Tax inclusive":"Tax exclusive"})]})]}),Y&&(0,E.jsxs)("div",{className:_n,children:[(0,E.jsx)("p",{className:xn,style:{whiteSpace:"pre-line"},children:null===(k=e.config)||void 0===k?void 0:k.content}),((null===(C=e.config)||void 0===C?void 0:C.occasion)||(null===(A=e.config)||void 0===A?void 0:A.meal_service_type)||(null===(N=e.config)||void 0===N||null===(P=N.cuisine_options)||void 0===P?void 0:P.length)>0||(null===(I=e.config)||void 0===I?void 0:I.drinks_served))&&(0,E.jsxs)("div",{className:fn,children:[(null===(S=e.config)||void 0===S?void 0:S.occasion)&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Occasion:"}),(0,E.jsx)("span",{className:jn,children:e.config.occasion})]}),(null===(w=e.config)||void 0===w?void 0:w.meal_service_type)&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Service Type:"}),(0,E.jsx)("span",{className:jn,children:e.config.meal_service_type})]}),(null===(D=e.config)||void 0===D?void 0:D.cuisine_options)&&e.config.cuisine_options.length>0&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Cuisine:"}),(0,E.jsx)("span",{className:jn,children:e.config.cuisine_options.join(", ")})]}),(null===(M=e.config)||void 0===M?void 0:M.drinks_served)&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Drinks:"}),(0,E.jsx)("span",{className:jn,children:"alcoholic"===e.config.drinks_served?"Alcoholic":"non_alcoholic"===e.config.drinks_served?"Non-Alcoholic":"Alcoholic and Non-Alcoholic"})]}),(null===(R=e.config)||void 0===R?void 0:R.price_per_child)>0&&(null===(B=e.config)||void 0===B?void 0:B.price_per_adult)>0&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Child Price:"}),(0,E.jsx)("span",{className:jn,children:e.config.price_per_child})]}),(null===(T=e.config)||void 0===T?void 0:T.price_applicable_for)&&"string"===typeof e.config.price_applicable_for&&(0,E.jsxs)("div",{className:yn,children:[(0,E.jsx)("span",{className:bn,children:"Pricing:"}),(0,E.jsx)("span",{className:jn,children:e.config.price_applicable_for.replace("per_","").replace("_"," ")})]})]})]})]},e.id)})]})})};var Cn=n(7070),An=n(3025),Nn=n(6804),Pn=n(896);const In="https://ik.imagekit.io/hotelzifyprod/assets/svg/Gift.svg",Sn="https://ik.imagekit.io/hotelzifyprod/assets/images/ppimg.svg",wn="https://ik.imagekit.io/hotelzifyprod/assets/images/tickselect.svg";t().extend(pe());const Dn=(0,h.withRouter)(e=>{var o,n,i,d,r,s,g,f,y,b,j,k,C,A,N,P;const I=(0,p.wA)(),{hotelData:S,selectedRooms:w,selectedRatePlans:D,fetching:M,selectedAddons:R,totalPeople:B,dateRange:ee,dateCount:oe,selectedHotelAddons:le,policies:ie,totalAdult:te,totalChild:ae,isHourlyRoom:de,isRatePlans:re,hourlyTime:se,hourlyDate:me,hourlyHour:pe,roomSlots:he,couponName:ge,paymentProvider:_e,bnplConfig:xe,couponCode:fe,bookingEngineConfig:ye,isReturningMember:be,selectedPaymentOffer:je,maharajaId:ke,gstin:Ce}=(0,p.d4)(e=>e.hotelInfo),{id:Ae,HotelAddons:Ne}=S,Pe=[1,76].includes(null===S||void 0===S?void 0:S.chainId),Ie=z.A.get("utmObj")||{},Se="maharajaclub"===(null===Ie||void 0===Ie?void 0:Ie.utmSource)||"maharaja"===(null===Ie||void 0===Ie?void 0:Ie.utmSource),we=1===(null===S||void 0===S?void 0:S.chainId)&&Se,{width:De}=(0,J.A)(),Me=(0,h.useHistory)(),Re=(0,Z.A)(),Be=(0,Q.Ay)(),Ee=Be.selectedRooms.map(e=>(0,l.A)((0,l.A)({},e),null===e||void 0===e?void 0:e.room)),Te=(0,a.useRef)(),Oe=(0,a.useRef)(),Ge=(0,a.useRef)(null);Ge.current||(Ge.current=function(){let e,o,n=!1;return{run(l){let{background:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i?n?Promise.resolve():e||(e=Promise.resolve().then(l).finally(()=>{e=void 0}),e):(n=!0,o||(o=Promise.resolve(e).catch(()=>{}).then(l).finally(()=>{o=void 0}),o))}}}());console.log("test");let He=z.A.get("subscribed")||!1,Le=1,We=!0;z.A.get("source");Le=1;He=!1,We=!1;
1const[Ve,qe]=(0,a.useState)(),[Ue,Je]=(0,a.useState)(),[Ke,Xe]=(0,a.useState)(),[Qe,Ze]=(0,a.useState)(""),[$e,eo]=(0,a.useState)("Male"),[oo,no]=(0,a.useState)(""),[lo,io]=(0,a.useState)(""),[to,ao]=(0,a.useState)([]),[ro,so]=(0,a.useState)(""),[co,uo]=(0,a.useState)(""),[vo,mo]=(0,a.useState)(""),[po,ho]=(0,a.useState)(),[go,_o]=(0,a.useState)(),[xo,fo]=(0,a.useState)(),[yo,bo]=(0,a.useState)(),[jo,ko]=(0,a.useState)(null),[Co,Ao]=(0,a.useState)(!1),[No,Po]=(0,a.useState)(),[Io,So]=(0,a.useState)(!1),[wo,Do]=(0,a.useState)(0),[Mo,Ro]=(0,a.useState)(!1),[Bo,Eo]=(0,a.useState)(!1),[To,Oo]=(0,a.useState)(""),[Yo,Fo]=(0,a.useState)(),[Ho,Lo]=(0,a.useState)(!1),[Wo,Vo]=(0,a.useState)(!1),[qo,Uo]=(0,a.useState)(!1),[Jo,Ko]=(0,a.useState)(!1),[Zo,$o]=(0,a.useState)(),[en,on]=(0,a.useState)("12:00 PM"),[nn,ln]=(0,a.useState)(!1),tn=(0,m.N)(null===S||void 0===S?void 0:S.country),[an,dn]=(0,a.useState)(!1),[rn,sn]=(0,a.useState)(),[cn,un]=(0,a.useState)(!1),[vn,mn]=(0,a.useState)(!1),[pn,hn]=(0,a.useState)(!1),[gn,_n]=(0,a.useState)(!1),[xn,fn]=(0,a.useState)(!1),[yn,bn]=(0,a.useState)(!1),[jn,Dn]=(0,a.useState)(!1),[Mn,Rn]=(0,a.useState)({}),[Bn,En]=(0,a.useState)(!1),[Tn]=(0,a.useState)(null),[On,Yn]=(0,a.useState)(!1),[Fn,zn]=(0,a.useState)("rzp_live_1V5wz8nlIYcRkn"),[Gn,Hn]=(0,a.useState)(),[Ln,Wn]=(0,a.useState)(),[Vn,qn]=(0,a.useState)(""),[Un,Jn]=(0,a.useState)(!1),[Kn,Xn]=(0,a.useState)({}),[Qn,Zn]=(0,a.useState)(!1),[$n,el]=(0,a.useState)(!1),[ol,nl]=(0,a.useState)(!1),[ll,il]=(0,a.useState)({}),[tl,al]=(0,a.useState)(!0),[dl,rl]=(0,a.useState)(!1),[sl,cl]=(0,a.useState)([]),[ul,vl]=(0,a.useState)(1),[ml,pl]=(0,a.useState)({cardNumber:"",amount:""}),[hl,gl]=(0,a.useState)(""),[_l,xl]=(0,a.useState)(!1),[fl,yl]=(0,a.useState)(""),[bl,jl]=(0,a.useState)(!1),[kl,Cl]=(0,a.useState)(""),[Al,Nl]=(0,a.useState)(null),[Pl,Il]=(0,a.useState)(!1),[Sl,wl]=(0,a.useState)(!1),[Dl,Ml]=(0,a.useState)(""),[Rl,Bl]=(0,a.useState)(!1),El=z.A.get("testId")||0,{t:Tl,i18n:Ol}=(0,x.Bd)();let Yl=(0,a.useRef)();const Fl=(0,a.useRef)(),zl=(0,a.useRef)(),Gl=(0,a.useRef)(),Hl=((0,a.useRef)(),(0,a.useRef)(),(0,a.useRef)(),(0,a.useRef)(),(0,a.useRef)(null));let Ll=z.A.get("discount");const Wl=z.A.get("promo")||{};let Vl=0;"late"!==(null===Wl||void 0===Wl?void 0:Wl.type)&&"early"!==(null===Wl||void 0===Wl?void 0:Wl.type)||(Vl=z.A.get("discountedValue"),Ll=Ue-Vl);const ql=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const o=document.getElementById("rzp");o&&o.remove();const n=document.createElement("script");n.src="https://checkout.razorpay.com/v1/checkout.js",n.async=!0,n.id="rzp",n.onerror=o=>{const n=e+1;if(console.error("Razorpay script load failed (attempt ".concat(n,"/").concat(4,")"),o),(0,U.FA)("payment_script_load_retry",{attempt:n,maxAttempts:4,gateway:"razorpay",bookingId:z.A.get("bookingId"),errorMessage:(null===o||void 0===o?void 0:o.message)||String(o),errorType:null===o||void 0===o?void 0:o.type},e<3?"high":"critical"),e<3)setTimeout(()=>ql(e+1),2e3);else{const e=z.A.get("bookingId"),o=z.A.get("bookingObj")||{};(0,U.Zo)(e,null===o||void 0===o?void 0:o.totalAmount),_().error("Payment system failed to load. Please refresh the page."),(0,V.fireGtmEvent)("razorpay_script_load_failed",{bookingId:e,amount:null===o||void 0===o?void 0:o.totalAmount}),bn(!1)}},document.body.appendChild(n)},Ul=e=>{mo(e),"Razorpay"!==e&&"PartialPayment"!==e&&I({type:Y.A.SET_PAYMENT_METHOD_OFFER,payload:null}),(0,V.fireGtmEvent)("checkout_payment_selected",{selectedPaymentOption:e});const o=re&&!de?Be.selectedRooms:Re.roomObjects||w;if(o&&o.length>0){const n=o.map(e=>"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Ae)),l=o.map(e=>({id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Ae),quantity:1})),i=re&&!de?Be.appliedDiscount.discount>0?Be.priceAfterDiscount:Be.rpPrice:Re.totalPrice,a={content_ids:n,content_type:"hotel_room",value:parseFloat(i),currency:(null===S||void 0===S?void 0:S.currency)||"INR",contents:l,num_items:o.length,checkin_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),checkout_date:t()(null===ee||void 0===ee?void 0:ee.endD
1ate).format("YYYY-MM-DD"),payment_method:e};(0,V.newFBEvents)("AddPaymentInfo",a)}},Jl="PartialPayment"===vo?Ue*((null===yo||void 0===yo||null===(o=yo.config)||void 0===o?void 0:o.minPercentage)||100)/100:Ue||0,Kl=Sl&&parseFloat(ml.amount||0)>=Math.round(Jl),Xl=Sl?parseFloat(ml.amount||0):0;(0,a.useEffect)(()=>{const e=document.createElement("script");return e.src="https://cdn.paidyet.com/paynowv3.js",e.async=!0,e.onload=()=>fn(!0),document.body.appendChild(e),()=>document.body.removeChild(e)},[]),(0,a.useEffect)(()=>{null!==S&&void 0!==S&&S.chainId&&(0,K.T3)(S.chainId)},[null===S||void 0===S?void 0:S.chainId]),(0,a.useEffect)(()=>{window.scrollTo({top:0,behavior:"instant"})},[]),(0,a.useEffect)(()=>{I((0,O.X$)(Ae))},[]);const Ql=async e=>{if(!e)return al(!1),{ok:!1,data:null};al(!0),rl(!1);try{var o,n,l;const i=await(0,F.yD)({hotelId:e});return(0,V.fireGtmEvent)("cod_payment_provider_check",{hotelId:e,responseStatus:null===i||void 0===i?void 0:i.status,vendor:null===i||void 0===i||null===(o=i.data)||void 0===o?void 0:o.vendor,superVendor:null===i||void 0===i||null===(n=i.data)||void 0===n?void 0:n.superVendor,isPciEnabled:"pcibooking"===(null===i||void 0===i||null===(l=i.data)||void 0===l?void 0:l.vendor),success:200===(null===i||void 0===i?void 0:i.status)}),200===(null===i||void 0===i?void 0:i.status)?(console.log("COD Payment Provider:",null===i||void 0===i?void 0:i.data),il(null===i||void 0===i?void 0:i.data),al(!1),{ok:!0,data:null===i||void 0===i?void 0:i.data}):(rl(!0),al(!1),{ok:!1,data:null})}catch(i){return(0,V.fireGtmEvent)("cod_payment_provider_error",{hotelId:e,error:null===i||void 0===i?void 0:i.message,errorCode:null===i||void 0===i?void 0:i.code}),rl(!0),al(!1),{ok:!1,data:null}}};(0,a.useEffect)(()=>{Ql(Ae)},[Ae]),(0,a.useEffect)(()=>{let e=0,o=0;null===w||void 0===w||w.forEach(n=>{e+=null===n||void 0===n?void 0:n.sAdult,o+=(null===n||void 0===n?void 0:n.sChild)+(null===n||void 0===n?void 0:n.sInfant)}),Hn(e),Wn(o)},[w]);const{checkoutAdultCount:Zl,checkoutChildCount:$l}=(0,a.useMemo)(()=>{const{adultCount:e,childrenCount:o}=c({selectedRooms:w,selectedRatePlans:D,totalAdult:te,totalChild:ae});return{checkoutAdultCount:e,checkoutChildCount:o}},[w,D,te,ae]);(0,a.useEffect)(()=>{re&&!de&&(Hn(Be.adultCount),Wn(Be.childCount+Be.infantCount))},[re,de,Be]),(0,a.useEffect)(()=>{_e&&"razorpay"===(null===_e||void 0===_e?void 0:_e.vendor)&&zn(null===_e||void 0===_e?void 0:_e.vendorKey)},[_e]),(0,a.useEffect)(()=>{(async()=>{if(Ae&&null!==ee&&void 0!==ee&&ee.startDate)try{const e=t()(ee.startDate).format("YYYY-MM-DD"),o=await(0,F.iR)({hotelId:Ae,checkInDate:e});console.log("Custom Messages:",o),cl((null===o||void 0===o?void 0:o.data)||[])}catch(e){console.error("Failed to fetch custom messages:",e),cl([])}})()},[Ae,ee]),(0,a.useEffect)(()=>{null!==po&&void 0!==po&&po.some(e=>{var o;return["Razorpay","PartialPayment"].includes(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)})&&Uo(!0),Ko(null===po||void 0===po?void 0:po.some(e=>{var o;return["Razorpay","PartialPayment"].includes(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)}))},[po]),(0,a.useEffect)(()=>{z.A.get("isBooked")&&window.history.back()},[]),(0,a.useEffect)(()=>{const e=setTimeout(()=>{(async()=>{try{var e;const o=null===Kn||void 0===Kn||null===(e=Kn.couponCodes)||void 0===e?void 0:e[0];if(null===Kn||void 0===Kn||!Kn.id||!o)return;const n={hotelId:null===S||void 0===S?void 0:S.id,couponCode:o,checkInDate:t()(null===ee||void 0===ee?void 0:ee.startDate).format("DD/MM/YYYY"),checkOutDate:t()(null===ee||void 0===ee?void 0:ee.endDate).format("DD/MM/YYYY"),isRetargeting:!0,adultCount:te,childrenCount:ae,bookingAmount:Be.rpPrice},l=await(0,F.uB)(n);200===(null===l||void 0===l?void 0:l.status)&&(I({type:Y.A.SET_RETARGETING,payload:!0}),I({type:Y.A.SET_COUPON_CODE,payload:null===l||void 0===l?void 0:l.data}),nl(!0),(0,V.fireGtmEvent)("retargeting_promotion_applied",{couponCode:o,retargetingDiscount:Kn}))}catch(o){console.error("Error applying retargeting promotions:",o)}})()},6e5);return()=>clearTimeout(e)},[Kn]),(0,a.useEffect)(()=>{const e=z.A.get("utmObj");if("verification"===(null===e||void 0===e?void 0:e.googleSource)){var o;const e=JSON.parse(null!==(o=localStorage.getItem("bookingState"))&&void 0!==o?o:"null");I({type:Y.A.SET_FULL_STATE,payload:e})}},[]),(0,a.useEffect)(()=>{var e,o;let n=w,l=D,i=Ae;const t=z.A.get("utmObj");if("verification"===(null===t||void 0===t?void 0:t.googleSource)){var a,d;const e=JSON.parse(null!==(a=localStorage.getItem("bookingState"))&&void 0!==a?a:"null");n=(null===e||void 0===e?void 0:e.selectedRooms)||[],l=(null===e||void 0===e?void 0:e.selectedRatePlans)||[],i=(null===e||void 0===e||null===(d=e.hotelData)||void 0===d?void 0:d.id)||Ae}(0===(null===(e=n)||void 0===e?void 0:e.length)&&0===(null===(o=l)||void 0===o?void 0:o.length)||!i)&&(_().error("Please select atleast 1 room"),(0,V.fireGtmEvent)("checkout_no_rooms_selected",{selectedRooms:n,selectedRatePlans:l,hotelId:i}),Me.goBack())},[]),(0,a.useEffect)(()=>{(0,V.fireGtmEvent)("checkout_page_opened"),(0,V.trackCheckoutFunnel)("checkout_started"),Gl.current&&Gl.current.focus(),z.A.remove("bookingId")},[]);const ei=(0,a.useRef)(!1);(0,a.useEffect)(()=>
1{if(ei.current)return;if(!(Ue>0))return;ei.current=!0;const e=de?me:null===ee||void 0===ee?void 0:ee.startDate,o=de?me:null===ee||void 0===ee?void 0:ee.endDate,n=re?D.length:w.length;(0,q.$1)({checkInDate:e,checkOutDate:o,hotelId:(null===S||void 0===S?void 0:S.id)||Ae,hotelName:null===S||void 0===S?void 0:S.name,city:null===S||void 0===S?void 0:S.city,state:null===S||void 0===S?void 0:S.state,country:"IN",numberOfRooms:n,numberOfTravelers:B,price:Ue,currency:(null===S||void 0===S?void 0:S.currency)||"INR"})},[Ue]),(0,a.useEffect)(()=>{const e=localStorage.getItem("corporateToken"),o=localStorage.getItem("corporateHotelId"),n=localStorage.getItem("corporateAgentId");e&&o&&(Ao(!0),(0,F.P$)(n).then(e=>{console.log({response:e}),200===(null===e||void 0===e?void 0:e.status)&&null!==e&&void 0!==e&&e.data&&ko(e.data)}))},[null===S||void 0===S?void 0:S.id]),(0,a.useEffect)(()=>{null!==S&&void 0!==S&&S.id&&(0,F.Jq)({hotelId:S.id}).then(e=>{var o;Bl(!(null===e||void 0===e||null===(o=e.data)||void 0===o||!o.enabled))})},[null===S||void 0===S?void 0:S.id]),(0,a.useEffect)(()=>{!async function(){var e,o,n,l;if(!Ae)return;let i=Intl.DateTimeFormat().resolvedOptions().timeZone;i="Etc/Unknown"===i?null:encodeURIComponent(i);const t={hotelId:Ae,timezone:i,vendorCampaignId:Ie.hotel_campaign,currency:null===S||void 0===S?void 0:S.currency};i||delete t.timezone;const a=localStorage.getItem("corporateToken"),d=localStorage.getItem("corporateAgentId"),r=(null===(e=z.A.get("utmObj"))||void 0===e?void 0:e.utmSource)||null,s=a&&d?"agent":r?"utm_source":null,c=a&&d?d:r||null,u=(s&&c?await(0,F.Qo)(t,s,c):await(0,F.Zf)(t)).data;ho(u);const v=null===u||void 0===u?void 0:u.find(e=>{var o;return"PartialPayment"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)});bo(v);const m=null===u||void 0===u?void 0:u.find(e=>{var o;return 4===(null===e||void 0===e?void 0:e.gatewayId)||"BookNowPayLater"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)});null!==m&&void 0!==m&&null!==(o=m.config)&&void 0!==o&&o.cutoff&&I({type:Y.A.BNPL_CONFIG,payload:{cutoff:m.config.cutoff}}),0===(null===u||void 0===u?void 0:u.length)&&Ul("COD"),1===(null===u||void 0===u?void 0:u.length)&&Ul(null===(n=u[0])||void 0===n||null===(l=n.Gateway)||void 0===l?void 0:l.name),(0===(null===u||void 0===u?void 0:u.length)||1===(null===u||void 0===u?void 0:u.length)&&null!==u&&void 0!==u&&u.some(e=>{var o;return"COD"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)}))&&Yn(!0);const p=z.A.get("source");null!==u&&void 0!==u&&u.some(e=>"PartialPayment"===e.Gateway.name)&&Ul("PartialPayment"),null!==u&&void 0!==u&&u.some(e=>"COD"===e.Gateway.name)&&"g_ads"!==p&&Ul("COD")}()},[Ae,jo,Co]),(0,a.useEffect)(()=>{var e;po&&(0,V.fireGtmEvent)("payment_config",{onlinePayment:null===po||void 0===po?void 0:po.some(e=>{var o;return 1===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),cod:null===po||void 0===po?void 0:po.some(e=>{var o;return 2===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),partialPayment:null===po||void 0===po?void 0:po.some(e=>{var o;return 3===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),partialPercentage:(null===yo||void 0===yo||null===(e=yo.config)||void 0===e?void 0:e.minPercentage)||0})},[po]),(0,a.useEffect)(()=>{let e=[...w,...Ee],o=new Map;e.forEach(e=>{if(o.has(e.id)){let n=o.get(e.id);n++,o.set(e.id,n)}else o.set(e.id,1)}),_o(o);let n=[...le],l=new Map;n.forEach(e=>{if(l.has(e.id)){let o=l.get(e.id);o++,l.set(e.id,o)}else l.set(e.id,1)}),fo(l)},[le]),(0,a.useEffect)(()=>{var e,o,n,l,i;let a;var d,r,s,c;if(null===w||void 0===w||w.forEach(e=>{let o=te<=(null===e||void 0===e?void 0:e.defaultGuestCount)?te:null===e||void 0===e?void 0:e.defaultGuestCount;0===El?(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant):o}),null===(e=[...new Set(w)])||void 0===e||e.forEach(e=>{null===R||void 0===R||R.forEach(o=>{var n;"person"===(null===o||void 0===o||null===(n=o.Addon)||void 0===n?void 0:n.category)&&(null===e||void 0===e?void 0:e.id)===(null===o||void 0===o?void 0:o.hotelRoomId)&&0})}),1===(null===(o=w[0])||void 0===o||null===(n=o.pricing)||void 0===n?void 0:n.length))a={startDate:null===(d=w[0])||void 0===d||null===(r=d.pricing[0])||void 0===r?void 0:r.date,endD
1ate:t()(null===(s=w[0])||void 0===s||null===(c=s.pricing[0])||void 0===c?void 0:c.date).add(1,"days")};else if((null===(l=w[0])||void 0===l||null===(i=l.pricing)||void 0===i?void 0:i.length)>1){var u,v,m,p,h,g;a={startDate:null===(u=w[0])||void 0===u||null===(v=u.pricing[0])||void 0===v?void 0:v.date,endDate:t()(null===(m=w[0])||void 0===m||null===(p=m.pricing[(null===(h=w[0])||void 0===h||null===(g=h.pricing)||void 0===g?void 0:g.length)-1])||void 0===p?void 0:p.date).add(1,"days")}}else a=z.A.get("dates")||ee;const{startDate:x,endDate:f}=a;null!==x&&null!==f||(_().error("Please select proper dates"),Me.goBack()),Xe(a);let y=0;null===le||void 0===le||le.forEach(e=>{"per_day"===e.Addon.multiplier?y+=parseFloat(e.price)*oe:y+=parseFloat(e.price)}),Do(y.toFixed(0))},[le]),(0,a.useEffect)(()=>{if(re&&!de){let e=Be.appliedDiscount.discount>0?Be.priceAfterDiscount+Be.rpTax+Be.taxObj.totalBookingTax:Be.rpPrice+Be.rpTax+Be.taxObj.totalBookingTax;Je(e),qe(Be.rpTotalGuest)}else{let e=Re.totalPrice+Math.abs(Re.totalTax);Je(e),qe(Re.totalGuests)}},[re,de,Re,Be]),(0,a.useEffect)(()=>{0===(null===le||void 0===le?void 0:le.length)&&(null===Ne||void 0===Ne?void 0:Ne.length)>0&&$o(!0)},[]),(0,a.useEffect)(()=>{if((null===ie||void 0===ie?void 0:ie.length)>0){let l=(null===ie||void 0===ie?void 0:ie.filter(e=>"cancellation_policy"===(null===e||void 0===e?void 0:e.type)))||[];var e,o,n;if((null===l||void 0===l?void 0:l.length)>0)null===(e=l[0])||void 0===e||null===(o=e.HotelPolicies)||void 0===o||o.sort((e,o)=>{var n,l;return(null===o||void 0===o||null===(n=o.variables)||void 0===n?void 0:n.daysBeforeArrival)-(null===e||void 0===e||null===(l=e.variables)||void 0===l?void 0:l.daysBeforeArrival)}),Fo(null===(n=l[0])||void 0===n?void 0:n.HotelPolicies)}},[ie]);(0,a.useEffect)(()=>{var e;if(null!==Mn&&void 0!==Mn&&Mn.closed||null!==(e=Yl.current)&&void 0!==e&&e.closed){let e=z.A.get("bookingId");if(e){z.A.get("isBooked")?ii(Ue,null===S||void 0===S?void 0:S.currency,e,e):(0,F.aO)({id:e}).then(o=>{var n;const l=null===o||void 0===o||null===(n=o.data)||void 0===n?void 0:n[0];["booked","confirmed_by_owner"].includes(null===l||void 0===l?void 0:l.status)&&ii((null===l||void 0===l?void 0:l.totalAmount)||Ue,null===S||void 0===S?void 0:S.currency,e,e)}).catch(e=>{console.log("Error checking booking confirmation on window close",e)})}}},[Mn,null===Mn||void 0===Mn?void 0:Mn.closed,Yl,null===(n=Yl.current)||void 0===n?void 0:n.closed]),(0,a.useEffect)(()=>{let e;return Bn&&(e=setInterval(()=>oi(),500)),()=>{clearInterval(e)}},[Bn]);const oi=async()=>{var e;if((null!==Mn&&void 0!==Mn&&Mn.closed||null!==(e=Yl.current)&&void 0!==e&&e.closed)&&Bn){var o,n;En(!1),clearInterval(Tn);let e=z.A.get("bookingId"),l=Intl.DateTimeFormat().resolvedOptions().timeZone;l="Etc/Unknown"===l?null:encodeURIComponent(l);const i={id:e,timezone:l};l||delete i.timezone;const t=await(0,F.aO)(i);let a=z.A.get("callback")||"";const d=null===t||void 0===t||null===(o=t.data)||void 0===o?void 0:o[0],r=["booked","confirmed_by_owner"].includes(null===d||void 0===d?void 0:d.status);d&&r&&null!==d&&void 0!==d&&null!==(n=d.payments)&&void 0!==n&&n.some(e=>"razorpay"===(null===e||void 0===e?void 0:e.gateway))&&(null===a||void 0===a?void 0:a.length)>2&&"true"!==a&&(ii(null===d||void 0===d?void 0:d.totalAmount,null===S||void 0===S?void 0:S.currency,e,e),z.A.set("callback","true"))}},ni=function(e,o){var n,l,i,t;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=null===ye||void 0===ye||null===(n=ye.pages)||void 0===n||null===(l=n.checkout)||void 0===l||null===(i=l.paymentOptions)||void 0===i||null===(t=i.names)||void 0===t?void 0:t[e];if(d&&"object"===typeof d&&!Array.isArray(d)){let e=d[Ol.language||"en"]||d.en||o;return Object.keys(a).forEach(o=>{e=e.replace(new RegExp("{".concat(o,"}"),"g"),a[o])}),e}return o};(0,a.useEffect)(()=>{if((null===ie||void 0===ie?void 0:ie.length)>0){var e,o,n;let l=(null===ie||void 0===ie?void 0:ie.filter(e=>{var o;return"house_rules"===(null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e||null===(o=e.category)||void 0===o?void 0:o.includes("Flexi CheckIn allowed,"))})[0])||{},i=(null===l||void 0===l||null===(e=l.HotelPolicies)||void 0===e||null===(o=e[0])||void 0===o||null===(n=o.variables)||void 0===n?void 0:n.isAllowed)||!1;ln(i)}},[ie]),(0,a.useEffect)(()=>
1{if(ie&&(null===ie||void 0===ie?void 0:ie.length)>0){let o=null===ie||void 0===ie?void 0:ie.filter(e=>"house_rules"===(null===e||void 0===e?void 0:e.type)&&"boolean"===(null===e||void 0===e?void 0:e.uiType));if("USD"===(null===S||void 0===S?void 0:S.currency)||26999===(null===S||void 0===S?void 0:S.id)){var e;const n=26999===(null===S||void 0===S?void 0:S.id)?["Unmarried"]:["Unmarried","Foreigners","Visitors","Local"];o=null===(e=o)||void 0===e?void 0:e.filter(e=>!n.some(o=>{var n;return null===e||void 0===e||null===(n=e.category)||void 0===n?void 0:n.includes(o)}))}sn(o)}},[ie]);const li=z.A.get("source")||"Hotelzify_Fallback",ii=(o,n,l,i)=>{Vo(!1);const t=[i,l].filter(Boolean),a=t.some(e=>{try{return!!localStorage.getItem("ga4_purchase_tracked_".concat(e))}catch(o){return!1}}),d=G(i,z.A.get("bookingResp"));a?e.history.push(d):(t.forEach(e=>{try{localStorage.setItem("ga4_purchase_tracked_".concat(e),"1")}catch(o){console.error("Error setting purchase tracked key in localStorage",o)}}),function(e){let{track:o,navigate:n}=e,l=!1;const i=()=>{l||(l=!0,n())};try{o(i)}catch(t){console.warn("Purchase tracking failed after booking completion")}finally{i()}}({track:e=>ti(o,n,l,i,e),navigate:()=>e.history.push(d)}))},ti=(e,o,n,l,i)=>{var a,d,r,s,c,u,m;window.dataLayer=window.dataLayer||[];let p,h=0;re&&!de?(p=Be.selectedRooms,p.forEach(e=>{var o;null===e||void 0===e||null===(o=e.onedayObj)||void 0===o||o.forEach(e=>{h+=parseFloat((null===e||void 0===e?void 0:e.tax)||0)})})):(p=Re.roomObjects||[],p.forEach(e=>{h+=parseFloat((null===e||void 0===e?void 0:e.tax)||0)}));const g=p.map((e,o)=>{let n=0;return n=re&&!de?parseFloat((null===e||void 0===e?void 0:e.sum)||0):parseFloat((null===e||void 0===e?void 0:e.finalValue)||(null===e||void 0===e?void 0:e.sum)||0),{roomId:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Ae),roomName:(null===e||void 0===e?void 0:e.roomName)||(null===e||void 0===e?void 0:e.name)||"Room",roomPrice:parseFloat(n.toFixed(2)),index:o}}),_=null!==(a=null!==(d=null===S||void 0===S?void 0:S.chainId)&&void 0!==d?d:z.A.get("chainId"))&&void 0!==a?a:"",x=null!==(r=null!==(s=null===S||void 0===S?void 0:S.name)&&void 0!==s?s:z.A.get("hotelName"))&&void 0!==r?r:"",f=null!==(c=null!==(u=null===S||void 0===S?void 0:S.id)&&void 0!==u?u:z.A.get("hotelId"))&&void 0!==c?c:Ae,y=g.map(e=>({item_id:e.roomId,item_name:e.roomName,item_category:String(_||""),price:e.roomPrice,quantity:1,index:e.index,start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}));if(window){var b,j,k,C,A,N;const i={chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:li,transaction_id:"".concat(n),value:e,currency:o,items:y};h>0&&(i.tax=h),(ge||fe)&&(i.coupon=ge||fe),null===(b=window)||void 0===b||b.gtag("event","purchase",i);const a=g.map(e=>({id:e.roomId,quantity:1,item_price:e.roomPrice})),d=g.map(e=>e.roomId),r=g.map(e=>e.roomName).join(", ");try{let e;if(re&&!de){var P;e=((null===Be||void 0===Be||null===(P=Be.appliedDiscount)||void 0===P?void 0:P.discount)>0?(null===Be||void 0===Be?void 0:Be.priceAfterDiscount)||0:(null===Be||void 0===Be?void 0:Be.rpPrice)||0)+Math.abs(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.taxObj.totalTax)}else{const o=(null===Re||void 0===Re?void 0:Re.totalPrice)||0;e=o+Math.abs((null===Re||void 0===Re?void 0:Re.totalTax)||0)}const i={value:parseFloat(e),currency:o,content_ids:d,content_type:"hotel_room",content_name:r,contents:a,num_items:p.length,checkin_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),checkout_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD"),num_adults:Gn,num_children:Ln,order_id:n,booking_id:l,hotel_id:(null===S||void 0===S?void 0:S.id)||Ae,hotel_name:null===S||void 0===S?void 0:S.name,city:null===S||void 0===S?void 0:S.city,country:null===S||void 0===S?void 0:S.country};(0,V.newFBEvents)("Purchase",i)}catch(U){console.log("Meta Pixel failed")}(0,q.DC)({checkInDate:null===ee||void 0===ee?void 0:ee.startDate,checkOutDate:null===ee||void 0===ee?void 0:ee.endD
1ate,hotelId:(null===S||void 0===S?void 0:S.id)||Ae,hotelName:null===S||void 0===S?void 0:S.name,city:null===S||void 0===S?void 0:S.city,state:null===S||void 0===S?void 0:S.state,country:"IN",numberOfRooms:null===(j=p)||void 0===j?void 0:j.length,numberOfTravelers:B,discountCode:ge||fe||"",price:e,confirmationNumber:l,currency:o}),(0,V.pushDataLayerEvent)({event:"conversionAnalytics",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:li,value:parseFloat(e||0),currency:o,transaction_id:"".concat(n),source:li,utm_source:(null===(k=z.A.get("utmObj"))||void 0===k?void 0:k.utmSource)||null,utm_campaign:(null===(C=z.A.get("utmObj"))||void 0===C?void 0:C.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Ae),id:"".concat(Ae),item_category:String(_||""),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}],item:[{id:"".concat(Ae),item_id:"".concat(Ae),item_category:String(_||""),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}],id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}),(0,V.pushDataLayerEvent)({event:"purchase",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:li,value:parseFloat(e||0),currency:o,transaction_id:"".concat(n),source:li,utm_source:(null===(A=z.A.get("utmObj"))||void 0===A?void 0:A.utmSource)||null,utm_campaign:(null===(N=z.A.get("utmObj"))||void 0===N?void 0:N.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Ae),id:"".concat(Ae),item_category:String(_||""),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}]});try{var I,w,D,M,R,E,T,O,Y,F,G;let l=oo||"";try{const e=(0,v.parsePhoneNumber)(String(oo));l=e.countryCallingCode+e.nationalNumber.replace(/\s+/g,"")}catch(J){l=String(oo||"").replace(/[^0-9]/g,"")}(0,V.pushDataLayerEvent)({event:"product_purchase",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:li,value:parseFloat(e||0),currency:o,transaction_id:"".concat(n),source:li,utm_source:(null===(I=z.A.get("utmObj"))||void 0===I?void 0:I.utmSource)||null,utm_campaign:(null===(w=z.A.get("utmObj"))||void 0===w?void 0:w.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Ae),id:"".concat(Ae),item_category:String(_||""),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD HH:mm:ss"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD HH:mm:ss")}],resort:(null===S||void 0===S?void 0:S.name)||"",checkin:null!==ee&&void 0!==ee&&ee.startDate?t()(ee.startDate).format("YYYY-MM-DD HH:mm:ss"):"",checkout:null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endDate).format("YYYY-MM-DD HH:mm:ss"):"",adult_guests:null!==(D=null!==(M=null===Be||void 0===Be?void 0:Be.adultCount)&&void 0!==M?M:Gn)&&void 0!==D?D:0,children_guests:null!==(R=null!==(E=null===Be||void 0===Be?void 0:Be.childCount)&&void 0!==E?E:Ln)&&void 0!==R?R:0,infant_guests:null!==(T=null===Be||void 0===Be?void 0:Be.infantCount)&&void 0!==T?T:0,number_of_nights:null!==ee&&void 0!==ee&&ee.startDate&&null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endDate).diff(t()(ee.startDate),"day"):0,number_of_rooms:null!==(O=null===g||void 0===g?void 0:g.length)&&void 0!==O?O:0,promotion_applied:ge||fe||"",totalprice:parseFloat(e||0),page_url:"undefined"!==typeof window?null===(Y=window.location)||void 0===Y?void 0:Y.href:"",resort_banner:(null===S||void 0===S||null===(F=S.HotelImages)||void 0===F||null===(G=F[0])||void 0===G?void 0:G.cdnImageUrl)||"",mobile:l||"",email:lo||"",salutation:"Male"===$e?"Mr":"Female"===$e?"Ms":$e||"",name:Qe||"",special_requests:No||"",gst_invoice:Ce||0,mode_of_payment:vo||""})}catch(K){console.error("Analytics tracking error (product_purchase):",K)}(0,V.mixpanelConversion)({value:e,currency:o,transaction_id:"".concat(n),items:[{id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endD
1ate).format("YYYY-MM-DD")}],item:[{id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}],id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}),(0,V.pixelConversion)({value:e,currency:o,transaction_id:"".concat(n),content_ids:"".concat(n),items:[{id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}],item:[{id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")}],id:"".concat(Ae),item_id:"".concat(Ae),start_date:t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY-MM-DD"),end_date:t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY-MM-DD")})}const H={transaction_id:"".concat(n),value:parseFloat(e),currency:o,items:y};(0,V.fireGtmEvent)("conversion",H),"undefined"!==typeof window&&window.gtag&&window.gtag("event","conversion",{send_to:"AW-11452557213/v1YoCOmjnvcbEJ3PgNUq",value:parseFloat(e),currency:o,transaction_id:"".concat(n)});if([1,76].includes(null===S||void 0===S?void 0:S.chainId)&&"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-11024745253/aKXnCOnr-ZkYEKWGgYkp",value:e,currency:o,transaction_id:"".concat(n),items:y,event_callback:i}),23===(null===S||void 0===S?void 0:S.chainId)&&"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-10888201272",value:e,currency:o,transaction_id:"".concat(n),items:y,event_callback:i}),"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-11159414012/Lg_hCIfgh4EZEPzJnMkp",value:parseFloat(e),currency:o,transaction_id:"".concat(n),items:y,event_callback:i}),null!==ye&&void 0!==ye&&null!==(m=ye.googlePixel)&&void 0!==m&&m.googleAdsId){var L,W;const l=null===ye||void 0===ye||null===(L=ye.googlePixel)||void 0===L||null===(W=L.googleAdsConversions)||void 0===W?void 0:W.purchase,i=l?"".concat(ye.googlePixel.googleAdsId,"/").concat(l):"".concat(ye.googlePixel.googleAdsId);"undefined"!==typeof window&&window.gtag&&window.gtag("event","conversion",{send_to:i,value:parseFloat(e),currency:o,transaction_id:"".concat(n),items:y})}},ai=e=>{let{gateway:o,amount:n,errorCode:l,errorMessage:i,bookingId:a}=e;try{var d,r,s,c,u,m,p,h,g,_,x;let e=oo||"";try{const o=(0,v.parsePhoneNumber)(String(oo));e=o.countryCallingCode+o.nationalNumber.replace(/\s+/g,"")}catch(f){e=String(oo||"").replace(/[^0-9]/g,"")}(0,V.pushDataLayerEvent)({event:"payment_failed",failure_type:"payment_failed",failure_stage:"payment_processing",error_code:l||null,error_message:i||null,booking_id:a||z.A.get("bookingId")||null,hotel_id:(null===S||void 0===S?void 0:S.id)||null,total_amount:parseFloat(n||0),currency:(null===S||void 0===S?void 0:S.currency)||"INR",payment_gateway:o||null,source:z.A.get("source")||"Direct",resort:(null===S||void 0===S?void 0:S.name)||null,checkin:null!==ee&&void 0!==ee&&ee.startDate?t()(ee.startDate).format("YYYY-MM-DD HH:mm:ss"):null,checkout:null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endDate).format("YYYY-MM-DD HH:mm:ss"):null,adult_guests:null!==(d=null!==(r=null===Be||void 0===Be?void 0:Be.adultCount)&&void 0!==r?r:Gn)&&void 0!==d?d:null,children_guests:null!==(s=null!==(c=null===Be||void 0===Be?void 0:Be.childCount)&&void 0!==c?c:Ln)&&void 0!==s?s:null,infant_guests:null!==(u=null===Be||void 0===Be?void 0:Be.infantCount)&&void 0!==u?u:null,number_of_nights:null!==ee&&void 0!==ee&&ee.startDate&&null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endDate).diff(t()(ee.startDate),"day"):null,number_of_rooms:re?null!==(m=null===Be||void 0===Be||null===(p=Be.selectedRooms)||void 0===p?void 0:p.length)&&void 0!==m?m:null:null!==(h=null===w||void 0===w?void 0:w.length)&&void 0!==h?h:null,promotion_applied:ge||fe||null,page_url:"undefined"!==typeof window?null===(g=window.location)||void 0===g?void 0:g.href:null,resort_banner:(null===S||void 0===S||null===(_=S.HotelImages)||void 0===_||null===(x=_[0])||void 0===x?void 0:x.cdnImageUrl)||null,mobile:e||null,email:lo||null,salutation:"Male"===$e?"Mr":"Female"===$e?"Ms":$e||null,name:Qe||null,special_requests:No||"",gst_invoice:Ce||0,mode_of_payment:o||null})}catch(y){console.error("Analytics tracking error (payment_failed):",y)}};(0,a.useEffect)(()=>{let e=z.A.get("isApiCalled")||!1;const o="pcibooking"===(null===ll||void 0===ll?void 0:ll.vendor),n=!On||!tl&&o;return(null===Qe||void 0===Qe?void 0:Qe.length)>=4&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(lo)&&(null===oo||void 0===oo?void 0:oo.length)>0&&(0,v.g0)(oo)&&!e&&!yn&&187479!==(null===S||void 0===S?void 0:S.userId)&&26296!==(null===S||void 0===S?void 0:S.id)&&n?(Hl.current&&clearTimeout(Hl.current),Hl.current=setTimeout(()=>{Hl.current=null,pi(!0)},2e3),dn(!0)):(Hl.current&&(clearTimeout(Hl.current),Hl.current=null),dn(!1)),()=>{Hl.current&&(clearTimeout(Hl.current),Hl.current=null)}},[Qe,lo,oo,$e,le,On,tl,null===ll||void 0===ll?void 0:ll.vendor]),(0,a.useEffect)(()=>{console.log("checkoutpg");(0,v.g0)(String(oo))&&0===(null===lo||void 0===lo?void 0:lo.length)&&0===(null===Qe||void 0===Qe?void 0:Qe.length)&&(async()=>{var e,o,n,i;Dn(!0);const t=(0,v.parsePhoneNumber)(String(oo));let a="%2b"+t.countryCallingCode;const d=await(0,F.Vz)(a,t.nationalNumber);Ze(null===d||void 0===d||null===(e=d.data)||void 0===e?void 0:e.name),io(null===d||void 0===d||null===(o=d.data)||void 0===o?void 0:o.email),eo((null===d||void 0===d||null===(n=d.data)||void 0===n?void 0:n.gender)||"Male"),uo((0,K.ns)(null===d||void 0===d||null===(i=d.data)||void 0===i?void 0:i.dob)),Dn(!1);const r=(e=>{let{isRatePlans:o,priceCalculator:n,oldPriceCalculator:l,selectedRooms:i,hotelData:t,dateRange:a,totalAdult:d,totalChild:r}=e;try{var s,c;const e=o?null===n||void 0===n?void 0:n.selectedRooms:(null===l||void 0===l?void 0:l.roomObjects)||i;if(!e||0===e.length)return null;const u=e.map(e=>"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id))),v=e.map(e=>({id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id)),quantity:1})),m=o?((null===(s=n.appliedDiscount)||void 0===s?void 0:s.discount)>0?n.priceAfterDiscount:n.rpPrice)+Math.abs(null!==t&&void 0!==t&&t.isTaxIncluded?0:(null===(c=n.taxObj)||void 0===c?void 0:c.totalTax)||0):l.totalPrice+Math.abs(l.totalTax||0),p=e.map(e=>({item_id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id)),item_name:(null===e||void 0===e?void 0:e.roomName)||(null===e||void 0===e?void 0:e.name)||"Room",price:parseFloat((null===e||void 0===e?void 0:e.sum)||(null===e||void 0===e?void 0:e.finalValue)||0),quantity:1,google_business_vertical:"hotel_rental"})),h=(null===a||void 0===a?void 0:a.startDate)||(null===a||void 0===a?void 0:a[0])||"",g=(null===a||void 0===a?void 0:a.endDate)||(null===a||void 0===a?void 0:a[1])||"",_=(null===a||void 0===a?void 0:a.numNights)||1;return{rooms:e,contentIds:u,contents:v,items:p,totalValue:parseFloat(m),currency:(null===t||void 0===t?void 0:t.currency)||"INR",numNights:_,checkinDate:h,checkoutDate:g,totalAdult:d||0,totalChild:r||0}}catch(u){return console.error("Error building analytics room data:",u),null}})({isRatePlans:re,priceCalculator:Be,oldPriceCalculator:Re,selectedRooms:w,hotelData:S,dateRange:ee,totalAdult:te,totalChild:ae});if(r){const e=function(e,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return o?(0,l.A)({value:o.totalValue,currency:o.currency,items:o.items},n):null}catch(i){return console.error("Error building GA4 event:",i),null}}("add_payment_info",r);(0,V.fireGtmEvent)("add_payment_info",e)}})()},[oo]),(0,a.useEffect)(()=>{null!==S&&void 0!==S&&S.id&&null!==ee&&void 0!==ee&&ee.startDate&&null!==ee&&void 0!==ee&&ee.endDate&&(async()=>
1{if(!(0,v.g0)(String(oo)))return I({type:Y.A.SET_RETURNING_MEMBER,payload:!1}),void(null!==fe&&void 0!==fe&&fe.isReturningMember&&I({type:Y.A.SET_COUPON_CODE,payload:{}}));try{var e;const o=(0,v.parsePhoneNumber)(String(oo)),n="+"+o.countryCallingCode,l=o.nationalNumber,i=await(0,F.RT)({hotelId:null===S||void 0===S?void 0:S.id,dialCode:n,mobile:l,checkInDate:t()(null===ee||void 0===ee?void 0:ee.startDate).format("DD/MM/YYYY"),checkOutDate:t()(null===ee||void 0===ee?void 0:ee.endDate).format("DD/MM/YYYY")});200===(null===i||void 0===i?void 0:i.status)&&null!==i&&void 0!==i&&null!==(e=i.data)&&void 0!==e&&e.eligible?(I({type:Y.A.SET_RETURNING_MEMBER,payload:!0}),null!==fe&&void 0!==fe&&fe.id||(I({type:Y.A.SET_COUPON_CODE,payload:i.data.promotion}),Eo(!0))):(I({type:Y.A.SET_RETURNING_MEMBER,payload:!1}),null!==fe&&void 0!==fe&&fe.isReturningMember&&I({type:Y.A.SET_COUPON_CODE,payload:{}}))}catch(o){}})()},[oo,null===S||void 0===S?void 0:S.id]);const di=async(e,o)=>{console.log("called6");try{I({type:Y.A.FETCHING,payload:!0});const a=await(0,F.C8)(o);var n,l,i,t;if(200===(null===a||void 0===a?void 0:a.status))ii(null===e||void 0===e||null===(n=e.payment)||void 0===n?void 0:n.amount,null===S||void 0===S?void 0:S.currency,null===e||void 0===e?void 0:e.bookingId,null===e||void 0===e?void 0:e.bookingId),(0,V.trackCheckoutFunnel)("payment_completed",{payment_gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(l=e.payment)||void 0===l?void 0:l.amount});else fn(!0),_().error(null===a||void 0===a?void 0:a.error),(0,V.trackCheckoutFunnel)("payment_failed",{payment_gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(i=e.payment)||void 0===i?void 0:i.amount,error_reason:null===a||void 0===a?void 0:a.error}),ai({gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(t=e.payment)||void 0===t?void 0:t.amount,errorMessage:null===a||void 0===a?void 0:a.error,bookingId:null===e||void 0===e?void 0:e.bookingId})}catch(a){}finally{I({type:Y.A.FETCHING,payload:!1})}},ri=null===K.hq||void 0===K.hq?void 0:K.hq.includes(null===S||void 0===S?void 0:S.id),[si,ci]=(0,a.useState)(!1),[ui,vi]=(0,a.useState)(""),mi=()=>{ci(!1),vi("")},pi=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!e&&Hl.current&&(clearTimeout(Hl.current),Hl.current=null),Ge.current.run(async()=>{try{return await hi(e)}finally{I({type:Y.A.FETCHING,payload:!1}),bn(!1)}},{background:e})},hi=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(bn(!0),t()(null===ee||void 0===ee?void 0:ee.endDate).isBefore(null===ee||void 0===ee?void 0:ee.startDate)||!de&&t()(null===ee||void 0===ee?void 0:ee.endDate).isSame(null===ee||void 0===ee?void 0:ee.startDate))_().error("Invalid Checkin Checkout Dates");else{if(""===oo||!(0,v.g0)(String(oo)))return Gl.current&&Gl.current.focus(),Gl.current&&Gl.current.scrollIntoView(),_n(!0),(0,V.fireGtmEvent)("submit_without_phone"),_().error(Tl("enter_valid_phone_number")),void bn(!1);if((null===No||void 0===No?void 0:No.length)>255)_().error("Special requests can not have more than 255 characters");else{if(""===lo)return(0,V.fireGtmEvent)("submit_without_email"),_().error(Tl("enter_email_address")),zl.current&&zl.current.scrollIntoView(),bn(!1),void(zl.current&&zl.current.focus());if(!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(lo))return zl.current&&zl.current.focus(),zl.current&&zl.current.scrollIntoView(),(0,V.fireGtmEvent)("submit_incorrect_email"),hn(!0),bn(!1),void _().error(Tl("enter_valid_email_address"));if(""===(null===Qe||void 0===Qe?void 0:Qe.trim()))return bn(!1),Fl.current&&Fl.current.focus(),(0,V.fireGtmEvent)("submit_without_name"),mn(!0),void _().error(Tl("enter_name"));if((0,K.e3)(Qe))return bn(!1),Fl.current&&Fl.current.focus(),mn(!0),void _().error("Please enter a name without special characters");if((0,K.SA)(Qe))return bn(!1),Fl.current&&Fl.current.focus(),mn(!0),void _().error("Please enter a valid name");if(""===Qe.trim()||""===lo.trim()||!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(lo)||""===oo.trim()||!(0,v.g0)(String(oo)))return bn(!1),void _().error(Tl("enter_all_details"));if(""===vo)return _().error(Tl("select_payment_method")),void bn(!1);if(!we||ke){!e&&I({type:Y.A.FETCHING,payload:!0}),(0,V.fireGtmEvent)("user_details_added",{userName:Qe,email:lo,phone:oo,paymentOption:vo}),(0,V.trackCheckoutFunnel)("guest_details_entered",{payment_method:vo});try{var o,n,i,a,d,r;let e=oo||"";try{const o=(0,v.parsePhoneNumber)(String(oo));e=o.countryCallingCode+o.nationalNumber.replace(/\s+/g,"")}catch(Ye){e=String(oo||"").replace(/[^0-9]/g,"")}const l=parseInt(null!==(o=null===Be||void 0===Be?void 0:Be.adultCount)&&void 0!==o?o:b,10)||0,s=parseInt(null!==(n=null===Be||void 0===Be?void 0:Be.childCount)&&void 0!==n?n:Ln,10)||0,c=parseInt(null===Be||void 0===Be?void 0:Be.infantCount,10)||0;(0,V.pushDataLayerEvent)({event:"guest_details_submitted",booking_id:z.A.get("bookingId")||null,guest_name:Qe||null,guest_email:lo||null,guest_mobile:e||null,total_guests:l+s,adult_guests:l,children_guests:s,infant_guests:c,hotel_id:(null===S||void 0===S?void 0:S.id)||Ae||null,hotel_name:(null===S||void 0===S?void 0:S.name)||null,check_in_date:null!==ee&&void 0!==ee&&ee.startDate?t()(ee.startDate).format("YYYY-MM-DD HH:mm:ss"):z.A.get("checkInDate")?t()(z.A.get("checkInDate")).format("YYYY-MM-DD HH:mm:ss"):null,check_out_date:null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endD
1ate).format("YYYY-MM-DD HH:mm:ss"):z.A.get("checkOutDate")?t()(z.A.get("checkOutDate")).format("YYYY-MM-DD HH:mm:ss"):null,number_of_nights:null!==ee&&void 0!==ee&&ee.startDate&&null!==ee&&void 0!==ee&&ee.endDate?t()(ee.endDate).diff(t()(ee.startDate),"day"):0,number_of_rooms:re?(null===Be||void 0===Be||null===(i=Be.selectedRooms)||void 0===i?void 0:i.length)||0:(null===w||void 0===w?void 0:w.length)||0,promotion_applied:ge||fe||null,totalprice:null!=Ue?parseFloat(Ue):0,source:z.A.get("source")||"Direct",salutation:"Male"===$e?"Mr":"Female"===$e?"Ms":$e||null,special_requests:No||"",gst_invoice:Ce||0,mode_of_payment:vo||null,page_url:"undefined"!==typeof window?null===(a=window.location)||void 0===a?void 0:a.href:null,resort_banner:(null===S||void 0===S||null===(d=S.HotelImages)||void 0===d||null===(r=d[0])||void 0===r?void 0:r.cdnImageUrl)||null})}catch(Fe){console.error("Analytics tracking error (guest_details_submitted):",Fe)}if((null===S||void 0===S?void 0:S.chainId)===K.CV)try{"undefined"!==typeof window&&"function"===typeof window.createPushLapEmail?(window.createPushLapEmail(lo.trim(),Qe.trim()),console.log("[PushLap] createPushLapEmail called:",{email:lo.trim(),name:Qe.trim()})):console.log("[PushLap] createPushLapEmail function not available")}catch(ze){console.error("[PushLap] Error calling createPushLapEmail:",ze)}try{var s,c,u,m,p,h,g,x;const o=(0,v.parsePhoneNumber)(String(oo)),n={dialCode:"+"+o.countryCallingCode,mobile:o.nationalNumber.replace(/\s+/g,""),regMedium:"webapp",email:lo.trim().replace(/\s+/g,""),name:null===Qe||void 0===Qe?void 0:Qe.trim(),dob:(null===(s=String(co))||void 0===s?void 0:s.length)>0?(0,K.Nl)(co):"",gender:$e},i=H.A.isCorporateBooking();if(i){const e=localStorage.getItem("corporateToken");e&&z.A.set("token",e)}else{const e=(await(0,F.nC)(n)).data.token;z.A.set("token",e)}!e&&I((0,O.z2)());const a=[...w];let d=new Map;a.forEach(e=>{if(d.has(e.id)){let o=d.get(e.id);o++,d.set(e.id,o)}else d.set(e.id,1)});let r=[];var f=0,y=0,b=0,j=0;Re.roomObjects.forEach((e,o)=>{var n,i;let a=d.get(null===e||void 0===e?void 0:e.id),s=[];var c;(null===e||void 0===e||null===(n=e.HotelRoomAddons)||void 0===n?void 0:n.length)>0&&(s=null===e||void 0===e||null===(c=e.HotelRoomAddons)||void 0===c?void 0:c.filter(e=>{var o;return Number(null===e||void 0===e?void 0:e.price)<=0&&"meal"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)}));const u=null===R||void 0===R?void 0:R.filter(o=>{var n;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"meal"===(null===o||void 0===o||null===(n=o.Addon)||void 0===n?void 0:n.category)}),v=(null===R||void 0===R||R.filter(o=>{var n;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"Extra Adult"===(null===o||void 0===o||null===(n=o.Addon)||void 0===n?void 0:n.name)}),null===R||void 0===R||R.filter(o=>(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"child"===(null===o||void 0===o?void 0:o.type)),null===R||void 0===R||R.filter(o=>(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"infant"===(null===o||void 0===o?void 0:o.type)),null===R||void 0===R?void 0:R.filter(o=>{var n;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"person"===(null===o||void 0===o||null===(n=o.Addon)||void 0===n?void 0:n.category)}));let m=a*(null===e||void 0===e?void 0:e.defaultGuestCount)+(null===v||void 0===v?void 0:v.length),p=[];null===(i=s)||void 0===i||i.forEach(o=>{o.hotelRoomId===e.id&&p.push({id:o.addonId,quantity:m})}),null===u||void 0===u||u.forEach(o=>{var n;o.hotelRoomId===e.id&&p.push({id:o.addonId,quantity:null===u||void 0===u||null===(n=u.filter(e=>(null===e||void 0===e?void 0:e.addonId)===(null===o||void 0===o?void 0:o.addonId)))||void 0===n?void 0:n.length})});let h={};if(null===e||void 0===e||e.promosApplied.forEach(e=>{var o,n;h=(0,l.A)((0,l.A)({},h),{},{[t()(null===e||void 0===e?void 0:e.checkInDate).format("YYYY-MM-DD")]:null===e||void 0===e||null===(o=e.promo)||void 0===o||null===(n=o.map(e=>null===e||void 0===e?void 0:e.id))||void 0===n?void 0:n.filter(e=>!(null!==je&&void 0!==je&&je.id)||String(e)!==String(je.id))})}),0===El){var g,_,x;let o={};o=1===(null===e||void 0===e?void 0:e.idx)?(0,l.A)((0,l.A)({},o),{},{addons:[...new Map(p.map(e=>[e.id,e])).values()]}):(0,l.A)((0,l.A)({},o),{},{addons:[]}),o=(0,l.A)((0,l.A)({},o),{},{quantity:1,guests:(null===e||void 0===e?void 0:e.sAdult)<(null===e||void 0===e?void 0:e.defaultGuestCount)?null===e||void 0===e?void 0:e.sAdult:null===e||void 0===e?void 0:e.defaultGuestCount,id:e.id,extraAdults:(null===e||void 0===e?void 0:e.sAdult)-(null===e||void 0===e?void 0:e.defaultGuestCount)>0?(null===e||void 0===e?void 0:e.sAdult)-(null===e||void 0===e?void 0:e.defaultGuestCount):0,extraChildren:null===e||void 0===e?void 0:e.sChild,extraInfant:null===e||void 0===e?void 0:e.sInfant,slotId:(null===(g=he[null===e||void 0===e?void 0:e.id])||void 0===g?void 0:g.id)||null,promotionData:null!==(_=Re.bulkDiscount)&&void 0!==_&&_.id?null:(null===e||void 0===e||null===(x=e.promosApplied)||void 0===x?void 0:x.length)>0?h:null}),f+=(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant),y+=null===e||void 0===e?void 0:e.sChild,b+=null===e||void 0===e?void 0:e.sAdult,j+=null===e||void 0===e?void 0:e.sInfant,r.push(o)}}
1),0!==El&&(r.forEach(e=>{const{extraAdults:o,extraChildren:n,guests:l,extraInfant:i}=e;b=b+o+l,y+=n,j+=i}),f=f+y+b+j);const ge=String(z.A.get("source"))||"Hotelzify_Fallback";let we={};if(de&&(we=(0,K.D4)(me,se,pe,!0)),re&&!de){let e=[];Be.selectedRooms.forEach(o=>{var n,i,a,d,r;let s=0,c=0;var u,v;(null===o||void 0===o?void 0:o.sAdult)>(null===o||void 0===o||null===(n=o.room)||void 0===n?void 0:n.defaultGuestCount)?(s=null===o||void 0===o||null===(u=o.room)||void 0===u?void 0:u.defaultGuestCount,c=(null===o||void 0===o?void 0:o.sAdult)-(null===o||void 0===o||null===(v=o.room)||void 0===v?void 0:v.defaultGuestCount)):(s=null===o||void 0===o?void 0:o.sAdult,c=0);let m={};null===o||void 0===o||o.promosApplied.forEach(e=>{var o,n;m=(0,l.A)((0,l.A)({},m),{},{[t()(null===e||void 0===e?void 0:e.checkInDate).format("YYYY-MM-DD")]:null===e||void 0===e||null===(o=e.promo)||void 0===o||null===(n=o.map(e=>null===e||void 0===e?void 0:e.id))||void 0===n?void 0:n.filter(e=>!(null!==je&&void 0!==je&&je.id)||String(e)!==String(je.id))})});let p={addons:[],quantity:1,id:null===o||void 0===o?void 0:o.roomId,slotId:null,guests:s,extraAdults:c,promotionData:null!==(i=Be.bulkDiscount)&&void 0!==i&&i.id?null:(null===o||void 0===o||null===(a=o.promosApplied)||void 0===a?void 0:a.length)>0?m:null,extraChildren:null===o||void 0===o?void 0:o.sChild,extraInfant:null===o||void 0===o?void 0:o.sInfant,ratePlanId:null===o||void 0===o||null===(d=o.rpObject)||void 0===d?void 0:d.id,ratePlanInfo:{ratePlanCode:null===o||void 0===o||null===(r=o.rpObject)||void 0===r?void 0:r.pmsCode}};e.push(p)}),r=e}const De=[...le],Te=new Map;null===De||void 0===De||De.forEach(e=>{if(Te.has(e.id)){let o=Te.get(e.id);o++,Te.set(e.id,o)}else Te.set(e.id,1)});const Ye=[];for(let[e,l]of Te){let o={id:e,count:l};Ye.push(o)}const ze=(0,l.A)((0,l.A)((0,l.A)((0,l.A)({hotelId:Ae,hotelRooms:r,totalGuests:re&&!de?Be.rpTotalGuest:f,childrenCount:re&&!de?Be.childCount:y,adultCount:re&&!de?Be.adultCount:b,infantCount:re&&!de?Be.infantCount:j,arrivalTime:nn&&!de?en:null,name:null===Qe||void 0===Qe?void 0:Qe.trim(),addons:Ye,gender:$e,type:de?"hourly":"normal",checkInTime:de?(0,K.Ij)(se):null,checkOutTime:de?(0,K.Ij)((0,K.D4)(me,se,pe)):null,dob:(null===co||void 0===co?void 0:co.length)>0?(0,K.Nl)(co):null,email:null===lo||void 0===lo?void 0:lo.trim().replace(/\s+/g,""),requests:No,source:i?"ABT":["bot9chatbot","ai_internal_voice"].includes(localStorage.getItem("source"))?localStorage.getItem("source"):(null===ge||void 0===ge?void 0:ge.length)>0&&"null"!==ge?ge:"Hotelzify"},localStorage.getItem("displaySource")&&{displaySource:localStorage.getItem("displaySource")}),{},{dialCode:"+"+o.countryCallingCode,mobile:o.nationalNumber.replace(/\s+/g,""),checkInDate:de?t()(me).format("YYYY/MM/DD"):t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY/MM/DD"),checkOutDate:de?(null===(c=we)||void 0===c?void 0:c.date)||t()(null===ee||void 0===ee?void 0:ee.startDate).format("YYYY/MM/DD"):t()(null===ee||void 0===ee?void 0:ee.endDate).format("YYYY/MM/DD"),promotionId:re?null===(u=Be.bulkDiscount)||void 0===u?void 0:u.id:null===Re||void 0===Re||null===(m=Re.bulkDiscount)||void 0===m?void 0:m.id,coupon:null===fe||void 0===fe?void 0:fe.couponCodeId},i&&{taxDetails:(null===ro||void 0===ro?void 0:ro.trim())||null,emails:(null===to||void 0===to?void 0:to.length)>0?JSON.stringify(to):null,corporateAgentId:(null===jo||void 0===jo?void 0:jo.id)||null}),(null===je||void 0===je?void 0:je.id)&&{paymentOffer:{id:je.id,discount:je.discount,discountType:je.discountType}}),Ce&&{taxDetails:Ce});let He,Le,We=z.A.get("utmObj")||{},Ve=(0,K.nP)(We),qe=z.A.get("locationDetails")||{},Je=JSON.parse(localStorage.getItem("visited"))||[],Ke=localStorage.getItem("uuid")||"",Xe=(0,l.A)((0,l.A)((0,l.A)({},ze),{},{utmData:Ve},ke&&{loyalty:{programName:"maharajaclub",memberId:ke}}),{},{bookingAnalytics:(0,l.A)((0,l.A)({},ze),{},{oldSource:z.A.get("old_source"),locationDetails:qe,showBanner:z.A.get("showBanner")||null,networkSpeed:(null===(p=window)||void 0===p||null===(h=p.navigator)||void 0===h||null===(g=h.connection)||void 0===g?void 0:g.effectiveType)||"not-set",deviceType:K.RX,utmObj:We,testId:El,isGHC:null===S||void 0===S?void 0:S.ghcEnabled,isDev:K.Cu,themeId:2,uuid:Ke,sourceTrack:Je,hotelName:z.A.get("hotelName"),userId:z.A.get("userId"),hotelId:z.A.get("hotelId"),slug:z.A.get("slug"),domain:z.A.get("domain"),end_date:z.A.get("checkOutDate"),start_date:z.A.get("checkInDate")})}),Ze=re&&!de?Be.appliedDiscount.discount>0?Be.priceAfterDiscount+Be.rpTax+Be.taxObj.totalBookingTax:Be.rpPrice+Be.rpTax+Be.taxObj.totalBookingTax:Re.totalPrice+Math.abs(Re.totalTax),eo=z.A.get("bookingId")||null,
1no=z.A.get("bookingObj")||{};const io=z.A.get("bookingResp");if(eo&&null!=(null===io||void 0===io?void 0:io.id)&&String(io.id)===String(eo)&&JSON.stringify(no)===JSON.stringify(Xe))He=io.id,Le={status:200,data:io};else{var k,C,A,N,P,D,M,B,E,T,G,L,W;if(bn(!0),Le=await(0,F.mI)(Xe),200!==(null===(k=Le)||void 0===k?void 0:k.status)){let e={data:Xe,error:Le,reason:"booking_api_failed"};(0,V.fireGtmEvent)("booking_error",e),(0,U.Jd)(Xe,Le)}if(200===(null===(C=Le)||void 0===C?void 0:C.status)&&null!==(A=Le)&&void 0!==A&&null!==(N=A.data)&&void 0!==N&&N.id){var q,J;const e=null===(q=Le)||void 0===q||null===(J=q.data)||void 0===J?void 0:J.id;try{var X,Q;localStorage.setItem("bookingId",JSON.stringify({bookingId:e,date:null===(X=Le)||void 0===X||null===(Q=X.data)||void 0===Q?void 0:Q.checkInDate}))}catch(Fe){console.error("Failed to save booking ID:",Fe)}}He=null===(P=Le)||void 0===P||null===(D=P.data)||void 0===D||null===(M=D.BookingItems[0])||void 0===M?void 0:M.bookingId,z.A.set("bookingObj",Xe),z.A.set("bookingId",null===(B=Le)||void 0===B||null===(E=B.data)||void 0===E||null===(T=E.BookingItems[0])||void 0===T?void 0:T.bookingId),z.A.set("publicId",(null===(G=Le)||void 0===G||null===(L=G.data)||void 0===L?void 0:L.publicId)||null),z.A.set("bookingResp",null===(W=Le)||void 0===W?void 0:W.data)}var Z,$;if("COD"!==vo&&ql(),400===(null===(x=Le)||void 0===x?void 0:x.status))return bn(!1),void _().error((null===(Z=Le)||void 0===Z?void 0:Z.error)||(null===($=Le)||void 0===$?void 0:$.message));if(e)return bn(!1),void z.A.set("isApiCalled",!0);z.A.get("isDomain");if(!window.location.href.includes("bookmystay.io")&&!window.location.href.includes("dev.hotelzify.com")&&!window.location.href.includes("localhost")&&!window.location.href.includes("booking.sterlingholidays.com")&&!window.location.href.includes("bookings.mhohotels.com")&&!window.location.href.includes("bookings.thealtruisthotels.com")&&!window.location.href.includes("bookings.fernhotels.com")&&!window.location.href.includes("bookings.thealtitudehotels.com")&&!window.location.href.includes("bookings.oliveliving.com")&&!window.location.href.includes("booking.openhotels.in")&&!window.location.href.includes("bookings.subahotels.com")&&!window.location.href.includes("bookings.burgbnb.com")&&!window.location.href.includes("booking.envihotel.com")&&!window.location.href.includes("owniacollection.com")&&!window.location.href.includes("bookings.rocklandhotels.com")&&!window.location.href.includes("stay.clubmahindra.com")&&He&&("Razorpay"===vo||"PartialPayment"===vo)&&("hotelzify"===(null===_e||void 0===_e?void 0:_e.superVendor)||"hotelzify"===(null===_e||void 0===_e?void 0:_e.subVendor))){if(K.un||K.nr)window.open("https://hotelzify.com/checkout/".concat(He,"?").concat(vo),"_self");else{let e=window.open("https://hotelzify.com/checkout/".concat(He,"?").concat(vo));Yl.current=e,Rn(e),En(!0)}return}if(He){var oe,ne,ie,te,ae,ce,ue,ve,xe,ye,be,Ne,Pe;let e=ll;if("COD"===vo&&(tl||dl)){const{ok:o,data:n}=await Ql(Ae);if(!o)return bn(!1),void _().error(Tl("payment_setup_check_failed")||"Couldn't verify payment setup for this hotel. Please try again.");e=n}const o="pcibooking"===(null===(oe=e)||void 0===oe?void 0:oe.vendor)&&"COD"===vo;if("COD"===vo&&!o&&(null===_e||void 0===_e||!_e.vendor))return bn(!1),void _().error(Tl("payment_setup_check_failed")||"Couldn't verify payment setup for this hotel. Please try again.");const n=localStorage.getItem("corporateToken"),i=localStorage.getItem("corporateAgentId"),t=(null===(ne=z.A.get("utmObj"))||void 0===ne?void 0:ne.utmSource)||null,a=n&&i?"agent":t?"utm_source":null,d=n&&i?i:t||null,r=(0,l.A)({bookingId:He,gateway:vo,vendor:o?null===(ie=e)||void 0===ie?void 0:ie.vendor:null===_e||void 0===_e?void 0:_e.vendor,superVendor:o?null===(te=e)||void 0===te?void 0:te.superVendor:null===_e||void 0===_e?void 0:_e.superVendor,partialAmount:Number(null===(ae=Le)||void 0===ae||null===(ce=ae.data)||void 0===ce?void 0:ce.totalAmount)>0?parseFloat(Number(null===(ue=Le)||void 0===ue||null===(ve=ue.data)||void 0===ve?void 0:ve.totalAmount)*(null===yo||void 0===yo?void 0:yo.config.minPercentage)/100).toFixed(2):parseFloat(Ze*(null===yo||void 0===yo?void 0:yo.config.minPercentage)/100).toFixed(2)||0,frontendDomain:window.location.origin},a&&{contextType:a,contextValue:d});let s={bookingId:He,frontEndPrice:Ze,backEndPrice:null===(xe=Le)||void 0===xe||null===(ye=xe.data)||void 0===ye?void 0:ye.totalAmount,hotelId:null===S||void 0===S?void 0:S.id};if(await(0,F.dP)(s),Sl){if(!hl.trim())return bn(!1),void xl(!0);const e=parseFloat(ml.amount),o=e===Math.round(Jl)?Jl:e;r.voucher={superVendor:"sterling",vendor:"qwikcilver",cardNumber:ml.cardNumber,cardPin:hl,amount:o.toFixed(2)}}const c=await(0,F.zr)(r);if(Sl&&200===(null===c||void 0===c?void 0:c.status)&&(null===c||void 0===c||null===(be=c.data)||void 0===be||!be.order)&&"completed"===(null===c||void 0===c||null===(Ne=c.data)||void 0===Ne||null===(Pe=Ne.payment)||void 0===Pe?void 0:Pe.status)){try{ii(Ue,(null===S||void 0===S?void 0:S.currency)||"INR",He,He),z.A.set("isBooked",!0)}catch(Ge){console.log("erere",Ge)}return}if(200===(null===c||void 0===c?void 0:c.status))if("paidyet"===(null===_e||void 0===_e?void 0:_e.vendor)&&window.PaidYET)(e=>{window.PaidYET.processPayment(function(o){var n,l;if(null!==o&&void 0!==o&&o.success){var i;const n={gateway:"razorpay",paymentId:null===e||void 0===e||null===(i=e.payment)||void 0===i?void 0:i.id,paidyetToken:null===o||void 0===o?void 0:o.token,vendor:"paidyet",hotelId:null===S||void 0===S?void 0:S.id};di(e,n)}else((null===o||void 0===o||null===(n=o.error)||void 0===n?void 0:n.length)>0||(null===o||void 0===o||null===(l=o.message)||void 0===l?void 0:l.length)>0)&&_().error((null===o||void 0===o?void 0:o.error)||(null===o||void 0===o?void 0:o.message))})})(null===c||void 0===c?void 0:c.data);else if(o){var Ie,Se;console.log({orderResp:c}),(e=>{let{script:o,orderResp:n}=e;Oe.current=n,vi(o),ci(!0)})({script:null===c||void 0===c||null===(Ie=c.data)||void 0===Ie||null===(Se=Ie.order)||void 0===Se?void 0:Se.iframeUrl,orderResp:null===c||void 0===c?void 0:c.data})}else if("Razorpay"===vo||"PartialPayment"===vo)o?((0,V.fireGtmEvent)("pcibooking_opened",{amount:Ue,currency:null===S||void 0===S?void 0:S.currency}),(0,V.trackCheckoutFunnel)("payment_initiated",{payment_gateway:"pcibooking",amount:Ue}),(0,K.Sp)(null===c||void 0===c?void 0:c.data,null===S||void 0===S?void 0:S.id,_e,di)):((0,V.fireGtmEvent)("razorpay_opened",{amount:Ue,currency:null===S||void 0===S?void 0:S.currency}),(0,V.trackCheckoutFunnel)("payment_initiated",{payment_gateway:"razorpay",amount:Ue}
1),"paytring"===(null===_e||void 0===_e?void 0:_e.superVendor)?(0,K.dc)(null===c||void 0===c?void 0:c.data,null===S||void 0===S?void 0:S.id,_e,di):((e,o)=>{const{order:n,payment:i,voucherPayment:t}=e,a=(0,Pn.V)(je);var d=(0,l.A)((0,l.A)({key:Fn,amount:n.amount,currency:n.currency,name:null===S||void 0===S?void 0:S.name,description:"Paying ".concat(null===S||void 0===S?void 0:S.name),image:"".concat(null===S||void 0===S?void 0:S.logo,"?tr=w-1080,h-920")||0,order_id:n.id},a?{config:a}:{}),{},{handler:async function(e){console.log("Entering handler");const l={gateway:"razorpay",paymentId:i.id,razorpayOrderId:e.razorpay_order_id,razorpayPaymentId:e.razorpay_payment_id,razorpaySignature:e.razorpay_signature,hotelId:null===S||void 0===S?void 0:S.id};bn(!1);const t=await(0,F.C8)(l);z.A.set("isBooked",!0);try{200===(null===t||void 0===t?void 0:t.status)&&(ii(Ue,null===n||void 0===n?void 0:n.currency,o,o),(0,V.trackCheckoutFunnel)("payment_completed",{payment_gateway:"razorpay",amount:Ue}))}catch(a){console.log("tagM eror",a)}},prefill:{name:Qe,email:lo,contact:oo},notes:{address:"Hotelzify Corporate Office"},theme:{color:"#e73c00"},modal:{ondismiss:function(){var e,o,n,l,i;if(bn(!1),Sl&&null!==t&&void 0!==t&&t.id&&(0,F.GO)({publicId:z.A.get("publicId"),voucherPaymentId:t.id}).catch(e=>{console.log("Gift card reversal on dismiss failed",e)}),je){const e=je.selectedInstrument,o=e?((o,n,l,i,t,a)=>{const d=[];null!==(o=e.apps)&&void 0!==o&&o.length&&d.push(e.apps[0].replace(/_/g," ")),null!==(n=e.issuers)&&void 0!==n&&n.length&&d.push(e.issuers[0]),null!==(l=e.banks)&&void 0!==l&&l.length&&d.push(e.banks[0]),null!==(i=e.networks)&&void 0!==i&&i.length&&d.push(e.networks[0]),null!==(t=e.wallets)&&void 0!==t&&t.length&&d.push(e.wallets[0]),null!==(a=e.providers)&&void 0!==a&&a.length&&d.push(e.providers[0]);const r=e.method?"upi"===e.method?"UPI":"card"===e.method?"Card":"netbanking"===e.method?"Net Banking":e.method:"";return d.length>0?"".concat(d.join(" ")," ").concat(r).trim():r})():je.name;I({type:Y.A.SET_PAYMENT_METHOD_OFFER,payload:null}),_().info("This offer is valid only for ".concat(o,". Please use the correct payment method to avail it."))}null!==Kn&&void 0!==Kn&&Kn.couponCodes&&0!==(null===Kn||void 0===Kn||null===(e=Kn.couponCodes)||void 0===e?void 0:e.length)?(Zn(!0),I({type:Y.A.SET_RETARGETING,payload:!0})):Ro(!0);let a={bookingObj:z.A.get("bookingObj")||{},bookingId:z.A.get("bookingId")||0,reason:"modal_closed"};document.querySelectorAll("#rzp").forEach(e=>e.remove()),document.querySelectorAll(".razorpay-container").forEach(e=>e.remove()),(0,V.fireGtmEvent)("payment_closed",{data:a}),(0,V.trackPaymentCancelled)({reason:"user_dismissed_modal",booking_id:a.bookingId,total_amount:(null===(o=a.bookingObj)||void 0===o?void 0:o.totalAmount)||(null===(n=a.bookingObj)||void 0===n?void 0:n.grandTotal)}),ai({gateway:"razorpay",amount:(null===(l=a.bookingObj)||void 0===l?void 0:l.totalAmount)||(null===(i=a.bookingObj)||void 0===i?void 0:i.grandTotal),errorCode:null,errorMessage:"Payment popup closed by user",bookingId:a.bookingId})}}}),r=new window.Razorpay(d);r.open(),r.on("payment.failed",function(e){var o,n,l,i,t,a,d,r,s;let c={bookingObj:z.A.get("bookingObj")||{},bookingId:z.A.get("bookingId")||0,reason:"payment_failed",error:e};(0,V.fireGtmEvent)("payment_error",{data:c}),(0,V.trackCheckoutFunnel)("payment_failed",{payment_gateway:"razorpay",amount:null===(o=c.bookingObj)||void 0===o?void 0:o.totalAmount,error_reason:null===(n=e.error)||void 0===n?void 0:n.reason}),ai({gateway:"razorpay",amount:null===(l=c.bookingObj)||void 0===l?void 0:l.totalAmount,errorCode:null===(i=e.error)||void 0===i?void 0:i.code,errorMessage:(null===(t=e.error)||void 0===t?void 0:t.description)||(null===(a=e.error)||void 0===a?void 0:a.reason),bookingId:c.bookingId}),(0,U.gp)({bookingId:z.A.get("bookingId"),amount:null===(d=c.bookingObj)||void 0===d?void 0:d.totalAmount,gateway:"razorpay",orderId:null===(r=e.error)||void 0===r||null===(s=r.metadata)||void 0===s?void 0:s.order_id},e.error),(0,V.trackBookingFailureAnalytics)({bookingData:c.bookingObj,error:e.error,failureType:"payment_failed",failureStage:"payment_processing"}),_().error(e.error.description),console.log(e.error.reason),console.log(e.error.metadata.order_id),console.log(e.error.metadata.payment_id)})})(c.data,He));else try{ii(Ue,(null===S||void 0===S?void 0:S.currency)||"INR",He,He),z.A.set("isBooked",!0)}catch(Fe){console.log("erere",Fe)}else if(400===(null===c||void 0===c?void 0:c.status)){const e=(null===c||void 0===c?void 0:c.message)||(null===c||void 0===c?void 0:c.error)||"Something went wrong. Please try again.";if(Sl)bn(!1),_().error(e),gl(""),Ml(e);else{z.A.remove("bookingId");let o=z.A.get("err")||!1;z.A.set("err",!0),bn(!1),o?_().error(e):await hi()}}else{let e={bookingId:z.A.get("bookingId")||0,bookingObj:z.A.get("bookingObj")||{},error:c,name:Qe,email:lo,phone:oo};(0,V.fireGtmEvent)("booking_error",e)}}else{var Me,Ee;let e={bookingId:z.A.get("bookingId")||0,bookingObj:z.A.get("bookingObj")||{},error:{name:"Order API Failed",bookingId:He,gateway:vo,partialAmount:parseFloat((Number(null===(Me=Le)||void 0===Me||null===(Ee=Me.data)||void 0===Ee?void 0:Ee.totalAmount)*(null===yo||void 0===yo?void 0:yo.config.minPercentage)/100).toFixed(2))||0},name:Qe,email:lo,phone:oo};(0,V.fireGtmEvent)("booking_error",e)}}catch(Fe){let e={bookingId:z.A.get("bookingId")||0,bookingObj:z.A.get("bookingObj")||{},error:Fe,reason:"catch_error",name:Qe,email:lo,phone:oo};(0,V.fireGtmEvent)("booking_error",e),console.log("err",Fe,Fe.message),_().error(Tl("try_again_later")),Ro(!0)}}else{var Te;I({type:Y.A.SET_MAHARAJA_ID_ERROR,payload:!0}),bn(!1),De<=768&&(null===(Te=document.getElementById("maharaja-club-section"))||void 0===Te||Te.scrollIntoView({behavior:"smooth",block:"center"}))}}}},[,gi]=(0,a.useState)([]),_i=e=>{"Enter"===e.code&&("name"===e.target.name?zl.current.focus():"email"===e.target.name&&Gl.current.focus())};let xi=parseFloat(z.A.get("tax"));"INR"!==(null===S||void 0===S?void 0:S.currency)&&(xi=0),(0,a.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("phone")),o=JSON.parse(localStorage.getItem("email"));var n;((null===o||void 0===o?void 0:o.length)>0&&io(o),(null===e||void 0===e?void 0:e.length)>0)&&(no(e),Fl.current&&(null===(n=Fl.current)||void 0===n||n.focus()))},[]),(0,a.useEffect)(()=>{const e=async e=>{console.log({event:e}),console.log("Payment callback received:",e.data);try{let l=e.data;if("string"===typeof l&&l.startsWith("{")&&(l=JSON.parse(l)),console.log("Parsed data:",l),console.log("Message type:",l.messageType),"CardSubmitSuccess"===l.messageType){var o,n;const e=Oe.current;if(!e)return console.error("PCIBooking order response not found"),_().error("Payment c
1onfirmation failed"),void mi();const i=null===(o=l)||void 0===o?void 0:o.cardToken,t=/\/api\/payments\/paycard\/([a-f0-9]{32})/,a=i.match(t),d=a?a[1]:null,r={gateway:"pcibooking",paymentId:null===e||void 0===e||null===(n=e.payment)||void 0===n?void 0:n.id,pciBookingData:l,pciBookingToken:d,vendor:"pcibooking",superVendor:null===ll||void 0===ll?void 0:ll.superVendor,hotelId:null===S||void 0===S?void 0:S.id};mi(),di(e,r)}else"CardSubmitFailed"===l.messageType||"CardSubmitCancelled"===l.messageType?(mi(),"CardSubmitFailed"===l.messageType?(console.error("Payment failed:",l.message||"Payment processing failed"),_().error(l.message||"Payment failed. Please try again."),(0,V.trackCheckoutFunnel)("payment_failed",{payment_gateway:"pcibooking",error_reason:l.message}),ai({gateway:"pcibooking",errorMessage:l.message})):(console.log("Payment cancelled by user"),_().info("Payment cancelled")),fn(!0),bn(!1)):"payment_failed"===l.type&&(mi(),console.error("Payment failed:",l.message),_().error("Payment failed. Please try again."),fn(!0),bn(!1),(0,V.trackCheckoutFunnel)("payment_failed",{payment_gateway:"pcibooking",error_reason:l.message}),ai({gateway:"pcibooking",errorMessage:l.message}))}catch(l){console.error("Error handling payment callback:",l)}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[null===ll||void 0===ll?void 0:ll.superVendor,null===S||void 0===S?void 0:S.id]);const fi=null===(i=t()(null===ee||void 0===ee?void 0:ee.startDate))||void 0===i?void 0:i.subtract(null!==(d=null===xe||void 0===xe?void 0:xe.cutoff)&&void 0!==d?d:0,"days").isSameOrAfter(t()());(0,a.useEffect)(()=>{(async()=>{try{if(null!==S&&void 0!==S&&S.id){var e,o,n;const l=await(0,F.yJ)(null===S||void 0===S?void 0:S.id);200===(null===l||void 0===l?void 0:l.status)&&null!==(null===l||void 0===l?void 0:l.data)&&Array.isArray(null===l||void 0===l||null===(e=l.data)||void 0===e?void 0:e.couponCodes)&&(null===l||void 0===l||null===(o=l.data)||void 0===o||null===(n=o.couponCodes)||void 0===n?void 0:n.length)>0&&Xn(null===l||void 0===l?void 0:l.data)}}catch(l){console.error("Error fetching discount:",l)}})()},[null===S||void 0===S?void 0:S.id]),(0,a.useEffect)(()=>{const e=Te.current;if(!e)return;const o=new IntersectionObserver(e=>{let[o]=e;vl(e=>o.isIntersecting?2:e)},{threshold:.15});return o.observe(e),()=>o.disconnect()},[]),(0,a.useEffect)(()=>{null!==Qe&&void 0!==Qe&&Qe.trim()&&oo&&null!==lo&&void 0!==lo&&lo.trim()?vl(2):vl(e=>2===e?1:e)},[Qe,oo,lo]);const yi=(0,a.useMemo)(()=>{var e,o,n,l,i;const t="PartialPayment"===vo?(null!==(e=+(null===yo||void 0===yo||null===(o=yo.config)||void 0===o?void 0:o.minPercentage))&&void 0!==e?e:100)/100:1,a=re&&!de?(Be.appliedDiscount.discount>0?Be.priceAfterDiscount+(null===Be||void 0===Be?void 0:Be.totalAddonCost)+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+(null===(n=Be.taxObj)||void 0===n?void 0:n.totalBookingTax):Be.rpPrice+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+(null===(l=Be.taxObj)||void 0===l?void 0:l.totalBookingTax))*t:(Re.totalPrice+Math.abs(Re.totalTax+(null===(i=Re.taxObj)||void 0===i?void 0:i.totalBookingTax)))*t,d=Sl?parseFloat(ml.amount||0):0;return Math.max(0,a-d).toFixed(2)},[re,de,null===(r=Re.taxObj)||void 0===r?void 0:r.totalBookingTax,Re.totalPrice,Re.totalTax,null===yo||void 0===yo||null===(s=yo.config)||void 0===s?void 0:s.minPercentage,vo,Be.appliedDiscount.discount,Be.priceAfterDiscount,Be.rpPrice,Be.rpTax,null===(g=Be.taxObj)||void 0===g?void 0:g.totalBookingTax,null===Be||void 0===Be?void 0:Be.totalAddonCost,Sl,ml.amount]);return(0,E.jsxs)("div",{className:ue.A.checkoutPage,children:[(0,E.jsxs)(u.m,{children:[(0,E.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,E.jsx)("meta",{name:"googlebot",content:"noindex,nofollow"}),(0,E.jsxs)("title",{children:["Checkout - ",(null===S||void 0===S?void 0:S.name)||"Hotel Booking"]})]}),(0,E.jsxs)("div",{className:ue.A.rowContainer,children:[(0,E.jsx)("div",{className:ue.A.checkoutProgress,children:[{label:"Your Selection",step:0},{label:"Your Details",step:1},{label:"Finish Booking",step:2}].map((e,o,n)=>{let{label:l,step:i}=e;const t=!!(null!==Qe&&void 0!==Qe&&Qe.trim()&&oo&&null!==lo&&void 0!==lo&&lo.trim()),d=0===i||1===i&&t,r=1===i&&!t||2===i&&t;return(0,E.jsxs)(a.Fragment,{children:[(0,E.jsxs)("div",{className:"".concat(ue.A.progressStep," ").concat(d?ue.A.progressStep__done:""," ").concat(r?ue.A.progressStep__active:""),children:[(0,E.jsx)("div",{className:ue.A.progressStep__circle,children:d?(0,E.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",children:(0,E.jsx)("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,E.jsx)("span",{children:i+1})}),(0,E.jsx)("span",{className:ue.A.progressStep__label,children:l})]}),o<n.length-1&&(0,E.jsx)("div",{className:"".concat(ue.A.progressConnector," ").concat(0===i||1===i&&t?ue.A.progressConnector__filled:"")})]},i)})}),(0,E.jsxs)("div",{className:ue.A.boxContainer,children:[(0,E.jsxs)("div",{className:ue.A.leftBoxContainer,children:[null!==Ne&&void 0!==Ne&&Ne.length?(0,E.jsx)("div",{className:ue.A.addons_section,children:(0,E.jsx)(Xo,{HotelAddons:Ne})}
1):null,sl.length>0&&(0,E.jsx)(kn,{messages:sl,childCount:Ln}),(0,E.jsxs)("div",{className:ue.A.guestFormBox,children:[(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsx)("h3",{children:"Contact Details"}),(0,E.jsxs)("div",{className:ue.A.formRowBox,children:[(0,E.jsxs)("div",{className:ue.A.formFieldCol,children:[(0,E.jsxs)("label",{htmlFor:"checkout-phone",style:{fontSize:"0.875rem",fontWeight:500,color:"#171719"},children:["Phone Number ",(0,E.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,E.jsx)(v.Ay,{id:"checkout-phone",defaultCountry:tn,className:ue.A.guestPhoneInput,style:{width:"100%"},placeholder:"Phone Number",value:oo,ref:Gl,name:"phone",onChange:e=>{no(e),_n(!1)},onKeyPress:_i,"aria-required":"true","aria-invalid":gn||Boolean(oo&&!(0,v.g0)(String(oo)))?"true":"false",autoComplete:"tel"})]}),(0,E.jsxs)("div",{className:ue.A.formFieldCol,children:[(0,E.jsxs)("label",{htmlFor:"checkout-email",style:{fontSize:"0.875rem",fontWeight:500,color:"#171719"},children:["Email Address ",(0,E.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,E.jsx)("input",{id:"checkout-email",type:"email",ref:zl,value:lo,onChange:e=>{var o;io(null===(o=e.target.value)||void 0===o?void 0:o.trim()),hn(!1)},name:"email",placeholder:"Email Address",onKeyPress:_i,className:ue.A.guestEmailInput,style:{width:"100%"},"aria-required":"true","aria-invalid":pn?"true":"false",autoComplete:"email"})]})]})]}),(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsxs)("h3",{children:["Guest Details"," ",(0,E.jsx)("span",{style:{color:"red",verticalAlign:"middle"},children:"*"})]}),(0,E.jsxs)("div",{className:ue.A.customerInput,children:[(0,E.jsx)("label",{htmlFor:"checkout-title",className:"visually-hidden",children:"Title (Mr/Ms/Mrs)"}),(0,E.jsxs)("select",{id:"checkout-title",name:"title",value:$e,onChange:e=>eo(e.target.value),style:{border:"none",padding:"0"},"aria-label":"Select title",children:[(0,E.jsx)("option",{value:"Male",children:"Mr"}),(0,E.jsx)("option",{value:"Female",children:"Ms"}),(0,E.jsx)("option",{value:"Female",children:"Mrs"})]}),(0,E.jsx)("label",{htmlFor:"checkout-name",className:"visually-hidden",children:"Full Name (required)"}),(0,E.jsx)("input",{id:"checkout-name",ref:Fl,type:"text",value:Qe,onChange:e=>{Ze(e.target.value),mn(!1)},name:"name",placeholder:"Full Name",onKeyPress:_i,"aria-required":"true","aria-invalid":vn?"true":"false",autoComplete:"name"})]})]}),Co&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsx)("h3",{children:"Tax Details (GST/VAT/Tax ID)"}),(0,E.jsx)("label",{htmlFor:"checkout-tax-details",className:"visually-hidden",children:"Tax ID (GST/VAT/etc.)"}),(0,E.jsx)("input",{id:"checkout-tax-details",type:"text",value:ro,onChange:e=>
1so(e.target.value),name:"taxDetails",placeholder:"Enter your Tax ID (GST/VAT/etc.)",className:ue.A.guestEmailInput})]}),(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsx)("h3",{children:"Additional Email Recipients"}),(0,E.jsxs)("div",{className:ue.A.emailChipsContainer,children:[(0,E.jsx)("div",{className:ue.A.emailChips,children:to.filter(e=>e.trim()).map((e,o)=>(0,E.jsxs)("div",{className:ue.A.emailChip,children:[(0,E.jsx)("span",{children:e}),(0,E.jsx)("button",{type:"button",onClick:()=>{const e=to.filter((e,n)=>n!==o);ao(e)},className:ue.A.chipRemove,"aria-label":"Remove",children:"\xd7"})]},o))}),(0,E.jsx)("label",{htmlFor:"additional-emails-input",className:"visually-hidden",children:"Additional Email Recipients"}),(0,E.jsx)("input",{id:"additional-emails-input",type:"email",placeholder:"Type email and press Enter",className:ue.A.emailChipInput,onKeyDown:e=>{if("Enter"===e.key&&e.target.value.trim()){e.preventDefault();const o=e.target.value.trim();o&&!to.includes(o)&&(ao([...to,o]),e.target.value="")}},onBlur:e=>{const o=e.target.value.trim();o&&!to.includes(o)&&(ao([...to,o]),e.target.value="")},"aria-describedby":"additional-emails-help"}),(0,E.jsx)("span",{id:"additional-emails-help",className:"visually-hidden",children:"Press Enter to add multiple email addresses"})]})]})]}),(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsx)("h3",{children:"Special Requests (if any)"}),(0,E.jsx)("label",{htmlFor:"checkout-special-requests",className:"visually-hidden",children:"Special Requests (optional)"}),(0,E.jsx)("textarea",{id:"checkout-special-requests",name:"requests",placeholder:"Write Here",cols:"20",rows:"5",value:No,className:ue.A.guestRequestBox,onClick:()=>(0,V.fireGtmEvent)("checkout_special_request"),onChange:e=>Po(e.target.value),style:{resize:"vertical"}})]}),Pe?(0,E.jsxs)("div",{className:ue.A.formInputContainer,children:[(0,E.jsx)("h3",{children:"GST Invoice (optional)"}),(0,E.jsx)(X.A,{})]}):null]}),!On&&!re&&(0,E.jsx)("div",{className:ue.A.cancellationPolicyBox,children:(0,E.jsx)(Cn.A,{cancellationPolicy:Yo,setCancellationPolicy:Fo,dateRange:ee,isMiniVersion:!0,paymentProvider:_e})}),(0,E.jsxs)("div",{className:ue.A.paymentsMethodBox,ref:Te,children:[(0,E.jsx)("div",{className:ue.A.paymentHeaderBox,children:(0,E.jsxs)("p",{className:ue.A.paymentTitle,children:[Tl("payment_methods"),Co&&jo&&(0,E.jsxs)("span",{style:{fontSize:"0.75rem",color:"#6366f1",marginLeft:"10px",fontWeight:"normal",fontStyle:"italic"},children:["(",jo.name,")"]})]})}),(0,E.jsxs)("div",{className:ue.A.totalSummaryBox,children:[(0,E.jsx)("p",{children:"Amount to be paid"}),(0,E.jsx)("span",{children:re&&!de?(0,E.jsx)("span",{style:{color:"#000000",fontWeight:"700",fontSize:"1.1rem"},children:(0,E.jsx)(W.A,{amount:Math.max(0,(Be.appliedDiscount.discount>0?Be.priceAfterDiscount+(null===Be||void 0===Be?void 0:Be.totalAddonCost)+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+(null===(f=Be.taxObj)||void 0===f?void 0:f.totalBookingTax):Be.rpPrice+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+(null===(y=Be.taxObj)||void 0===y?void 0:y.totalBookingTax))-Xl)})}):(0,E.jsx)("span",{style:{color:"#494545",fontWeight:"700",fontSize:"1.1rem"},children:(0,E.jsx)(W.A,{amount:Math.max(0,Re.totalPrice+Math.abs(Re.totalTax+(null===(b=Re.taxObj)||void 0===b?void 0:b.totalBookingTax))-Xl)})})})]}),Rl&&(0,E.jsxs)("div",{style:{margin:"16px 0",padding:"20px",background:"#ffffff",borderRadius:"16px",boxShadow:"0 4px 20px rgba(0,0,0,0.04)",border:"1px solid rgba(0,0,0,0.05)",width:"100%",boxSizing:"border-box"},children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},children:[(0,E.jsx)("div",{style:{background:"linear-gradient(135deg, #e3f2fd, #bbdefb)",padding:"8px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,E.jsx)("img",{src:In,alt:"gift card",width:22,height:22})}),(0,E.jsx)("p",{style:{fontWeight:700,fontSize:"1.05rem",color:"#1c1c1e",margin:0},children:"Have a Gift Card, Redeem Here"})]}),Sl?(0,E.jsxs)("div",{style:{background:"linear-gradient(135deg, #f1f8e9, #dcedc8)",borderRadius:"12px",padding:"16px 18px",border:"1px solid rgba(104, 159, 56, 0.2)"},children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,E.jsx)("span",{style:{fontWeight:700,color:"#33691e",fontSize:"0.95rem"},children:"Gift Card Applied"}),(0,E.jsxs)("div",{style:{fontSize:"0.85rem",color:"#558b2f",fontWeight:500},children:["****",ml.cardNumber.slice(-4)," \u2022 Applied amount: ",(0,L.Gl)(null===S||void 0===S?void 0:S.currency),ml.amount]}),Al&&(0,E.jsxs)("div",{style:{fontSize:"0.8rem",color:"#558b2f"},children:["Available balance: ",(0,L.Gl)(null===S||void 0===S?void 0:S.currency),Al.balance,(0,E.jsx)("div",{children:"Enter Gift Card amount to be used for this booking."})]})]}),(0,E.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[!bl&&(0,E.jsx)("button",{onClick:()=>{jl(!0),Cl(ml.amount),Ml("")},style:{background:"rgba(26, 115, 232, 0.12)",color:"#1a73e8",border:"none",borderRadius:"8px",padding:"7px 14px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600,transition:"background 0.2s"},children:"Edit"}),(0,E.jsx)("button",{onClick:()=>{wl(!1),Nl(null),gl(""),jl(!1),Cl(""),pl({cardNumber:"",amount:""})},style:{background:"rgba(198, 40, 40, 0.1)",color:"#c62828",border:"none",borderRadius:"8px",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background 0.2s"},title:"Remove","aria-label":"Remove Gift Card",children:(0,E.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,E.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),bl&&(0,E.jsxs)("div",{style:{marginTop:"14px"},children:[(0,E.jsx)("input",{type:"text",inputMode:"decimal",value:kl,onChange:e=>{/^\d*\.?\d*$/.test(e.target.value)&&(Cl(e.target.value),Ml(""))},autoFocus:!0,style:{width:"100%",padding:"11px 14px",background:"#fff",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"10px",fontSize:"0.95rem",color:"#1c1c1e",outlineColor:"#1a73e8",boxSizing:"border-box",marginBottom:"10px"}}),(0,E.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,E.jsx)("button",{onClick:()=>{const e=parseFloat(kl);if(!e||e<=0)return void Ml("Please enter a valid amount");if(e>parseFloat((null===Al||void 0===Al?void 0:Al.balance)||0))return void Ml("Amount exceeds available balance");if(e>Math.round(Jl))return void Ml("Amount exceeds booking total");const o=Jl-e;o>0&&o<1?Ml("Please redeem the full amount, or leave at least \u20b91 to pay separately"):(pl(o=>(0,l.A)((0,l.A)({},o),{},{amount:e.toFixed(2)})),jl(!1),Ml(""))},style:{flex:1,padding:"11px 14px",background:"linear-gradient(135deg, #1a73e8, #0056b3)",color:"#fff",border:"none",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem",fontWeight:600,boxShadow:"0 4px 12px rgba(26,115,232,0.3)"},children:"Redeem"}),(0,E.jsx)("button",{onClick:()=>{jl(!1),Ml("")},style:{flex:1,padding:"11px 14px",background:"rgba(0,0,0,0.06)",color:"#48484a",border:"none",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem",fontWeight:600},children:"Cancel"})]}),Dl&&(0,E.jsx)("div",{style:{color:"#c62828",fontSize:"0.82rem",marginTop:"8px",fontWeight:500},children:Dl})]})]}):(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"12px"},children:[(0,E.jsx)("input",{type:"text",placeholder:"Enter Gift Card Number",value:ml.cardNumber,onChange:e=>{pl(o=>(0,l.A)((0,l.A)({},o),{},{cardNumber:e.target.value.trim()})),Nl(null),Ml("")},style:{flex:1,minWidth:0,padding:"12px 14px",background:"#f4f5f7",border:"1px solid rgba(0,0,0,0.06)",borderRadius:"10px",fontSize:"0.95rem",color:"#1c1c1e",outlineColor:"#1a73e8"}}),(0,E.jsx)("button",{onClick:()=>{ml.cardNumber.trim()?(Ml(""),xl(!0)):Ml("Please enter a card number")},disabled:Pl||!ml.cardNumber.trim(),style:{flexShrink:0,padding:"12px 16px",background:Pl||!ml.cardNumber.trim()?"#e0e0e0":"linear-gradient(135deg, #1a73e8, #0056b3)",color:Pl||!ml.cardNumber.trim()?"#9e9e9e":"#ffffff",border:"none",borderRadius:"10px",cursor:Pl||!ml.cardNumber.trim()?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:600,whiteSpace:"nowrap",boxShadow:Pl||!ml.cardNumber.trim()?"none":"0 4px 12px rgba(26,115,232,0.3)"},children:Pl?"Checking...":"Apply"})]}),Dl&&(0,E.jsxs)("div",{style:{background:"#ffebee",color:"#c62828",padding:"10px 14px",borderRadius:"8px",fontSize:"0.85rem",fontWeight:500,marginTop:"4px",display:"flex",alignItems:"center",gap:"6px"},children:[(0,E.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,E.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,E.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Dl]})]})]}),!Kl&&(0,E.jsxs)(E.Fragment,{children:["razorpay"===(null===_e||void 0===_e?void 0:_e.vendor)&&qo&&(0,E.jsxs)("div",{className:ue.A.securePaymentBox,children:[(0,E.jsx)("span",{children:"Payments secured by"}),(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/razorpay_logo.svg.svg",alt:"razorpay"})]}),(0,E.jsxs)("div",{className:ue.A.paymentContainer,children:["paidyet"===(null===_e||void 0===_e?void 0:_e.vendor)?(0,E.jsx)("div",{children:(0,E.jsx)(ce.A,{email:lo,isScriptLoaded:xn,amount:re&&!de?(Be.appliedDiscount.discount>0?Be.priceAfterDiscount+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+Be.taxObj.totalBookingTax:Be.rpPrice+(null!==S&&void 0!==S&&S.isTaxIncluded?0:Be.rpTax)+Be.taxObj.totalBookingTax).toFixed((0,K.S2)(null===S||void 0===S?void 0:S.currency)):(Re.totalPrice+Math.abs(Re.totalTax)).toFixed((0,K.S2)(null===S||void 0===S?void 0:S.currency))})}):tl?(0,E.jsxs)("div",{className:ue.A.paymentOptions,children:[[1,2].map(e=>(0,E.jsxs)("div",{className:ue.A.paymentOption,style:{opacity:.6,pointerEvents:"none",position:"relative",overflow:"hidden"},children:[(0,E.jsx)("div",{style:{width:"40px",height:"40px",backgroundColor:"#e0e0e0",borderRadius:"8px",animation:"pulse 1.5s ease-in-out infinite"}}),(0,E.jsx)("div",{style:{flex:1},children:(0,E.jsx)("div",{style:{width:"120px",height:"16px",backgroundColor:"#e0e0e0",borderRadius:"4px",animation:"pulse 1.5s ease-in-out infinite"}})})]},e)),(0,E.jsx)("style",{children:"\n @keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n "})]}):(0,E.jsxs)("div",{className:ue.A.paymentOptions,role:"radiogroup","aria-label":"Payment methods",children:[(0===(null===po||void 0===po?void 0:po.length)||(null===po||void 0===po?void 0:po.some(e=>2===(null===e||void 0===e?void 0:e.gatewayId))))&&(0,E.jsxs)("div",{role:"radio","aria-checked":"COD"===vo,tabIndex:"0",onClick:()=>Ul("COD"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ul("COD"))},className:"COD"===vo?ue.A.selectedPaymentOption:ue.A.paymentOption,children:["COD"===vo&&(0,E.jsx)("img",{src:wn,alt:"selected payment option",className:ue.A.selectedPay}),(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/cod.svg",alt:"pay at property"}),(0,E.jsxs)("p",{children:[ni("2",Tl("pay_at_property")),"pcibooking"===(null===ll||void 0===ll?void 0:ll.vendor)&&(0,E.jsx)("span",{style:{display:"block",color:"#000",fontSize:"12px",fontWeight:"normal"},children:"Credit card information required"})]})]}),(null===po||void 0===po?void 0:po.some(e=>1===(null===e||void 0===e?void 0:e.gatewayId)))&&(0,E.jsxs)("div",{role:"radio","aria-checked":"Razorpay"===vo,tabIndex:"0",onClick:()=>Ul("Razorpay"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ul("Razorpay"))},className:"Razorpay"===vo?ue.A.selectedPaymentOption:ue.A.paymentOption,children:["Razorpay"===vo&&(0,E.jsx)("img",{src:wn,alt:"selected payment option",className:ue.A.selectedPay}),(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/rzpimg.svg",alt:"pay now"}),null!==po&&void 0!==po&&po.some(e=>2===(null===e||void 0===e?void 0:e.gatewayId))||null!==po&&void 0!==po&&po.some(e=>3===(null===e||void 0===e?void 0:e.gatewayId))||null!==po&&void 0!==po&&po.some(e=>4===e.gatewayId)&&fi?(0,E.jsx)("p",{children:Tl("pay_full_amount")}):(0,E.jsx)("p",{children:"Pay Now"})]}),(null===po||void 0===po?void 0:po.some(e=>3===(null===e||void 0===e?void 0:e.gatewayId)))&&(0,E.jsxs)("div",{role:"radio","aria-checked":"PartialPayment"===vo,tabIndex:"0",onClick:()=>Ul("PartialPayment"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ul("PartialPayment"))},className:"PartialPayment"===vo?ue.A.selectedPaymentOption:ue.A.paymentOption,children:["PartialPayment"===vo&&(0,E.jsx)("img",{src:wn,alt:"selected payment option",className:ue.A.selectedPay}),(0,E.jsx)("img",{src:Sn,alt:"pay partial",width:30,height:30}),(0,E.jsxs)("p",{children:[Tl("pay_just")," ",null===yo||void 0===yo||null===(j=yo.config)||void 0===j?void 0:j.minPercentage,"%"," ",Tl("now_to_reserve")]})]}),(null===po||void 0===po?void 0:po.some(e=>4===e.gatewayId))&&fi&&(0,E.jsxs)("div",{onClick:()=>Ul("BNPL"),className:"BNPL"===vo?ue.A.selectedPaymentOption:ue.A.paymentOption,children:["BNPL"===vo&&(0,E.jsx)("img",{src:wn,alt:"selected payment option",className:ue.A.selectedPay}),(0,E.jsx)("img",{src:Sn,alt:"pay partial",width:30,height:30}),(0,E.jsx)("p",{children:"Book Now Pay Later"})]})]}),"BNPL"===vo&&(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",margin:"16px 0",lineHeight:"32px"},className:ue.A.bnplMessageContainer,children:[(0,E.jsx)("img",{width:50,height:50,className:ue.A.bnplSuccessIcon,src:"https://ik.imagekit.io/hotelzifyprod/assets/images/success.svg",alt:"success icon"}),(0,E.jsxs)("h6",{className:ue.A.bnplMessage,children:["Settle your payment anytime before"," ",(0,E.jsxs)("span",{style:{fontWeight:600},children:[null===(k=t()(null===ee||void 0===ee?void 0:ee.startDate))||void 0===k?void 0:k.subtract(null!==(C=null===xe||void 0===xe?void 0:xe.cutoff)&&void 0!==C?C:0,"days").format("LLL")," "]}),(0,E.jsx)("br",{className:ue.A.bnplLineBreak})," to secure your booking. No rush, we've got you covered!"]})]})]})]})]})]}),(0,E.jsxs)("div",{className:ue.A.rightBoxContainer,children:[(0,Fe.DF)(ye,ze.i.CHECKOUT.FLASH_SALE_CARD)&&(0,E.jsx)("div",{className:ue.A.flash_sale,children:(0,E.jsx)(Ye,{hotelData:S,isHourlyRoom:de,hourlyTime:se,hourlyDate:me,hourlyHour:pe,dateRange:ee,dateCount:oe,addHoursToTime:K.D4})}),(0,E.jsxs)("div",{className:ue.A.paymentSummary_section,children:[(0,E.jsx)(Nn.A,{paymentOption:vo,hasOnlinePayment:null===po||void 0===po?void 0:po.some(e=>{var o;return 1===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),onSelectOnlinePayment:()=>Ul("Razorpay"),totalAmount:(Be.appliedDiscount.discount>0?Be.priceAfterDiscount:Be.rpPrice)+Be.rpTax+(Be.taxObj.totalBookingTax||0),stayNights:oe}),(0,E.jsx)(zo,{isRatePlans:re,priceCalculator:Be,oldPriceCalculator:Re,extraPrice:1,giftCardApplied:Sl,giftCard:ml})]}),ri?null:(0,E.jsx)(ve.A,{})]})]})]}),(0,E.jsxs)("div",{className:"checkoutPage__button fixed",children:[(0,E.jsxs)("div",{className:"checkout__button_pyment",children:[(0,E.jsx)("span",{children:(0,E.jsx)("span",{style:{color:"#494545",fontWeight:"700",fontSize:"1.1rem"},children:(0,E.jsx)(W.A,{amount:Number(yi)})})}),(0,E.jsxs)("div",{className:"checkOutPage_paymentMethodContainer",children:[(0,E.jsx)("p",{children:"Razorpay"===vo?"Pay now":"COD"===vo?ni("2","Pay at Property"):"BNPL"===vo?"Book Now Pay Later":"PartialPayment"===vo?(0,E.jsxs)(E.Fragment,{children:[Tl("pay_just")," ",null===yo||void 0===yo||null===(A=yo.config)||void 0===A?void 0:A.minPercentage,"%"," ",Tl("now_to_reserve")]}):""}),(0,E.jsxs)("div",{className:"checkOutPage_paymentMethods_box",onClick:()=>{(0,V.fireGtmEvent)("clicked_checkout_edit_payment_method"),Te.current.scrollIntoView({behavior:"smooth",block:"start"})},children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzify
1prod/assets/svg/edit_btn_chkout.svg",alt:"edit_payment_method"}),(0,E.jsx)("span",{className:"checkOutPage_paymentMethod_desk",children:"Edit Payment Mode"}),(0,E.jsx)("span",{className:"checkOutPage_paymentMethod_chng",children:"Change"})]})]})]}),(0,E.jsx)("button",{className:an?" checkoutPage__bookNow reduceWidth newBG":" checkoutPage__bookNow reduceWidth",style:{display:"flex",justifyContent:"center",alignItems:"center"},disabled:yn||M||jn||tl,onClick:()=>{pi()},children:(0,E.jsxs)("div",{className:"checkout_bookNow_content",children:[M?(0,E.jsx)($.A,{}):(0,An.ZN)(null===S||void 0===S?void 0:S.userId,"Complete Booking"),(0,E.jsx)(Go.A,{className:"checkoutPage_bokNow_arrow"})]})})]}),(0,E.jsx)(Qo.A,{isOpen:si,onClose:mi,paymentUrl:ui,onPaymentSuccess:e=>{console.log("Payment success",e)},onPaymentFailure:e=>{console.log("Payment failure",e)}}),Ho&&(0,E.jsx)("div",{className:"checkoutPageShowWhy",children:(0,E.jsxs)("div",{className:"checkoutPageShowWhyContainer",children:[(0,E.jsxs)("ul",{children:[(0,E.jsx)("div",{className:"showWhyHeader",children:Tl("why_book_direct")}),(0,E.jsxs)("li",{children:[Tl("book_directly_message")," \ud83d\udc51"]}),(0,E.jsxs)("li",{children:[Tl("booking_directly_message")," \ud83d\ude42"]}),(0,E.jsxs)("li",{children:[Tl("payment_options_message")," \ud83d\ude42"]})]}),(0,E.jsx)("div",{className:"showWhyClose",onClick:()=>{Lo(!Ho),Ho?(0,V.fireGtmEvent)("book_why_closed"):(0,V.fireGtmEvent)("book_why_opened")},children:"X"})]})}),cn&&(0,E.jsx)("div",{className:"checkoutPageShowWhy",children:(0,E.jsxs)("div",{className:"checkoutPageShowWhyContainer",children:[(0,E.jsxs)("ul",{children:[(0,E.jsx)("div",{className:"showWhyHeader",children:Tl("disclaimer")}),(0,E.jsx)("p",{style:{fontSize:"14px"},children:Tl("disclaimer_text")})]}),(0,E.jsx)("div",{className:"showWhyClose",onClick:()=>un(!1),children:"X"})]})}),(0,E.jsx)(T,{show:Mo,onClose:()=>Ro(!1),retargetingPopupConfig:null===ye||void 0===ye||null===(N=ye.pages)||void 0===N||null===(P=N.checkout)||void 0===P?void 0:P.retargetingPopup,feedbackText:To,onFeedbackTextChange:Oo,onFeedbackSubmit:async()=>{if(0===(null===To||void 0===To?void 0:To.length))return void _().info(Tl("add_reason_suggestions"));const e={bookingId:(null===z.A||void 0===z.A?void 0:z.A.get("bookingId"))||205,reasons:[{id:14,reason:"others "+To}]};200===(await(0,F.aK)(e)).status&&(_().success(Tl("thank_you_response")),gi([]),Oo("")),Ro(!1)}}
1),ol&&Kn&&(0,E.jsx)(ne,{coupon:Kn,onComplete:()=>{nl(!1)},isRetargeting:!0,duration:1e4}),Qn&&(0,E.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100dvh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"3000"},children:(0,E.jsxs)("div",{style:{backgroundColor:"#fff",padding:"17px",borderRadius:"10px",textAlign:"center",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.2)",width:De<540?"80vw":"500px",marginBottom:"20px"},children:[(0,E.jsx)("img",{style:{marginLeft:"97%",marginTop:"-20px",cursor:"pointer"},src:"https://ik.imagekit.io/hotelzifyprod/assets/images/close.svg",onClick:()=>{el(!1),Zn(!1)},alt:"close"}),(0,E.jsxs)("h2",{style:{marginTop:"-10px",fontSize:De>=540?"23px":"20px"},children:["Wait a Second!",(0,E.jsx)("br",{})," We have"," ",(0,E.jsx)("span",{style:{color:"var(--blue)"},children:"something special"})," ","for you"]}),(0,E.jsxs)("p",{style:{marginTop:"5px"},children:[" ","Here's an extra"," ","string"===typeof(null===Kn||void 0===Kn?void 0:Kn.discountType)&&null!==Kn&&void 0!==Kn&&Kn.discountType.includes("fixed")?(0,E.jsxs)("b",{children:[(0,E.jsx)("strong",{style:{color:"var(--blue)"},children:(0,E.jsx)(W.A,{amount:Math.floor((Number(null===Kn||void 0===Kn?void 0:Kn.discount)||0)*(Number(oe)||0)*(Array.isArray(w)&&(null===w||void 0===w?void 0:w.length)>0?null===w||void 0===w?void 0:w.length:Array.isArray(D)&&(null===D||void 0===D?void 0:D.length)>0?null===D||void 0===D?void 0:D.length:0))})})," "]}):(0,E.jsxs)("b",{children:[(0,E.jsxs)("strong",{style:{color:"var(--blue)"},children:[Math.floor(Number(null===Kn||void 0===Kn?void 0:Kn.discount)||0),"% discount"]})," "]}),"to complete your booking."]}),(0,E.jsx)("img",{src:In,alt:"Gift box"}),(0,E.jsx)("div",{style:{width:"fit-content",height:"fit-content",margin:"auto",marginBottom:"20px",marginTop:"20px",alignContent:"center",padding:"5px 20px 5px 20px",border:"2px dotted var(--blue)"},className:"testBluecolor",children:(0,E.jsxs)("p",{style:{margin:"auto"},children:[" ",null===Kn||void 0===Kn?void 0:Kn.couponCodes]})}),(0,E.jsxs)("button",{style:{background:$n?"#4caf50":"var(--blue)",color:"white",padding:"10px 20px",border:"none",borderRadius:"5px",cursor:"pointer",transition:"background-color 0.3s"},onClick:()=>{var e;I({type:Y.A.SET_RETARGETING,payload:!0});const o=Array.isArray(null===Kn||void 0===Kn?void 0:Kn.couponCodes)?null===Kn||void 0===Kn||null===(e=Kn.couponCodes)||void 0===e?void 0:e.join(", "):"";navigator.clipboard.writeText(o).then(()=>{el(!0)}).catch(e=>console.error("Failed to copy: ",e))},children:[$n?(0,E.jsxs)("div",{style:{display:"flex"},children:[(0,E.jsx)("svg",{style:{marginRight:"8px",width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,E.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsx)("span",{children:"Copy promo code"})," "]}),(0,E.jsx)("p",{style:{fontSize:"13px",marginTop:"10px",textDecoration:"underline",color:"var(--blue)",cursor:"pointer"},onClick:()=>{Zn(!1),Ro(!0)},children:"Share your feedback and win an Amazon voucher worth Rs 500"})]})}),Bo&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("style",{children:"\n @keyframes rm2-overlay-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes rm2-card-in {\n 0% { opacity: 0; transform: translateY(28px) scale(0.97); }\n 100% { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes rm2-line-expand {\n from { transform: scaleX(0); }\n to { transform: scaleX(1); }\n }\n @keyframes rm2-num-in {\n 0% { opacity: 0; transform: translateY(16px); }\n 100% { opacity: 1; transform: translateY(0); }\n }\n @keyframes rm2-fade-up {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes rm2-ripple {\n 0% { transform: scale(0.6); opacity: 0.5; }\n 100% { transform: scale(2.4); opacity: 0; }\n }\n @keyframes rm2-shimmer {\n 0% { background-position: -200% center; }\n 100% { background-position: 200% center; }\n }\n @keyframes rm2-pulse-ring {\n 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue-solid, #0078d4) 35%, transparent); }\n 70% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--blue-solid, #0078d4) 0%, transparent); }\n 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue-solid, #0078d4) 0%, transparent); }\n }\n .rm2-overlay { animation: rm2-overlay-in 0.28s ease forwards; }\n .rm2-card { animation: rm2-card-in 0.48s cubic-bezier(0.22,1,0.36,1) forwards; }\n .rm2-divider { transform-origin: left; animation: rm2-line-expand 0.55s cubic-bezier(0.22,1,0.36,1) 0.2s both; }\n .rm2-num { animation: rm2-num-in 0.5s cubic-bezier(0.22,1,0.36,1) 0.12s both; }\n .rm2-t1 { animation: rm2-fade-up 0.38s ease 0.28s both; }\n .rm2-t2 { animation: rm2-fade-up 0.38s ease 0.38s both; }\n .rm2-t3 { animation: rm2-fade-up 0.38s ease 0.48s both; }\n .rm2-cta{ animation: rm2-fade-up 0.38s ease 0.56s both; }\n .rm2-icon-ring { animation: rm2-pulse-ring 1.8s ease 0.6s infinite; }\n .rm2-shimmer-num {\n background: linear-gradient(\n 90deg,\n var(--blue-solid, #0078d4) 0%,\n color-mix(in srgb, var(--blue-solid, #0078d4) 55%, #fff) 30%,\n color-mix(in srgb, var(--blue-solid, #0078d4) 20%, #fff) 50%,\n color-mix(in srgb, var(--blue-solid, #0078d4) 55%, #fff) 70%,\n var(--blue-solid, #0078d4) 100%\n );\n background-size: 200% auto;\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n animation: rm2-shimmer 2.6s linear 0.5s infinite;\n }\n .rm2-ripple-circle {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n background: color-mix(in srgb, var(--blue-solid, #0078d4) 18%, transparent);\n animation: rm2-ripple 1.5s ease-out 0.5s forwards;\n }\n .rm2-cta-btn {\n transition: opacity 0.18s, transform 0.15s;\n }\n .rm2-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }\n .rm2-cta-btn:active { transform: translateY(0); }\n .rm2-close-btn { transition: background 0.15s, color 0.15s; }\n .rm2-close-btn:hover {\n background: color-mix(in srgb, var(--blue-solid, #0078d4) 12%, transparent) !important;\n color: var(--blue-solid, #0078d4) !important;\n }\n "}),(0,E.jsx)("div",{className:"rm2-overlay",style:{position:"fixed",inset:0,backgroundColor:"rgba(0,10,26,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3e3,padding:"16px",boxSizing:"border-box",backdropFilter:"blur(8px)"},onClick:()=>Eo(!1),children:(0,E.jsxs)("div",{className:"rm2-card",style:{backgroundColor:"#fff",borderRadius:"24px",width:"100%",maxWidth:"400px",position:"relative",overflow:"hidden",boxShadow:"0 32px 80px rgba(0,30,80,0.22)"},onClick:e=>e.stopPropagation(),children:[(0,E.jsx)("div",{style:{height:"4px",background:"var(--blue)"}}),(0,E.jsx)("div",{style:{position:"absolute",top:"-60px",right:"-60px",width:"220px",height:"220px",borderRadius:"50%",background:"radial-gradient(circle, color-mix(in srgb, var(--blue-solid, #0078d4) 10%, transparent) 0%, transparent 70%)",pointerEvents:"none"}}),(0,E.jsx)("button",{className:"rm2-close-btn",onClick:()=>Eo(!1),style:{position:"absolute",top:"18px",right:"18px",background:"#f4f4f4",border:"none",cursor:"pointer",color:"var(--blue-solid, #0078d4)",lineHeight:0,padding:"8px",borderRadius:"50%"},children:(0,E.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,E.jsx)("path",{d:"M1 1L9 9M9 1L1 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}),(0,E.jsxs)("div",{style:{padding:"40px 36px 36px",textAlign:"center"},children:[(0,E.jsx)("div",{className:"rm2-t1",style:{marginBottom:"24px"},children:(0,E.jsxs)("div",{className:"rm2-icon-ring",style:{width:"72px",height:"72px",borderRadius:"50%",background:"color-mix(in srgb, var(--blue-solid, #0078d4) 10%, #fff)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto",position:"relative"},children:[(0,E.jsx)("div",{className:"rm2-ripple-circle"}),(0,E.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[(0,E.jsx)("circle",{cx:"16",cy:"16",r:"15",stroke:"var(--blue-solid, #0078d4)",strokeWidth:"1.5",fill:"none"}),(0,E.jsx)("path",{d:"M9 16L14 21L23 11",stroke:"var(--blue-solid, #0078d4)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}),(0,E.jsx)("div",{className:"rm2-t1",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"10px",fontWeight:600,letterSpacing:"0.18em",textTransform:"uppercase",color:"var(--blue-solid, #0078d4)",marginBottom:"12px"},children:"Returning Guest Reward"}),(0,E.jsx)("div",{className:"rm2-num",style:{lineHeight:1,marginBottom:"4px"},children:(0,E.jsx)("span",{className:"rm2-shimmer-num",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"percentage"===(null===fe||void 0===fe?void 0:fe.discountType)?"80px":"60px",fontWeight:700,display:"inline-block",letterSpacing:"-3px"},children:"percentage"===(null===fe||void 0===fe?void 0:fe.discountType)?"".concat(null===fe||void 0===fe?void 0:fe.discount,"%"):"\u20b9".concat(null===fe||void 0===fe?void 0:fe.discount)})}),(0,E.jsx)("div",{className:"rm2-t1",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"12px",fontWeight:500,letterSpacing:"0.22em",textTransform:"uppercase",color:"#aaa",marginBottom:"24px"},children:"OFF \u2014 Applied automatically"}),(0,E.jsx)("div",{className:"rm2-divider",style:{height:"1px",background:"linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue-solid, #0078d4) 20%, transparent), transparent)",marginBottom:"24px"}}),(0,E.jsx)("h3",{className:"rm2-t2",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",margin:"0 0 10px",fontSize:"20px",fontWeight:700,color:"#0a0a0a",letterSpacing:"-0.4px",lineHeight:1.25},children:"Welcome back!"}),(0,E.jsxs)("p",{className:"rm2-t3",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",margin:"0 0 30px",fontSize:"14px",fontWeight:400,color:"#777",lineHeight:1.65},children:["We recognised you as a returning guest.",(0,E.jsx)("br",{}),"Your loyalty discount has been applied."]}),(0,E.jsx)("button",{className:"rm2-cta rm2-cta-btn",onClick:()=>Eo(!1),style:{width:"100%",padding:"15px",background:"var(--blue)",color:"#fff",border:"none",borderRadius:"12px",fontSize:"14px",fontWeight:600,fontFamily:"var(--volte, 'Jakarta', sans-serif)",letterSpacing:"0.02em",cursor:"pointer",display:"block",boxShadow:"0 6px 20px color-mix(in srgb, var(--blue-solid, #0078d4) 32%, transparent)"},children:"Continue to checkout"})]})]})})]}),_l&&(0,E.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,E.jsxs)("div",{style:{position:"relative",background:"#ffffff",borderRadius:"24px",padding:"32px 28px",width:"90%",maxWidth:"360px",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",transform:"translateY(0)"},children:[(0,E.jsx)("button",{onClick:()=>{xl(!1),gl(""),yl("")},style:{position:"absolute",top:"20px",right:"20px",background:"#f4f5f7",border:"none",cursor:"pointer",color:"#6e6e73",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"},"aria-label":"Close",children:(0,E.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,E.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,E.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16
1px"},children:(0,E.jsx)("div",{style:{background:"linear-gradient(135deg, #e3f2fd, #bbdefb)",padding:"12px",borderRadius:"16px"},children:(0,E.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#1a73e8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,E.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})})}),(0,E.jsx)("h3",{style:{fontWeight:800,fontSize:"1.25rem",margin:"0 0 8px 0",textAlign:"center",color:"#1c1c1e"},children:"Enter Security PIN"}),(0,E.jsx)("p",{style:{color:"#6e6e73",fontSize:"0.9rem",margin:"0 0 24px 0",textAlign:"center",lineHeight:"1.5"},children:Sl?(0,E.jsxs)(E.Fragment,{children:["Please enter the PIN for gift card ending in ",(0,E.jsx)("strong",{style:{color:"#1c1c1e"},children:ml.cardNumber.slice(-4)})," to redeem ",(0,E.jsxs)("strong",{style:{color:"#2e7d32"},children:[(0,L.Gl)(null===S||void 0===S?void 0:S.currency),ml.amount]}),"."]}):(0,E.jsxs)(E.Fragment,{children:["Please enter the PIN for gift card ending in ",(0,E.jsx)("strong",{style:{color:"#1c1c1e"},children:ml.cardNumber.slice(-4)})," to continue."]})}),(0,E.jsx)("input",{type:"password",placeholder:"\u2022\u2022\u2022\u2022",value:hl,onChange:e=>{gl(e.target.value.trim()),yl("")},maxLength:10,autoFocus:!0,style:{width:"100%",padding:"14px 16px",background:"#f4f5f7",border:"1px solid ".concat(fl?"#d32f2f":"#e0e0e0"),borderRadius:"12px",fontSize:"1.2rem",textAlign:"center",letterSpacing:"6px",fontWeight:700,color:"#1c1c1e",marginBottom:fl?"8px":"24px",boxSizing:"border-box",outlineColor:"#1a73e8"}}),fl&&(0,E.jsx)("p",{style:{color:"#d32f2f",fontSize:"0.85rem",textAlign:"center",margin:"0 0 16px 0"},children:fl}),(0,E.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,E.jsx)("button",{onClick:()=>{xl(!1),gl(""),yl("")},style:{flex:1,padding:"14px",background:"#f4f5f7",color:"#48484a",border:"none",borderRadius:"12px",cursor:"pointer",fontSize:"0.95rem",fontWeight:600,transition:"background 0.2s"},children:"Cancel"}),(0,E.jsx)("button",{onClick:()=>{hl.trim()&&(xl(!1),Sl?(bn(!0),pi()):(async()=>{if(ml.cardNumber.trim()){Il(!0),Ml("");try{const e=await(0,F.be)({cardNumber:ml.cardNumber,hotelId:null===S||void 0===S?void 0:S.id,cardPin:hl});null!==e&&void 0!==e&&e.data?(Nl(e.data),pl(e=>(0,l.A)((0,l.A)({},e),{},{amount:"0"})),wl(!0),jl(!0),Cl("0")):(Ml((null===e||void 0===e?void 0:e.error)||"Invalid gift card number or PIN. Please try again."),gl(""))}catch(t){var e,o,n,i;gl(""),Ml((null===t||void 0===t||null===(e=t.response)||void 0===e||null===(o=e.data)||void 0===o?void 0:o.error)||(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.message)||"Card not found or unavailable")}finally{Il(!1)}}else Ml("Please enter a card number")})())},disabled:!hl.trim(),style:{flex:1,padding:"14px",background:hl.trim()?"linear-gradient(135deg, #1a73e8, #0056b3)":"#e0e0e0",color:hl.trim()?"#ffffff":"#9e9e9e",border:"none",borderRadius:"12px",cursor:hl.trim()?"pointer":"not-allowed",fontSize:"0.95rem",fontWeight:600,boxShadow:hl.trim()?"0 4px 12px rgba(26,115,232,0.3)":"none",transition:"all 0.2s"},children:Sl?"Verify & Pay":"Continue"})]})]})})]})})},9368:(e,o,n)=>{n.d(o,{A:()=>a});var l=n(6177),i=n(475),t=n(579);const a=()=>{const{isConverted:e,effectiveCurrency:o,hotelCurrency:n}=(0,l.A)();return e?(0,t.jsxs)("div",{style:{background:"#FFF8E1",border:"1px solid #FFE082",borderRadius:"8px",padding:"10px 14px",margin:"10px 0",fontSize:"13px",color:"#5D4037",display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{fontSize:"16px"},children:"\u24d8"}),(0,t.jsxs)("span",{children:["Prices shown in ",o," (",(0,i.Gl)(o),"). You will be charged in"," ",n," (",(0,i.Gl)(n),")."]})]}):null}}}]); 2//# sourceMappingURL=4521.af3ad4e3.chunk.js.map
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.