1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72560],{18:(e,t,r)=>{r.d(t,{HU:()=>s,R1:()=>c,Sh:()=>l,Z9:()=>o,fn:()=>i,gU:()=>h,mo:()=>n,nN:()=>u,sI:()=>d});var a=r(71867);let o=(e,t,r,a,o)=>{var n;let{rate:i}=e;return{item_id:null==a?void 0:a.toString(),crs_type:i.crsType,item_name:r?void 0:o,currency:i.pricePerNight.currency,price:i.pricePerNight.amount,quantity:1,discount:(null==(n=i.wasPricePerNight)?void 0:n.amount)?i.wasPricePerNight.amount-i.pricePerNight.amount:0,rooms:1,nights:t,guests:i.occupancy.numberOfAdults+i.occupancy.children.length,adults:i.occupancy.numberOfAdults,children:i.occupancy.children.length}},n=(e,t,r,a)=>{var o;let{rate:n}=e;return{item_id:null==r?void 0:r.toString(),crs_type:n.crsType,item_name:a,currency:n.pricePerNight.currency,price:n.pricePerNight.amount,quantity:1,discount:(null==(o=n.wasPricePerNight)?void 0:o.amount)?n.wasPricePerNight.amount-n.pricePerNight.amount:0,rooms:1,nights:t,guests:n.occupancy.numberOfAdults+n.occupancy.children.length,adults:n.occupancy.numberOfAdults,children:n.occupancy.children.length}},i=(e,t)=>e.reduce((e,r)=>e+(r.discount?r.discount:0)*t,0),u=e=>{let{vouchers:t,amount:r}=e;return t&&r?r-t.amountRedeemable:r};function s(e){let t="N";return e.hotelData&&e.hotelData.hotel.btcPaySupport&&(t="OPTIONAL"===e.hotelData.hotel.btcPayStatus?"Y_optional":"MANDATORY"===e.hotelData.hotel.btcPayStatus?"Y_mandatory":"N"),t}let l={400:{errorType:"Invalid voucher",errorMessage:"This offer is invalid"},491:{errorType:"Insufficient pay amount",errorMessage:"Amount to pay must be greater than or equal to the offerâs minimum value"},492:{errorType:"Invalid voucher",errorMessage:"The offer is not valid yet"},493:{errorType:"Invalid voucher",errorMessage:"Offer is not valid for these dates"},494:{errorType:"Invalid voucher",errorMessage:"This offer is not supported"},495:{errorType:"Invalid voucher",errorMessage:"Offer does not support this currency"},497:{errorType:"Expired offer",errorMessage:"This offer has been fully redeemed"},499:{errorType:"Green Stay offer",errorMessage:"Offer must be used with a Green Stay hotel"},501:{errorType:"Expired offer",errorMessage:"This offer is expired"},507:{errorType:"Expired offer",errorMessage:"This offer is expired"},503:{errorType:"Insufficient pay amount",errorMessage:"Your voucher exceeds the total booking amount. Please use a different voucher"},505:{errorType:"Offer combination error",errorMessage:"The offer cannot be used in conjunction with other offers"},508:{errorType:"User type restriction",errorMessage:"The offer is available for logged-in users only"},509:{errorType:"User type restriction",errorMessage:"The offer is not available for you at the moment"},510:{errorType:"User type restriction",errorMessage:"The offer is not available for you at the moment"},GenericError:{errorType:"Generic error",errorMessage:"This offer is invalid"}},c=e=>{let{paymentOption:t,preAuthorizationOnCreditCard:r}=e;return"PAY_NOW"===t?"N":r?"Y":"N"},d=(e,t)=>{var r,o;let{summary:n,payment:i,paymentOption:u,selectedTemplate:l}=e,d=!l||l.name===a.$f,h=s(e),m=(null==n?void 0:n.creditCardRequired)?"Y":"N",O=(null==n?void 0:n.freeCancellation)?"Y":"N",p=i.sendBillingAddress?"Y":"N",y="PAY_NOW"===u&&i.sendBillingAddress&&(i.smartPayActivated||"begin_checkout"===t)?"Y":"N";return{btc_pay_supported:h,pay_now:"PAY_NOW"===u?"Y":"N",credit_card_required:m,free_cancellation:O,booking_template:d?"N":"Y",invoice_address:p,digital_invoice:y,bonus_program:null!=(o=null==(r=e.loyaltyCard)?void 0:r.cardType)?o:"",pre_auth:c(e)}};function h(e){let t=e.map(e=>{var t;return null!=(t=e.rate.discountType)?t:"NO_LABEL"});return t.length>0?t.join("|"):"NO_LABEL"}},9914:(e,t,r)=>{r.d(t,{s:()=>a});var a=function(e){return e.STANDARD="STANDARD",e.ECONOMY="ECONOMY",e.SUPERIOR="SUPERIOR",e.BUSINESS="BUSINESS",e.SUITE="SUITE",e.JUNIORSUITE="JUNIORSUITE",e.APPARTMENT="APPARTMENT",e.FAMILY="FAMILY",e}({})},15392:(e,t,r)=>{r.d(t,{H:()=>s});var a=r(7158),o=r(40373),n=r(9914),i=function(e){return e.TERRACE="TERRACE",e.SEAVIEW="SEAVIEW",e.LAKEVIEW="LAKEVIEW",e.POOLVIEW="POOLVIEW",e.MOUNTAINVIEW="MOUNTAINVIEW",e.RIVERVIEW="RIVERVIEW",e.BALCONY="BALCONY",e}({}),u=r(19458);class s{static map(e,t,r){return t.length<1||!e||e.length<1?t:(0,a.jM)(t,t=>{for(let a of t){let t=this.findMatchingPictures(e,a.room.category,a.room.type,a.room.roomEnhancements,r);a.room.pictureUrls=t.pictureUrls,a.room.roomPictures=t.pictures,a.room.exactRoomMatching=t.exactRoomMatching}})}static findMatchingPictures(e,t,r,a,n){var i,u,s;let l=this.mapRoomToPictureCategories(t,r,a),c=this.getLowerPictureCategory(t),d=c?this.mapRoomToPictureCategories(c,r,a):void 0,h=this.getRelatedRoomType(n,r),m=h?this.mapRoomToPictureCategories(t,h,a):void 0;if(l&&l.length>0){let t=null==e?void 0:e.filter(e=>l.indexOf(e.category)>=0);if(t&&t.length>0)return{pictureUrls:t.map(e=>e.url),pictures:t,exactRoomMatching:!0}}let O=null!=(i=null==e?void 0:e.filter(e=>e.category===o.Z.STANDARD_ROOM))?i:[],p=null!=(u=null==e?void 0:e.filter(e=>e.category===o.Z.ROOM))?u:[],y=null!=(s=null==e?void 0:e.filter(e=>e.category===o.Z.BATHROOM))?s:[],_=[];
1if(m&&m.length>0){let t=null==e?void 0:e.filter(e=>m.indexOf(e.category)>=0);_.push(...null!=t?t:[])}else if(O.length>0)_.push(...O);else if(p.length>0)_.push(...p);else if(d&&d.length>0){let t=null==e?void 0:e.filter(e=>d.indexOf(e.category)>=0);_.push(...null!=t?t:[])}else y.length>0&&_.push(...y);return _.length>0?{pictureUrls:_.map(e=>e.url),pictures:_,exactRoomMatching:!1}:{pictureUrls:[],pictures:[],exactRoomMatching:!1}}static getRelatedRoomType(e,t){if(e)switch(t){case u.C.SINGLEROOM:return u.C.DOUBLEROOM;case u.C.DOUBLEROOM:return u.C.SINGLEROOM;default:return}}static getLowerPictureCategory(e){switch(e){case n.s.SUPERIOR:case n.s.BUSINESS:return n.s.STANDARD;case n.s.SUITE:return n.s.JUNIORSUITE;case n.s.JUNIORSUITE:return n.s.STANDARD;case n.s.APPARTMENT:return n.s.FAMILY;case n.s.FAMILY:return n.s.STANDARD;default:return}}static mapRoomToPictureCategories(e,t,r){if(r&&r.length>0){let e=[];return r.forEach(t=>{switch(t){case i.TERRACE:e.push(o.Z.ROOM_TERRACE);break;case i.SEAVIEW:e.push(o.Z.ROOM_SEAVIEW);break;case i.LAKEVIEW:e.push(o.Z.ROOM_LAKEVIEW);break;case i.POOLVIEW:e.push(o.Z.ROOM_POOLVIEW);break;case i.MOUNTAINVIEW:e.push(o.Z.ROOM_MOUNTAINVIEW);break;case i.RIVERVIEW:e.push(o.Z.ROOM_RIVERVIEW);break;case i.BALCONY:e.push(o.Z.ROOM_BALCONY)}}),e}switch(e){case n.s.STANDARD:switch(t){case u.C.SINGLEROOM:return[o.Z.SINGLE_ROOM_STANDARD];case u.C.DOUBLEROOM:return[o.Z.DOUBLE_ROOM_STANDARD];case u.C.THREEBEDROOM:return[o.Z.THREE_BED_ROOM];case u.C.FOURBEDROOM:return[o.Z.FOUR_BED_ROOM];default:return}case n.s.SUPERIOR:switch(t){case u.C.SINGLEROOM:return[o.Z.ROOM_SUPERIOR,o.Z.SINGLE_ROOM_COMFORT];case u.C.DOUBLEROOM:return[o.Z.ROOM_SUPERIOR,o.Z.DOUBLE_ROOM_COMFORT];default:return}case n.s.ECONOMY:switch(t){case u.C.SINGLEROOM:return[o.Z.ECO_SINGLE];case u.C.DOUBLEROOM:return[o.Z.ECO_DOUBLE];default:return}case n.s.BUSINESS:return[o.Z.ROOM_BUSINESS];case n.s.SUITE:return[o.Z.SUITE];case n.s.JUNIORSUITE:return[o.Z.JUNIOR_SUITE];case n.s.APPARTMENT:return[o.Z.APARTMENT];case n.s.FAMILY:return[o.Z.ROOM_FAMILY];default:return}}}},37782:(e,t,r)=>{r.d(t,{As:()=>p,FQ:()=>E,Gf:()=>c,H9:()=>g,KY:()=>f,MD:()=>m,ND:()=>y,Yt:()=>_,jo:()=>w,md:()=>v,mt:()=>R,qn:()=>d,tG:()=>l,xA:()=>O,z_:()=>h});var a=r(64549),o=r(16734),n=r.n(o),i=r(80549),u=r(58697),s=r(18);let l=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({...(0,u.HK)(),...e,event:"proceed_to_payment",hit_timestamp:new Date().toISOString(),feature:"booking"})},c=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({...(0,u.HK)(),...e,event:"payment_layover_show",hit_timestamp:new Date().toISOString(),feature:"booking"})},d=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({...(0,u.HK)(),...e,event:"creditcard_security_code_layover_show",hit_timestamp:new Date().toISOString(),feature:"booking"})},h=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({...(0,u.HK)(),...e,event:"creditcard_credentials_layover_show",hit_timestamp:new Date().toISOString(),feature:"booking_pay_now"})},m=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({...(0,u.HK)(),...e,event:"select_payment_method",hit_timestamp:new Date().toISOString(),feature:"booking"})},O=function(e,t){var r,a,o,l,c,d,h,m,O,p,y,_,v,g,R,f,E,w,M,S;let I=arguments.length>2&&void 0!==arguments[2]&&arguments[2],N=arguments.length>3?arguments[3]:void 0,T=arguments.length>4?arguments[4]:void 0,A=t.arrival&&t.departure?(0,i.GS)(t.arrival,t.departure):0,D=t.itemGuestUnits.map(e=>{var r,a;return(0,s.Z9)(e,A,I,null==(r=t.hotelData)?void 0:r.hotel.id,null==(a=t.hotelData)?void 0:a.hotel.name)}),L=(0,s.fn)(D,A),U=null==(r=t.summary)?void 0:r.totalPrice.amount,P="add_payment_info"!==e?U:(0,s.nN)({vouchers:null==(a=t.summary)?void 0:a.vouchers,amount:U}),Y={item_id:null==(o=t.hotelData)?void 0:o.hotel.id.toString(),item_name:null==(l=t.hotelData)?void 0:l.hotel.name,crs_type:null!=(g=null==(c=t.itemGuestUnits[0])?void 0:c.rate.crsType)?g:"NO_CRS_VALUE",currency:null==(d=t.summary)?void 0:d.totalPrice.currency,price:P,quantity:1,discount:L,discount_value:L,rooms:D.length,nights:A,guests:D.reduce((e,t)=>
1e+t.guests,0),adults:D.reduce((e,t)=>e+t.adults,0),children:D.reduce((e,t)=>e+t.children,0),discount_label:(0,s.gU)(t.itemGuestUnits)};if(0===D.length)return;let C=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.numberOfAdults,0),b=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.children.length,0);window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null});let V={...(0,u.HK)(),event:e,hit_timestamp:new Date().toISOString(),funnel:N,feature:"ecommerce",start_date:n()(t.arrival).format("YYYY-MM-DD"),end_date:n()(t.departure).format("YYYY-MM-DD"),ecommerce:{value:P,currency:null==(h=t.summary)?void 0:h.totalPrice.currency,hotel_id:null==(m=t.hotelData)?void 0:m.hotel.id.toString(),hotel_name:null==(O=t.hotelData)?void 0:O.hotel.name,crs_type:null!=(R=null==(p=t.itemGuestUnits[0])?void 0:p.rate.crsType)?R:"NO_CRS_VALUE",btc_pay_supported:(0,s.HU)(t),rooms:t.itemGuestUnits.length,guests:C+b,adults:C,children:b,nights:A,hotel_city:null==(y=t.hotelData)?void 0:y.hotel.address.city,hotel_country:null==(_=t.hotelData)?void 0:_.hotel.address.country,items:[Y],..."add_payment_info"===e&&(0,s.sI)(t),discount_label:(0,s.gU)(t.itemGuestUnits),pre_auth:(0,s.R1)(t)}};if("add_payment_info"===e&&(V.ecommerce.pay_now="PAY_NOW"===t.paymentOption?"Y":"N"),T&&(V.ecommerce.payment_type=null!=(M=null!=(w=null==(f=t.payment.creditCard)?void 0:f.type)?w:null==(E=t.payment.captureCardResponse)?void 0:E.cardType)?M:"payment_at_hotel",V.ecommerce.invoice_address=t.billingAddress?"Y":"N",t.processNumber&&t.processNumber>0&&(V.ecommerce.transaction_id=null==(S=t.processNumber)?void 0:S.toString())),null==(v=t.summary)?void 0:v.vouchers){let e=t.summary.vouchers.details.map(e=>"FIXED_AMOUNT"===e.type?"Fixed amount":"Percentage").join(", ");V.ecommerce.voucher_type=e,V.ecommerce.voucher_discount=t.summary.vouchers.amountRedeemable}["begin_checkout","add_payment_info"].includes(e)&&(V.ecommerce={...V.ecommerce,...(0,s.sI)(t,e)}),window.dataLayer.push(V)},p=(e,t)=>{var r,a,o,l,c,d,h,m,O,p,y,_,v,g;let R=t.arrival&&t.departure?(0,i.GS)(t.arrival,t.departure):0,f=t.itemGuestUnits.map(e=>{var r,a;return(0,s.mo)(e,R,null==(r=t.hotelData)?void 0:r.hotel.id,null==(a=t.hotelData)?void 0:a.hotel.name)}),E=(0,s.fn)(f,R),w={item_id:null==(r=t.hotelData)?void 0:r.hotel.id.toString(),item_name:null==(a=t.hotelData)?void 0:a.hotel.name,currency:null==(o=t.summary)?void 0:o.totalPrice.currency,price:null==(l=t.summary)?void 0:l.totalPrice.amount,crs_type:null!=(v=null==(c=t.itemGuestUnits[0])?void 0:c.rate.crsType)?v:"NO_CRS_VALUE",quantity:1,discount:E,discount_value:E,rooms:f.length,nights:R,guests:f.reduce((e,t)=>e+t.guests,0),adults:f.reduce((e,t)=>e+t.adults,0),children:f.reduce((e,t)=>e+t.children,0),discount_label:(0,s.gU)(t.itemGuestUnits)};if(0===f.length)return;let M=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.numberOfAdults,0),S=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.children.length,0);window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null});let I={...(0,u.HK)(),event:e,hit_timestamp:new Date().toISOString(),funnel:void 0,feature:"ecommerce",start_date:n()(t.arrival).format("YYYY-MM-DD"),end_date:n()(t.departure).format("YYYY-MM-DD"),ecommerce:{value:null==(d=t.summary)?void 0:d.totalPrice.amount,currency:null==(h=t.summary)?void 0:h.totalPrice.currency,hotel_id:null==(m=t.hotelData)?void 0:m.hotel.id.toString(),hotel_name:null==(O=t.hotelData)?void 0:O.hotel.name,crs_type:null!=(g=null==(p=t.itemGuestUnits[0])?void 0:p.rate.crsType)?g:"NO_CRS_VALUE",btc_pay_supported:(0,s.HU)(t),rooms:t.itemGuestUnits.length,guests:M+S,adults:M,children:S,nights:R,hotel_city:null==(y=t.hotelData)?void 0:y.hotel.address.city,hotel_country:null==(_=t.hotelData)?void 0:_.hotel.address.country,items:[w],discount_label:(0,s.gU)(t.itemGuestUnits),pre_auth:t.preAuthorizationOnCreditCard?"Y":"N"}};window.dataLayer.push(I)},y=(e,t,r)=>{var o;let s=e.arrival&&e.departure?(0,i.GS)(e.arrival,e.departure):0,l=null==(o=e.hotelData)?void 0:o.hotel.id;e.itemGuestUnits.forEach(o=>{var i,c,d,h,m;let O=o.rate.occupancy.numberOfAdults,p=o.rate.occupancy.children.length,y=o.rate.tariffType,_=o.room.category,v=o.rate.rateType,g=o.room.type,R=o.rate.mealAvailability===a.J.Inclusive?"Y":"N",f=o.rate.freeCancellation?"Y":"N",E="unknown";void 0!==o.rate.noPrepayment&&(E=o.rate.noPrepayment?"N":"Y");
1let w=o.rate.creditCardRequired?"Y":"N",M={...(0,u.HK)(),event:t,hit_timestamp:new Date().toISOString(),funnel:"checkout",feature:"offers",start_date:n()(e.arrival).format("YYYY-MM-DD"),end_date:n()(e.departure).format("YYYY-MM-DD"),value:o.rate.totalPrice.amount,currency:o.rate.totalPrice.currency,hotel_id:null==l?void 0:l.toString(),hotel_name:null==(i=e.hotelData)?void 0:i.hotel.name,hotel_city:null==(c=e.hotelData)?void 0:c.hotel.address.city,hotel_country:null==(d=e.hotelData)?void 0:d.hotel.address.country,rooms:1,guests:O+p,adults:O,children:p,nights:s,room_back_end_tariff:y,room_category:_,room_front_end_tariff:v,room_type:g,offer_id:[l,g,_,v,y,R,f,E,w].join(":"),quantity:1,discount:(null==(h=o.rate.wasPricePerNight)?void 0:h.amount)?(o.rate.wasPricePerNight.amount-o.rate.pricePerNight.amount)*s:0,breakfast:R,free_cancellation:f,deposit_required:E,credit_card_required:w,discount_label:null!=(m=o.rate.discountType)?m:"NO_LABEL",crs_type:o.rate.crsType};(null==r?void 0:r.bookingProcessId)&&(null==r?void 0:r.bookingProcessId)>0&&(M.transaction_id_offers=r.bookingProcessId.toString()),window.dataLayer=window.dataLayer||[],window.dataLayer.push(M)})},_=(e,t,r)=>{var a,o,l,c,d,h,m,O,p,y,_,v,g,R,f,E,w,M,S;let I=e.arrival&&e.departure?(0,i.GS)(e.arrival,e.departure):0,N=t.itemGuestUnits.map(t=>{var r,a;return(0,s.Z9)(t,I,!1,null==(r=e.hotelData)?void 0:r.hotel.id,null==(a=e.hotelData)?void 0:a.hotel.name)}),T=(0,s.fn)(N,I),A=(0,s.nN)({vouchers:null==(a=e.summary)?void 0:a.vouchers,amount:null==(o=e.summary)?void 0:o.totalPrice.amount}),D={item_id:null==(l=e.hotelData)?void 0:l.hotel.id.toString(),item_name:null==(c=e.hotelData)?void 0:c.hotel.name,currency:null==(d=e.summary)?void 0:d.totalPrice.currency,crs_type:null!=(E=null==(h=e.itemGuestUnits[0])?void 0:h.rate.crsType)?E:"NO_CRS_VALUE",price:A,quantity:1,discount:T,discount_value:T,rooms:N.length,nights:I,guests:N.reduce((e,t)=>e+t.guests,0),adults:N.reduce((e,t)=>e+t.adults,0),children:N.reduce((e,t)=>e+t.children,0),discount_label:(0,s.gU)(e.itemGuestUnits)},L=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.numberOfAdults,0),U=t.itemGuestUnits.reduce((e,t)=>e+t.rate.occupancy.children.length,0),P=t.itemGuestUnits.every(e=>e.rate.freeCancellation)?"Y":"N",Y=t.itemGuestUnits.filter(e=>e.rate.creditCardRequired).length>0?"Y":"N";window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null});let C={...(0,u.HK)(),event:"purchase",hit_timestamp:new Date().toISOString(),funnel:"checkout",feature:"ecommerce",start_date:n()(e.arrival).format("YYYY-MM-DD"),end_date:n()(e.departure).format("YYYY-MM-DD"),ecommerce:{value:A,crs_type:null!=(w=null==(m=e.itemGuestUnits[0])?void 0:m.rate.crsType)?w:"NO_CRS_VALUE",currency:null==(O=e.summary)?void 0:O.totalPrice.currency,hotel_id:null==(p=e.hotelData)?void 0:p.hotel.id.toString(),hotel_name:null==(y=e.hotelData)?void 0:y.hotel.name,rooms:e.itemGuestUnits.length,guests:L+U,adults:L,children:U,nights:I,hotel_city:null==(_=e.hotelData)?void 0:_.hotel.address.city,hotel_country:null==(v=e.hotelData)?void 0:v.hotel.address.country,items:[D],...(0,s.sI)(e),free_cancellation:P,credit_card_required:Y,discount_label:(0,s.gU)(e.itemGuestUnits)}};if(C.ecommerce.payment_type=null!=(S=null!=(M=null==(g=e.payment.creditCard)?void 0:g.type)?M:null==(R=e.payment.captureCardResponse)?void 0:R.cardType)?S:"payment_at_hotel",r.bookingProcessId&&r.bookingProcessId>0&&(C.ecommerce.transaction_id=r.bookingProcessId.toString()),null==(f=e.summary)?void 0:f.vouchers){let t=e.summary.vouchers.details.map(e=>"FIXED_AMOUNT"===e.type?"Fixed amount":"Percentage").join(", ");C.ecommerce.voucher_type=t,C.ecommerce.voucher_discount=e.summary.vouchers.amountRedeemable}window.dataLayer.push(C)},v=()=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({...(0,u.HK)(),event:"contact_details_view",feature:"booking",hit_timestamp:new Date().toISOString()})},g=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({...(0,u.HK)(),event:e,feature:"booking",hit_timestamp:new Date().toISOString()})},R=()=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({...(0,u.HK)(),event:"contact_details_add",feature:"booking",hit_timestamp:new Date().toISOString()})},f=(e,t)=>{let{arrival:r,departure:a,summary:o,hotelData:i,rooms:l}=t;window.dataLayer=window.dataLayer||[];let c={...(0,u.HK)(),...(0,s.sI)(t),start_date:n()(r).format("YYYY-MM-DD"),end_date:n()(a).format("YYYY-MM-DD"),value:null==o?void 0:o.totalPrice.amount,currency:null==o?void 0:o.totalPrice.currency,hotel_id:null==i?void 0:i.hotel.id.toString(),hotel_name:null==i?void 0:i.hotel.name,rooms:l.length,event:"booking_attempt_failed",type:e,funnel:"checkout",feature:"booking",hit_timestamp:new Date().toISOString()};window.dataLayer.push(c)},E=e=>{let{hotelId:t,hotelName:r}=e;window.dataLayer=window.dataLayer||[],window.dataLayer.push({...(0,u.HK)(),event:"apply_voucher",location:"Book - voucher field",voucher_type:"Fixed amount",funnel:"checkout",feature:"voucher",hotel_id:"".concat(t),hotel_name:r,hit_timestamp:new Date().toISOString()})},w=e=>{let{errorCode:t,hotelId:r,hotelName:a}=e;window.dataLayer=window.dataLayer||[];let o=s.Sh[t];o&&window.dataLayer.push({...(0,u.HK)(),event:"error_occured",location:"Book - voucher field",error_message:o.errorMessage,error_type:o.errorType,funnel:"checkout",feature:"voucher",hotel_id:"".concat(r),hotel_name:a,hit_timestamp:new Date().toISOString()})}},40373:(e,t,r)=>{r.d(t,{Z:()=>a});var a=function(e){return e.EXTERIOR_VIEW="EXTERIOR_VIEW",e.APARTMENT="APARTMENT",e.BATHROOM="BATHROOM",e.JUNIOR_SUITE="JUNIOR_SUITE",e.SUITE="SUITE",e.ROOM="ROOM",e.ROOM_BUSINESS="ROOM_BUSINESS",e.ROOM_SUPERIOR="ROOM_SUPERIOR",e.ROOM_FAMILY="ROOM_FAMILY",e.ROOM_TERRACE="ROOM_TERRACE",e.ROOM_BALCONY="ROOM_BALCONY",e.ROOM_LAKEVIEW="ROOM_LAKEVIEW",e.ROOM_MOUNTAINVIEW="ROOM_MOUNTAINVIEW",e.ROOM_RIVERVIEW="ROOM_RIVERVIEW",e.ROOM_SEAVIEW="ROOM_SEAVIEW",e.ROOM_POOLVIEW="ROOM_POOLVIEW",e.STANDARD_ROOM="STANDARD_ROOM",e.SINGLE_ROOM_STANDARD="SINGLE_ROOM_STANDARD",e.SINGLE_ROOM_COMFORT="SINGLE_ROOM_COMFORT",e.DOUBLE_ROOM_STANDARD="DOUBLE_ROOM_STANDARD",e.DOUBLE_ROOM_COMFORT="DOUBLE_ROOM_COMFORT",e.THREE_BED_ROOM="THREE_BED_ROOM",e.FOUR_BED_ROOM="FOUR_BED_ROOM",e.ECO_SINGLE="ECO_SINGLE",e.ECO_DOUBLE="ECO_DOUBLE",e}({})}
1,54822:(e,t,r)=>{r.d(t,{G:()=>s});var a=r(18614),o=r(16752),n=r(69406),i=r(84713);class u{static map(e){if(e){var t,r;if(e.hasVoucher&&!(e.redeemedAmount<=0)&&(null==(r=e.details)||null==(t=r[0])?void 0:t.currency))return{hasVoucher:e.hasVoucher,redeemedAmount:e.redeemedAmount,details:e.details,currency:e.details[0].currency}}}}class s{static async verify(e){let{currency:t,payAmount:r,stayEndDate:i,stayStartDate:u,voucherCodes:s,isGreenStayHotel:l}=e,{voucherEndpoint:c}=o.T.apiConfig,d=await (0,a.gf)(),h="".concat(c,"/v1/redemption/verify");if("EUR"!==t)return n.Vy.error("Currency ".concat(t," is not supported for voucher redemption."),{source:n._q.VoucherService,status:-1,currency:t}),{code:495,error:"Currency not supported",status:"INVALID_ARGUMENT"};try{let e=await fetch(h,{method:"POST",headers:this.getHeaders(d),body:JSON.stringify({currency:t,payAmount:r,stayEndDate:i,stayStartDate:u,voucherCodes:s,isGreenStayHotel:l})}),a=await e.json();if(e.ok)return a;return n.Vy.error("Failed to verify voucher response with http status code ".concat(e.status),{source:n._q.VoucherService,status:a.status,url:h,step:"fetch",errorMessage:a.error}),a}catch(e){return n.Vy.error(e,{source:n._q.VoucherService,status:-2,url:h}),{error:"Technical error",status:"UNKNOWN ERROR"}}}static async getVoucherRedemption(e,t){let{voucherEndpoint:r}=o.T.apiConfig,i=await (0,a.gf)(),s="".concat(r,"/v1/redemption/redeemed-amount?bookingProcessId=").concat(e,"&accessCode=").concat(t),l=s.replace(/(bookingProcessId|accessCode)=[^&]*/g,"$1=xxx");return await fetch(s,{method:"GET",redirect:"follow",headers:this.getHeaders(i)}).then(async e=>{if(!e.ok){let t=await e.text();n.Vy.error("Failed to get voucher redemption by booking process id with http status code ".concat(e.status,"."),{source:n._q.VoucherService,status:e.status,url:l,step:"fetch",message:t});return}return e.json()}).then(e=>e).then(e=>u.map(e)).catch(e=>{n.Vy.error(e,{source:n._q.VoucherService,status:-2,url:l})})}static async getVoucherDetail(e){let{voucherEndpoint:t}=o.T.apiConfig,r=await (0,a.gf)(),i="".concat(t,"/v1/details?code=").concat(e.toLowerCase());return await fetch(i,{method:"GET",redirect:"follow",headers:this.getHeaders(r)}).then(async e=>{if(!e.ok){let t=await e.text();n.Vy.error("Failed to get voucher detail with http status code ".concat(e.status,"."),{source:n._q.VoucherService,status:e.status,url:i,step:"fetch",message:t});return}return e.json()}).then(e=>e).catch(e=>{n.Vy.error(e,{source:n._q.VoucherService,status:-2,url:i})})}static getHeaders(e){let t=new Headers;return t.append("Content-Type","application/json"),t.append("Accept-Encoding","application/json"),t.append("x-client-id",(0,i.Jf)()),e&&t.append("Authorization","Bearer ".concat(e)),t}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.