@roomstay/frontend 2.6.111-4 → 2.6.112

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.
Files changed (73) hide show
  1. package/dist/288.bundle.js +1 -1
  2. package/dist/370.bundle.js +1 -1
  3. package/dist/686.bundle.js +1 -0
  4. package/dist/836.bundle.js +1 -1
  5. package/dist/main.bundle.js +1 -1
  6. package/dist/src/api/AvailabilityAPI.js +1 -1
  7. package/dist/src/api/AvailabilityAPI.js.map +1 -1
  8. package/dist/src/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField.d.ts +2 -2
  9. package/dist/src/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField.js.map +1 -1
  10. package/dist/src/components/generic/map/HotelLocationMap.d.ts +2 -0
  11. package/dist/src/components/generic/map/{BEHotelLocationMapBlock.js → HotelLocationMap.js} +3 -10
  12. package/dist/src/components/generic/map/HotelLocationMap.js.map +1 -0
  13. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.d.ts +0 -4
  14. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.js +30 -105
  15. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.js.map +1 -1
  16. package/dist/src/components/members/SignInModal/ExternalMemberModal.d.ts +3 -9
  17. package/dist/src/components/members/SignInModal/ExternalMemberModal.js +6 -45
  18. package/dist/src/components/members/SignInModal/ExternalMemberModal.js.map +1 -1
  19. package/dist/src/components/steps/confirmation/RoomContactDetails.js +4 -4
  20. package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
  21. package/dist/src/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal.js +23 -11
  22. package/dist/src/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal.js.map +1 -1
  23. package/dist/src/components/steps/date/PeoplePicker.d.ts +2 -0
  24. package/dist/src/components/steps/date/{BEPeoplePickerBlock.js → PeoplePicker.js} +4 -13
  25. package/dist/src/components/steps/date/PeoplePicker.js.map +1 -0
  26. package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js +0 -2
  27. package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js.map +1 -1
  28. package/dist/src/components/summary/BEMobileSummaryModal.js +3 -3
  29. package/dist/src/components/summary/BEMobileSummaryModal.js.map +1 -1
  30. package/dist/src/components/summary/BESummary.js +3 -3
  31. package/dist/src/components/summary/BESummary.js.map +1 -1
  32. package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
  33. package/dist/src/contexts/BasketContext/BasketContextWrapper.js +1 -63
  34. package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
  35. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +11 -1
  36. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
  37. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +6 -6
  38. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
  39. package/dist/src/handlers/membership/SalesforceMemberHandler.js +1 -1
  40. package/dist/src/handlers/membership/SalesforceMemberHandler.js.map +1 -1
  41. package/dist/src/index.d.ts +8 -8
  42. package/dist/src/index.js +10 -16
  43. package/dist/src/index.js.map +1 -1
  44. package/dist/src/models/BasketRowDifferences.d.ts +1 -0
  45. package/dist/src/models/BasketRowDifferences.js.map +1 -1
  46. package/dist/src/pages/findReservation/FindReservationResults.js +1 -1
  47. package/dist/src/pages/findReservation/FindReservationResults.js.map +1 -1
  48. package/dist/src/pages/findReservation/ReservationRow.js +9 -10
  49. package/dist/src/pages/findReservation/ReservationRow.js.map +1 -1
  50. package/dist/src/pages/hotel/HotelInfo.js +9 -10
  51. package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
  52. package/dist/src/pages/steps/StepDate/StepDateComponent.js +2 -2
  53. package/dist/src/pages/steps/StepDate/StepDateComponent.js.map +1 -1
  54. package/dist/src/pages/steps/StepThanks/StepThanksComponent.d.ts +0 -2
  55. package/dist/src/pages/steps/StepThanks/StepThanksComponent.js +1 -8
  56. package/dist/src/pages/steps/StepThanks/StepThanksComponent.js.map +1 -1
  57. package/dist/src/providers/storage/SessionProvider.js.map +1 -1
  58. package/dist/src/stories/EnhancedPhoneNumberField.stories.d.ts +1 -1
  59. package/dist/src/translations/Translation.d.ts +0 -3
  60. package/dist/src/translations/Translation.js +0 -3
  61. package/dist/src/translations/Translation.js.map +1 -1
  62. package/dist/src/translations/languages/en-gb.js +0 -3
  63. package/dist/src/translations/languages/en-gb.js.map +1 -1
  64. package/dist/src/util/Analytics/Analytics.js +0 -1
  65. package/dist/src/util/Analytics/Analytics.js.map +1 -1
  66. package/dist/test.bundle.js +1 -1
  67. package/dist/vendors.bundle.js +1 -1
  68. package/package.json +3 -3
  69. package/dist/291.bundle.js +0 -1
  70. package/dist/src/components/generic/map/BEHotelLocationMapBlock.d.ts +0 -4
  71. package/dist/src/components/generic/map/BEHotelLocationMapBlock.js.map +0 -1
  72. package/dist/src/components/steps/date/BEPeoplePickerBlock.d.ts +0 -4
  73. package/dist/src/components/steps/date/BEPeoplePickerBlock.js.map +0 -1
@@ -45,7 +45,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.ExternalMemberModelFieldType = void 0;
49
48
  const core_1 = require("@roomstay/core");
50
49
  const classnames_1 = __importDefault(require("classnames"));
51
50
  const react_1 = __importStar(require("react"));
@@ -53,8 +52,6 @@ const react_hook_form_1 = require("react-hook-form");
53
52
  const react_i18next_1 = require("react-i18next");
54
53
  const BookingAPI_1 = __importDefault(require("../../../api/BookingAPI"));
55
54
  const BEButton_1 = __importDefault(require("../../generic/BEButton"));
56
- const Checkbox_1 = __importDefault(require("../../generic/Checkbox/Checkbox"));
57
- const EnhancedPhoneNumberField_1 = __importDefault(require("../../generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField"));
58
55
  const Headline_1 = __importDefault(require("../../generic/Headline"));
59
56
  const Icon_1 = require("../../generic/Icon/Icon");
60
57
  const InputGroup_1 = __importDefault(require("../../generic/InputGroup/InputGroup"));
@@ -64,30 +61,22 @@ const Text_1 = __importStar(require("../../generic/Text"));
64
61
  const TextBox_1 = __importDefault(require("../../generic/TextBox"));
65
62
  const contexts_1 = require("../../../contexts");
66
63
  const hooks_1 = require("../../../hooks");
67
- const E164PhoneNumberFieldFeature_1 = __importDefault(require("../../../providers/feature/E164PhoneNumberFieldFeature"));
68
64
  const ImageProvider_1 = __importStar(require("../../../providers/ImageProvider"));
69
65
  const Translation_1 = require("../../../translations/Translation");
70
66
  const Color_1 = require("../../../util/Color");
71
67
  const ExternalMemberModal_module_scss_1 = __importDefault(require("./ExternalMemberModal.module.scss"));
