@roomstay/frontend 2.3.41 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/319.bundle.js +1 -1
- package/dist/572.bundle.js +1 -1
- package/dist/903.bundle.js +1 -1
- package/dist/975.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/ReservationAPI.d.ts +2 -1
- package/dist/src/api/ReservationAPI.js +24 -2
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +3 -3
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/PaymentCard/InlinePaymentOption.d.ts +1 -0
- package/dist/src/components/generic/PaymentCard/InlinePaymentOption.js +3 -2
- package/dist/src/components/generic/PaymentCard/InlinePaymentOption.js.map +1 -1
- package/dist/src/components/generic/Select/InputSelect.js +1 -1
- package/dist/src/components/generic/Select/InputSelect.js.map +1 -1
- package/dist/src/components/generic/loader/OverlayLoader.d.ts +6 -0
- package/dist/src/components/generic/loader/OverlayLoader.js +18 -0
- package/dist/src/components/generic/loader/OverlayLoader.js.map +1 -0
- package/dist/src/components/steps/confirmation/PaymentInformation.d.ts +2 -1
- package/dist/src/components/steps/confirmation/PaymentInformation.js +8 -3
- package/dist/src/components/steps/confirmation/PaymentInformation.js.map +1 -1
- package/dist/src/components/steps/confirmation/RoomContactDetails.js +32 -2
- package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +44 -13
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRoomList.js +4 -23
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRoomList.js.map +1 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRooms.js +4 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRooms.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsPriceBlock.js +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsPriceBlock.js.map +1 -1
- package/dist/src/components/summary/BESummary.js +41 -5
- package/dist/src/components/summary/BESummary.js.map +1 -1
- package/dist/src/components/summary/BESummaryRoomRow.js +6 -0
- package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextType.d.ts +5 -1
- package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +41 -2
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +2 -0
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContext.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.d.ts +4 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +33 -6
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/hooks/ConfirmationQuery.d.ts +2 -0
- package/dist/src/hooks/ConfirmationQuery.js +3 -1
- package/dist/src/hooks/ConfirmationQuery.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +4 -1
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/Api/ReservationsDTO.d.ts +4 -0
- package/dist/src/models/Api/ReservationsDTO.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +2 -1
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +3 -1
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/Confirmation.d.ts +4 -0
- package/dist/src/models/Confirmation.js.map +1 -1
- package/dist/src/models/UserProfile.d.ts +3 -0
- package/dist/src/models/UserProfile.js.map +1 -1
- package/dist/src/pages/hotel/HotelInfo.js +3 -1
- package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +22 -22
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +2 -0
- package/dist/src/translations/Translation.js +2 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +2 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EnvironmentName } from '@planpay/web';
|
|
2
|
-
import type { EBookingPaymentMethod } from '@roomstay/core';
|
|
2
|
+
import type { EBookingPaymentMethod, EHotelCardProcessor } from '@roomstay/core';
|
|
3
3
|
import { DeepPartial } from 'react-hook-form';
|
|
4
4
|
import ColorProfile from '../Client/Hotel/ColorProfile';
|
|
5
5
|
import { DistanceUnitType } from '../Client/Hotel/DistanceUnitType.types';
|
|
@@ -24,6 +24,7 @@ export type HotelRoomGroupsDTO = {
|
|
|
24
24
|
name: string;
|
|
25
25
|
type: 'select';
|
|
26
26
|
includeAllAbove: boolean;
|
|
27
|
+
requireInput: boolean;
|
|
27
28
|
options: any;
|
|
28
29
|
};
|
|
29
30
|
};
|
|
@@ -80,6 +81,7 @@ export type HotelDTO = {
|
|
|
80
81
|
weekdayStartsOn?: WeekdayStartsOn;
|
|
81
82
|
crossSellHotelIds?: string[];
|
|
82
83
|
paymentMethods: EBookingPaymentMethod[];
|
|
84
|
+
cardProcessor: EHotelCardProcessor;
|
|
83
85
|
planpay?: {
|
|
84
86
|
username: string;
|
|
85
87
|
minDaysShowPlanpay: number;
|
|
@@ -90,6 +92,7 @@ export type HotelDTO = {
|
|
|
90
92
|
heroImage?: string;
|
|
91
93
|
images?: string[];
|
|
92
94
|
roomGroups: HotelRoomGroupsDTO;
|
|
95
|
+
requireDeposit?: boolean;
|
|
93
96
|
};
|
|
94
97
|
export declare enum VGSCardName {
|
|
95
98
|
Visa = "visa",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotelDTO.js","sourceRoot":"/","sources":["src/models/Api/HotelDTO.ts"],"names":[],"mappings":";;;AAMA,uDAA+D;
|
|
1
|
+
{"version":3,"file":"HotelDTO.js","sourceRoot":"/","sources":["src/models/Api/HotelDTO.ts"],"names":[],"mappings":";;;AAMA,uDAA+D;AAqG/D,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,0BAAW,CAAA;IACX,wCAAyB,CAAA;IACzB,uCAAwB,CAAA;IACxB,oCAAqB,CAAA;AACzB,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;AAEY,QAAA,0BAA0B,GAAsD;IACzF,CAAC,wBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI;IACzC,CAAC,wBAAgB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU;IACrD,CAAC,wBAAgB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG;IACvC,CAAC,wBAAgB,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,eAAe;IAC/D,CAAC,wBAAgB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU;IACrD,CAAC,wBAAgB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ;CACpD,CAAC","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport type { EBookingPaymentMethod, EHotelCardProcessor } from '@roomstay/core';\nimport { DeepPartial } from 'react-hook-form';\n\nimport ColorProfile from '@/models/Client/Hotel/ColorProfile';\nimport { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport { EPaymentCardType } from '@/models/Client/Hotel/Hotel';\nimport HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\n\nexport type HotelServiceDTO = {\n detail: string;\n included: boolean;\n name: string;\n onsite: boolean;\n};\n\nexport type HotelRoomsDTO = {\n [roomTypeCode: string]: HotelRoomDTO;\n};\n\nexport type HotelRoomGroupsDTO = {\n groupName: string;\n id: string;\n filters: { [id: string]: { name: string; type: 'select'; includeAllAbove: boolean; requireInput: boolean; options: any } };\n}[];\n\nexport type HotelRoomAmenitiesDTO = {\n type: string;\n description: string;\n};\n\nexport type HotelRoomDTO = {\n code: string;\n name: string;\n shortDescription: string;\n longDescription: string;\n images: string[];\n quantity: number;\n maxOccupancy: number;\n bedQuantity: number;\n standardNumBeds: number;\n maxRollaways: number;\n bedType: string;\n amenities: HotelRoomAmenitiesDTO[];\n features: HotelRoomAmenitiesDTO[];\n bedTypeOverride?: string;\n roomGroupId?: string;\n roomSize?: number;\n};\n\nexport type HotelDTO = {\n id: number;\n name: string;\n chainId: number;\n chainName: string;\n\n address: HotelAddress;\n phone: string;\n\n latitude: string;\n longitude: string;\n\n utcOffset: string;\n\n languageCode: string;\n currencyCode: string;\n\n checkInTime: string;\n checkOutTime: string;\n\n paymentCardTypes: EPaymentCardType[];\n\n description: string;\n locationDescription: string;\n policies: string;\n\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n\n rooms: { [roomTypeCode: string]: HotelRoomDTO };\n dataSource: HotelDataSource;\n\n // Following fields are only present if dataSource = 'roomstay'\n logo?: string;\n colors: DeepPartial<ColorProfile>;\n distanceUnitType?: DistanceUnitType;\n weekdayStartsOn?: WeekdayStartsOn;\n\n crossSellHotelIds?: string[];\n paymentMethods: EBookingPaymentMethod[];\n cardProcessor: EHotelCardProcessor;\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n\n email?: string;\n hotelUrl?: string;\n heroImage?: string;\n images?: string[];\n roomGroups: HotelRoomGroupsDTO;\n requireDeposit?: boolean;\n};\n\nexport enum VGSCardName {\n Visa = 'visa',\n Mastercard = 'mastercard',\n JCB = 'jcb',\n DinersClub = 'dinersclub',\n AmericanExpress = 'amex',\n UnionPay = 'unionpay',\n}\n\nexport const SynxisToVGSCardNameMapping: { [synxisName in EPaymentCardType]: VGSCardName } = {\n [EPaymentCardType.Visa]: VGSCardName.Visa,\n [EPaymentCardType.Mastercard]: VGSCardName.Mastercard,\n [EPaymentCardType.JCB]: VGSCardName.JCB,\n [EPaymentCardType.AmericanExpress]: VGSCardName.AmericanExpress,\n [EPaymentCardType.DinersClub]: VGSCardName.DinersClub,\n [EPaymentCardType.UnionPay]: VGSCardName.UnionPay,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReservationsDTO.js","sourceRoot":"/","sources":["src/models/Api/ReservationsDTO.ts"],"names":[],"mappings":"","sourcesContent":["import { EBookingPaymentMethod } from '@roomstay/core';\n\nimport RoomNightRateDTO from '@/models/Api/RoomNightRateDTO';\n\ntype ReservationsDTO = {\n roomstayId: string;\n reservations: ReservationDTO[];\n itineraryNumber: string;\n warnings?: string[];\n total?: string;\n payment?: {\n planpay?: {\n id: string;\n checkoutWorkflow: {\n type: string;\n id: string;\n scriptUrl: string;\n };\n };\n };\n};\n\nexport type ReservationAddonDTO = {\n availability: any;\n code: string;\n inclusive: false;\n pricingType: string;\n quantity: number;\n adultQuantity: number;\n childQuantity?: number;\n description: string;\n name: string;\n category: string;\n image: string;\n price: number;\n adultPrice?: number;\n childPrice?: number;\n nights?: number;\n};\n\nexport type ReservationDTO = {\n nights: {\n [date: string]: RoomNightRateDTO;\n };\n guestCounts: {\n adults: number;\n children: number;\n };\n guest: {\n address: {\n line1: string;\n city: string;\n postalCode: string;\n };\n firstName: string;\n lastName: string;\n phone: string;\n email: string;\n };\n paymentCard: {\n type?: string;\n last4: string;\n expiry: string;\n name: string;\n };\n paymentMethod?: EBookingPaymentMethod;\n comments?: string[];\n addons?: ReservationAddonDTO[];\n\n reservationNumber: string;\n cancelPolicy: string;\n cancellationPolicyLongDescription?: string;\n guaranteePolicy: string;\n guaranteePolicyLongDescription?: string;\n roomType: string;\n roomCode: string;\n rate: string;\n images: [string];\n status: string;\n isCancelable: boolean;\n total: {\n beforeTax: number;\n afterTax: number;\n };\n};\n\nexport default ReservationsDTO;\n"]}
|
|
1
|
+
{"version":3,"file":"ReservationsDTO.js","sourceRoot":"/","sources":["src/models/Api/ReservationsDTO.ts"],"names":[],"mappings":"","sourcesContent":["import { EBookingPaymentMethod } from '@roomstay/core';\n\nimport RoomNightRateDTO from '@/models/Api/RoomNightRateDTO';\n\ntype ReservationsDTO = {\n roomstayId: string;\n reservations: ReservationDTO[];\n itineraryNumber: string;\n warnings?: string[];\n total?: string;\n payment?: {\n planpay?: {\n id: string;\n checkoutWorkflow: {\n type: string;\n id: string;\n scriptUrl: string;\n };\n };\n external?: {\n id: string;\n redirectUrl: string;\n };\n };\n};\n\nexport type ReservationAddonDTO = {\n availability: any;\n code: string;\n inclusive: false;\n pricingType: string;\n quantity: number;\n adultQuantity: number;\n childQuantity?: number;\n description: string;\n name: string;\n category: string;\n image: string;\n price: number;\n adultPrice?: number;\n childPrice?: number;\n nights?: number;\n};\n\nexport type ReservationDTO = {\n nights: {\n [date: string]: RoomNightRateDTO;\n };\n guestCounts: {\n adults: number;\n children: number;\n };\n guest: {\n address: {\n line1: string;\n city: string;\n postalCode: string;\n };\n firstName: string;\n lastName: string;\n phone: string;\n email: string;\n };\n paymentCard: {\n type?: string;\n last4: string;\n expiry: string;\n name: string;\n };\n paymentMethod?: EBookingPaymentMethod;\n comments?: string[];\n addons?: ReservationAddonDTO[];\n\n reservationNumber: string;\n cancelPolicy: string;\n cancellationPolicyLongDescription?: string;\n guaranteePolicy: string;\n guaranteePolicyLongDescription?: string;\n roomType: string;\n roomCode: string;\n rate: string;\n images: [string];\n status: string;\n isCancelable: boolean;\n total: {\n beforeTax: number;\n afterTax: number;\n };\n};\n\nexport default ReservationsDTO;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRoomstayMember } from '@roomstay/core';
|
|
1
|
+
import { IBookingQuoteResponse, IRoomstayMember } from '@roomstay/core';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { ReservationDTO } from './Api/ReservationsDTO';
|
|
4
4
|
import BasketRowDifferences from './BasketRowDifferences';
|
|
@@ -18,6 +18,7 @@ export default class BasketRow {
|
|
|
18
18
|
private endDate;
|
|
19
19
|
private promoOnly;
|
|
20
20
|
private member?;
|
|
21
|
+
quoteDetails: NonNullable<IBookingQuoteResponse>['rows'][number];
|
|
21
22
|
constructor(rate?: RoomRate, uniqId?: string);
|
|
22
23
|
getStale(): boolean;
|
|
23
24
|
getRate(): RoomRate | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasketRow.js","sourceRoot":"/","sources":["src/models/BasketRow.ts"],"names":[],"mappings":";;AAOA,wCAAqC;AACrC,oEAA4D;AAE5D,MAAqB,SAAS;IAkB1B,YAAmB,IAAe,EAAE,MAAe;;QAC/C;;;MAGF;QACE,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;QAED,IAAI,CAAC,MAAM,GAAG,MAAA,oCAAc,CAAC,MAAM,mCAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,MAAA,oCAAc,CAAC,QAAQ,mCAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;Q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AAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEM,WAAW,CAAC,QAAgB;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAEM,OAAO,CAAC,IAAc;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IAEM,SAAS,CAAC,MAAgC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEM,aAAa,CAAC,SAAS,GAAG,KAAK;;QAClC,OAAO,MAAA,IAAI,CAAC,OAAO,EAAE,0CAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAEM,wBAAwB,CAAC,GAAmB;QAC/C,MAAM,WAAW,GAAyB,EAAE,CAAC;QAE7C,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACnF,WAAW,CAAC,UAAU,GAAG;gBACrB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;gBAC5B,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ;aAC5B,CAAC;SACL;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE;YACjC,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE9B,OAAO,WAAW,CAAC;SACtB;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CACJ;AAlND,4BAkNC","sourcesContent":["import { IRoomstayMember } from '@roomstay/core';\nimport dayjs from 'dayjs';\n\nimport { ReservationDTO } from '@/models/Api/ReservationsDTO';\nimport BasketRowDifferences from '@/models/BasketRowDifferences';\nimport type { Room } from '@/models/Room/Room';\nimport type { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport { DEFAULT_VALUES } from '@/util/DefaultValueManager';\n\nexport default class BasketRow {\n private uniqId: string;\n\n private room!: Room;\n private rate!: RoomRate | null;\n private isStale!: boolean;\n private adults: number;\n private children: number;\n\n private promoCode: string;\n private promoCodeStatus: 'valid' | 'invalid' | 'new';\n\n private startDate!: dayjs.Dayjs;\n private endDate!: dayjs.Dayjs;\n\n private promoOnly: boolean;\n private member?: Partial<IRoomstayMember>;\n\n public constructor(rate?: RoomRate, uniqId?: string) {\n /*\n Rate is optional since we can create row entries\n on first step, where there is no ability to select rate.\n */\n if (rate) {\n this.setRate(rate);\n }\n\n this.adults = DEFAULT_VALUES.ADULTS ?? 1;\n this.children = DEFAULT_VALUES.CHILDREN ?? 0;\n this.promoCode = '';\n this.promoCodeStatus = 'new';\n this.promoOnly = false;\n\n this.uniqId = uniqId ? uniqId : btoa(((Date.now() % 1000) / 1000) * Math.random() + '');\n }\n\n public getStale() {\n return this.isStale;\n }\n\n public getRate() {\n return this.rate;\n }\n\n public getPromoCode() {\n return this.promoCode.toUpperCase();\n }\n\n public getPromoOnly() {\n return this.promoOnly;\n }\n\n public getPromoCodeColour() {\n if (this.promoCodeStatus === 'valid') {\n return Color.Success;\n } else if (this.promoCodeStatus === 'invalid') {\n return Color.Alert;\n }\n\n return Color.Navy;\n }\n\n public isPromoCodeValid() {\n const rate = this.getRate();\n\n return (rate?.getAveragePrice(true) as number) < (rate?.getAveragePriceBeforeDiscount(true) as number) && this.getPromoCode() && this.getPromoCodeStatus() === 'valid';\n }\n\n public getNumberOfDays() {\n if (this.endDate && this.startDate) {\n return this.endDate.diff(this.startDate, 'day');\n }\n\n return 0;\n }\n\n public getRoom() {\n return this.room;\n }\n\n public getStartDate() {\n return this.startDate;\n }\n\n public getEndDate() {\n return this.endDate;\n }\n\n public getArrivalDate() {\n if (this.startDate) {\n return this.startDate.format('D MMM');\n }\n\n return null;\n }\n\n public getDepartureDate() {\n if (this.endDate) {\n return this.endDate.format('D MMM');\n }\n\n return null;\n }\n\n public getStayDateRange(format = 'ddd D MMM', separator = ',') {\n if (this.startDate && this.endDate) {\n return `${this.startDate.format(format)}${separator} ${this.endDate.format(format)}`;\n }\n }\n\n public getAdults() {\n return this.adults;\n }\n\n public getChildren() {\n return this.children;\n }\n\n public getID() {\n return this.uniqId;\n }\n\n public getPromoCodeStatus() {\n return this.promoCodeStatus;\n }\n\n public isValid(): boolean {\n return this.startDate && this.endDate && !!this.rate;\n }\n\n public setPromoCode(code: string) {\n if (this.promoCode !== code.toUpperCase()) {\n this.setPromoCodeStatus('new');\n this.promoOnly = false;\n }\n\n this.promoCode = code.toUpperCase();\n }\n\n public setPromoOnly(value: boolean) {\n this.promoOnly = value;\n }\n\n public setStale(status: boolean) {\n this.isStale = status;\n }\n\n public setPromoCodeStatus(status: 'valid' | 'invalid' | 'new') {\n this.promoCodeStatus = this.promoCode ? status : 'new';\n }\n\n public setStartDate(date: dayjs.Dayjs) {\n if (this.rate && !date.isSame(this.startDate) && this.startDate) {\n this.rate = null;\n }\n\n if (date?.isValid() || date === undefined) {\n this.startDate = date;\n }\n }\n\n public setEndDate(date: dayjs.Dayjs) {\n if (this.rate && !date.isSame(this.endDate) && this.endDate) {\n this.rate = null;\n }\n\n if (date?.isValid() || date === undefined) {\n this.endDate = date;\n }\n }\n\n public setAdults(adults: number) {\n this.adults = adults;\n }\n\n public setChildren(children: number) {\n this.children = children;\n }\n\n public setRate(rate: RoomRate) {\n this.rate = rate;\n this.room = rate.getRoom();\n }\n\n public setMember(member: Partial<IRoomstayMember>) {\n this.member = member;\n }\n\n public getTotalPrice(beforeTax = false) {\n return this.getRate()?.getTotalPrice(beforeTax);\n }\n\n public checkDiffFromReservation(res: ReservationDTO) {\n const differences: BasketRowDifferences = {};\n\n if (Number(res.total.afterTax).toFixed(2) !== Number(this.getTotalPrice()).toFixed(2)) {\n differences.totalPrice = {\n before: this.getTotalPrice(),\n after: res.total.afterTax,\n };\n }\n\n if (Object.keys(differences).length) {\n differences.id = this.getID();\n\n return differences;\n } else {\n return false;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BasketRow.js","sourceRoot":"/","sources":["src/models/BasketRow.ts"],"names":[],"mappings":";;AAOA,wCAAqC;AACrC,oEAA4D;AAE5D,MAAqB,SAAS;IAoB1B,YAAmB,IAAe,EAAE,MAAe;;QAC/C;;;MAGF;QACE,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;QAED,IAAI,CAAC,MAAM,GAAG,MAAA,oCAAc,CAAC,MAAM,mCAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,MAAA,oCAAc,CAAC,QAAQ,mCAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5F,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAEM,kBAAkB;QACrB,IAAI,IAAI,CAAC,eAAe,KAAK,OAAO,EAAE;YAClC,OAAO,aAAK,CAAC,OAAO,CAAC;SACxB;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AAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACnF,WAAW,CAAC,UAAU,GAAG;gBACrB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;gBAC5B,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ;aAC5B,CAAC;SACL;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE;YACjC,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE9B,OAAO,WAAW,CAAC;SACtB;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CACJ;AApND,4BAoNC","sourcesContent":["import { IBookingQuoteResponse, IRoomstayMember } from '@roomstay/core';\nimport dayjs from 'dayjs';\n\nimport { ReservationDTO } from '@/models/Api/ReservationsDTO';\nimport BasketRowDifferences from '@/models/BasketRowDifferences';\nimport type { Room } from '@/models/Room/Room';\nimport type { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport { DEFAULT_VALUES } from '@/util/DefaultValueManager';\n\nexport default class BasketRow {\n private uniqId: string;\n\n private room!: Room;\n private rate!: RoomRate | null;\n private isStale!: boolean;\n private adults: number;\n private children: number;\n\n private promoCode: string;\n private promoCodeStatus: 'valid' | 'invalid' | 'new';\n\n private startDate!: dayjs.Dayjs;\n private endDate!: dayjs.Dayjs;\n\n private promoOnly: boolean;\n private member?: Partial<IRoomstayMember>;\n\n public quoteDetails!: NonNullable<IBookingQuoteResponse>['rows'][number];\n\n public constructor(rate?: RoomRate, uniqId?: string) {\n /*\n Rate is optional since we can create row entries\n on first step, where there is no ability to select rate.\n */\n if (rate) {\n this.setRate(rate);\n }\n\n this.adults = DEFAULT_VALUES.ADULTS ?? 1;\n this.children = DEFAULT_VALUES.CHILDREN ?? 0;\n this.promoCode = '';\n this.promoCodeStatus = 'new';\n this.promoOnly = false;\n\n this.uniqId = uniqId ? uniqId : btoa(((Date.now() % 1000) / 1000) * Math.random() + '');\n }\n\n public getStale() {\n return this.isStale;\n }\n\n public getRate() {\n return this.rate;\n }\n\n public getPromoCode() {\n return this.promoCode.toUpperCase();\n }\n\n public getPromoOnly() {\n return this.promoOnly;\n }\n\n public getPromoCodeColour() {\n if (this.promoCodeStatus === 'valid') {\n return Color.Success;\n } else if (this.promoCodeStatus === 'invalid') {\n return Color.Alert;\n }\n\n return Color.Navy;\n }\n\n public isPromoCodeValid() {\n const rate = this.getRate();\n\n return (rate?.getAveragePrice(true) as number) < (rate?.getAveragePriceBeforeDiscount(true) as number) && this.getPromoCode() && this.getPromoCodeStatus() === 'valid';\n }\n\n public getNumberOfDays() {\n if (this.endDate && this.startDate) {\n return this.endDate.diff(this.startDate, 'day');\n }\n\n return 0;\n }\n\n public getRoom() {\n return this.room;\n }\n\n public getStartDate() {\n return this.startDate;\n }\n\n public getEndDate() {\n return this.endDate;\n }\n\n public getArrivalDate() {\n if (this.startDate) {\n return this.startDate.format('D MMM');\n }\n\n return null;\n }\n\n public getDepartureDate() {\n if (this.endDate) {\n return this.endDate.format('D MMM');\n }\n\n return null;\n }\n\n public getStayDateRange(format = 'ddd D MMM', separator = ',') {\n if (this.startDate && this.endDate) {\n return `${this.startDate.format(format)}${separator} ${this.endDate.format(format)}`;\n }\n }\n\n public getAdults() {\n return this.adults;\n }\n\n public getChildren() {\n return this.children;\n }\n\n public getID() {\n return this.uniqId;\n }\n\n public getPromoCodeStatus() {\n return this.promoCodeStatus;\n }\n\n public isValid(): boolean {\n return this.startDate && this.endDate && !!this.rate;\n }\n\n public setPromoCode(code: string) {\n if (this.promoCode !== code.toUpperCase()) {\n this.setPromoCodeStatus('new');\n this.promoOnly = false;\n }\n\n this.promoCode = code.toUpperCase();\n }\n\n public setPromoOnly(value: boolean) {\n this.promoOnly = value;\n }\n\n public setStale(status: boolean) {\n this.isStale = status;\n }\n\n public setPromoCodeStatus(status: 'valid' | 'invalid' | 'new') {\n this.promoCodeStatus = this.promoCode ? status : 'new';\n }\n\n public setStartDate(date: dayjs.Dayjs) {\n if (this.rate && !date.isSame(this.startDate) && this.startDate) {\n this.rate = null;\n }\n\n if (date?.isValid() || date === undefined) {\n this.startDate = date;\n }\n }\n\n public setEndDate(date: dayjs.Dayjs) {\n if (this.rate && !date.isSame(this.endDate) && this.endDate) {\n this.rate = null;\n }\n\n if (date?.isValid() || date === undefined) {\n this.endDate = date;\n }\n }\n\n public setAdults(adults: number) {\n this.adults = adults;\n }\n\n public setChildren(children: number) {\n this.children = children;\n }\n\n public setRate(rate: RoomRate) {\n this.rate = rate;\n this.room = rate.getRoom();\n }\n\n public setMember(member: Partial<IRoomstayMember>) {\n this.member = member;\n }\n\n public getTotalPrice(beforeTax = false) {\n return this.getRate()?.getTotalPrice(beforeTax);\n }\n\n public checkDiffFromReservation(res: ReservationDTO) {\n const differences: BasketRowDifferences = {};\n\n if (Number(res.total.afterTax).toFixed(2) !== Number(this.getTotalPrice()).toFixed(2)) {\n differences.totalPrice = {\n before: this.getTotalPrice(),\n after: res.total.afterTax,\n };\n }\n\n if (Object.keys(differences).length) {\n differences.id = this.getID();\n\n return differences;\n } else {\n return false;\n }\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EnvironmentName } from '@planpay/web';
|
|
2
|
-
import { EBookingPaymentMethod, IHotelColorScheme } from '@roomstay/core';
|
|
2
|
+
import { EBookingPaymentMethod, EHotelCardProcessor, IHotelColorScheme } from '@roomstay/core';
|
|
3
3
|
import type { ReactChild } from 'react';
|
|
4
4
|
import type { MemberOnlyModalInputs } from '../../../components/steps/room/MemberSignInModal/MemberSignInModal.types';
|
|
5
5
|
import type { HotelRoomGroupsDTO, HotelRoomsDTO, HotelServiceDTO } from '../../Api/HotelDTO';
|
|
@@ -66,6 +66,8 @@ export interface AdminHotelConfig {
|
|
|
66
66
|
hideByLine?: boolean;
|
|
67
67
|
transportDistances?: TransportDistances;
|
|
68
68
|
roomGroups: HotelRoomGroupsDTO;
|
|
69
|
+
cardProcessor: EHotelCardProcessor;
|
|
70
|
+
requireDeposit?: boolean;
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
71
73
|
* This config comes from hard static local file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotel.js","sourceRoot":"/","sources":["src/models/Client/Hotel/Hotel.ts"],"names":[],"mappings":";;;AAgBA,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,8BAAU,CAAA;IACV,0CAAsB,CAAA;IACtB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport { EBookingPaymentMethod, IHotelColorScheme } from '@roomstay/core';\nimport type { ReactChild } from 'react';\n\nimport type { MemberOnlyModalInputs } from '@/components/steps/room/MemberSignInModal/MemberSignInModal.types';\nimport type { HotelRoomGroupsDTO, HotelRoomsDTO, HotelServiceDTO } from '@/models/Api/HotelDTO';\nimport type { TransportDistances } from '@/models/Api/HotelOverrideDTO';\nimport type { HasDatalayerTags } from '@/models/Client/Hotel/Company';\nimport type { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport type HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport type { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport type { HotelPerk } from '@/models/Client/Hotel/HotelPerk';\nimport type { HotelRoomOverwrite } from '@/models/Client/Hotel/HotelRoomOverwrite';\nimport type { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\nimport type { Language } from '@/providers/LanguageProvider';\n\nexport enum EPaymentCardType {\n Visa = 'VI',\n Mastercard = 'MC',\n JCB = 'JC',\n AmericanExpress = 'AX',\n DinersClub = 'DN',\n UnionPay = 'UP',\n}\n\nexport interface IVGSVaultNames {\n standard: string;\n members: string;\n}\n\n/**\n * This config comes from admin\n */\nexport interface AdminHotelConfig {\n hotelID: string;\n name: string;\n address?: HotelAddress;\n latitude?: number;\n longitude?: number;\n phone?: string;\n email?: string;\n checkInTime?: string;\n checkOutTime?: string;\n paymentCardTypes?: EPaymentCardType[];\n description?: string;\n locationDescription?: string;\n policies?: string;\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n rooms: HotelRoomsDTO;\n hasLoadedDetails?: boolean;\n dataSource: HotelDataSource;\n defaultCurrency: string;\n paymentMethods: EBookingPaymentMethod[];\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n hotelUrl: string;\n heroImage: string;\n memberOnlyModalImage?: string;\n images?: string[];\n logo: string | ReactChild;\n colors: IHotelColorScheme;\n distanceUnitType: DistanceUnitType;\n startsWeekOnDay?: WeekdayStartsOn;\n crossSellHotelIds?: string[];\n maxOccupancy?: number;\n hideByLine?: boolean;\n transportDistances?: TransportDistances;\n roomGroups: HotelRoomGroupsDTO;\n}\n\n/**\n * This config comes from hard static local file\n */\nexport interface ClientHotelConfig {\n providerHotelID: string;\n shortName?: string;\n defaultDatepickerType?: 'Month' | 'Week';\n // TODO: need to do magic to see if we need to append / prepend stuff, for now we assume that it's only used while on the site.\n checkoutUrl?: string;\n defaultLanguage: Language;\n privacyPolicyUrl: string;\n bookNowPayLaterUrl?: string;\n bestRateNoBSUrl?: string;\n\n memberOnlyRates?: string[];\n memberOnlyPromoCode?: string;\n memberOnlySignupInputs?: MemberOnlyModalInputs;\n googleMapsImage?: string;\n /**\n * Whether to show the Breakfast / Lunch / Dinner included\n */\n showMealPill?: boolean;\n perks: HotelPerk[];\n /**\n * Hide perks on room row\n */\n perksHideOnRoomRow?: boolean;\n /**\n * Hide perks on room detail modal\n */\n perksHideOnRoomDetail?: boolean;\n perksShowDisclaimer?: boolean;\n /** @deprecated Use the vgs.vaultNames.standard property now */\n vgsVaultName?: string;\n vgs?: {\n vaultNames: IVGSVaultNames;\n };\n showAddonLoader: boolean;\n overwrites?: { [code: string]: Partial<HotelRoomOverwrite> };\n forwardFindReservationToSynxis?: boolean;\n additionalOptions?: { [name: string]: any };\n googleReCaptcha?: {\n loadForMembers?: boolean;\n siteKey?: string;\n };\n /**\n * Show description on RoomDetails\n */\n showDescriptionOnRoomDetails?: boolean;\n /**\n * Customize the Member modal colours. Specifically replacing the green (success) with the primary color of hotel (accent)\n */\n memberOnlyModalUsePrimaryColor?: boolean;\n /**\n * Callback to trigger specific events on load of a hotel.\n *\n * This is where you can specify custom fields, language overrides, feature toggles etc.\n */\n onLoad?: () => void;\n}\n\nexport interface ConfigHotel extends ClientHotelConfig, AdminHotelConfig, HasDatalayerTags {}\n\nexport type Hotel = ConfigHotel & {\n lowestPrice?: {\n value: number;\n isLoading: boolean;\n };\n};\n\n/**\n * Used for DetailsHotel event\n */\nexport type InitialHotelDetailsEventPayload = {\n name: string;\n hotelID: number | string;\n hotelUrl: string;\n currency: string;\n language: Language;\n address?: HotelAddress;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Hotel.js","sourceRoot":"/","sources":["src/models/Client/Hotel/Hotel.ts"],"names":[],"mappings":";;;AAgBA,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,8BAAU,CAAA;IACV,0CAAsB,CAAA;IACtB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport { EBookingPaymentMethod, EHotelCardProcessor, IHotelColorScheme } from '@roomstay/core';\nimport type { ReactChild } from 'react';\n\nimport type { MemberOnlyModalInputs } from '@/components/steps/room/MemberSignInModal/MemberSignInModal.types';\nimport type { HotelRoomGroupsDTO, HotelRoomsDTO, HotelServiceDTO } from '@/models/Api/HotelDTO';\nimport type { TransportDistances } from '@/models/Api/HotelOverrideDTO';\nimport type { HasDatalayerTags } from '@/models/Client/Hotel/Company';\nimport type { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport type HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport type { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport type { HotelPerk } from '@/models/Client/Hotel/HotelPerk';\nimport type { HotelRoomOverwrite } from '@/models/Client/Hotel/HotelRoomOverwrite';\nimport type { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\nimport type { Language } from '@/providers/LanguageProvider';\n\nexport enum EPaymentCardType {\n Visa = 'VI',\n Mastercard = 'MC',\n JCB = 'JC',\n AmericanExpress = 'AX',\n DinersClub = 'DN',\n UnionPay = 'UP',\n}\n\nexport interface IVGSVaultNames {\n standard: string;\n members: string;\n}\n\n/**\n * This config comes from admin\n */\nexport interface AdminHotelConfig {\n hotelID: string;\n name: string;\n address?: HotelAddress;\n latitude?: number;\n longitude?: number;\n phone?: string;\n email?: string;\n checkInTime?: string;\n checkOutTime?: string;\n paymentCardTypes?: EPaymentCardType[];\n description?: string;\n locationDescription?: string;\n policies?: string;\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n rooms: HotelRoomsDTO;\n hasLoadedDetails?: boolean;\n dataSource: HotelDataSource;\n defaultCurrency: string;\n paymentMethods: EBookingPaymentMethod[];\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n hotelUrl: string;\n heroImage: string;\n memberOnlyModalImage?: string;\n images?: string[];\n logo: string | ReactChild;\n colors: IHotelColorScheme;\n distanceUnitType: DistanceUnitType;\n startsWeekOnDay?: WeekdayStartsOn;\n crossSellHotelIds?: string[];\n maxOccupancy?: number;\n hideByLine?: boolean;\n transportDistances?: TransportDistances;\n roomGroups: HotelRoomGroupsDTO;\n cardProcessor: EHotelCardProcessor;\n\n requireDeposit?: boolean;\n}\n\n/**\n * This config comes from hard static local file\n */\nexport interface ClientHotelConfig {\n providerHotelID: string;\n shortName?: string;\n defaultDatepickerType?: 'Month' | 'Week';\n // TODO: need to do magic to see if we need to append / prepend stuff, for now we assume that it's only used while on the site.\n checkoutUrl?: string;\n defaultLanguage: Language;\n privacyPolicyUrl: string;\n bookNowPayLaterUrl?: string;\n bestRateNoBSUrl?: string;\n\n memberOnlyRates?: string[];\n memberOnlyPromoCode?: string;\n memberOnlySignupInputs?: MemberOnlyModalInputs;\n googleMapsImage?: string;\n /**\n * Whether to show the Breakfast / Lunch / Dinner included\n */\n showMealPill?: boolean;\n perks: HotelPerk[];\n /**\n * Hide perks on room row\n */\n perksHideOnRoomRow?: boolean;\n /**\n * Hide perks on room detail modal\n */\n perksHideOnRoomDetail?: boolean;\n perksShowDisclaimer?: boolean;\n /** @deprecated Use the vgs.vaultNames.standard property now */\n vgsVaultName?: string;\n vgs?: {\n vaultNames: IVGSVaultNames;\n };\n showAddonLoader: boolean;\n overwrites?: { [code: string]: Partial<HotelRoomOverwrite> };\n forwardFindReservationToSynxis?: boolean;\n additionalOptions?: { [name: string]: any };\n googleReCaptcha?: {\n loadForMembers?: boolean;\n siteKey?: string;\n };\n /**\n * Show description on RoomDetails\n */\n showDescriptionOnRoomDetails?: boolean;\n /**\n * Customize the Member modal colours. Specifically replacing the green (success) with the primary color of hotel (accent)\n */\n memberOnlyModalUsePrimaryColor?: boolean;\n /**\n * Callback to trigger specific events on load of a hotel.\n *\n * This is where you can specify custom fields, language overrides, feature toggles etc.\n */\n onLoad?: () => void;\n}\n\nexport interface ConfigHotel extends ClientHotelConfig, AdminHotelConfig, HasDatalayerTags {}\n\nexport type Hotel = ConfigHotel & {\n lowestPrice?: {\n value: number;\n isLoading: boolean;\n };\n};\n\n/**\n * Used for DetailsHotel event\n */\nexport type InitialHotelDetailsEventPayload = {\n name: string;\n hotelID: number | string;\n hotelUrl: string;\n currency: string;\n language: Language;\n address?: HotelAddress;\n};\n"]}
|
|
@@ -13,6 +13,10 @@ export declare enum EUserProfileFormKey {
|
|
|
13
13
|
}
|
|
14
14
|
export type TUserProfileFormValues = {
|
|
15
15
|
[userProfileKey in EUserProfileFormKey]: string;
|
|
16
|
+
} & {
|
|
17
|
+
AuxInputs?: {
|
|
18
|
+
[key: string]: string | number;
|
|
19
|
+
};
|
|
16
20
|
};
|
|
17
21
|
export interface ConfirmationFormValues {
|
|
18
22
|
IATANumber?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAKA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport BasketRowDifferences from './BasketRowDifferences';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n};\n\nexport interface ConfirmationFormValues {\n IATANumber?: string;\n userProfiles: TUserProfileFormValues[];\n copyCheckBox?: boolean;\n paymentMethod: EBookingPaymentMethod;\n}\n\nexport interface IBookValidationResult {\n differences: BasketRowDifferences[];\n warnings: string[];\n}\n\nexport type FBookValidationCallback = (validationResult?: IBookValidationResult) => void;\nexport type FBookSuccessCallback = (data: ReservationsDTO) => Promise<void>;\nexport type FBookValidateFunction = () => Promise<boolean>;\nexport type FBookGetPaymentDetails = () => Promise<IBookingPayment>;\n"]}
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAKA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport BasketRowDifferences from './BasketRowDifferences';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n} & { AuxInputs?: { [key: string]: string | number } };\n\nexport interface ConfirmationFormValues {\n IATANumber?: string;\n userProfiles: TUserProfileFormValues[];\n copyCheckBox?: boolean;\n paymentMethod: EBookingPaymentMethod;\n}\n\nexport interface IBookValidationResult {\n differences: BasketRowDifferences[];\n warnings: string[];\n}\n\nexport type FBookValidationCallback = (validationResult?: IBookValidationResult) => void;\nexport type FBookSuccessCallback = (data: ReservationsDTO) => Promise<void>;\nexport type FBookValidateFunction = () => Promise<boolean>;\nexport type FBookGetPaymentDetails = () => Promise<IBookingPayment>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfile.js","sourceRoot":"/","sources":["src/models/UserProfile.ts"],"names":[],"mappings":"","sourcesContent":["type UserProfile = {\n Title?: string;\n FirstName: string;\n MiddleName?: string;\n LastName: string;\n NameSuffix?: string;\n Phone: string;\n Email: string;\n Address: {\n Line1?: string;\n Line2?: string;\n Line3?: string;\n City: string;\n PostalCode: string;\n State?: string;\n Country: string;\n };\n MarketingOptIn: boolean;\n ReservationId?: string;\n};\n\nexport default UserProfile;\n"]}
|
|
1
|
+
{"version":3,"file":"UserProfile.js","sourceRoot":"/","sources":["src/models/UserProfile.ts"],"names":[],"mappings":"","sourcesContent":["type UserProfile = {\n Title?: string;\n FirstName: string;\n MiddleName?: string;\n LastName: string;\n NameSuffix?: string;\n Phone: string;\n Email: string;\n Address: {\n Line1?: string;\n Line2?: string;\n Line3?: string;\n City: string;\n PostalCode: string;\n State?: string;\n Country: string;\n };\n MarketingOptIn: boolean;\n ReservationId?: string;\n AuxInputs?: { [key: string]: string | number };\n};\n\nexport default UserProfile;\n"]}
|
|
@@ -152,7 +152,9 @@ function HotelInfo() {
|
|
|
152
152
|
react_1.default.createElement("span", { dangerouslySetInnerHTML: {
|
|
153
153
|
__html: perk.name,
|
|
154
154
|
} }))))));
|
|
155
|
-
}))
|
|
155
|
+
})),
|
|
156
|
+
(hotel === null || hotel === void 0 ? void 0 : hotel.perksShowDisclaimer) && (react_1.default.createElement("div", { className: "row u-marg-top--lighter" },
|
|
157
|
+
react_1.default.createElement("small", { className: "col-12" }, t(Translation_1.Translation.Misc.PerksDisclaimer))))))),
|
|
156
158
|
!!((_f = hotel === null || hotel === void 0 ? void 0 : hotel.hotelServices) === null || _f === void 0 ? void 0 : _f.length) && (react_1.default.createElement("div", { className: "u-marg-bottom u-marg-bottom--heavy" },
|
|
157
159
|
react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
|
|
158
160
|
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Step.Hotel.HotelAmenities))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0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ClC,uCAAK,SAAS,EAAC,KAAK;gCACf,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oCACrB,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE;wCACvB,OAAO,CACH,uCAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,OAAO,IAC7B,QAAQ,CAAC,KAAK,CAAC,CACd,CACT,CAAC;qCACL;gCACL,CAAC,CAAC;gCACD,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,uCAAK,SAAS,EAAC,OAAO;oCAClB,uCAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,iBAAiB;wCAC9D,QAAQ,CAAC,CAAC,CAAC;wCACZ;;4CAAS,MAAM,CAAC,MAAM,GAAG,CAAC,CAAQ,CAChC,CACJ,CACT,CACC,CACJ,CACJ,CACJ,CACJ,CACJ;QACL,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,CACjB,8BAAC,0BAAU,IACP,OAAO,EAAE,kBAAkB,CAAC,OAAO,EACnC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAC/B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAa,CAAC,WAAW,CAAC,KAAK,EAAE,yBAAS,CAAC,QAAQ,CAAC,CAAC,EACpF,IAAI,EAAC,OAAO,GACd,CACL,CACF,CACN,CAAC;AACN,CAAC;AAxPD,4BAwPC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport HotelLocationMap from '@/components/generic/map/HotelLocationMap';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n return (\n <>\n <div style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }} className=\"c-masthead has-tint\">\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">{hotel?.address?.country}</h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy\" style={{ height: '240px' }}>\n <HotelLocationMap />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.About)}</Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.description?.replace('\\r\\n', '<br/><br/>') || '' }} />\n </Text>\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.locationDescription?.replace('\\r\\n', '<br/><br/>') }} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n {hotel?.perks.map((perk) => {\n return (\n <div className=\"col-6 col-md-4\" key={perk.name}>\n <div className=\"u-flex u-marg-bottom\">\n <div className=\"room-perk-icon\">{perk.iconElement ? perk.iconElement : <Icon icon={perk.icon as IconType} />}</div>\n <span className=\"u-flex__item\">\n <Text type={TextType.Small}>\n <span\n dangerouslySetInnerHTML={{\n __html: perk.name,\n }}\n />\n </Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </>\n )}\n </div>\n {!!hotel?.hotelServices?.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.HotelAmenities)}</Headline>\n </div>\n <div className=\"row\">\n {hotel?.hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.Policies)}</Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.Gallery)}</Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAC1D,2CAA4D;AAC5D,wEAA0C;AAC1C,uEAAuE;AACvE,+CAAmD;AACnD,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,iGAAyE;AACzE,kEAA2D;AAC3D,2HAAmG;AACnG,2EAAqE;AACrE,wCAAqC;AACrC,qEAA6C;AAE7C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;gCACf,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oCACrB,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE;wCACvB,OAAO,CACH,uCAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,OAAO,IAC7B,QAAQ,CAAC,KAAK,CAAC,CACd,CACT,CAAC;qCACL;gCACL,CAAC,CAAC;gCACD,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,uCAAK,SAAS,EAAC,OAAO;oCAClB,uCAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,iBAAiB;wCAC9D,QAAQ,CAAC,CAAC,CAAC;wCACZ;;4CAAS,MAAM,CAAC,MAAM,GAAG,CAAC,CAAQ,CAChC,CACJ,CACT,CACC,CACJ,CACJ,CACJ,CACJ,CACJ;QACL,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,CACjB,8BAAC,0BAAU,IACP,OAAO,EAAE,kBAAkB,CAAC,OAAO,EACnC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAC/B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAa,CAAC,WAAW,CAAC,KAAK,EAAE,yBAAS,CAAC,QAAQ,CAAC,CAAC,EACpF,IAAI,EAAC,OAAO,GACd,CACL,CACF,CACN,CAAC;AACN,CAAC;AA7PD,4BA6PC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport HotelLocationMap from '@/components/generic/map/HotelLocationMap';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n return (\n <>\n <div style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }} className=\"c-masthead has-tint\">\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">{hotel?.address?.country}</h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy\" style={{ height: '240px' }}>\n <HotelLocationMap />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.About)}</Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.description?.replace('\\r\\n', '<br/><br/>') || '' }} />\n </Text>\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.locationDescription?.replace('\\r\\n', '<br/><br/>') }} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n {hotel?.perks.map((perk) => {\n return (\n <div className=\"col-6 col-md-4\" key={perk.name}>\n <div className=\"u-flex u-marg-bottom\">\n <div className=\"room-perk-icon\">{perk.iconElement ? perk.iconElement : <Icon icon={perk.icon as IconType} />}</div>\n <span className=\"u-flex__item\">\n <Text type={TextType.Small}>\n <span\n dangerouslySetInnerHTML={{\n __html: perk.name,\n }}\n />\n </Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n {hotel?.perksShowDisclaimer && (\n <div className=\"row u-marg-top--lighter\">\n <small className=\"col-12\">{t(Translation.Misc.PerksDisclaimer)}</small>\n </div>\n )}\n </>\n )}\n </div>\n {!!hotel?.hotelServices?.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.HotelAmenities)}</Headline>\n </div>\n <div className=\"row\">\n {hotel?.hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.Policies)}</Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Hotel.Gallery)}</Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n"]}
|
|
@@ -59,28 +59,28 @@ function StepConfirmationComponent() {
|
|
|
59
59
|
raise(event);
|
|
60
60
|
}, []);
|
|
61
61
|
return (react_1.default.createElement("div", { className: "container" },
|
|
62
|
-
react_1.default.createElement(
|
|
63
|
-
|
|
64
|
-
react_1.default.createElement(StepLayout_1.
|
|
65
|
-
|
|
66
|
-
react_1.default.createElement(
|
|
67
|
-
react_1.default.createElement(
|
|
68
|
-
|
|
69
|
-
react_1.default.createElement(
|
|
70
|
-
|
|
71
|
-
react_1.default.createElement(
|
|
72
|
-
|
|
73
|
-
react_1.default.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
react_1.default.createElement(StepLayout_1.
|
|
77
|
-
react_1.default.createElement(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
react_1.default.createElement(StepConfirmationFormProvider_1.default, null)))
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
react_1.default.createElement(contexts_1.ConfirmationFormContextWrapper, null,
|
|
63
|
+
react_1.default.createElement(BEMobileSummary_1.default, null),
|
|
64
|
+
react_1.default.createElement(StepLayout_1.StepLayoutContainer, null,
|
|
65
|
+
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
66
|
+
context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
67
|
+
react_1.default.createElement(react_router_dom_1.Link, { to: StepManager_1.default.getPreviousStepUrl(currentStep) },
|
|
68
|
+
react_1.default.createElement(BackButton_1.default, null)),
|
|
69
|
+
react_1.default.createElement("div", { className: "u-marg-top--light u-marg-bottom--heavy" },
|
|
70
|
+
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Navigation.Steps.Confirmation))))),
|
|
71
|
+
react_1.default.createElement("div", { className: "u-marg-top@m-" },
|
|
72
|
+
react_1.default.createElement(StepRoomBestRateAlert_1.default, null))),
|
|
73
|
+
context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
|
|
74
|
+
react_1.default.createElement(StepRoomHotelDetails_1.default, null)))),
|
|
75
|
+
react_1.default.createElement(LineBreak_1.default, null),
|
|
76
|
+
react_1.default.createElement(StepLayout_1.StepLayoutContainer, null,
|
|
77
|
+
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
78
|
+
react_1.default.createElement("div", { className: "block-container" },
|
|
79
|
+
!InlineAddonStepFeature_1.default.isActive() && react_1.default.createElement(AdditionalOffers_1.default, null),
|
|
80
|
+
react_1.default.createElement(StepConfirmationFormProvider_1.default, null))),
|
|
81
|
+
context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
|
|
82
|
+
react_1.default.createElement(StepConfirmationLimitedOffer_1.default, { endDate: (0, dayjs_1.default)().add(10, 'minute') }),
|
|
83
|
+
react_1.default.createElement(BESummary_1.BESummary, { showImages: true })))))));
|
|
84
84
|
}
|
|
85
85
|
exports.default = StepConfirmationComponent;
|
|
86
86
|
//# sourceMappingURL=StepConfirmationComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgI;AAChI,6CAAyD;AACzD,kDAA0B;AAC1B,+CAAqD;AACrD,iDAA+C;AAC/C,uDAAwC;AACxC,0DAAuD;AAEvD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,yHAAiG;AACjG,gIAAwG;AACxG,0GAAkF;AAClF,wGAAgF;AAChF,2FAAmE;AACnE,8DAA2D;AAC3D,iDAA6C;AAC7C,wGAAgF;AAChF,mEAA2C;AAC3C,qEAA6C;AAE7C,uIAA+G;AAE/G,SAAS,yBAAyB;IAC9B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAC1D,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAExD,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAQ,GAAE,CAAC;IAE7B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,MAAM,KAAK,GAAG,IAAI,8BAAqB,CAAC,iBAAiB,CAAC,CAAC;QAC3D,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,uCAAK,SAAS,EAAC,WAAW;QACtB,8BAAC,yBAAe,OAAG;
|
|
1
|
+
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgI;AAChI,6CAAyD;AACzD,kDAA0B;AAC1B,+CAAqD;AACrD,iDAA+C;AAC/C,uDAAwC;AACxC,0DAAuD;AAEvD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,yHAAiG;AACjG,gIAAwG;AACxG,0GAAkF;AAClF,wGAAgF;AAChF,2FAAmE;AACnE,8DAA2D;AAC3D,iDAA6C;AAC7C,wGAAgF;AAChF,mEAA2C;AAC3C,qEAA6C;AAE7C,uIAA+G;AAE/G,SAAS,yBAAyB;IAC9B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAC1D,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAExD,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAQ,GAAE,CAAC;IAE7B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,MAAM,KAAK,GAAG,IAAI,8BAAqB,CAAC,iBAAiB,CAAC,CAAC;QAC3D,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAA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BookingEngineContext, ConfirmationFormContextWrapper, FullPageEngineContext } from '@frontend/contexts';\nimport { StepCheckoutViewEvent } from '@frontend/events';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BackButton from '@/components/generic/BackButton';\nimport Headline from '@/components/generic/Headline';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\nimport LineBreak from '@/components/generic/LineBreak';\nimport AdditionalOffers from '@/components/steps/confirmation/additionalOffers/AdditionalOffers';\nimport StepConfirmationLimitedOffer from '@/components/steps/confirmation/StepConfirmationLimitedOffer';\nimport StepRoomBestRateAlert from '@/components/steps/room/StepRoomBestRateAlert';\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\nimport { BESummary } from '@/components/summary/BESummary';\nimport { useEvent } from '@/hooks/EventHook';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nimport StepConfirmationFormProvider from '../../../components/steps/confirmation/StepConfirmationFormProvider';\n\nfunction StepConfirmationComponent() {\n const context = useContext(BookingEngineContext);\n const { currentStep } = useContext(FullPageEngineContext);\n const { currentBasketRows } = useContext(BasketContext);\n\n const { t } = useTranslation();\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepCheckoutViewEvent(currentBasketRows);\n raise(event);\n }, []);\n\n return (\n <div className=\"container\">\n <ConfirmationFormContextWrapper>\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link to={StepManager.getPreviousStepUrl(currentStep)}>\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Navigation.Steps.Confirmation)}</Headline>\n </div>\n </>\n )}\n\n <div className=\"u-marg-top@m-\">\n <StepRoomBestRateAlert />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n <LineBreak />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <div className=\"block-container\">\n {!InlineAddonStepFeature.isActive() && <AdditionalOffers />}\n <StepConfirmationFormProvider />\n </div>\n </StepLayoutLeftContent>\n\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepConfirmationLimitedOffer endDate={dayjs().add(10, 'minute')} />\n <BESummary showImages />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </ConfirmationFormContextWrapper>\n </div>\n );\n}\n\nexport default StepConfirmationComponent;\n"]}
|
|
@@ -278,6 +278,7 @@ export declare const Translation: {
|
|
|
278
278
|
AlreadyHaveAccount: string;
|
|
279
279
|
AdditionalOfferings: string;
|
|
280
280
|
Address: string;
|
|
281
|
+
AdditionalDetailsTitle: string;
|
|
281
282
|
AlmostDone: string;
|
|
282
283
|
Comments: string;
|
|
283
284
|
ContactInfo: string;
|
|
@@ -329,6 +330,7 @@ export declare const Translation: {
|
|
|
329
330
|
PlanpayHelperText: string;
|
|
330
331
|
CardLabel: string;
|
|
331
332
|
CardSubLabel: string;
|
|
333
|
+
CardThirdPartyLabel: string;
|
|
332
334
|
PlanpayLabel: string;
|
|
333
335
|
PaidWithPlanpay: string;
|
|
334
336
|
UnexpectedErrorFromBookingDatabase: string;
|
|
@@ -281,6 +281,7 @@ exports.Translation = {
|
|
|
281
281
|
AlreadyHaveAccount: 'Step.Confirmation.AlreadyHaveAccount',
|
|
282
282
|
AdditionalOfferings: 'Step.Confirmation.AdditionalOfferings',
|
|
283
283
|
Address: 'Step.Confirmation.Address',
|
|
284
|
+
AdditionalDetailsTitle: 'Step.Confirmation.AdditionalDetailsTitle',
|
|
284
285
|
AlmostDone: 'Step.Confirmation.AlmostDone',
|
|
285
286
|
Comments: 'Step.Confirmation.Comments',
|
|
286
287
|
ContactInfo: 'Step.Confirmation.ContactInfo',
|
|
@@ -332,6 +333,7 @@ exports.Translation = {
|
|
|
332
333
|
PlanpayHelperText: 'Step.Confirmation.PlanpayHelperText',
|
|
333
334
|
CardLabel: 'Step.Confirmation.CardLabel',
|
|
334
335
|
CardSubLabel: 'Step.Confirmation.CardSubLabel',
|
|
336
|
+
CardThirdPartyLabel: 'Step.Confirmation.CardThirdPartyLabel',
|
|
335
337
|
PlanpayLabel: 'Step.Confirmation.PlanpayLabel',
|
|
336
338
|
PaidWithPlanpay: 'Step.Confirmation.PaidWithPlanpay',
|
|
337
339
|
UnexpectedErrorFromBookingDatabase: 'Step.Confirmation.UnexpectedErrorFromBookingDatabase',
|