72
- var ExternalMemberModelFieldType;
73
- (function (ExternalMemberModelFieldType) {
74
- ExternalMemberModelFieldType["TextBox"] = "TextBox";
75
- ExternalMemberModelFieldType["CheckBox"] = "CheckBox";
76
- ExternalMemberModelFieldType["Phone"] = "Phone";
77
- })(ExternalMemberModelFieldType || (exports.ExternalMemberModelFieldType = ExternalMemberModelFieldType = {}));
78
68
  const ExternalMemberModal = (props) => {
79
69
  var _a;
80
70
  const { hotel } = (0, hooks_1.useCurrentHotel)();
81
71
  const basketContext = (0, react_1.useContext)(contexts_1.BasketContext);
82
72
  const { signUserIn, closeMemberSignupModal } = (0, react_1.useContext)(contexts_1.CompanyContext);
83
73
  const { t } = (0, react_i18next_1.useTranslation)();
84
- const formMethods = (0, react_hook_form_1.useFormContext)();
85
74
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
86
75
  const [errorMessage, setErrorMessage] = (0, react_1.useState)('');
76
+ const formMethods = (0, react_hook_form_1.useForm)();
87
77
  const modalPrimaryColor = (hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor) ? Color_1.Color.Accent : Color_1.Color.Success;
88
78
  const memberOnlySignupLink = (_a = hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlySignupLinks) === null || _a === void 0 ? void 0 : _a[props.provider];
89
79
  const getValidationClass = (name) => {
90
- console.log(formMethods.formState, formMethods.getValues());
91
80
  if (formMethods.formState.errors) {
92
81
  if (formMethods.formState.errors[name]) {
93
82
  return 'error';
@@ -146,39 +135,11 @@ const ExternalMemberModal = (props) => {
146
135
  props.subTitle && react_1.default.createElement(Text_1.default, { className: "u-marg-top external-member-modal-sub-title" }, props.subTitle),
147
136
  react_1.default.createElement("form", { onSubmit: formMethods.handleSubmit(onSubmit) },
148
137
  props.fields.map((field) => {
149
- const isRequired = field.required !== false;
150
- const validationStatus = getValidationClass(field.name);
151
- const register = formMethods.register(field.name, { required: isRequired });
152
- const inputProps = Object.assign({ iconProps: { color: Color_1.Color.DarkGrey }, icon: field.icon, inputProps: { disabled: isLoading }, placeholder: field.label, wide: true, required: isRequired, validationStatus }, register);
153
- const renderCheckbox = () => (react_1.default.createElement("div", { className: "u-marg-top", key: field.name },
154
- react_1.default.createElement(InputGroup_1.default, { dimensions: "1" },
155
- react_1.default.createElement(Checkbox_1.default, Object.assign({ label: field.label }, register)))));
156
- const renderPhone = () => (react_1.default.createElement(InputGroup_1.default, { dimensions: "1", key: field.name }, E164PhoneNumberFieldFeature_1.default.isActive() ? (react_1.default.createElement(react_hook_form_1.Controller, { control: formMethods.control, name: field.name, rules: {
157
- required: {
158
- value: isRequired,
159
- message: t(Translation_1.Translation.Step.Confirmation.Inputs.Required, {
160
- field: t(Translation_1.Translation.Step.Confirmation.Inputs.Phone),
161
- }),
162
- },
163
- minLength: { value: 5, message: 'Phone number is required' },
164
- maxLength: { value: 17, message: 'Phone number is too long' },
165
- pattern: {
166
- value: /^[1-9]( |\d){1,15}$/g,
167
- message: 'Incorrect phone number entered',
168
- },
169
- }, render: ({ field: controllerField }) => (react_1.default.createElement(EnhancedPhoneNumberField_1.default, Object.assign({}, controllerField, register, { validationStatus: validationStatus }))) })) : (react_1.default.createElement(TextBox_1.default, Object.assign({}, inputProps)))));
170
- const renderTextInput = () => {
171
- return (react_1.default.createElement("div", { className: "u-marg-top u-marg-bottom", key: field.name },
172
- react_1.default.createElement(InputGroup_1.default, { dimensions: "1" }, field.isMasked ? react_1.default.createElement(PasswordBox_1.PasswordBox, Object.assign({}, inputProps)) : react_1.default.createElement(TextBox_1.default, Object.assign({}, inputProps))),
173
- field.helperText && (react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.DarkGrey }, field.helperText))));
174
- };
175
- if (field.type === ExternalMemberModelFieldType.CheckBox) {
176
- return renderCheckbox();
177
- }
178
- if (field.type === ExternalMemberModelFieldType.Phone) {
179
- return renderPhone();
180
- }
181
- return renderTextInput();
138
+ const isRequired = field.required !== false; // Default to true if not specified
139
+ const inputProps = Object.assign({ iconProps: { color: Color_1.Color.DarkGrey }, icon: field.icon, inputProps: { disabled: isLoading }, placeholder: field.label, wide: true, required: isRequired, validationStatus: getValidationClass(field.name) }, formMethods.register(field.name, { required: isRequired }));
140
+ return (react_1.default.createElement("div", { className: "u-marg-top u-marg-bottom", key: field.name },
141
+ react_1.default.createElement(InputGroup_1.default, { dimensions: "1" }, field.isMasked ? react_1.default.createElement(PasswordBox_1.PasswordBox, Object.assign({}, inputProps)) : react_1.default.createElement(TextBox_1.default, Object.assign({}, inputProps))),
142
+ field.helperText && (react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.DarkGrey }, field.helperText))));
182
143
  }),
183
144
  react_1.default.createElement(BEButton_1.default, { isLoading: isLoading, htmlType: "submit", className: "u-marg-top external-member-modal-submit-btn", size: "normal", filled: true, primary: hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor, success: !(hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor), stopIconAnimation: true, icon: Icon_1.IconType.ArrowRight, iconPosition: "right", wide: true }, t(Translation_1.Translation.ExternalMemberPopup.Submit)),
184
145
  react_1.default.createElement("div", { className: "u-marg-top" },
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalMemberModal.js","sourceRoot":"/","sources":["src/components/members/SignInModal/ExternalMemberModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA4F;AAC5F,4DAAoC;AAEpC,+CAAoD;AACpD,qDAA+F;AAC/F,iDAA+C;AAE/C,kEAAmC;AACnC,6EAAqD;AACrD,sFAA8D;AAC9D,6IAAqH;AACrH,6EAAqD;AACrD,yDAA0D;AAC1D,4FAAoE;AACpE,sFAAsF;AACtF,8EAA2E;AAC3E,kEAA2D;AAC3D,2EAAqE;AACrE,yCAA2D;AAC3D,mCAA0C;AAE1C,kHAA0F;AAC1F,2EAAqE;AACrE,4DAAyD;AACzD,wCAAqC;AAErC,wGAAuD;AAevD,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACpC,mDAAmB,CAAA;IACnB,qDAAqB,CAAA;IACrB,+CAAe,CAAA;AACnB,CAAC,EAJW,4BAA4B,4CAA5B,4BAA4B,QAIvC;AAYD,MAAM,mBAAmB,GAAG,CAA8C,KAAkC,EAAE,EAAE;;IAC5G,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IACpC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAChD,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IAC1E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,WAAW,GAAQ,IAAA,gCAAc,GAA0B,CAAC;IAElE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG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,IAAC,IAAI,QAAC,KAAK,EAAE,aAAK,CAAC,MAAM,IACzB,YAAY,CACV,CACL,CACH;oBAEN,oBAAoB,IAAI,CACrB,uCAAK,SAAS,EAAC,8BAA8B;wBACzC,uCAAK,SAAS,EAAC,YAAY,GAAO;wBAClC,uCAAK,SAAS,EAAC,wDAAwD;4BACnE,8BAAC,cAAI,IAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,EAAE,SAAS,EAAC,2BAA2B,EAAC,KAAK,EAAE,aAAK,CAAC,QAAQ,IAClF,CAAC,CAAC,yBAAW,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAChD;4BACP,8BAAC,kBAAQ,IACL,SAAS,EAAC,kCAAkC,EAC5C,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,QAAQ,EACb,MAAM,QACN,OAAO,QACP,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,IAEzD,CAAC,CAAC,yBAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CACnC,CACT,CACJ,CACT,CACC,CACJ,CACJ,CACI,CACjB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["import { EMembershipProvider, IMemberVerification, IMessage, nameof } from '@roomstay/core';\nimport classNames from 'classnames';\nimport { Property } from 'csstype';\nimport React, { useContext, useState } from 'react';\nimport { Controller, FieldValues, Path, SubmitHandler, useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\n\nimport API from '@/api/BookingAPI';\nimport BEButton from '@/components/generic/BEButton';\nimport Checkbox from '@/components/generic/Checkbox/Checkbox';\nimport EnhancedPhoneNumberField from '@/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField';\nimport Headline from '@/components/generic/Headline';\nimport { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport SimpleModal, { SimpleModalSize } from '@/components/generic/modal/SimpleModal';\nimport { PasswordBox } from '@/components/generic/PasswordBox/PasswordBox';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox, { TextBoxProps } from '@/components/generic/TextBox';\nimport { BasketContext, CompanyContext } from '@/contexts';\nimport { useCurrentHotel } from '@/hooks';\nimport UserProfile from '@/models/UserProfile';\nimport E164PhoneNumberFieldFeature from '@/providers/feature/E164PhoneNumberFieldFeature';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Translation } from '@/translations/Translation';\nimport { Color } from '@/util/Color';\n\nimport styles from './ExternalMemberModal.module.scss';\n\nexport type CommonMemberModalProps = {\n title: string;\n subTitle?: string;\n image: string;\n isOpen: boolean;\n imageSize: Property.ObjectFit;\n provider: EMembershipProvider;\n};\n\nexport type ExternalMemberModalProps<T extends FieldValues> = CommonMemberModalProps & {\n fields: ExternalMemberModelField<T>[];\n};\n\nexport enum ExternalMemberModelFieldType {\n TextBox = 'TextBox',\n CheckBox = 'CheckBox',\n Phone = 'Phone',\n}\nexport type ExternalMemberModelField<T extends FieldValues> = {\n name: keyof T & string;\n icon: IconType;\n label: string;\n profileMapping?: keyof UserProfile;\n isMasked?: boolean;\n required?: boolean;\n helperText?: string;\n type?: ExternalMemberModelFieldType;\n};\n\nconst ExternalMemberModal = <T extends FieldValues & IMemberVerification>(props: ExternalMemberModalProps<T>) => {\n const { hotel } = useCurrentHotel();\n const basketContext = useContext(BasketContext);\n const { signUserIn, closeMemberSignupModal } = useContext(CompanyContext);\n const { t } = useTranslation();\n const formMethods: any = useFormContext<Record<string, string>>();\n\n const [isLoading, setIsLoading] = useState(false);\n const [errorMessage, setErrorMessage] = useState('');\n\n const modalPrimaryColor = hotel?.memberOnlyModalUsePrimaryColor ? Color.Accent : Color.Success;\n const memberOnlySignupLink = hotel?.memberOnlySignupLinks?.[props.provider];\n\n const getValidationClass = (name: keyof T) => {\n console.log(formMethods.formState, formMethods.getValues());\n if (formMethods.formState.errors) {\n if (formMethods.formState.errors[name]) {\n return 'error';\n } else {\n return 'success';\n }\n }\n };\n\n const onSubmit: SubmitHandler<T> = async (fields) => {\n setIsLoading(true);\n setErrorMessage('');\n\n try {\n const hotelId = hotel?.hotelID as string;\n const member = await API.Member.verifyMember(hotelId, props.provider, fields);\n\n if (member && member.memberId) {\n await signUserIn({\n saveState: true, //TODO: why was this false???\n memberNumber: member.memberId,\n memberProvider: props.provider,\n firstName: fields.firstName,\n lastName: fields.lastName,\n email: fields.email,\n });\n\n // Preset checkout defaults\n basketContext.currentBasketRows?.forEach(\n (row) =>\n (row.checkoutDefaults = {\n firstName: fields.firstName,\n lastName: fields.lastName,\n email: fields.email,\n })\n );\n } else {\n setErrorMessage(t(Translation.ExternalMemberPopup.InvalidMember));\n }\n } catch (e: any) {\n if (e[nameof<IMessage>('Message')]) {\n setErrorMessage(e.Message);\n } else {\n throw e;\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <SimpleModal open={props.isOpen} onClose={closeMemberSignupModal} size={SimpleModalSize.Normal} alignCenter>\n <div className={classNames(styles['external-member-modal'], 'row', `external-member-modal-${props.provider}`)}>\n <div className=\"col-md-6 external-member-modal-image\">\n <img\n src={ImageProvider.resizeImage(props.image, ImageSize.Original)}\n alt={props.title}\n className={styles['external-member-image']}\n style={{ objectFit: props.imageSize }}\n />\n </div>\n\n <div className=\"col-md-6 u-pad--heavy external-member-modal-content\">\n <div className=\"u-pad\">\n <Headline className=\"external-member-modal-title\" bold color={modalPrimaryColor}>\n {props.title}\n </Headline>\n {props.subTitle && <Text className=\"u-marg-top external-member-modal-sub-title\">{props.subTitle}</Text>}\n\n <form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {props.fields.map((field) => {\n const isRequired = field.required !== false;\n const validationStatus = getValidationClass(field.name);\n const register = formMethods.register(field.name as Path<T>, { required: isRequired });\n const inputProps: TextBoxProps = {\n iconProps: { color: Color.DarkGrey },\n icon: field.icon,\n inputProps: { disabled: isLoading },\n placeholder: field.label,\n wide: true,\n required: isRequired,\n validationStatus,\n ...register,\n };\n const renderCheckbox = () => (\n <div className=\"u-marg-top\" key={field.name}>\n <InputGroup dimensions=\"1\">\n <Checkbox label={field.label} {...register} />\n </InputGroup>\n </div>\n );\n\n const renderPhone = () => (\n <InputGroup dimensions=\"1\" key={field.name}>\n {E164PhoneNumberFieldFeature.isActive() ? (\n <Controller\n control={formMethods.control}\n name={field.name}\n rules={{\n required: {\n value: isRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, {\n field: t(Translation.Step.Confirmation.Inputs.Phone),\n }),\n },\n minLength: { value: 5, message: 'Phone number is required' },\n maxLength: { value: 17, message: 'Phone number is too long' },\n pattern: {\n value: /^[1-9]( |\\d){1,15}$/g,\n message: 'Incorrect phone number entered',\n },\n }}\n render={({ field: controllerField }) => (\n <EnhancedPhoneNumberField {...controllerField} {...register} validationStatus={validationStatus} />\n )}\n />\n ) : (\n <TextBox {...inputProps} />\n )}\n </InputGroup>\n );\n\n const renderTextInput = () => {\n return (\n <div className=\"u-marg-top u-marg-bottom\" key={field.name}>\n <InputGroup dimensions=\"1\">{field.isMasked ? <PasswordBox {...inputProps} /> : <TextBox {...inputProps} />}</InputGroup>\n\n {field.helperText && (\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {field.helperText}\n </Text>\n )}\n </div>\n );\n };\n\n if (field.type === ExternalMemberModelFieldType.CheckBox) {\n return renderCheckbox();\n }\n\n if (field.type === ExternalMemberModelFieldType.Phone) {\n return renderPhone();\n }\n\n return renderTextInput();\n })}\n\n <BEButton\n isLoading={isLoading}\n htmlType=\"submit\"\n className=\"u-marg-top external-member-modal-submit-btn\"\n size=\"normal\"\n filled\n primary={hotel?.memberOnlyModalUsePrimaryColor}\n success={!hotel?.memberOnlyModalUsePrimaryColor}\n stopIconAnimation\n icon={IconType.ArrowRight}\n iconPosition=\"right\"\n wide\n >\n {t(Translation.ExternalMemberPopup.Submit)}\n </BEButton>\n <div className=\"u-marg-top\">\n <Text bold color={Color.Danger}>\n {errorMessage}\n </Text>\n </div>\n </form>\n\n {memberOnlySignupLink && (\n <div className=\"external-member-modal-signup\">\n <div className=\"line-break\"></div>\n <div className=\"u-marg-top u-flex align-items-center u-justify-between\">\n <Text type={TextType.Small} className=\"u-flex align-items-center\" color={Color.DarkGrey}>\n {t(Translation.ExternalMemberPopup.DontHaveAccount)}\n </Text>\n <BEButton\n className=\"external-member-modal-signup-btn\"\n htmlType=\"button\"\n size=\"normal\"\n filled\n primary\n onClick={() => window.open(memberOnlySignupLink, '_blank')}\n >\n {t(Translation.ExternalMemberPopup.SignUp)}\n </BEButton>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </SimpleModal>\n );\n};\n\nexport default ExternalMemberModal;\n"]}
1
+ {"version":3,"file":"ExternalMemberModal.js","sourceRoot":"/","sources":["src/components/members/SignInModal/ExternalMemberModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA4F;AAC5F,4DAAoC;AAEpC,+CAAoD;AACpD,qDAA4E;AAC5E,iDAA+C;AAE/C,kEAAmC;AACnC,6EAAqD;AACrD,6EAAqD;AACrD,yDAA0D;AAC1D,4FAAoE;AACpE,sFAAsF;AACtF,8EAA2E;AAC3E,kEAA2D;AAC3D,2EAAqE;AACrE,yCAA2D;AAC3D,mCAA0C;AAE1C,2EAAqE;AACrE,4DAAyD;AACzD,wCAAqC;AAErC,wGAAuD;AAyBvD,MAAM,mBAAmB,GAAG,CAA8C,KAAkC,EAAE,EAAE;;IAC5G,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IACpC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAChD,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IAC1E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B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C,CAAC,yBAAW,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAChD;4BACP,8BAAC,kBAAQ,IACL,SAAS,EAAC,kCAAkC,EAC5C,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,QAAQ,EACb,MAAM,QACN,OAAO,QACP,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,IAEzD,CAAC,CAAC,yBAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CACnC,CACT,CACJ,CACT,CACC,CACJ,CACJ,CACI,CACjB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["import { EMembershipProvider, IMemberVerification, IMessage, nameof } from '@roomstay/core';\nimport classNames from 'classnames';\nimport { Property } from 'csstype';\nimport React, { useContext, useState } from 'react';\nimport { FieldValues, Path, SubmitHandler, useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\n\nimport API from '@/api/BookingAPI';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport SimpleModal, { SimpleModalSize } from '@/components/generic/modal/SimpleModal';\nimport { PasswordBox } from '@/components/generic/PasswordBox/PasswordBox';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox, { TextBoxProps } from '@/components/generic/TextBox';\nimport { BasketContext, CompanyContext } from '@/contexts';\nimport { useCurrentHotel } from '@/hooks';\nimport UserProfile from '@/models/UserProfile';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Translation } from '@/translations/Translation';\nimport { Color } from '@/util/Color';\n\nimport styles from './ExternalMemberModal.module.scss';\n\nexport type CommonMemberModalProps = {\n title: string;\n subTitle?: string;\n image: string;\n isOpen: boolean;\n imageSize: Property.ObjectFit;\n provider: EMembershipProvider;\n};\n\ntype ExternalMemberModalProps<T extends FieldValues> = CommonMemberModalProps & {\n fields: ExternalMemberModelField<T>[];\n};\n\ntype ExternalMemberModelField<T extends FieldValues> = {\n name: keyof T & string;\n icon: IconType;\n label: string;\n profileMapping?: keyof UserProfile;\n isMasked: boolean;\n required?: boolean;\n helperText?: string;\n};\n\nconst ExternalMemberModal = <T extends FieldValues & IMemberVerification>(props: ExternalMemberModalProps<T>) => {\n const { hotel } = useCurrentHotel();\n const basketContext = useContext(BasketContext);\n const { signUserIn, closeMemberSignupModal } = useContext(CompanyContext);\n const { t } = useTranslation();\n const [isLoading, setIsLoading] = useState(false);\n const [errorMessage, setErrorMessage] = useState('');\n const formMethods = useForm<T>();\n const modalPrimaryColor = hotel?.memberOnlyModalUsePrimaryColor ? Color.Accent : Color.Success;\n const memberOnlySignupLink = hotel?.memberOnlySignupLinks?.[props.provider];\n\n const getValidationClass = (name: keyof T) => {\n if (formMethods.formState.errors) {\n if (formMethods.formState.errors[name]) {\n return 'error';\n } else {\n return 'success';\n }\n }\n };\n\n const onSubmit: SubmitHandler<T> = async (fields) => {\n setIsLoading(true);\n setErrorMessage('');\n\n try {\n const hotelId = hotel?.hotelID as string;\n const member = await API.Member.verifyMember(hotelId, props.provider, fields);\n\n if (member && member.memberId) {\n await signUserIn({\n saveState: true, //TODO: why was this false???\n memberNumber: member.memberId,\n memberProvider: props.provider,\n firstName: fields.firstName,\n lastName: fields.lastName,\n email: fields.email,\n });\n\n // Preset checkout defaults\n basketContext.currentBasketRows?.forEach(\n (row) =>\n (row.checkoutDefaults = {\n firstName: fields.firstName,\n lastName: fields.lastName,\n email: fields.email,\n })\n );\n } else {\n setErrorMessage(t(Translation.ExternalMemberPopup.InvalidMember));\n }\n } catch (e: any) {\n if (e[nameof<IMessage>('Message')]) {\n setErrorMessage(e.Message);\n } else {\n throw e;\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <SimpleModal open={props.isOpen} onClose={closeMemberSignupModal} size={SimpleModalSize.Normal} alignCenter>\n <div className={classNames(styles['external-member-modal'], 'row', `external-member-modal-${props.provider}`)}>\n <div className=\"col-md-6 external-member-modal-image\">\n <img\n src={ImageProvider.resizeImage(props.image, ImageSize.Original)}\n alt={props.title}\n className={styles['external-member-image']}\n style={{ objectFit: props.imageSize }}\n />\n </div>\n\n <div className=\"col-md-6 u-pad--heavy external-member-modal-content\">\n <div className=\"u-pad\">\n <Headline className=\"external-member-modal-title\" bold color={modalPrimaryColor}>\n {props.title}\n </Headline>\n {props.subTitle && <Text className=\"u-marg-top external-member-modal-sub-title\">{props.subTitle}</Text>}\n\n <form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {props.fields.map((field) => {\n const isRequired = field.required !== false; // Default to true if not specified\n const inputProps: TextBoxProps = {\n iconProps: { color: Color.DarkGrey },\n icon: field.icon,\n inputProps: { disabled: isLoading },\n placeholder: field.label,\n wide: true,\n required: isRequired,\n validationStatus: getValidationClass(field.name),\n ...formMethods.register(field.name as Path<T>, { required: isRequired }),\n };\n\n return (\n <div className=\"u-marg-top u-marg-bottom\" key={field.name}>\n <InputGroup dimensions=\"1\">{field.isMasked ? <PasswordBox {...inputProps} /> : <TextBox {...inputProps} />}</InputGroup>\n {field.helperText && (\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {field.helperText}\n </Text>\n )}\n </div>\n );\n })}\n\n <BEButton\n isLoading={isLoading}\n htmlType=\"submit\"\n className=\"u-marg-top external-member-modal-submit-btn\"\n size=\"normal\"\n filled\n primary={hotel?.memberOnlyModalUsePrimaryColor}\n success={!hotel?.memberOnlyModalUsePrimaryColor}\n stopIconAnimation\n icon={IconType.ArrowRight}\n iconPosition=\"right\"\n wide\n >\n {t(Translation.ExternalMemberPopup.Submit)}\n </BEButton>\n <div className=\"u-marg-top\">\n <Text bold color={Color.Danger}>\n {errorMessage}\n </Text>\n </div>\n </form>\n\n {memberOnlySignupLink && (\n <div className=\"external-member-modal-signup\">\n <div className=\"line-break\"></div>\n <div className=\"u-marg-top u-flex align-items-center u-justify-between\">\n <Text type={TextType.Small} className=\"u-flex align-items-center\" color={Color.DarkGrey}>\n {t(Translation.ExternalMemberPopup.DontHaveAccount)}\n </Text>\n <BEButton\n className=\"external-member-modal-signup-btn\"\n htmlType=\"button\"\n size=\"normal\"\n filled\n primary\n onClick={() => window.open(memberOnlySignupLink, '_blank')}\n >\n {t(Translation.ExternalMemberPopup.SignUp)}\n </BEButton>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </SimpleModal>\n );\n};\n\nexport default ExternalMemberModal;\n"]}
@@ -263,7 +263,7 @@ const RoomContactDetails = () => {
263
263
  setValue(padInputName(Confirmation_1.EUserProfileFormKey.CountryCode), code); // Hack to make CountryID be set...
264
264
  }, required: isCountryRequired }, rest)));
265
265
  } }));
266
- return (react_1.default.createElement("div", { key: field.id },
266
+ return (react_1.default.createElement("div", { key: field.id, className: "rs-checkout-contact-details" },
267
267
  react_1.default.createElement("div", { className: index === 0 ? '' : 'u-marg-bottom--heavy' },
268
268
  react_1.default.createElement("div", { className: "u-marg-bottom", onClick: openExpandable },
269
269
  react_1.default.createElement("div", { className: "u-flex u-marg-bottom align-items-center" },
@@ -292,7 +292,7 @@ const RoomContactDetails = () => {
292
292
  react_1.default.createElement("strong", null, basketRow.getEndDate().format('ddd, MMM D')))))),
293
293
  renderError(index)),
294
294
  react_1.default.createElement("div", { className: "room-contact-details--row", style: { maxHeight: opens[index] ? undefined : 0 } },
295
- react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
295
+ react_1.default.createElement("div", { className: "u-marg-bottom--heavy rs-checkout-contact-info" },
296
296
  react_1.default.createElement("div", { className: "u-marg-bottom--light" },
297
297
  react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
298
298
  react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.ContactInfo)))),
@@ -364,7 +364,7 @@ const RoomContactDetails = () => {
364
364
  message: t(Translation_1.Translation.Step.Confirmation.Inputs.Required, { field: t(Translation_1.Translation.Step.Confirmation.Inputs.Phone) }),
365
365
  },
366
366
  })))))),
367
- react_1.default.createElement("div", { className: "" },
367
+ react_1.default.createElement("div", { className: "rs-checkout-contact-info-address" },
368
368
  react_1.default.createElement("div", { className: "u-marg-bottom--light" },
369
369
  react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
370
370
  react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.Address)))),
@@ -409,7 +409,7 @@ const RoomContactDetails = () => {
409
409
  },
410
410
  })))) : (countryInputField)),
411
411
  includeStateField && react_1.default.createElement(InputGroup_1.default, { dimensions: "1" }, countryInputField))),
412
- requiredInputs.length > 0 && (react_1.default.createElement("div", { className: "u-marg-top" },
412
+ requiredInputs.length > 0 && (react_1.default.createElement("div", { className: "rs-checkout-required-inputs u-marg-top" },
413
413
  react_1.default.createElement("div", { className: "u-marg-top" },
414
414
  react_1.default.createElement(InputGroup_1.default, { dimensions: "2/2" }, requiredInputs.map((input) => {
415
415
  const options = input.options;
@@ -1 +1 @@
1
- {"version":3,"file":"RoomContactDetails.js","sourceRoot":"/","sources":["src/components/steps/confirmation/RoomContactDetails.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0E;AAC1E,2CAAkD;AAClD,yCAA8F;AAC9F,iEAAyC;AACzC,+CAAmE;AACnE,qDAAiG;AACjG,iDAA+C;AAC/C,0DAAuD;AAEvD,iFAAyD;AACzD,oEAA8D;AAC9D,sFAA8D;AAC9D,6IAAqH;AACrH,6EAAqD;AACrD,uEAAgE;AAChE,4FAAoE;AACpE,wDAA0D;AAC1D,kEAA2D;AAC3D,2EAAmD;AACnD,sIAA8G;AAC9G,mEAAgE;AAChE,uDAA8E;AAC9E,wDAAuI;AACvI,kHAA0F;AAC1F,wGAAgF;AAChF,wCAAqC;AACrC,8DAA+E;AAC/E,uEAA+C;AAC/C,kDAAgD;AAchD,MAAM,kBAAkB,GAAO,GAAG,EAAE;IAChC,MAAM,EAAE,QAA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,KAAK,EAAd,IAAI,UAAK,KAAK,EAAxB,OAAgB,CAAQ,CAAC;oBAC/B,OAAO,CACH;wBACI,uCAAK,SAAS,EAAC,sBAAsB;4BACjC,8BAAC,cAAI,IAAC,IAAI,EAAE,eAAQ,CAAC,KAAK;gCACtB,8CAAS,KAAK,CAAU,CACrB,CACL;wBACN,8BAAC,oBAAW,kBACR,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,UAAU,EACnB,WAAW,EAAC,iBAAiB,IACzB,IAAI,IACR,gBAAgB,EAAE,kBAAkB,CAAC,UAAU,CAAC,IAClD,CACH,CACN,CAAC;gBACN,CAAC,GACH,CACL,CAAC;QACN,CAAC,CAAC,CACO,CAChB,CAAC;IACN,CAAC,CAAC,CACA,CACT,CAAC;AACN,CAAC,CAAC;AACF,kBAAe,kBAAkB,CAAC","sourcesContent":["import { BasketContext, RoomstayMemberContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { EBookingPaymentMethod, EHotelStateFieldConfiguration, nameof } from '@roomstay/core';\nimport cloneDeep from 'lodash/cloneDeep';\nimport React, { FC, useContext, useEffect, useState } from 'react';\nimport { Control, Controller, FieldError, useFieldArray, useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport Checkbox from '@/components/generic/Checkbox/Checkbox';\nimport EnhancedPhoneNumberField from '@/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport { InputSelect } from '@/components/generic/Select';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport StepConfirmationCountrySelector from '@/components/steps/confirmation/StepConfirmationCountrySelector';\nimport { useSearchScopeHook } from '@/hooks/useSearchScopeHook';\nimport { EHotelAddressRequirement, Hotel } from '@/models/Client/Hotel/Hotel';\nimport { ConfirmationFormValues, EUserProfileFormKey, EUserRequiredInputFormKey, TUserProfileFormValues } from '@/models/Confirmation';\nimport E164PhoneNumberFieldFeature from '@/providers/feature/E164PhoneNumberFieldFeature';\nimport GuestTitleFieldFeature from '@/providers/feature/GuestTitleFieldFeature';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport StringHelper from '@/util/StringHelper';\nimport { EMAIL_REGEX } from '@/util/Validation';\n\ntype AuxiliaryFilterSelect = {\n id: string;\n name: string;\n label: string;\n options: AuxiliaryFilterOption[];\n};\n\ntype AuxiliaryFilterOption = {\n label: string;\n value: string;\n};\n\nconst RoomContactDetails: FC = () => {\n const { register, formState, control, watch, getValues, setValue } = useFormContext<ConfirmationFormValues>();\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const { hotel } = useCurrentHotel();\n\n const isAddressRequired = hotel?.addressRequirement === EHotelAddressRequirement.FullAddressRequired;\n const isCountryRequired =\n hotel?.addressRequirement === EHotelAddressRequirement.FullAddressRequired || hotel?.addressRequirement === EHotelAddressRequirement.AddressOptionalCountryRequired;\n\n const addressPlaceholder = (placeholder: string, required: boolean): string => placeholder + (required ? ' *' : '');\n\n const { update, fields } = useFieldArray({\n control,\n name: 'userProfiles',\n rules: {\n required: false,\n },\n });\n const [copyCheckBox, paymentMethod] = watch(['copyCheckBox', 'paymentMethod']);\n\n const errors = formState.errors;\n\n const { t } = useTranslation();\n const { roomstayMember: member } = useContext(RoomstayMemberContext);\n const { showChildren } = useSearchScopeHook();\n\n useEffect(() => {\n errors.userProfiles?.forEach?.((_, index) => {\n if (errors.userProfiles?.[index]) {\n opens[index] = true;\n }\n });\n setOpens(opens.slice(0));\n }, [errors.userProfiles, copyCheckBox]);\n\n useEffect(() => {\n const getDefaultValue = (index: number, potentialDefaultValue = '') => {\n return index === 0 ? potentialDefaultValue : '';\n };\n\n const userProfiles = basketRows.map((basketRow, index) => {\n const defaults = basketRow.checkoutDefaults;\n const addr = defaults?.address;\n\n return {\n [EUserProfileFormKey.Title]: '', // TODO: Add this to @roomstay/core IRoomstayMember?\n [EUserProfileFormKey.Forename]: getDefaultValue(index, defaults?.firstName ?? member?.forename),\n [EUserProfileFormKey.Surname]: getDefaultValue(index, defaults?.lastName ?? member?.surname),\n [EUserProfileFormKey.Email]: getDefaultValue(index, defaults?.email ?? member?.email),\n [EUserProfileFormKey.Phone]: getDefaultValue(index, defaults?.phone ?? member?.phoneNumber),\n [EUserProfileFormKey.Address]: getDefaultValue(index, addr?.line1 ?? member?.address?.address),\n [EUserProfileFormKey.City]: getDefaultValue(index, addr?.city ?? member?.address?.city),\n [EUserProfileFormKey.PostCode]: getDefaultValue(index, addr?.postalCode ?? member?.address?.zip),\n [EUserProfileFormKey.State]: getDefaultValue(index, addr?.state ?? member?.address?.state),\n [EUserProfileFormKey.Country]: getDefaultValue(index, addr?.country ?? member?.address?.country),\n [EUserProfileFormKey.CountryId]: getDefaultValue(index, addr?.countryId?.toString()),\n [EUserProfileFormKey.CountryCode]: getDefaultValue(index, addr?.countryCode),\n [EUserRequiredInputFormKey.AuxInputs]: basketRow.auxiliaryFilter,\n };\n });\n setValue('userProfiles', userProfiles);\n setValue('copyCheckBox', !!(basketRows?.length && basketRows.length > 1));\n }, [member, basketRows?.length]);\n\n const padInputNameByRoomNumber = (name: EUserProfileFormKey, index: number) => `userProfiles.${index}.${name}` as const;\n\n const [opens, setOpens] = useState<boolean[]>(basketRows.map((basketRow, index) => index === 0));\n\n const copyUserProfileFormFields = (currentIndex: number) => {\n const values = cloneDeep(getValues(`userProfiles.0`));\n const currentValues = cloneDeep(getValues(`userProfiles.${currentIndex}`));\n\n // Exclude AuxInputs\n values[EUserRequiredInputFormKey.AuxInputs] = currentValues.AuxInputs;\n\n // Exclude Child Ages\n values.CaptureChildAge = currentValues.CaptureChildAge;\n\n return values;\n };\n\n const onInputChange =\n (fieldName: string, interactionName: string) =>\n (event: any): void => {\n DataLayer.instance.sendInteraction(interactionName, InteractionType.FORM_FIELD, InteractionStep.GUEST_DETAILS);\n };\n\n useEffect(() => {\n if (copyCheckBox)\n fields.forEach((basketRow, index) => {\n if (index === 0) return;\n const values = copyUserProfileFormFields(index);\n update(index, values);\n });\n }, [copyCheckBox]);\n\n useEffect(() => {\n const { unsubscribe } = watch((allFields, { name, type }) => {\n if (type === 'change' && name?.includes('userProfiles') && name.split('.')[1] === '0' && allFields.copyCheckBox) {\n fields.map((field, index) => {\n if (index === 0) return;\n const values = copyUserProfileFormFields(index);\n update(index, values);\n });\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [fields]);\n\n const setOpenByIndex = (index: number, value: boolean) => {\n opens.splice(index, 1, value);\n setOpens(opens.slice(0));\n };\n\n const renderError = (userProfileIndex: number): JSX.Element[] | null => {\n const userProfile = errors.userProfiles?.[userProfileIndex];\n\n if (userProfile && formState.submitCount >= 1 && (userProfileIndex === 0 || !copyCheckBox))\n return Object.values(userProfile).map((error, errorIndex) => {\n return (\n <AutoAutoHeight key={errorIndex} open>\n <div className=\"u-flex\">\n <Alert icon={IconType.Error} type={AlertType.Danger} noMargin={errorIndex === Object.keys(userProfile).length - 1}>\n <Text type={TextType.Small}>{(error as FieldError)?.message}</Text>\n </Alert>\n </div>\n </AutoAutoHeight>\n );\n });\n\n return null;\n };\n\n return (\n <>\n {fields.map((field, index) => {\n const padInputName = (name: EUserProfileFormKey) => padInputNameByRoomNumber(name, index);\n const getValidationClass = (name: EUserProfileFormKey) => {\n if (!errors.userProfiles || (copyCheckBox && index >= 1)) return;\n if (errors.userProfiles[index]?.[name]) {\n return 'error';\n // Hack to get Aux Inputs to validate as well.\n } else if (errors.userProfiles[index]?.AuxInputs?.[name.replace('AuxInputs.', '')]) {\n return 'error';\n } else {\n return 'success';\n }\n };\n\n const openExpandable = () => {\n if (index !== 0) {\n setOpenByIndex(index, !opens[index]);\n }\n };\n\n const basketRow = basketRows[index];\n const currentRoom = basketRow.getRoom();\n const filterValue = basketRow.getAuxiliaryFilter();\n\n const isDisabled = (copyCheckBox && index >= 1) || paymentMethod === EBookingPaymentMethod.Planpay;\n\n const includeStateField =\n hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Optional || hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Required;\n const stateFieldRequired = hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Required;\n\n // Build list of auxiliary inputs the user is required to complete\n const roomGroup = hotel?.roomGroups?.find(({ id }) => id === currentRoom.roomGroupId);\n const requiredInputs: AuxiliaryFilterSelect[] = [];\n\n for (const inputKey of Object.keys(roomGroup?.filters ?? {})) {\n const input = roomGroup?.filters[inputKey];\n const values = currentRoom?.auxiliaryValues?.[inputKey]?.map((value) => value.toString());\n\n if (input?.requireInput && values) {\n // Reduce available options to those assigned to the room\n const options = input.options.filter((option) => {\n if (values.includes(option.value.toString())) {\n return option;\n }\n });\n\n const requiredInputId = `${nameof<TUserProfileFormValues>('AuxInputs')}.${inputKey}`;\n\n if (options.length === 1) {\n setValue(padInputName(requiredInputId as any), options[0].value as never);\n } else if (filterValue?.[inputKey]) {\n setValue(padInputName(requiredInputId as any), filterValue[inputKey] as never);\n }\n\n // Convert options to format acceptable by the input\n requiredInputs.push({\n id: requiredInputId,\n name: input.name,\n label: input.name,\n options: options.map((option: any) => {\n return { label: option.label, value: option.value };\n }),\n });\n }\n }\n\n // The Country input field will be included in different places, depending on whether the State field is enabled or not.\n const countryInputField = (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Country)}\n rules={{\n required: {\n value: isCountryRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Country) }),\n },\n }}\n render={({ field }) => {\n const { ref, onChange, ...rest } = field;\n return (\n <StepConfirmationCountrySelector\n ref={ref}\n disableOpenOnFocus\n disabled={isDisabled}\n validationStatus={getValidationClass(EUserProfileFormKey.Country)}\n onChange={(e) => {\n onChange(e);\n onInputChange(padInputName(EUserProfileFormKey.Country), 'Country - Address')(e);\n }}\n onChangeId={(id) => {\n setValue(padInputName(EUserProfileFormKey.CountryId), id as never); // Hack to make CountryID be set...\n }}\n onChangeCode={(code) => {\n setValue(padInputName(EUserProfileFormKey.CountryCode), code as never); // Hack to make CountryID be set...\n }}\n required={isCountryRequired}\n {...rest}\n />\n );\n }}\n />\n );\n\n return (\n <div key={field.id}>\n <div className={index === 0 ? '' : 'u-marg-bottom--heavy'}>\n <div className=\"u-marg-bottom\" onClick={openExpandable}>\n <div className=\"u-flex u-marg-bottom align-items-center\">\n <Headline bold>\n {t(Translation.Misc.Room)} {index + 1}\n </Headline>\n {index !== 0 && <Icon icon={opens[index] ? IconType.ArrowDown2 : IconType.ArrowUp2} color={Color.Grey} />}\n </div>\n {basketRow && (\n <div className=\"u-marg-bottom\">\n <Text>\n <strong className=\"u-block@l-\">{basketRow.getRoom().name}</strong> for{' '}\n {StringHelper.pluralWithDictAndCount(basketRow.getAdults(), Translation.Step.Date.Adult, t)}\n {showChildren ? (\n <>\n ,&nbsp;\n {StringHelper.pluralWithDictAndCount(basketRow.getChildren(), Translation.Step.Date.Child, t)}\n </>\n ) : null}\n {hotel?.childConfiguration?.supportInfants ? (\n <>\n ,&nbsp;\n {StringHelper.pluralWithDictAndCount(basketRow.getInfants(), Translation.Step.Date.Infant, t)}\n </>\n ) : null}\n </Text>\n <div className=\"step-one-status--dates u-flex justify-content-start\">\n <Text type={TextType.Small} color={Color.Accent}>\n <strong>{basketRow.getStartDate().format('ddd, MMM D')}</strong>\n </Text>\n <Icon icon={IconType.ArrowRight2} size=\"18px\" />\n <Text type={TextType.Small} color={Color.Accent}>\n <strong>{basketRow.getEndDate().format('ddd, MMM D')}</strong>\n </Text>\n </div>\n </div>\n )}\n {renderError(index)}\n </div>\n <div className=\"room-contact-details--row\" style={{ maxHeight: opens[index] ? undefined : 0 }}>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.ContactInfo)}</strong>\n </Text>\n </div>\n\n <InputGroup dimensions={GuestTitleFieldFeature.isActive() ? '1/2/2' : '2/2'}>\n {GuestTitleFieldFeature.isActive() && (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Title)}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n\n return (\n <InputSelect\n keyName=\"value\"\n labelName=\"label\"\n options={GuestTitleFieldFeature.getTitleOptions()}\n placeholder={t(Translation.Step.Confirmation.Inputs.Title) + ' *'}\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Title)}\n {...rest}\n />\n );\n }}\n />\n )}\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Forename) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Forename)}\n {...register(padInputName(EUserProfileFormKey.Forename), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Forename), 'Forename - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Forename) }),\n },\n })}\n />\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Surname) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Surname)}\n {...register(padInputName(EUserProfileFormKey.Surname), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Surname), 'Surname - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Surname) }),\n },\n })}\n />\n </InputGroup>\n\n <InputGroup dimensions=\"2/2\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Email) + ' *'}\n wide\n validationStatus={getValidationClass(EUserProfileFormKey.Email)}\n required\n {...register(padInputName(EUserProfileFormKey.Email), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Email), 'Email - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Email) }),\n },\n pattern: {\n value: EMAIL_REGEX,\n message: t(Translation.Step.Confirmation.Inputs.InvalidEmail),\n },\n })}\n />\n {E164PhoneNumberFieldFeature.isActive() ? (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Phone)}\n rules={{\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Phone) }),\n },\n minLength: {\n value: 5,\n message: 'Phone number is required',\n },\n maxLength: {\n value: 17,\n message: 'Phone number is too long',\n },\n pattern: {\n value: /^[1-9]( |\\d){1,15}$/g,\n message: 'Incorrect phone number entered',\n },\n }}\n render={({ field }) => {\n return (\n <EnhancedPhoneNumberField\n disabled={isDisabled}\n validationStatus={getValidationClass(EUserProfileFormKey.Phone)}\n {...field}\n onChange={(e: any) => {\n field.onChange(e);\n onInputChange(padInputName(EUserProfileFormKey.Phone), 'Phone - Contact Info')(e);\n }}\n />\n );\n }}\n />\n ) : (\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Phone) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Phone)}\n {...register(padInputName(EUserProfileFormKey.Phone), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Phone), 'Phone - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Phone) }),\n },\n })}\n />\n )}\n </InputGroup>\n </div>\n <div className=\"\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Address)}</strong>\n </Text>\n </div>\n\n <InputGroup dimensions=\"3/1\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.Address), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.Address)}\n {...register(padInputName(EUserProfileFormKey.Address), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Address), 'Address - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Address) }),\n },\n })}\n />\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.City), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.City)}\n {...register(padInputName(EUserProfileFormKey.City), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.City), 'City - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.City) }),\n },\n })}\n />\n </InputGroup>\n <InputGroup dimensions=\"2/2\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.PostCode), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.PostCode)}\n {...register(padInputName(EUserProfileFormKey.PostCode), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.PostCode), 'PostCode - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.PostCode) }),\n },\n })}\n />\n\n {includeStateField ? (\n // Render the State field here if it's required, otherwise render the Country field\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.State) + (stateFieldRequired ? ' *' : '')}\n wide\n required={stateFieldRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.State)}\n {...register(padInputName(EUserProfileFormKey.State), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.State), 'State - Address'),\n required: {\n value: stateFieldRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.State) }),\n },\n })}\n />\n ) : (\n countryInputField\n )}\n </InputGroup>\n\n {includeStateField && <InputGroup dimensions=\"1\">{countryInputField}</InputGroup>}\n </div>\n </div>\n {requiredInputs.length > 0 && (\n <div className=\"u-marg-top\">\n <div className=\"u-marg-top\">\n <InputGroup dimensions=\"2/2\">\n {requiredInputs.map((input) => {\n const options = input.options;\n return (\n <Controller\n key={input.id}\n control={control}\n name={padInputName(input.id as any)}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n\n return (\n <>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{input.name}</strong>\n </Text>\n </div>\n <InputSelect\n key={input.id}\n keyName={nameof<AuxiliaryFilterOption>('value')}\n labelName={nameof<AuxiliaryFilterOption>('label')}\n options={options}\n placeholder=\"Please Select *\"\n validationStatus={getValidationClass(input.id as any)}\n {...rest}\n />\n </>\n );\n }}\n />\n );\n })}\n </InputGroup>\n </div>\n </div>\n )}\n\n <CaptureChildAges hotel={hotel} numberOfChildrens={Number(basketRow.getChildren())} control={control} roomIndex={index} />\n </div>\n {fields.length > 1 && index === 0 ? (\n <div className=\"u-marg-bottom--heavy\">\n <Checkbox label={t(Translation.Step.Confirmation.ApplySameInfoToOtherRooms)} {...register('copyCheckBox')} />\n </div>\n ) : null}\n </div>\n );\n })}\n </>\n );\n};\n\nfunction chunkArray<T>(array: T[], chunkSize: number): T[][] {\n const result: T[][] = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n}\n\nconst CaptureChildAges = ({\n hotel,\n numberOfChildrens,\n control,\n roomIndex,\n}: {\n hotel: Hotel | undefined;\n numberOfChildrens: number;\n control: Control<ConfirmationFormValues, any>;\n roomIndex: number;\n}) => {\n if (!hotel?.captureChildAge || numberOfChildrens === 0) {\n return <></>;\n }\n const {\n formState: { errors },\n } = useFormContext<ConfirmationFormValues>();\n const ageOptions: { label: string; value: string }[] = [];\n const min = hotel?.childConfiguration?.childRange?.min || 0;\n const max = hotel?.childConfiguration?.childRange?.max || 0;\n for (let index = min; index <= max; index++) {\n ageOptions.push({ label: `${index}`, value: `${index}` });\n }\n const rootKey = `userProfiles[${roomIndex}].${nameof<TUserProfileFormValues>('CaptureChildAge')}`;\n const requiredInputs = Array.from({ length: numberOfChildrens }, (_, childIndex) => childIndex).map((childIndex) => ({\n name: `${rootKey}[${childIndex}]`,\n id: `${rootKey}[${childIndex}].id`,\n label: `Child ${childIndex + 1} Age`,\n childIndex: childIndex,\n }));\n const getValidationClass = (childIndex: number) => {\n if (!errors.userProfiles) return;\n if (errors.userProfiles?.[roomIndex]?.CaptureChildAge?.[childIndex]) {\n return 'error';\n } else {\n return 'success';\n }\n };\n const chunkInputs = chunkArray(requiredInputs, 3);\n\n return (\n <div className=\"u-marg-top\">\n {chunkInputs.map((chunkInput, chunkIndex) => {\n return (\n <InputGroup dimensions=\"1/1/1\" key={`InputGroup-${chunkIndex}`}>\n {chunkInput.map(({ id, name, label, childIndex }) => {\n return (\n <Controller\n key={id}\n control={control}\n name={name as any}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n return (\n <>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{label}</strong>\n </Text>\n </div>\n <InputSelect\n keyName=\"value\"\n labelName=\"label\"\n options={ageOptions}\n placeholder=\"Please Select *\"\n {...rest}\n validationStatus={getValidationClass(childIndex)}\n />\n </>\n );\n }}\n />\n );\n })}\n </InputGroup>\n );\n })}\n </div>\n );\n};\nexport default RoomContactDetails;\n"]}
1
+ {"version":3,"file":"RoomContactDetails.js","sourceRoot":"/","sources":["src/components/steps/confirmation/RoomContactDetails.tsx"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AW,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAElD,OAAO,CACH,uCAAK,SAAS,EAAC,YAAY,IACtB,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE;QACxC,OAAO,CACH,8BAAC,oBAAU,IAAC,UAAU,EAAC,OAAO,EAAC,GAAG,EAAE,cAAc,UAAU,EAAE,IACzD,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;YAChD,OAAO,CACH,8BAAC,4BAAU,IACP,GAAG,EAAE,EAAE,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAW,EACjB,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EACzB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;oBAClB,MAAM,EAAE,GAAG,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAAxB,OAAgB,CAAQ,CAAC;oBAC/B,OAAO,CACH;wBACI,uCAAK,SAAS,EAAC,sBAAsB;4BACjC,8BAAC,cAAI,IAAC,IAAI,EAAE,eAAQ,CAAC,KAAK;gCACtB,8CAAS,KAAK,CAAU,CACrB,CACL;wBACN,8BAAC,oBAAW,kBACR,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,UAAU,EACnB,WAAW,EAAC,iBAAiB,IACzB,IAAI,IACR,gBAAgB,EAAE,kBAAkB,CAAC,UAAU,CAAC,IAClD,CACH,CACN,CAAC;gBACN,CAAC,GACH,CACL,CAAC;QACN,CAAC,CAAC,CACO,CAChB,CAAC;IACN,CAAC,CAAC,CACA,CACT,CAAC;AACN,CAAC,CAAC;AACF,kBAAe,kBAAkB,CAAC","sourcesContent":["import { BasketContext, RoomstayMemberContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { EBookingPaymentMethod, EHotelStateFieldConfiguration, nameof } from '@roomstay/core';\nimport cloneDeep from 'lodash/cloneDeep';\nimport React, { FC, useContext, useEffect, useState } from 'react';\nimport { Control, Controller, FieldError, useFieldArray, useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport Checkbox from '@/components/generic/Checkbox/Checkbox';\nimport EnhancedPhoneNumberField from '@/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport { InputSelect } from '@/components/generic/Select';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport StepConfirmationCountrySelector from '@/components/steps/confirmation/StepConfirmationCountrySelector';\nimport { useSearchScopeHook } from '@/hooks/useSearchScopeHook';\nimport { EHotelAddressRequirement, Hotel } from '@/models/Client/Hotel/Hotel';\nimport { ConfirmationFormValues, EUserProfileFormKey, EUserRequiredInputFormKey, TUserProfileFormValues } from '@/models/Confirmation';\nimport E164PhoneNumberFieldFeature from '@/providers/feature/E164PhoneNumberFieldFeature';\nimport GuestTitleFieldFeature from '@/providers/feature/GuestTitleFieldFeature';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport StringHelper from '@/util/StringHelper';\nimport { EMAIL_REGEX } from '@/util/Validation';\n\ntype AuxiliaryFilterSelect = {\n id: string;\n name: string;\n label: string;\n options: AuxiliaryFilterOption[];\n};\n\ntype AuxiliaryFilterOption = {\n label: string;\n value: string;\n};\n\nconst RoomContactDetails: FC = () => {\n const { register, formState, control, watch, getValues, setValue } = useFormContext<ConfirmationFormValues>();\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const { hotel } = useCurrentHotel();\n\n const isAddressRequired = hotel?.addressRequirement === EHotelAddressRequirement.FullAddressRequired;\n const isCountryRequired =\n hotel?.addressRequirement === EHotelAddressRequirement.FullAddressRequired || hotel?.addressRequirement === EHotelAddressRequirement.AddressOptionalCountryRequired;\n\n const addressPlaceholder = (placeholder: string, required: boolean): string => placeholder + (required ? ' *' : '');\n\n const { update, fields } = useFieldArray({\n control,\n name: 'userProfiles',\n rules: {\n required: false,\n },\n });\n const [copyCheckBox, paymentMethod] = watch(['copyCheckBox', 'paymentMethod']);\n\n const errors = formState.errors;\n\n const { t } = useTranslation();\n const { roomstayMember: member } = useContext(RoomstayMemberContext);\n const { showChildren } = useSearchScopeHook();\n\n useEffect(() => {\n errors.userProfiles?.forEach?.((_, index) => {\n if (errors.userProfiles?.[index]) {\n opens[index] = true;\n }\n });\n setOpens(opens.slice(0));\n }, [errors.userProfiles, copyCheckBox]);\n\n useEffect(() => {\n const getDefaultValue = (index: number, potentialDefaultValue = '') => {\n return index === 0 ? potentialDefaultValue : '';\n };\n\n const userProfiles = basketRows.map((basketRow, index) => {\n const defaults = basketRow.checkoutDefaults;\n const addr = defaults?.address;\n\n return {\n [EUserProfileFormKey.Title]: '', // TODO: Add this to @roomstay/core IRoomstayMember?\n [EUserProfileFormKey.Forename]: getDefaultValue(index, defaults?.firstName ?? member?.forename),\n [EUserProfileFormKey.Surname]: getDefaultValue(index, defaults?.lastName ?? member?.surname),\n [EUserProfileFormKey.Email]: getDefaultValue(index, defaults?.email ?? member?.email),\n [EUserProfileFormKey.Phone]: getDefaultValue(index, defaults?.phone ?? member?.phoneNumber),\n [EUserProfileFormKey.Address]: getDefaultValue(index, addr?.line1 ?? member?.address?.address),\n [EUserProfileFormKey.City]: getDefaultValue(index, addr?.city ?? member?.address?.city),\n [EUserProfileFormKey.PostCode]: getDefaultValue(index, addr?.postalCode ?? member?.address?.zip),\n [EUserProfileFormKey.State]: getDefaultValue(index, addr?.state ?? member?.address?.state),\n [EUserProfileFormKey.Country]: getDefaultValue(index, addr?.country ?? member?.address?.country),\n [EUserProfileFormKey.CountryId]: getDefaultValue(index, addr?.countryId?.toString()),\n [EUserProfileFormKey.CountryCode]: getDefaultValue(index, addr?.countryCode),\n [EUserRequiredInputFormKey.AuxInputs]: basketRow.auxiliaryFilter,\n };\n });\n setValue('userProfiles', userProfiles);\n setValue('copyCheckBox', !!(basketRows?.length && basketRows.length > 1));\n }, [member, basketRows?.length]);\n\n const padInputNameByRoomNumber = (name: EUserProfileFormKey, index: number) => `userProfiles.${index}.${name}` as const;\n\n const [opens, setOpens] = useState<boolean[]>(basketRows.map((basketRow, index) => index === 0));\n\n const copyUserProfileFormFields = (currentIndex: number) => {\n const values = cloneDeep(getValues(`userProfiles.0`));\n const currentValues = cloneDeep(getValues(`userProfiles.${currentIndex}`));\n\n // Exclude AuxInputs\n values[EUserRequiredInputFormKey.AuxInputs] = currentValues.AuxInputs;\n\n // Exclude Child Ages\n values.CaptureChildAge = currentValues.CaptureChildAge;\n\n return values;\n };\n\n const onInputChange =\n (fieldName: string, interactionName: string) =>\n (event: any): void => {\n DataLayer.instance.sendInteraction(interactionName, InteractionType.FORM_FIELD, InteractionStep.GUEST_DETAILS);\n };\n\n useEffect(() => {\n if (copyCheckBox)\n fields.forEach((basketRow, index) => {\n if (index === 0) return;\n const values = copyUserProfileFormFields(index);\n update(index, values);\n });\n }, [copyCheckBox]);\n\n useEffect(() => {\n const { unsubscribe } = watch((allFields, { name, type }) => {\n if (type === 'change' && name?.includes('userProfiles') && name.split('.')[1] === '0' && allFields.copyCheckBox) {\n fields.map((field, index) => {\n if (index === 0) return;\n const values = copyUserProfileFormFields(index);\n update(index, values);\n });\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [fields]);\n\n const setOpenByIndex = (index: number, value: boolean) => {\n opens.splice(index, 1, value);\n setOpens(opens.slice(0));\n };\n\n const renderError = (userProfileIndex: number): JSX.Element[] | null => {\n const userProfile = errors.userProfiles?.[userProfileIndex];\n\n if (userProfile && formState.submitCount >= 1 && (userProfileIndex === 0 || !copyCheckBox))\n return Object.values(userProfile).map((error, errorIndex) => {\n return (\n <AutoAutoHeight key={errorIndex} open>\n <div className=\"u-flex\">\n <Alert icon={IconType.Error} type={AlertType.Danger} noMargin={errorIndex === Object.keys(userProfile).length - 1}>\n <Text type={TextType.Small}>{(error as FieldError)?.message}</Text>\n </Alert>\n </div>\n </AutoAutoHeight>\n );\n });\n\n return null;\n };\n\n return (\n <>\n {fields.map((field, index) => {\n const padInputName = (name: EUserProfileFormKey) => padInputNameByRoomNumber(name, index);\n const getValidationClass = (name: EUserProfileFormKey) => {\n if (!errors.userProfiles || (copyCheckBox && index >= 1)) return;\n if (errors.userProfiles[index]?.[name]) {\n return 'error';\n // Hack to get Aux Inputs to validate as well.\n } else if (errors.userProfiles[index]?.AuxInputs?.[name.replace('AuxInputs.', '')]) {\n return 'error';\n } else {\n return 'success';\n }\n };\n\n const openExpandable = () => {\n if (index !== 0) {\n setOpenByIndex(index, !opens[index]);\n }\n };\n\n const basketRow = basketRows[index];\n const currentRoom = basketRow.getRoom();\n const filterValue = basketRow.getAuxiliaryFilter();\n\n const isDisabled = (copyCheckBox && index >= 1) || paymentMethod === EBookingPaymentMethod.Planpay;\n\n const includeStateField =\n hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Optional || hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Required;\n const stateFieldRequired = hotel?.stateFieldConfiguration === EHotelStateFieldConfiguration.Required;\n\n // Build list of auxiliary inputs the user is required to complete\n const roomGroup = hotel?.roomGroups?.find(({ id }) => id === currentRoom.roomGroupId);\n const requiredInputs: AuxiliaryFilterSelect[] = [];\n\n for (const inputKey of Object.keys(roomGroup?.filters ?? {})) {\n const input = roomGroup?.filters[inputKey];\n const values = currentRoom?.auxiliaryValues?.[inputKey]?.map((value) => value.toString());\n\n if (input?.requireInput && values) {\n // Reduce available options to those assigned to the room\n const options = input.options.filter((option) => {\n if (values.includes(option.value.toString())) {\n return option;\n }\n });\n\n const requiredInputId = `${nameof<TUserProfileFormValues>('AuxInputs')}.${inputKey}`;\n\n if (options.length === 1) {\n setValue(padInputName(requiredInputId as any), options[0].value as never);\n } else if (filterValue?.[inputKey]) {\n setValue(padInputName(requiredInputId as any), filterValue[inputKey] as never);\n }\n\n // Convert options to format acceptable by the input\n requiredInputs.push({\n id: requiredInputId,\n name: input.name,\n label: input.name,\n options: options.map((option: any) => {\n return { label: option.label, value: option.value };\n }),\n });\n }\n }\n\n // The Country input field will be included in different places, depending on whether the State field is enabled or not.\n const countryInputField = (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Country)}\n rules={{\n required: {\n value: isCountryRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Country) }),\n },\n }}\n render={({ field }) => {\n const { ref, onChange, ...rest } = field;\n return (\n <StepConfirmationCountrySelector\n ref={ref}\n disableOpenOnFocus\n disabled={isDisabled}\n validationStatus={getValidationClass(EUserProfileFormKey.Country)}\n onChange={(e) => {\n onChange(e);\n onInputChange(padInputName(EUserProfileFormKey.Country), 'Country - Address')(e);\n }}\n onChangeId={(id) => {\n setValue(padInputName(EUserProfileFormKey.CountryId), id as never); // Hack to make CountryID be set...\n }}\n onChangeCode={(code) => {\n setValue(padInputName(EUserProfileFormKey.CountryCode), code as never); // Hack to make CountryID be set...\n }}\n required={isCountryRequired}\n {...rest}\n />\n );\n }}\n />\n );\n\n return (\n <div key={field.id} className=\"rs-checkout-contact-details\">\n <div className={index === 0 ? '' : 'u-marg-bottom--heavy'}>\n <div className=\"u-marg-bottom\" onClick={openExpandable}>\n <div className=\"u-flex u-marg-bottom align-items-center\">\n <Headline bold>\n {t(Translation.Misc.Room)} {index + 1}\n </Headline>\n {index !== 0 && <Icon icon={opens[index] ? IconType.ArrowDown2 : IconType.ArrowUp2} color={Color.Grey} />}\n </div>\n {basketRow && (\n <div className=\"u-marg-bottom\">\n <Text>\n <strong className=\"u-block@l-\">{basketRow.getRoom().name}</strong> for{' '}\n {StringHelper.pluralWithDictAndCount(basketRow.getAdults(), Translation.Step.Date.Adult, t)}\n {showChildren ? (\n <>\n ,&nbsp;\n {StringHelper.pluralWithDictAndCount(basketRow.getChildren(), Translation.Step.Date.Child, t)}\n </>\n ) : null}\n {hotel?.childConfiguration?.supportInfants ? (\n <>\n ,&nbsp;\n {StringHelper.pluralWithDictAndCount(basketRow.getInfants(), Translation.Step.Date.Infant, t)}\n </>\n ) : null}\n </Text>\n <div className=\"step-one-status--dates u-flex justify-content-start\">\n <Text type={TextType.Small} color={Color.Accent}>\n <strong>{basketRow.getStartDate().format('ddd, MMM D')}</strong>\n </Text>\n <Icon icon={IconType.ArrowRight2} size=\"18px\" />\n <Text type={TextType.Small} color={Color.Accent}>\n <strong>{basketRow.getEndDate().format('ddd, MMM D')}</strong>\n </Text>\n </div>\n </div>\n )}\n {renderError(index)}\n </div>\n <div className=\"room-contact-details--row\" style={{ maxHeight: opens[index] ? undefined : 0 }}>\n <div className=\"u-marg-bottom--heavy rs-checkout-contact-info\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.ContactInfo)}</strong>\n </Text>\n </div>\n\n <InputGroup dimensions={GuestTitleFieldFeature.isActive() ? '1/2/2' : '2/2'}>\n {GuestTitleFieldFeature.isActive() && (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Title)}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n\n return (\n <InputSelect\n keyName=\"value\"\n labelName=\"label\"\n options={GuestTitleFieldFeature.getTitleOptions()}\n placeholder={t(Translation.Step.Confirmation.Inputs.Title) + ' *'}\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Title)}\n {...rest}\n />\n );\n }}\n />\n )}\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Forename) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Forename)}\n {...register(padInputName(EUserProfileFormKey.Forename), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Forename), 'Forename - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Forename) }),\n },\n })}\n />\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Surname) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Surname)}\n {...register(padInputName(EUserProfileFormKey.Surname), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Surname), 'Surname - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Surname) }),\n },\n })}\n />\n </InputGroup>\n\n <InputGroup dimensions=\"2/2\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Email) + ' *'}\n wide\n validationStatus={getValidationClass(EUserProfileFormKey.Email)}\n required\n {...register(padInputName(EUserProfileFormKey.Email), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Email), 'Email - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Email) }),\n },\n pattern: {\n value: EMAIL_REGEX,\n message: t(Translation.Step.Confirmation.Inputs.InvalidEmail),\n },\n })}\n />\n {E164PhoneNumberFieldFeature.isActive() ? (\n <Controller\n control={control}\n name={padInputName(EUserProfileFormKey.Phone)}\n rules={{\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Phone) }),\n },\n minLength: {\n value: 5,\n message: 'Phone number is required',\n },\n maxLength: {\n value: 17,\n message: 'Phone number is too long',\n },\n pattern: {\n value: /^[1-9]( |\\d){1,15}$/g,\n message: 'Incorrect phone number entered',\n },\n }}\n render={({ field }) => {\n return (\n <EnhancedPhoneNumberField\n disabled={isDisabled}\n validationStatus={getValidationClass(EUserProfileFormKey.Phone)}\n {...field}\n onChange={(e: any) => {\n field.onChange(e);\n onInputChange(padInputName(EUserProfileFormKey.Phone), 'Phone - Contact Info')(e);\n }}\n />\n );\n }}\n />\n ) : (\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.Phone) + ' *'}\n wide\n required\n validationStatus={getValidationClass(EUserProfileFormKey.Phone)}\n {...register(padInputName(EUserProfileFormKey.Phone), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Phone), 'Phone - Contact Info'),\n required: {\n value: true,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Phone) }),\n },\n })}\n />\n )}\n </InputGroup>\n </div>\n <div className=\"rs-checkout-contact-info-address\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Address)}</strong>\n </Text>\n </div>\n\n <InputGroup dimensions=\"3/1\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.Address), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.Address)}\n {...register(padInputName(EUserProfileFormKey.Address), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.Address), 'Address - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.Address) }),\n },\n })}\n />\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.City), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.City)}\n {...register(padInputName(EUserProfileFormKey.City), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.City), 'City - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.City) }),\n },\n })}\n />\n </InputGroup>\n <InputGroup dimensions=\"2/2\">\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={addressPlaceholder(t(Translation.Step.Confirmation.Inputs.PostCode), isAddressRequired)}\n wide\n required={isAddressRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.PostCode)}\n {...register(padInputName(EUserProfileFormKey.PostCode), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.PostCode), 'PostCode - Address'),\n required: {\n value: isAddressRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.PostCode) }),\n },\n })}\n />\n\n {includeStateField ? (\n // Render the State field here if it's required, otherwise render the Country field\n <TextBox\n inputProps={{\n disabled: isDisabled,\n }}\n placeholder={t(Translation.Step.Confirmation.Inputs.State) + (stateFieldRequired ? ' *' : '')}\n wide\n required={stateFieldRequired}\n validationStatus={getValidationClass(EUserProfileFormKey.State)}\n {...register(padInputName(EUserProfileFormKey.State), {\n onChange: onInputChange(padInputName(EUserProfileFormKey.State), 'State - Address'),\n required: {\n value: stateFieldRequired,\n message: t(Translation.Step.Confirmation.Inputs.Required, { field: t(Translation.Step.Confirmation.Inputs.State) }),\n },\n })}\n />\n ) : (\n countryInputField\n )}\n </InputGroup>\n\n {includeStateField && <InputGroup dimensions=\"1\">{countryInputField}</InputGroup>}\n </div>\n </div>\n {requiredInputs.length > 0 && (\n <div className=\"rs-checkout-required-inputs u-marg-top\">\n <div className=\"u-marg-top\">\n <InputGroup dimensions=\"2/2\">\n {requiredInputs.map((input) => {\n const options = input.options;\n return (\n <Controller\n key={input.id}\n control={control}\n name={padInputName(input.id as any)}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n\n return (\n <>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{input.name}</strong>\n </Text>\n </div>\n <InputSelect\n key={input.id}\n keyName={nameof<AuxiliaryFilterOption>('value')}\n labelName={nameof<AuxiliaryFilterOption>('label')}\n options={options}\n placeholder=\"Please Select *\"\n validationStatus={getValidationClass(input.id as any)}\n {...rest}\n />\n </>\n );\n }}\n />\n );\n })}\n </InputGroup>\n </div>\n </div>\n )}\n\n <CaptureChildAges hotel={hotel} numberOfChildrens={Number(basketRow.getChildren())} control={control} roomIndex={index} />\n </div>\n {fields.length > 1 && index === 0 ? (\n <div className=\"u-marg-bottom--heavy\">\n <Checkbox label={t(Translation.Step.Confirmation.ApplySameInfoToOtherRooms)} {...register('copyCheckBox')} />\n </div>\n ) : null}\n </div>\n );\n })}\n </>\n );\n};\n\nfunction chunkArray<T>(array: T[], chunkSize: number): T[][] {\n const result: T[][] = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n}\n\nconst CaptureChildAges = ({\n hotel,\n numberOfChildrens,\n control,\n roomIndex,\n}: {\n hotel: Hotel | undefined;\n numberOfChildrens: number;\n control: Control<ConfirmationFormValues, any>;\n roomIndex: number;\n}) => {\n if (!hotel?.captureChildAge || numberOfChildrens === 0) {\n return <></>;\n }\n const {\n formState: { errors },\n } = useFormContext<ConfirmationFormValues>();\n const ageOptions: { label: string; value: string }[] = [];\n const min = hotel?.childConfiguration?.childRange?.min || 0;\n const max = hotel?.childConfiguration?.childRange?.max || 0;\n for (let index = min; index <= max; index++) {\n ageOptions.push({ label: `${index}`, value: `${index}` });\n }\n const rootKey = `userProfiles[${roomIndex}].${nameof<TUserProfileFormValues>('CaptureChildAge')}`;\n const requiredInputs = Array.from({ length: numberOfChildrens }, (_, childIndex) => childIndex).map((childIndex) => ({\n name: `${rootKey}[${childIndex}]`,\n id: `${rootKey}[${childIndex}].id`,\n label: `Child ${childIndex + 1} Age`,\n childIndex: childIndex,\n }));\n const getValidationClass = (childIndex: number) => {\n if (!errors.userProfiles) return;\n if (errors.userProfiles?.[roomIndex]?.CaptureChildAge?.[childIndex]) {\n return 'error';\n } else {\n return 'success';\n }\n };\n const chunkInputs = chunkArray(requiredInputs, 3);\n\n return (\n <div className=\"u-marg-top\">\n {chunkInputs.map((chunkInput, chunkIndex) => {\n return (\n <InputGroup dimensions=\"1/1/1\" key={`InputGroup-${chunkIndex}`}>\n {chunkInput.map(({ id, name, label, childIndex }) => {\n return (\n <Controller\n key={id}\n control={control}\n name={name as any}\n rules={{ required: true }}\n render={({ field }) => {\n const { ref, ...rest } = field;\n return (\n <>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{label}</strong>\n </Text>\n </div>\n <InputSelect\n keyName=\"value\"\n labelName=\"label\"\n options={ageOptions}\n placeholder=\"Please Select *\"\n {...rest}\n validationStatus={getValidationClass(childIndex)}\n />\n </>\n );\n }}\n />\n );\n })}\n </InputGroup>\n );\n })}\n </div>\n );\n};\nexport default RoomContactDetails;\n"]}