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MVU,EAAsB,SAACoC,EAA0BC,EAAgCC,EAAyBxC,GAEnH,IAAM4oB,EAAQ,EACV,QAAYD,EAAqBvpB,QACjC,QAAYupB,EAAqBrpB,QACjC,QAAUqpB,EAAqBppB,2BAgBnC,OAbI+C,GACAsmB,EAAM7jB,MAAK,QAAS4jB,EAAqBvpB,QAEzCmD,GACAqmB,EAAM7jB,MAAK,QAAS4jB,EAAqBrpB,QAEzCkD,GACAomB,EAAM7jB,MAAK,QAAS4jB,EAAqBtpB,OAE1CW,GACC4oB,EAAM7jB,MAAK,QAAU4jB,EAAqBnpB,gBAGvCopB,CACX,C,oUCvBaC,EANF,EAAP,KACO,KAAoB,CACvBhmB,SAJqC,aAUhCjB,EAAiC,EAC1C,QAASinB,EAAaxpB,OACtB,QAASwpB,EAAazpB,QACtB,QAAYypB,EAAazpB,QACzB,QAASypB,EAAavpB,QACtB,QAAYupB,EAAavpB,QACzB,QAAUupB,EAAatpB,2BACvB,QAASspB,EAAahmB,WACtB,QAAcgmB,EAAahmB,SAAU,KAAOimB,oBAAqB,KAAOC,qB","sources":["components/CallToAction.tsx","components/DataPolicy/DataPolicy.tsx","components/BookingFlow/JumpToEnd/JumpToEnd.tsx","components/AboutUs/AboutUs.tsx","contexts/BookingFlowContext.ts","components/BookingFlow/StepNumber/StepNumber.tsx","components/form-components/FixedButton/FixedButton.tsx","contexts/ReservationEndContext.ts","components/BookingFlow/ReservationEnd/sections/ReservationsSection/ReservationsSection.tsx","components/BookingFlow/ReservationEnd/functions/createFunctions.ts","components/BookingFlow/ReservationEnd/sections/PersonalDetailsSection/PersonalDetailsSection.tsx","components/BookingFlow/ReservationEnd/PaymentSelect/PaymentSelect.tsx","components/BookingFlow/ReservationEnd/sections/PaymentSelectSection/PaymentSelectSection.tsx","components/BookingFlow/ReservationEnd/sections/UserInvoiceDetailsSection/UserInvoiceDetailsSection.tsx","components/BookingFlow/ReservationEnd/statements/BarionStatement/BarionStatement.tsx","components/BookingFlow/ReservationEnd/statements/PrivacyStatement/PrivacyStatement.tsx","components/BookingFlow/ReservationEnd/statements/TermsConditionsStatement/TermsConditionsStatement.tsx","components/BookingFlow/ReservationEnd/sections/StatementSection/StatementSection.tsx","components/BookingFlow/ReservationEnd/ReservationEnd.tsx","components/BookingFlow/StepValue/StepValue.tsx","components/BookingFlow/BookingFlowReducer.ts","components/BookingFlow/Step/Step.tsx","components/BookingFlow/modules/withSearchParams.tsx","components/CalendarDescription/CalendarDescription.tsx","components/BookingFlow/modules/CalendarSelect/CalendarItem/CalendarItem.tsx","components/BookingFlow/modules/SelectButton.tsx","components/BookingFlow/modules/CalendarSelect/CalendarSelect.tsx","test-mocks/MockModule.tsx","components/BookingFlow/modules/ServiceSelect/ServiceItem/ServiceItem.tsx","components/BookingFlow/modules/ServiceSelect/ServiceSelect.tsx","components/BookingFlow/modules/DateTimeSelect/DateTimeSelectStep.tsx","components/BookingFlow/modules/CustomerData/CustomerDataStep.tsx","components/BookingFlow/modules/TimeTableSelect/TimeTableSelect.tsx","components/BookingFlow/Stepper/Stepper.tsx","components/ContactInfo/ContactInfo.tsx","services/bookingFlowUtils.ts","components/BookingFlow/BookingFlow.tsx","components/icons/Email.tsx","components/icons/Location.tsx","components/icons/Phone.tsx","components/icons/Facebook.tsx","components/icons/WebSite.tsx","components/Home/Home.tsx","services/api/reservationConfirm.ts","services/validations/reservationEndRules.ts","services/validations/signupRules.ts"],"sourcesContent":["import React from 'react';\r\nimport { HashLink as Link } from 'react-router-hash-link';\r\nimport { Routes } from 'src/routes';\r\nimport { FormattedMessage, defineMessages } from 'react-intl';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nconst messages = defineMessages({\r\n    callToAction: {\r\n        id: 'callToAction',\r\n        defaultMessage: 'Időpont foglalása'\r\n    }\r\n})\r\n\r\nconst CallToAction = () => {\r\n    const location = useLocation();\r\n\r\n    return (\r\n        <Link\r\n            to={{\r\n                pathname: Routes.Book,\r\n                hash: 'booking-flow',\r\n                search: location.search\r\n            }}\r\n            className=\"App__call-to-action button button--primary\">\r\n            <FormattedMessage {...messages.callToAction} />\r\n        </Link>\r\n    );\r\n}\r\n\r\nexport default CallToAction;","import React, { useEffect, useState } from 'react';\r\nimport CustomScroll from 'react-custom-scroll';\r\nimport { useIntl } from 'react-intl';\r\nimport { getDataPolicy } from 'src/services/api/company';\r\nimport makeCancelable from 'src/services/cancelablePromise';\r\nimport PrimaryButton from '../form-components/PrimaryButton/PrimaryButton';\r\nimport { IPopupable } from '../Popup/Popup';\r\nimport globalMessages from 'src/services/globalMessages';\r\n\r\nconst DataPolicy: React.FC<IPopupable> = ({ closePopup }) => {\r\n    const intl = useIntl();\r\n    const [adminPrivacyStatement, setAdminPrivacyStatement] = useState('');\r\n    const [clientApprovalStatement, setClientApprovalStatement] = useState('');\r\n    const fetchDataPolicy = (language: string) => {\r\n        const dataPolicySubscription = makeCancelable(getDataPolicy(language));\r\n        dataPolicySubscription.promise\r\n            .then((dataPolicy) => {\r\n                setAdminPrivacyStatement(dataPolicy.AdminPrivacyStatement);\r\n                setClientApprovalStatement(dataPolicy.ClientApprovalStatement);\r\n            })\r\n            .catch(() => null);\r\n        return dataPolicySubscription;\r\n    };\r\n\r\n    useEffect(() => {\r\n        const dataPolicySubscription = fetchDataPolicy(intl.locale);\r\n\r\n        return () => {\r\n            dataPolicySubscription.cancel();\r\n        };\r\n    }, []);\r\n\r\n    return (\r\n        <section className=\"data-policy\">\r\n            <CustomScroll>\r\n                <div className=\"data-policy__body\">\r\n                    <div dangerouslySetInnerHTML={{ __html: adminPrivacyStatement }} />\r\n                    <div dangerouslySetInnerHTML={{ __html: clientApprovalStatement }} />\r\n                </div>\r\n            </CustomScroll>\r\n            {closePopup && (\r\n                <div className=\"data-policy__button\">\r\n                    <PrimaryButton\r\n                        autoFocus={true}\r\n                        onClick={closePopup}\r\n                        caption={globalMessages.dataPolicyOk}\r\n                    />\r\n                </div>\r\n            )}\r\n        </section>\r\n    );\r\n};\r\n\r\nexport default DataPolicy;\r\n","import React from 'react';\r\nimport { useState } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport Confirmation from 'src/components/Confirmation/Confirmation';\r\nimport Popup from 'src/components/Popup/Popup';\r\nimport SecondaryButton from '../../form-components/SecondaryButton/SecondaryButton';\r\nimport globalMessages from 'src/services/globalMessages';\r\n\r\nconst messages = defineMessages({\r\n    pendingCount: {\r\n        id: 'pendingCount',\r\n        defaultMessage: '{n} függő foglalás'\r\n    },\r\n    jumpTo: {\r\n        id: 'jumpTo',\r\n        defaultMessage: 'Ugrás ide'\r\n    },\r\n    jumpToReservationEnd: {\r\n        id: 'jumpToReservationEnd',\r\n        defaultMessage: 'Vissza a véglegesítéshez'\r\n    },\r\n    confirmJumpToEnd: {\r\n        id: 'confirmJumpToEnd',\r\n        defaultMessage: 'A most megkezdett foglalás adatai el fognak veszni. Biztosan a Véglegesítés lépésre ugrasz?'\r\n    }\r\n});\r\n\r\nexport const enum PendingJumpType {\r\n    Top,\r\n    Bottom\r\n}\r\n\r\ninterface IPendingJumpProps {\r\n    type: PendingJumpType;\r\n    reservationCount: number;\r\n    action: () => void;\r\n}\r\n\r\nconst JumpToEnd: React.FunctionComponent<IPendingJumpProps> = (props) => {\r\n    const [isWarningVisible, setIsWarningVisible] = useState(false);\r\n    const { type, action, reservationCount } = props;\r\n    const caption = type === PendingJumpType.Top ? messages.jumpToReservationEnd : messages.jumpTo;\r\n    const className = type === PendingJumpType.Top ? 'stepper__jump-to-pending--top' : 'stepper__jump-to-pending--bottom';\r\n\r\n    return <>\r\n        <div className={className}>\r\n            <FormattedMessage {...messages.pendingCount} values={{ n: reservationCount }} />\r\n            <SecondaryButton\r\n                className=\"stepper__jump-to-pending-button\"\r\n                caption={caption}\r\n                onClick={() => setIsWarningVisible(true)} />\r\n        </div>\r\n        <Popup closePopup={() => setIsWarningVisible(false)} visible={isWarningVisible}>\r\n            <Confirmation\r\n                description={messages.confirmJumpToEnd}\r\n                affirmativeCaption={globalMessages.yes}\r\n                affirmativeAction={action}\r\n            />\r\n        </Popup>\r\n    </>\r\n};\r\n\r\nexport default JumpToEnd;\r\n","import React from 'react';\r\nimport { FormattedMessage } from 'react-intl';\r\nimport globalMessages from 'src/services/globalMessages';\r\n\r\n/**\r\n * @property body - rich text\r\n */\r\nexport interface IAboutUsProps {\r\n    body: string | null;\r\n}\r\n\r\nconst AboutUs: React.FunctionComponent<IAboutUsProps> = ({ body }) =>\r\n    body ?\r\n        <article className=\"about-us\">\r\n            <h1 className=\"about-us__title\"><FormattedMessage {...globalMessages.aboutUs} /></h1>\r\n            <div className=\"about-us__body\" dangerouslySetInnerHTML={{ __html: body }} />\r\n        </article>\r\n        : null\r\n\r\n\r\nexport default AboutUs;","import React from 'react';\r\nimport { IBookingFlowProps } from 'src/components/BookingFlow/BookingFlow';\r\nimport { initialUserState } from 'src/components/UserDetails/UserDetails';\r\nimport { IBookingFlowState } from 'src/models/bookingFlow';\r\nimport { ReservationOrder } from 'src/entities/company';\r\nimport { IReservationModel } from 'src/entities/reservation';\r\nimport { IReservationEndUser } from 'src/entities/user';\r\nimport { StepType } from 'src/services/getStepOrder';\r\n\r\nexport interface IBookingFlowActions {\r\n    setReservationEndUser: (value: IReservationEndUser) => void;\r\n    handleUserChange: (value: any, name: string) => void;\r\n    handleInvoiceChange: (value: any, name: string) => void;\r\n    reloadReservations: (reservationOrder: ReservationOrder, newReservations: IReservationModel[]) => void;\r\n    setReservationModel: (stepType: StepType, value: IReservationModel) => void;\r\n    addNewReservation: () => void;\r\n    removeReservation: (index?: number) => void;\r\n    setActiveReservation: (index: number) => void;\r\n    autoSelected: () => void;\r\n}\r\n\r\nexport type IBookingFlowProvidedState = IBookingFlowState & IBookingFlowProps;\r\n\r\nexport const BookingContext = React.createContext<IBookingFlowProvidedState>({\r\n    reservationEndUser: initialUserState,\r\n    stepOrderTypes: [],\r\n    reservations: [],\r\n    activeReservationIndex: 0,\r\n    actions: {\r\n        setReservationEndUser: () => undefined,\r\n        handleUserChange: () => undefined,\r\n        handleInvoiceChange: () => undefined,\r\n        reloadReservations: () => undefined,\r\n        setReservationModel: () => undefined,\r\n        addNewReservation: () => undefined,\r\n        removeReservation: () => undefined,\r\n        setActiveReservation: () => undefined,\r\n        autoSelected: () => undefined\r\n    },\r\n    hasAutoSelected: false,\r\n    activeStepIndex: 0,\r\n    reservationOrder: ReservationOrder.CalendarFirst\r\n});\r\n\r\nexport const BookingProvider = BookingContext.Provider;\r\nexport const BookingConsumer = BookingContext.Consumer;","import React from 'react';\r\nimport { FormattedMessage, MessageDescriptor } from 'react-intl';\r\nimport ClipLoader from 'react-spinners/ClipLoader';\r\n\r\ninterface IStepNumberProps {\r\n    name: MessageDescriptor;\r\n    touched: boolean;\r\n    index: number;\r\n    isLoading?: boolean;\r\n}\r\n\r\nconst StepNumber: React.FunctionComponent<IStepNumberProps> = ({ touched, name, index, isLoading }) => {\r\n    const stepTouchedClass = touched ? 'step-number--touched' : '';\r\n    return (\r\n        <header className={`step-number ${stepTouchedClass}`} id={`step-${index - 1}`}>\r\n            <div className=\"step-number__circle\">\r\n                {isLoading\r\n                    ? <ClipLoader size=\"1em\" color=\"white\" />\r\n                    : <span>{index}</span>\r\n                }\r\n            </div>\r\n            <h2 className=\"step-number__title\">\r\n                <FormattedMessage {...name} />\r\n            </h2>\r\n        </header>\r\n    );\r\n};\r\n\r\nexport default StepNumber;\r\n","import React from 'react';\r\nimport PrimaryButton from '../PrimaryButton/PrimaryButton';\r\nimport { IButtonProps } from '../Button/Button';\r\nimport { Helmet } from 'react-helmet';\r\n\r\ntype IFixedButtonProps = Pick<IButtonProps, 'caption' | 'onClick' | 'className' | 'form'>\r\n\r\nconst FixedButton: React.FC<IFixedButtonProps> = ({ caption, onClick, className, form }) =>\r\n    <div className=\"App__container-fixed-buttons\">\r\n        <PrimaryButton\r\n            className={'App__fixed-button ' + (className || '')}\r\n            caption={caption}\r\n            onClick={onClick}\r\n            form={form}\r\n        />\r\n        <Helmet>\r\n            <style media=\"screen and (max-width: 24rem)\">{'.footer { display: none; }'}</style>\r\n        </Helmet>\r\n    </div>\r\n\r\nexport default FixedButton;","import React from 'react';\r\nimport { IPaymentSelectOption } from 'src/entities/pocket';\r\nimport { IServiceSubtotal } from 'src/entities/service';\r\n\r\nexport interface IReservationEndActions {\r\n    setHasOnlinePocket: (value: boolean) => void;\r\n    setSelectedPayment: (value: IPaymentSelectOption | null) => void;\r\n    setShouldSignUp: (value: boolean) => void;\r\n}\r\n\r\nexport interface IReservationEndProvidedState {\r\n    hasOnlinePocket: boolean;\r\n    selectedPayment: IPaymentSelectOption | null;\r\n    shouldSignUp: boolean;\r\n    displayedSubtotal: IServiceSubtotal | null;\r\n    actions: IReservationEndActions;\r\n}\r\n\r\nexport const ReservationEndContext = React.createContext<IReservationEndProvidedState>({\r\n    hasOnlinePocket: false,\r\n    selectedPayment: null,\r\n    shouldSignUp: false,\r\n    displayedSubtotal: null,\r\n    actions: {\r\n        setHasOnlinePocket: () => undefined,\r\n        setSelectedPayment: () => undefined,\r\n        setShouldSignUp: () => undefined\r\n    }\r\n});\r\n\r\nexport const ReservationEndProvider = ReservationEndContext.Provider;\r\nexport const ReservationEndConsumer = ReservationEndContext.Consumer;","import React, { useContext } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport FormattedPrice from 'src/components/BookingFlow/modules/ServiceSelect/FormattedPrice/FormattedPrice';\r\nimport SecondaryButton from 'src/components/form-components/SecondaryButton/SecondaryButton';\r\nimport Reservation from 'src/components/Reservations/Reservation';\r\nimport { Section } from 'src/components/Section';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { ReservationEndContext } from 'src/contexts/ReservationEndContext';\r\nimport { reservationModelToRequest } from 'src/services/api/reservation';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { getPaymentNeedWithPrice } from '../../functions/helperFunctions';\r\n\r\nconst messages = defineMessages({\r\n    addNewReservation: {\r\n        id: 'addNewReservation',\r\n        defaultMessage: 'További időpont hozzáadása'\r\n    },\r\n    reservations: {\r\n        id: 'reservations',\r\n        defaultMessage: 'Időpontok'\r\n    }\r\n});\r\n\r\nconst ReservationsSection: React.FC = () => {\r\n\r\n    const { company } = useContext(AppContext);\r\n    const { reservations, actions } = useContext(BookingContext);\r\n    const { hasOnlinePocket, displayedSubtotal } = useContext(ReservationEndContext);\r\n\r\n    return (\r\n        <Section title={messages.reservations}>\r\n            {reservations.map((reservation, i) =>\r\n                <Reservation\r\n                    key={i}\r\n                    reservation={reservationModelToRequest(reservation)}\r\n                    displayReadMore={false}\r\n                    canModify={true}\r\n                    needsPayment={getPaymentNeedWithPrice(company?.PaymentSettings.IsPaymentEnabled,\r\n                        (reservation.service ? reservation.service : reservation.timetable?.service))}\r\n                    onEdit={() => actions.setActiveReservation(i)}\r\n                    onDelete={() => actions.removeReservation(i)}\r\n                    isReservationEnd={true}\r\n                />\r\n            )}\r\n            <div className={'reservation-end__container'}>\r\n                {!company?.IsCartDisabled &&\r\n                    <SecondaryButton className='reservation-end__add-new-reservation'\r\n                        onClick={actions.addNewReservation}\r\n                        caption={messages.addNewReservation} />\r\n                }\r\n                {(company?.PaymentSettings.IsPaymentEnabled && hasOnlinePocket && displayedSubtotal && displayedSubtotal.Price !== 0) &&\r\n                    <div className='reservation-end__subtotal'>\r\n                        <FormattedMessage {...globalMessages.subtotal} />\r\n                        <FormattedPrice value={displayedSubtotal.Price} currency={displayedSubtotal.Currency} />\r\n                    </div>\r\n                }\r\n            </div>\r\n        </Section>\r\n    );\r\n}\r\n\r\nexport default ReservationsSection;","import { IReservationRequiredFieldProps, isEmailRequired, isNameRequired, isPhoneNumberRequired } from 'src/entities/reservation';\r\nimport { IReservationEndUser, IUser, IUserInvoice } from 'src/entities/user';\r\nimport FormValidator from 'src/services/formValidator';\r\nimport { invoiceDetailsRules } from 'src/services/validations/invoiceDetailsRules';\r\nimport { reservationEndRules } from 'src/services/validations/reservationEndRules';\r\n\r\nexport const createUserInvoice = (actUser?: IUser | null): IUserInvoice => {\r\n    if (actUser && actUser.InvoiceDetails) {\r\n        return actUser.InvoiceDetails;\r\n    }\r\n\r\n    return {\r\n        InvoiceName: '',\r\n        Country: '',\r\n        City: '',\r\n        StreetAddress: '',\r\n        PostalCode: '',\r\n        PrivatePerson: false,\r\n        TaxNumber: ''\r\n    }\r\n}\r\n\r\nexport const createReservationEndUser = (actUser: IUser | null): IReservationEndUser => {\r\n    if (actUser) {\r\n        if (!actUser.InvoiceDetails) {\r\n            actUser.InvoiceDetails = createUserInvoice();\r\n        }\r\n        const { Email, Name, Phone, InvoiceDetails, PrivacyStatementAccepted } = actUser;\r\n        return { Email, Name, Phone, InvoiceDetails, PrivacyStatementAccepted, TermsAccepted: false };\r\n    }\r\n\r\n    const urlSearchParams = new URLSearchParams(window.location.search);\r\n    const nameParam = urlSearchParams.get('name');\r\n    const emailParam = urlSearchParams.get('email');\r\n    const phoneParam = urlSearchParams.get('phone');\r\n\r\n    return {\r\n        Email: emailParam || '',\r\n        Name: nameParam || '',\r\n        Phone: phoneParam || '',\r\n        PrivacyStatementAccepted: false,\r\n        InvoiceDetails: createUserInvoice(actUser),\r\n        TermsAccepted: false\r\n    }\r\n}\r\n\r\nexport const createValidator = (props: IReservationRequiredFieldProps, shouldSignUp: boolean, isTermsRequired: boolean) => {\r\n    return {\r\n        personalValidator: new FormValidator(\r\n            reservationEndRules(\r\n                shouldSignUp || isEmailRequired(props),\r\n                shouldSignUp || isPhoneNumberRequired(props),\r\n                shouldSignUp || isNameRequired(props),\r\n                isTermsRequired)),\r\n        invoiceValidator: new FormValidator(invoiceDetailsRules())\r\n    };\r\n}\r\n\r\nexport const createValidation = (actValidator: FormValidator, data: any, submitted: boolean) => {\r\n    return submitted\r\n        ? actValidator.validate(data)\r\n        : actValidator.getInitial();\r\n}","import React, { forwardRef, useContext, useState } from 'react';\r\nimport { FormattedMessage, defineMessages } from 'react-intl';\r\nimport Login from 'src/components/Login/Login';\r\nimport Popup from 'src/components/Popup/Popup';\r\nimport { Section } from 'src/components/Section';\r\nimport PersonalDetails, { IPersonalDetails } from 'src/components/UserDetails/PersonalDetails/PersonalDetails';\r\nimport Checkbox from 'src/components/form-components/Checkbox/Checkbox';\r\nimport SecondaryButton from 'src/components/form-components/SecondaryButton/SecondaryButton';\r\nimport TextInput, { TextInputType, createInputId } from 'src/components/form-components/TextInput/TextInput';\r\nimport ValidationMessage from 'src/components/form-components/ValidationMessage/ValidationMessage';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { EmbedContext } from 'src/contexts/EmbedContext';\r\nimport { ReservationEndContext } from 'src/contexts/ReservationEndContext';\r\nimport { defaultRequiredInfo } from 'src/entities/company';\r\nimport { IReservationRequiredFieldProps, isEmailRequired, isNameRequired, isPhoneNumberRequired } from 'src/entities/reservation';\r\nimport { IReservationEndUser } from 'src/entities/user';\r\nimport FormValidator, { IValidation } from 'src/services/formValidator';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { signupFields, signupRules } from 'src/services/validations/signupRules';\r\nimport { createValidation } from '../../functions/createFunctions';\r\n\r\nconst messages = defineMessages({\r\n    reservationEndLogin: {\r\n        id: 'reservationEndLogin',\r\n        defaultMessage: 'Van fiókom, bejelentkezem'\r\n    },\r\n    or: {\r\n        id: 'or',\r\n        defaultMessage: 'Vagy'\r\n    },\r\n    signUpOnReservation: {\r\n        id: 'signUpOnReservation',\r\n        defaultMessage: 'Fiók létrehozása'\r\n    }\r\n});\r\n\r\nexport interface IPersonalDetailsSectionProps {\r\n    validation: IValidation;\r\n    submitted: boolean;\r\n}\r\n\r\nconst PersonalDetailsSection = forwardRef<IPersonalDetails, IPersonalDetailsSectionProps> (({ validation, submitted }, ref) => {\r\n\r\n    const { isAuthenticated, company, user, actions } = useContext(AppContext);\r\n    const { hideUser } = useContext(EmbedContext)\r\n    const { reservationEndUser, actions: { handleUserChange } } = useContext(BookingContext);\r\n    const { shouldSignUp, actions: { setShouldSignUp } } = useContext(ReservationEndContext)\r\n\r\n    const [isLoginVisible, setLoginVisible] = useState(false);\r\n\r\n    const requiredFieldInfo: IReservationRequiredFieldProps = {\r\n        isAuthenticated,\r\n        requiredFieldInfo: company ? company.RequiredFieldInfo : defaultRequiredInfo\r\n    }\r\n\r\n    const toggleLogin = () => {\r\n        setLoginVisible(!isLoginVisible);\r\n    }\r\n\r\n    const validator = new FormValidator(signupRules);\r\n    const passwordValidation = createValidation(validator, reservationEndUser, submitted);\r\n\r\n    return (\r\n        <Section title={globalMessages.personalDetails}>\r\n            <div className='reservation-end__user-details'>\r\n                <form\r\n                    id={'reservation-end-form'}\r\n                    autoComplete='off'\r\n                    className='reservation-end__form'\r\n                    noValidate={true}\r\n                >\r\n                    {!user && !hideUser &&\r\n                        <Checkbox\r\n                            checked={shouldSignUp ?? false}\r\n                            onChange={setShouldSignUp}\r\n                            className='reservation-end__sign-up-checkbox'\r\n                        >\r\n                            <FormattedMessage {...messages.signUpOnReservation} />\r\n                        </Checkbox>\r\n                    }\r\n                    <PersonalDetails\r\n                        ref={ref}\r\n                        defaultUser={reservationEndUser}\r\n                        validation={validation}\r\n                        handleUserChange={handleUserChange}\r\n                        isEmailRequired={shouldSignUp || isEmailRequired(requiredFieldInfo)}\r\n                        isPhoneNumberRequired={shouldSignUp || isPhoneNumberRequired(requiredFieldInfo)}\r\n                        isNameRequired={shouldSignUp || isNameRequired(requiredFieldInfo)}\r\n                        adminCountryCode={company?.DefaultCountryCode}\r\n                    />\r\n                    {!user && !hideUser && shouldSignUp && reservationEndUser &&\r\n                        <>\r\n                            <TextInput\r\n                                type={TextInputType.Password}\r\n                                className='reservation-end__password'\r\n                                fieldName={signupFields.Password}\r\n                                label={globalMessages.password}\r\n                                onChange={handleUserChange}\r\n                                required={true}\r\n                                value={reservationEndUser[signupFields.Password as keyof IReservationEndUser] as string || ''}\r\n                                id={createInputId(signupFields.Password)}\r\n                            />\r\n                            <ValidationMessage\r\n                                className='reservation-end__password-validation'\r\n                                message={passwordValidation.fields[signupFields.Password].message}\r\n                                formatValues={passwordValidation.fields[signupFields.Password]?.messageValues}\r\n                            />\r\n                        </>\r\n                    }\r\n                </form>\r\n\r\n                {!user && !hideUser && <>\r\n                    <div className='reservation-end-separator' >\r\n                        <div className='reservation-end-separator__line' />\r\n                        <span className='reservation-end-separator__text'>\r\n                            <FormattedMessage {...messages.or} />\r\n                        </span>\r\n                        <div className='reservation-end-separator__line' />\r\n                    </div>\r\n                    <SecondaryButton autoFocus={true} className='reservation-end-login' caption={messages.reservationEndLogin} onClick={toggleLogin} />\r\n                    <Popup closePopup={toggleLogin} visible={isLoginVisible}>\r\n                        <Login setUser={actions.setUser} />\r\n                    </Popup>\r\n                </>}\r\n            </div>\r\n        </Section>\r\n    )\r\n});\r\n\r\nexport default PersonalDetailsSection;\r\n","import classNames from 'classnames';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport Radio from 'src/components/form-components/Radio/Radio';\r\nimport Placeholder from 'src/components/Placeholder/Placeholder';\r\nimport { PaymentType } from 'src/entities/company';\r\nimport { IPaymentSelectOption, IPocket, IProviderMessage, PaymentProvider, PocketType } from 'src/entities/pocket';\r\n\r\nconst messages = defineMessages({\r\n    onSitePayment: {\r\n        id: 'onSitePayment',\r\n        defaultMessage: 'Helyszíni fizetés'\r\n    },\r\n    onBarionPayment: {\r\n        id:'onBarionPayment',\r\n        defaultMessage: 'Bankkártyás fizetés Barionnal'\r\n    },\r\n    onPayPalPayment: {\r\n        id:'onPayPalPayment',\r\n        defaultMessage: 'PayPal'\r\n    }\r\n})\r\n\r\nconst PayPalImg = <img src={'https://www.paypalobjects.com/webstatic/en_US/i/buttons/cc-badges-ppmcvdam.png'} />;\r\nconst BarionImg = <img src={'https://d1ursyhqs5x9h1.cloudfront.net/sw/images/Barion-smart-payment-horizontal-whitebg.png'} />;\r\n\r\nexport interface IPaymentSelectProps {\r\n    pockets: IPocket[];\r\n    paymentType: PaymentType;\r\n    onChange: (value: IPaymentSelectOption) => void;\r\n    selected: IPaymentSelectOption | null;\r\n}\r\n\r\nconst PaymentSelect: React.FunctionComponent<IPaymentSelectProps> = ({ pockets, paymentType, onChange, selected }) => {\r\n\r\n    const [hasInit, setHasInit] = useState(false);\r\n    const selectOptions: IPaymentSelectOption[] = createOptions();\r\n\r\n    useEffect(() => {\r\n\r\n        if (hasInit || !pockets.length) {\r\n            return;\r\n        }\r\n\r\n        const selectedPocket = selected ? (selectOptions.find(opt => opt.Id === selected.Id) ?? selectOptions[0]) : selectOptions[0];\r\n        onChange(selectedPocket);\r\n        setHasInit(true);\r\n\r\n    }, [pockets, hasInit]);\r\n\r\n    function createOptions() {\r\n        /* eslint-disable-next-line no-bitwise */\r\n        const result: IPaymentSelectOption[] = pockets.filter(pocket => (PocketType.Online === (pocket.Type & PocketType.Online)) && pocket.IsActive);\r\n\r\n\r\n        if (paymentType === PaymentType.NeedAccept || paymentType === PaymentType.NoNeedToPay) {\r\n            result.push({\r\n                Id: -1,\r\n                Name: messages.onSitePayment.defaultMessage,\r\n                PaymentProvider: PaymentProvider.NoProvider,\r\n                NeedsInvoice: false,\r\n                DisplayName: messages.onSitePayment\r\n            });\r\n        }\r\n \r\n        return addLocalizedDisplayNameToOptions(result);\r\n    }\r\n\r\n    function addLocalizedDisplayNameToOptions(result: IPaymentSelectOption[]): IPaymentSelectOption[] {\r\n        const providerMessages: Partial<Record<PaymentProvider, IProviderMessage>> = {\r\n          [PaymentProvider.Barion]: {\r\n            displayName: messages.onBarionPayment,\r\n            name: messages.onBarionPayment.defaultMessage\r\n          },\r\n          [PaymentProvider.Paypal]: {\r\n            displayName: messages.onPayPalPayment,\r\n            name: messages.onPayPalPayment.defaultMessage\r\n          }\r\n          // Add more payment providers here if needed\r\n        };\r\n      \r\n        return result.map(o => {\r\n          const providerMessage = o.PaymentProvider ? providerMessages[o.PaymentProvider] : undefined;\r\n          if (providerMessage) {\r\n            return {\r\n              ...o,\r\n              DisplayName: providerMessage.displayName,\r\n              Name: providerMessage.name\r\n            };\r\n          }\r\n      \r\n          return o;\r\n        });\r\n    }\r\n      \r\n    return (\r\n        (selectOptions && selected) ?\r\n            <Radio<IPaymentSelectOption>\r\n                options={selectOptions}\r\n                selected={(payment) => payment.Id === selected.Id}\r\n                onChange={onChange}\r\n                rootClassName=\"payment\"\r\n                buttonClassName=\"payment-method\"\r\n                labelClassName=\"payment-method__label\"\r\n                inputClassName=\"payment-method__input\"\r\n                getLabel={(payment, checked) =>\r\n                    <div className={classNames(\r\n                        'pocket',\r\n                        { 'pocket--checked': checked })} >\r\n                        <span className={'pocket__name'}>\r\n                            {payment.DisplayName\r\n                                ? <FormattedMessage {...payment.DisplayName} />\r\n                                : payment.Name\r\n                            }\r\n                        </span>\r\n                        {payment.PaymentProvider === PaymentProvider.Paypal && PayPalImg}\r\n                        {payment.PaymentProvider === PaymentProvider.Barion && BarionImg}\r\n                    </div>}\r\n                name={'payment'}\r\n            />\r\n            :\r\n            <Placeholder count={2} />\r\n    )\r\n}\r\n\r\nexport default PaymentSelect;","import React, { useContext } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport FormattedPrice from 'src/components/BookingFlow/modules/ServiceSelect/FormattedPrice/FormattedPrice';\r\nimport { Section } from 'src/components/Section';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { ReservationEndContext } from 'src/contexts/ReservationEndContext';\r\nimport { IPocket, PocketType } from 'src/entities/pocket';\r\nimport { useConditionalFetch } from 'src/hooks';\r\nimport { getActivePockets } from 'src/services/api/company';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport PaymentSelect from '../../PaymentSelect/PaymentSelect';\r\n\r\nconst messages = defineMessages({\r\n    paymentSelect: {\r\n        id: 'paymentSelect',\r\n        defaultMessage: 'Fizetési mód'\r\n    }\r\n});\r\n\r\nconst PaymentSelectSection: React.FC = () => {\r\n\r\n    const { company } = useContext(AppContext);\r\n    const { displayedSubtotal, selectedPayment, hasOnlinePocket, actions: { setHasOnlinePocket, setSelectedPayment } } = useContext(ReservationEndContext);\r\n\r\n    const checkOnlinePockets = (pocketList: IPocket[]) => {\r\n        /* eslint-disable-next-line no-bitwise */\r\n        setHasOnlinePocket(pocketList.some(pocket => (PocketType.Online === (pocket.Type & PocketType.Online))));\r\n    }\r\n\r\n    const isSelectNeeded = (company?.PaymentSettings.IsPaymentEnabled && displayedSubtotal && displayedSubtotal?.Price !== 0) as boolean;\r\n\r\n    const [activePockets, isLoading] = useConditionalFetch(getActivePockets, checkOnlinePockets, isSelectNeeded, []);\r\n\r\n    return (\r\n        (hasOnlinePocket && company && isSelectNeeded && displayedSubtotal && !isLoading)\r\n            ?\r\n            <Section title={messages.paymentSelect}\r\n                otherTitle={<div>\r\n                    <FormattedMessage {...globalMessages.subtotal} />\r\n                    <FormattedPrice value={displayedSubtotal.Price} currency={displayedSubtotal.Currency} />\r\n                </div>}>\r\n                <PaymentSelect\r\n                    pockets={activePockets}\r\n                    paymentType={company.PaymentSettings.PaymentType}\r\n                    selected={selectedPayment}\r\n                    onChange={setSelectedPayment}\r\n                />\r\n            </Section>\r\n            :\r\n            null\r\n    )\r\n}\r\n\r\nexport default PaymentSelectSection;","import React, { useContext } from 'react';\r\nimport { Section } from 'src/components/Section';\r\nimport UserInvoiceDetails from 'src/components/UserDetails/InvoiceDetails/UserInvoiceDetails';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { ReservationEndContext } from 'src/contexts/ReservationEndContext';\r\nimport { IValidation } from 'src/services/formValidator';\r\nimport globalMessages from 'src/services/globalMessages';\r\n\r\nexport interface IUserInvoiceDetailsSectionProps {\r\n    validation: IValidation;\r\n}\r\n\r\nconst UserInvoiceDetailsSection: React.FC<IUserInvoiceDetailsSectionProps> = ({ validation }) => {\r\n\r\n    const { company } = useContext(AppContext);\r\n    const { reservationEndUser, actions: { handleInvoiceChange } } = useContext(BookingContext);\r\n    const { selectedPayment, displayedSubtotal } = useContext(ReservationEndContext);\r\n\r\n    return (\r\n        (company?.PaymentSettings.IsBillingEnabled &&\r\n            selectedPayment?.NeedsInvoice && reservationEndUser &&\r\n            displayedSubtotal && displayedSubtotal?.Price !== 0)\r\n            ?\r\n            <Section title={globalMessages.invoiceDetails}>\r\n                <UserInvoiceDetails\r\n                    defaultUserInvoice={reservationEndUser.InvoiceDetails}\r\n                    handleInvoiceChange={handleInvoiceChange}\r\n                    validation={validation} />\r\n            </Section>\r\n            :\r\n            null\r\n    )\r\n}\r\n\r\nexport default UserInvoiceDetailsSection;","import React, { useContext } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport { ReservationEndContext } from 'src/contexts/ReservationEndContext';\r\nimport { PaymentProvider } from 'src/entities/pocket';\r\n\r\nconst messages = defineMessages({\r\n    barionStatement: {\r\n        id: 'barionStatement',\r\n        defaultMessage: 'Az online fizetést a Barion Payment Zrt. biztosítja, MNB engedély száma: H-EN-I-1064/2013.'\r\n    }\r\n})\r\n\r\nconst BarionStatement: React.FC = () => {\r\n\r\n    const { selectedPayment } = useContext(ReservationEndContext);\r\n\r\n    return (\r\n        (selectedPayment?.PaymentProvider === PaymentProvider.Barion)\r\n            ?\r\n            <div className='reservation-end__statement'>\r\n                <FormattedMessage {...messages.barionStatement} />\r\n            </div>\r\n            :\r\n            null\r\n    );\r\n}\r\n\r\nexport default BarionStatement;","import React, { useContext, useState } from 'react';\r\nimport { FormattedMessage } from 'react-intl';\r\nimport DataPolicy from 'src/components/DataPolicy/DataPolicy';\r\nimport Checkbox from 'src/components/form-components/Checkbox/Checkbox';\r\nimport ValidationMessage from 'src/components/form-components/ValidationMessage/ValidationMessage';\r\nimport Popup from 'src/components/Popup/Popup';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { reservationEndFields } from 'src/services/validations/reservationEndRules';\r\nimport { IPrivacyStatementProps } from '../../sections/StatementSection/StatementSection';\r\n\r\nconst PrivacyStatement: React.FC<IPrivacyStatementProps> = ({ validation, setDataPolicy }) => {\r\n\r\n    const { user } = useContext(AppContext);\r\n    const { reservationEndUser } = useContext(BookingContext);\r\n    const [isDataPolicyVisible, setDataPolicyVisible] = useState(false);\r\n\r\n    const handleCheckBoxLinkClick = (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\r\n        e.preventDefault(); \r\n        e.stopPropagation();\r\n        setDataPolicyVisible(true);\r\n    }\r\n\r\n    return (\r\n        (!user || !user.PrivacyStatementAccepted)\r\n            ?\r\n            <div className='reservation-end__statement'>\r\n                <Checkbox\r\n                    checked={reservationEndUser.PrivacyStatementAccepted ?? false}\r\n                    onChange={setDataPolicy}\r\n                    required={true} >\r\n                    <FormattedMessage\r\n                        {...globalMessages.privacyAccept}\r\n                        values={{\r\n                            span: (msg: React.ReactNode) => (\r\n                                <span\r\n                                    className=\"link\"\r\n                                    onClick={handleCheckBoxLinkClick}\r\n                                >{msg}</span>)}}\r\n                    />\r\n                </Checkbox>\r\n                <ValidationMessage message={validation.fields[reservationEndFields.PrivacyStatementAccepted]?.message} />\r\n                <Popup\r\n                    visible={isDataPolicyVisible}\r\n                    closePopup={() => setDataPolicyVisible(false)}\r\n                    title={globalMessages.dataPolicyTitle}>\r\n                    <DataPolicy closePopup={() => setDataPolicyVisible(false)} />\r\n                </Popup>\r\n            </div>\r\n            :\r\n            null\r\n    );\r\n}\r\n\r\nexport default PrivacyStatement;","import React, { useContext } from 'react';\r\nimport { defineMessages, FormattedMessage } from 'react-intl';\r\nimport Checkbox from 'src/components/form-components/Checkbox/Checkbox';\r\nimport ValidationMessage from 'src/components/form-components/ValidationMessage/ValidationMessage';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { reservationEndFields } from 'src/services/validations/reservationEndRules';\r\nimport { ITermsCondidtionsProps } from '../../sections/StatementSection/StatementSection';\r\n\r\nconst messages = defineMessages({\r\n    termsStatement: {\r\n        id: 'termsStatement',\r\n        defaultMessage: 'Elfogadom az <a>Általános Szerződési Feltételeket</a>.'\r\n    }\r\n})\r\n\r\nconst TermsConditionsStatement: React.FC<ITermsCondidtionsProps> = ({ validation, setTermsAccepted }) => {\r\n    const { company } = useContext(AppContext);\r\n    const { reservationEndUser } = useContext(BookingContext);\r\n\r\n    return ((company?.TermsAndConditionsLink)\r\n        ?\r\n        <div className='reservation-end__statement'>\r\n            <Checkbox\r\n                checked={reservationEndUser.TermsAccepted ?? false}\r\n                onChange={setTermsAccepted}\r\n                required={true} >\r\n                <FormattedMessage {...messages.termsStatement} \r\n                    values={{ a: (msg: any) => \r\n                    <a href={company.TermsAndConditionsLink} className='link' target='_blank' rel='noopener noreferrer'>\r\n                        {msg}\r\n                    </a> }} />\r\n            </Checkbox>\r\n            <ValidationMessage message={validation.fields[reservationEndFields.TermsAccepted]?.message} />\r\n        </div>\r\n        : \r\n        null\r\n    );\r\n}\r\n\r\nexport default TermsConditionsStatement;","import React from 'react';\r\nimport { IValidation } from 'src/services/formValidator';\r\nimport BarionStatement from '../../statements/BarionStatement/BarionStatement';\r\nimport PrivacyStatement from '../../statements/PrivacyStatement/PrivacyStatement';\r\nimport TermsConditionsStatement from '../../statements/TermsConditionsStatement/TermsConditionsStatement';\r\n\r\ninterface IStatementSectionPropsBase {\r\n    validation: IValidation;\r\n}\r\n\r\nexport interface IPrivacyStatementProps extends IStatementSectionPropsBase {\r\n    setDataPolicy: (value: boolean) => void;\r\n}\r\n\r\nexport interface ITermsCondidtionsProps extends IStatementSectionPropsBase {\r\n    setTermsAccepted: (value: boolean) => void;\r\n}\r\n\r\nexport interface IStatementSectionProps extends IPrivacyStatementProps {\r\n    setTermsAccepted: (value: boolean) => void;\r\n}\r\n\r\nconst StatementSection: React.FC<IStatementSectionProps> = ({ validation, setDataPolicy, setTermsAccepted }) => {\r\n\r\n    return (\r\n        <section>\r\n            <PrivacyStatement validation={validation} setDataPolicy={setDataPolicy} />\r\n            <TermsConditionsStatement validation={validation} setTermsAccepted={setTermsAccepted} />\r\n            <BarionStatement />\r\n        </section>\r\n    );\r\n}\r\n\r\nexport default StatementSection;","import React, { createRef, useCallback, useContext, useEffect, useState } from 'react';\r\nimport { defineMessages, WrappedComponentProps, injectIntl, MessageDescriptor, FormattedMessage } from 'react-intl';\r\nimport { NavigationType, useLocation, useNavigate, useNavigationType } from 'react-router-dom';\r\nimport { IPersonalDetails } from 'src/components/UserDetails/PersonalDetails/PersonalDetails';\r\nimport { IReservationRequiredFieldProps, IReservationResponse, populateReservations } from 'src/entities/reservation';\r\nimport { postReservation, reservationModelToRequest } from 'src/services/api/reservation';\r\nimport FormValidator from 'src/services/formValidator';\r\nimport { StepType } from '../../../services/getStepOrder';\r\nimport StepNumber from '../StepNumber/StepNumber';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { IConfirmationLocationState } from '../ReservationConfirm/ReservationConfirm';\r\nimport FixedButton from 'src/components/form-components/FixedButton/FixedButton';\r\nimport { signupRules } from 'src/services/validations/signupRules';\r\nimport { Routes } from 'src/routes';\r\nimport { IPaymentSelectOption, PaymentProvider } from 'src/entities/pocket';\r\nimport { defaultRequiredInfo, PaymentType, ReservationOrder } from 'src/entities/company';\r\nimport { IPostPaymentReservationParams, postPaymentReservations, redirectToBarion, reservationEndUserToPaymentUser, reservationModelToPaymentRequest } from 'src/services/api/paymentReservation';\r\nimport ReservationsSection from './sections/ReservationsSection/ReservationsSection';\r\nimport PersonalDetailsSection from './sections/PersonalDetailsSection/PersonalDetailsSection';\r\nimport PaymentSelectSection from './sections/PaymentSelectSection/PaymentSelectSection';\r\nimport UserInvoiceDetailsSection from './sections/UserInvoiceDetailsSection/UserInvoiceDetailsSection';\r\nimport StatementSection from './sections/StatementSection/StatementSection';\r\nimport ValidationMessage from 'src/components/form-components/ValidationMessage/ValidationMessage';\r\nimport { getPaymentNeedWithPrice, getServiceFromReservation, getServicesFromReservations, getSubtotal, isReservationEndUserDirty, isValidSubtotal, transformResponse } from './functions/helperFunctions';\r\nimport { createReservationEndUser, createValidation, createValidator } from './functions/createFunctions';\r\nimport { localStore } from 'src/services/storage';\r\nimport { redirectAfterSendReservation } from 'src/services/api/reservationConfirm';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { IReservationEndProvidedState, ReservationEndProvider } from 'src/contexts/ReservationEndContext';\r\nimport { IPaymentReservationResponse } from 'src/entities/paymentReservation';\r\nimport Popup from 'src/components/Popup/Popup';\r\n\r\nconst messages = defineMessages<string, MessageDescriptor>({\r\n    sendReservation: {\r\n        id: 'sendReservation',\r\n        defaultMessage: 'Foglalás véglegesítése'\r\n    },\r\n    toPaymentSite: {\r\n        id: 'toPaymentSite',\r\n        defaultMessage: 'Tovább a fizetéshez'\r\n    },\r\n    reservationWarningHeader: {\r\n        id: 'reservationWarningHeader',\r\n        defaultMessage: 'Hiba a foglalások beküldésekor'\r\n    },\r\n    reservationWarningDefault: {\r\n        id: 'reservationWarningDefault',\r\n        defaultMessage: 'Általános hiba a foglalás véglegesítéskor'\r\n    },\r\n    reservationWarningCollision: {\r\n        id: 'reservationWarningCollision',\r\n        defaultMessage: 'Foglalás ütközés fizetendő foglalásnál'\r\n    },\r\n    reservationWarningPayment: {\r\n        id: 'reservationWarningPayment',\r\n        defaultMessage: 'Fizetési szolgáltatás hiba'\r\n    }\r\n});\r\n\r\ntype IReservationEndProps =\r\n    WrappedComponentProps\r\n    & {\r\n        index: number;\r\n        isEndStep: boolean;\r\n        onEndStep: () => void;\r\n        reservationOrder: ReservationOrder;\r\n    }\r\n\r\nexport interface ISendReservationResponse {\r\n    ReservedReservations: IReservationResponse[] | null,\r\n    PaymentReservationResponse: IPaymentReservationResponse | null\r\n}\r\n\r\nconst ReservationEnd: React.FC<IReservationEndProps> = ({ index, isEndStep, onEndStep, intl, reservationOrder }) => {\r\n\r\n    const location = useLocation();\r\n    const navigationType = useNavigationType();\r\n    const navigate = useNavigate();\r\n    const isReservationEndRoute = location.pathname === Routes.ReservationEnd;\r\n    const { company, isAuthenticated, actions, user } = useContext(AppContext);\r\n    const { reservationEndUser, reservations, activeReservationIndex,\r\n        actions: { reloadReservations, setActiveReservation, handleUserChange, setReservationEndUser } } = useContext(BookingContext);\r\n    const [selectedPayment, setSelectedPayment] = useState<IPaymentSelectOption | null>(null);\r\n    const [sendCondition, setSendCondition] = useState(false);\r\n    const [isWarningVisible, setIsWarningVisible] = useState(false);\r\n    const [warningText, setWarningText] = useState(messages.reservationWarningDefault);\r\n\r\n    const requiredFieldInfo: IReservationRequiredFieldProps = {\r\n        isAuthenticated,\r\n        requiredFieldInfo: company ? company.RequiredFieldInfo : defaultRequiredInfo\r\n    }\r\n\r\n    const sendReservation = useCallback(async () => {\r\n        const postReservationParams = {\r\n            user: reservationEndUser,\r\n            reservations: reservations.map(reservationModelToRequest),\r\n            shouldSignUp,\r\n            termsAccepted: reservationEndUser.TermsAccepted,\r\n            language: intl.locale,\r\n            setUser: actions.setUser\r\n        }\r\n\r\n        if (!selectedPayment || selectedPayment.PaymentProvider === PaymentProvider.NoProvider || !isValidSubtotal(reservations)) {\r\n            return postReservation(postReservationParams);\r\n        }\r\n        else {\r\n            let postPaymentReservationParams: IPostPaymentReservationParams = {\r\n                paymentReservations: reservations\r\n                    .filter(reservation => {\r\n                        const service = getServiceFromReservation(reservation);\r\n                        return getPaymentNeedWithPrice(company?.PaymentSettings.IsPaymentEnabled, service);\r\n                    })\r\n                    .map(reservationModelToPaymentRequest),\r\n                paymentUser: reservationEndUserToPaymentUser(reservationEndUser, selectedPayment),\r\n                termsAccepted: reservationEndUser.TermsAccepted,\r\n            }\r\n            postReservationParams.reservations = postReservationParams.reservations\r\n                .filter(reservation => !getPaymentNeedWithPrice(company?.PaymentSettings.IsPaymentEnabled, reservation.Service));\r\n\r\n            if (postReservationParams.reservations.length === 0) {\r\n                postPaymentReservationParams = {\r\n                    ...postPaymentReservationParams,\r\n                    user: reservationEndUser,\r\n                    shouldSignUp,\r\n                    setUser: actions.setUser\r\n                }\r\n\r\n                return postPaymentReservations(postPaymentReservationParams);\r\n            }\r\n            else {\r\n                return Promise.all([postReservation(postReservationParams), postPaymentReservations(postPaymentReservationParams)]);\r\n            }\r\n        }\r\n\r\n    }, [sendCondition, selectedPayment, reservations, reservationEndUser]);\r\n\r\n    const afterSend = async (responseAny: any) => {\r\n        setSendCondition(false);\r\n        const response = transformResponse(responseAny);\r\n        actions.setLoading(false);\r\n\r\n        if (!response || (!response.PaymentReservationResponse && !response.ReservedReservations)) {\r\n            showWarningPopup(messages.reservationWarningDefault);\r\n            return;\r\n        }\r\n\r\n        if (response.PaymentReservationResponse) {\r\n            if (response.PaymentReservationResponse.HasCollision) {\r\n                showWarningPopup(messages.reservationWarningCollision);\r\n                return;\r\n            }\r\n\r\n            if (response.PaymentReservationResponse.HasPaymentError) {\r\n                showWarningPopup(messages.reservationWarningPayment);\r\n                return;\r\n            }\r\n        }\r\n\r\n        if (selectedPayment?.PaymentProvider === PaymentProvider.NoProvider || !response.PaymentReservationResponse) {\r\n            const navigationState: IConfirmationLocationState =\r\n            {\r\n                UserEmail: reservationEndUser.Email,\r\n                Reservations: response.ReservedReservations\r\n                    ? populateReservations((response.ReservedReservations), getServicesFromReservations(reservations))\r\n                    : [],\r\n                didSignUp: shouldSignUp\r\n            };\r\n            redirectAfterSend = redirectAfterSendReservation(navigationState, company?.CustomSuccessLink);\r\n\r\n            if (!redirectAfterSend) {\r\n                navigate(Routes.Confirmation, { state: navigationState });\r\n            }\r\n        }\r\n        else {\r\n            if (response.ReservedReservations) {\r\n                localStore.setItem('reservationResponse', JSON.stringify(response.ReservedReservations));\r\n                localStore.setItem('didSignUp', JSON.stringify(shouldSignUp));\r\n            }\r\n\r\n            if (selectedPayment?.PaymentProvider === PaymentProvider.Barion) {\r\n                redirectToBarion(response.PaymentReservationResponse.PaymentUrl);\r\n            }\r\n            else if (selectedPayment?.PaymentProvider === PaymentProvider.Paypal) {\r\n                // TODO FINANCE redirect to PayPal    \r\n            }\r\n        }\r\n    }\r\n\r\n    const onSend = async () => {\r\n        let validation = validator.personalValidator.validate(reservationEndUser).isValid;\r\n\r\n        if (company?.PaymentSettings.IsBillingEnabled && selectedPayment?.NeedsInvoice) {\r\n            validation = validation && (validator.invoiceValidator.validate(reservationEndUser.InvoiceDetails).isValid);\r\n        }\r\n\r\n        const signUpValidation = !shouldSignUp || new FormValidator(signupRules).validate(reservationEndUser).isValid;\r\n        setSubmitted(true);\r\n\r\n        if (!validation || !signUpValidation || submitting) {\r\n            setSendCondition(false);\r\n            return;\r\n        }\r\n\r\n        setSendCondition(true);\r\n        submitting = true;\r\n        actions.setLoading(true);\r\n        redirectAfterSend = false;\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (sendCondition) {\r\n            sendReservation().then(\r\n                afterSend,\r\n                (reason) => {\r\n                    setErrorMessage(reason.errorMessage);\r\n                    actions.setLoading(false);\r\n                    submitting = false;\r\n                    setSendCondition(false);\r\n                }\r\n            );\r\n        }\r\n    }, [sendCondition])\r\n\r\n    const [shouldSignUp, setShouldSignUp] = useState(false);\r\n    const [submitted, setSubmitted] = useState(false);\r\n    const [validator, setValidator] = useState(createValidator(requiredFieldInfo, shouldSignUp, !!company?.TermsAndConditionsLink));\r\n    const [hasOnlinePocket, setHasOnlinePocket] = useState(false);\r\n    const [errorMessage, setErrorMessage] = useState<MessageDescriptor | undefined>();\r\n\r\n    const personalDetailsRef = createRef<IPersonalDetails>();\r\n    const personalValidation = createValidation(validator.personalValidator, reservationEndUser, submitted)\r\n    const invoiceValidation = createValidation(validator.invoiceValidator, reservationEndUser.InvoiceDetails, submitted)\r\n\r\n    const showWarningPopup = (warningTextValue: MessageDescriptor) => {\r\n        setWarningText(warningTextValue);\r\n        setIsWarningVisible(true);\r\n    }\r\n\r\n    const closeWarningPopup = () => {\r\n        setIsWarningVisible(false);\r\n        navigate(Routes.HomeSlash);\r\n    }\r\n\r\n    useEffect(() => {\r\n        if (!isReservationEndUserDirty(reservationEndUser)) {\r\n            setReservationEndUser(createReservationEndUser(user));\r\n        }\r\n        if (personalDetailsRef.current) {\r\n            personalDetailsRef.current.reset();\r\n        }\r\n    }, [user]);\r\n\r\n    useEffect(() => {\r\n        setValidator(createValidator(requiredFieldInfo, shouldSignUp, !!company?.TermsAndConditionsLink));\r\n    }, [isAuthenticated, shouldSignUp]);\r\n\r\n    useEffect(() => {\r\n        if (location && location.state && location.state.reservationModels\r\n            && location.state.reservationEndUser && location.state.selectedPaymentId && !isEndStep) {\r\n            onEndStep();\r\n            setReservationEndUser({ ...location.state.reservationEndUser, PrivacyStatementAccepted: user?.PrivacyStatementAccepted ?? false });\r\n            setSelectedPayment({ Id: location.state.selectedPaymentId, Name: '', NeedsInvoice: false })\r\n            reloadReservations(reservationOrder, location.state.reservationModels);\r\n            location.state.reservationModels = undefined;\r\n            location.state.reservationEndUser = undefined;\r\n            location.state.selectedPaymentId = undefined;\r\n        }\r\n        else if (isReservationEndRoute && !isEndStep) {\r\n            navigate({\r\n                pathname: Routes.Book,\r\n                search: location.search\r\n            });\r\n        }\r\n    }, [isEndStep]);\r\n\r\n    useEffect(() => {\r\n        return () => {\r\n            if (navigationType === NavigationType.Pop && location.pathname === Routes.Book) {\r\n                setActiveReservation(activeReservationIndex);\r\n            }\r\n        };\r\n    }, [location, navigationType])\r\n\r\n    useEffect(() => {\r\n        setErrorMessage(undefined);\r\n    }, [reservationEndUser, shouldSignUp])\r\n    \r\n\r\n    if (!isEndStep || !reservations) {\r\n        return null;\r\n    }\r\n\r\n    const displayedSubtotal = company?.PaymentSettings.IsPaymentEnabled ? getSubtotal(reservations) : null;\r\n    let redirectAfterSend: boolean = false;\r\n    let submitting: boolean = false;\r\n\r\n    const reservationEndContext: IReservationEndProvidedState = {\r\n        hasOnlinePocket,\r\n        selectedPayment,\r\n        shouldSignUp,\r\n        displayedSubtotal,\r\n        actions: {\r\n            setHasOnlinePocket,\r\n            setSelectedPayment,\r\n            setShouldSignUp\r\n        }\r\n    }\r\n\r\n    if (!isReservationEndRoute) {\r\n        return null;\r\n    }\r\n\r\n    return (\r\n        <ReservationEndProvider value={reservationEndContext}>\r\n            <section>\r\n                <StepNumber name={globalMessages[StepType.ReservationEnd]} index={index + 1} touched={true} />\r\n                <div className=\"reservation-end\">\r\n\r\n                    <ReservationsSection />\r\n\r\n                    <PersonalDetailsSection\r\n                        ref={personalDetailsRef}\r\n                        validation={personalValidation}\r\n                        submitted={submitted}\r\n                    />\r\n\r\n                    <PaymentSelectSection />\r\n\r\n                    <UserInvoiceDetailsSection\r\n                        validation={invoiceValidation}\r\n                    />\r\n\r\n                    <StatementSection\r\n                        validation={personalValidation}\r\n                        setDataPolicy={(value) => handleUserChange(value, 'PrivacyStatementAccepted')}\r\n                        setTermsAccepted={(value) => handleUserChange(value, 'TermsAccepted')}\r\n                    />\r\n\r\n                    <div className=\"validation-message-container\">\r\n                        <ValidationMessage message={errorMessage} />\r\n                    </div>\r\n                    <FixedButton\r\n                        className=\"reservation-end__send-button\"\r\n                        caption={(company?.PaymentSettings.PaymentType === PaymentType.NeedPay && hasOnlinePocket &&\r\n                            displayedSubtotal && displayedSubtotal?.Price !== 0) ?\r\n                            messages.toPaymentSite : messages.sendReservation}\r\n                        onClick={onSend}\r\n                        form={'reservation-end-form'}\r\n                    />\r\n                </div>\r\n            </section>\r\n            <Popup closePopup={closeWarningPopup} visible={isWarningVisible}>\r\n                <section className=\"confirmation\">\r\n                    <h2 className=\"confirmation__header\">\r\n                        <FormattedMessage {...messages.reservationWarningHeader} />\r\n                    </h2>\r\n                    <p className='confirmation__warning'>\r\n                        <FormattedMessage {...warningText} />\r\n                    </p>\r\n                </section>\r\n            </Popup>\r\n        </ReservationEndProvider>\r\n    );\r\n}\r\n\r\nexport default injectIntl(ReservationEnd);\r\n","import React from 'react';\r\nimport SecondaryButton from '../../form-components/SecondaryButton/SecondaryButton';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { FormattedMessage, MessageDescriptor } from 'react-intl';\r\nimport { isMessageDescriptor } from 'src/components/form-components/helpers';\r\n\r\ninterface IStepValueProps {\r\n    action: () => void;\r\n    isModifiable: boolean;\r\n    selectedValue?: string | MessageDescriptor;\r\n}\r\n\r\nconst StepValue: React.FunctionComponent<IStepValueProps> = (props) => {\r\n    const { action, selectedValue, isModifiable } = props;\r\n    return <>\r\n        <span className=\"booking-step__step-value\">\r\n            {isMessageDescriptor(selectedValue)\r\n                ? <FormattedMessage {...selectedValue} />\r\n                : selectedValue\r\n            }\r\n        </span>\r\n        {isModifiable &&\r\n            <SecondaryButton\r\n                className=\"booking-step__step-btn\"\r\n                caption={globalMessages.modify}\r\n                onClick={action}\r\n            />\r\n        }\r\n    </>\r\n};\r\n\r\nexport default StepValue;\r\n","import { useReducer } from 'react';\r\nimport { IBookingFlowState } from 'src/models/bookingFlow';\r\nimport { ReservationOrder } from 'src/entities/company';\r\nimport { IReservationModel } from 'src/entities/reservation';\r\nimport { IReservationEndUser, IUserInvoice } from 'src/entities/user';\r\nimport { clearObsoleteStepValues } from 'src/services/bookingFlowUtils';\r\nimport getStepOrder, {\r\n    StepOrderType,\r\n    StepType,\r\n    getMatchingStepOrderType,\r\n    reloadReservationStepOrders,\r\n} from 'src/services/getStepOrder';\r\nimport { initialUserState } from '../UserDetails/UserDetails';\r\nimport { CalendarType } from 'src/entities/calendar';\r\n\r\nexport enum BookingFlowActionTypes {\r\n    SET_RESERVATION_END_USER = 'SET_RESERVATION_END_USER',\r\n    HANDLE_USER_CHANGE = 'HANDLE_USER_CHANGE',\r\n    HANDLE_INVOICE_CHANGE = 'HANDLE_INVOICE_CHANGE',\r\n    RELOAD_RESERVATIONS = 'RELOAD_RESERVATIONS',\r\n    SET_RESERVATIONS = 'SET_RESERVATIONS',\r\n    ADD_RESERVATION = 'ADD_RESERVATION',\r\n    REMOVE_RESERVATION = 'REMOVE_RESERVATION',\r\n    SET_ACTIVE_RESERVATION = 'SET_ACTIVE_RESERVATION',\r\n    SET_AUTO_SELECTED = 'SET_AUTO_SELECTED',\r\n    SET_STEP_ORDER_TYPES = 'SET_STEP_ORDER_TYPES',\r\n    SET_ACTIVE_STEP_INDEX = 'SET_ACTIVE_STEP_INDEX',\r\n}\r\n\r\ninterface ISetReservationEndUserAction {\r\n    type: BookingFlowActionTypes.SET_RESERVATION_END_USER;\r\n    value: IReservationEndUser;\r\n}\r\n\r\ninterface IHandleUserChangeAction {\r\n    type: BookingFlowActionTypes.HANDLE_USER_CHANGE;\r\n    value: { value: unknown; name: keyof IReservationEndUser };\r\n}\r\n\r\ninterface IHandleInvoiceChangeAction {\r\n    type: BookingFlowActionTypes.HANDLE_INVOICE_CHANGE;\r\n    value: { value: unknown; name: keyof IUserInvoice };\r\n}\r\n\r\ninterface IReloadReservationsAction {\r\n    type: BookingFlowActionTypes.RELOAD_RESERVATIONS;\r\n    value: { reservationOrder: ReservationOrder; newReservations: IReservationModel[] };\r\n}\r\n\r\ninterface ISetReservationsAction {\r\n    type: BookingFlowActionTypes.SET_RESERVATIONS;\r\n    value: { stepType: StepType; value: IReservationModel };\r\n}\r\n\r\ninterface IAddReservationAction {\r\n    type: BookingFlowActionTypes.ADD_RESERVATION;\r\n    value: { stepOrderType: StepOrderType };\r\n}\r\n\r\ninterface IRemoveReservationAction {\r\n    type: BookingFlowActionTypes.REMOVE_RESERVATION;\r\n    value: number | undefined;\r\n}\r\n\r\ninterface ISetActiveReservationAction {\r\n    type: BookingFlowActionTypes.SET_ACTIVE_RESERVATION;\r\n    value: number;\r\n}\r\n\r\ninterface ISetAutoSelectedAction {\r\n    type: BookingFlowActionTypes.SET_AUTO_SELECTED;\r\n}\r\n\r\ninterface ISetStepOrderTypesAction {\r\n    type: BookingFlowActionTypes.SET_STEP_ORDER_TYPES;\r\n    value: { stepType: StepType; value: IReservationModel };\r\n}\r\n\r\ninterface ISetActiveStepIndexAction {\r\n    type: BookingFlowActionTypes.SET_ACTIVE_STEP_INDEX;\r\n    value: number;\r\n}\r\n\r\nexport type BookingFlowActions =\r\n    | ISetReservationEndUserAction\r\n    | IHandleUserChangeAction\r\n    | IHandleInvoiceChangeAction\r\n    | IReloadReservationsAction\r\n    | ISetReservationsAction\r\n    | IAddReservationAction\r\n    | IRemoveReservationAction\r\n    | ISetActiveReservationAction\r\n    | ISetAutoSelectedAction\r\n    | ISetStepOrderTypesAction\r\n    | ISetActiveStepIndexAction;\r\n\r\nexport const bookingFlowReducer = (\r\n    state: IBookingFlowState,\r\n    action: BookingFlowActions\r\n): IBookingFlowState => {\r\n    switch (action.type) {\r\n        case BookingFlowActionTypes.SET_RESERVATION_END_USER: {\r\n            return { ...state, reservationEndUser: action.value };\r\n        }\r\n\r\n        case BookingFlowActionTypes.HANDLE_USER_CHANGE: {\r\n            return {\r\n                ...state,\r\n                reservationEndUser: {\r\n                    ...state.reservationEndUser,\r\n                    [action.value.name]: action.value.value,\r\n                },\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.HANDLE_INVOICE_CHANGE: {\r\n            return {\r\n                ...state,\r\n                reservationEndUser: {\r\n                    ...state.reservationEndUser,\r\n                    InvoiceDetails: {\r\n                        ...state.reservationEndUser.InvoiceDetails,\r\n                        [action.value.name]: action.value.value,\r\n                        ...(action.value.name === 'PrivatePerson' && action.value.value\r\n                            ? { TaxNumber: '' }\r\n                            : {}),\r\n                    },\r\n                },\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.RELOAD_RESERVATIONS: {\r\n            const { reservationOrder, newReservations } = action.value;\r\n            const newStepOrderTypes = reloadReservationStepOrders(\r\n                reservationOrder,\r\n                newReservations\r\n            );\r\n            const newActiveReservationIndex = newReservations.length - 1;\r\n            const newActiveStepIndex =\r\n                getStepOrder(newStepOrderTypes[newActiveReservationIndex]).length - 1;\r\n\r\n            return {\r\n                ...state,\r\n                reservations: newReservations,\r\n                stepOrderTypes: newStepOrderTypes,\r\n                activeReservationIndex: newActiveReservationIndex,\r\n                activeStepIndex: newActiveStepIndex,\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.SET_RESERVATIONS: {\r\n            const { activeReservationIndex, reservations, stepOrderTypes } = state;\r\n            const { stepType, value } = action.value;\r\n            const currentReservation = reservations[activeReservationIndex];\r\n            const currentStepOrder = stepOrderTypes[activeReservationIndex];\r\n\r\n            const newReservation = { ...currentReservation, ...value };\r\n            const newReservations = [...reservations];\r\n            newReservations[activeReservationIndex] = clearObsoleteStepValues(\r\n                stepType,\r\n                currentStepOrder,\r\n                newReservation,\r\n                currentReservation\r\n            );\r\n\r\n            return { ...state, reservations: newReservations };\r\n        }\r\n\r\n        case BookingFlowActionTypes.ADD_RESERVATION: {\r\n            return {\r\n                ...state,\r\n                reservations: [\r\n                    ...state.reservations,\r\n                    {\r\n                        searchParams: {\r\n                            CalendarId: 'unset',\r\n                            ServiceId: 'unset',\r\n                            Date: 'unset',\r\n                        },\r\n                    },\r\n                ],\r\n                hasAutoSelected: false,\r\n                activeReservationIndex: state.reservations.length,\r\n                activeStepIndex: 0,\r\n                stepOrderTypes: [...state.stepOrderTypes, action.value.stepOrderType],\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.REMOVE_RESERVATION: {\r\n            const removableIndex = action.value ?? state.activeReservationIndex;\r\n            const removedReservations = state.reservations.filter(\r\n                (_, i: number) => i !== removableIndex\r\n            );\r\n            const removedStepOrderTypes = state.stepOrderTypes.filter(\r\n                (_, i: number) => i !== removableIndex\r\n            );\r\n\r\n            return {\r\n                ...state,\r\n                reservations: removedReservations,\r\n                activeReservationIndex: removedReservations.length - 1,\r\n                stepOrderTypes: removedStepOrderTypes,\r\n                activeStepIndex:\r\n                    getStepOrder(removedStepOrderTypes[removedReservations.length - 1]).length - 1,\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.SET_ACTIVE_RESERVATION: {\r\n            const currentStepOrder = getStepOrder(state.stepOrderTypes[action.value]);\r\n            const newActiveStepIndex =\r\n                (currentStepOrder.indexOf(StepType.Timetable) + 1 ||\r\n                    currentStepOrder.indexOf(StepType.Date) + 1) - 1;\r\n\r\n            return {\r\n                ...state,\r\n                activeReservationIndex: action.value,\r\n                activeStepIndex: newActiveStepIndex,\r\n            };\r\n        }\r\n\r\n        case BookingFlowActionTypes.SET_AUTO_SELECTED: {\r\n            return { ...state, hasAutoSelected: true };\r\n        }\r\n\r\n        case BookingFlowActionTypes.SET_STEP_ORDER_TYPES: {\r\n            const { stepOrderTypes, activeReservationIndex } = state;\r\n            const { stepType, value } = action.value;\r\n            const calendar = value[StepType.Calendar];\r\n            const service = value[StepType.Service] || value[StepType.Timetable]?.service;\r\n            const newStepOrderTypes = [...stepOrderTypes];\r\n            let newStepOrderType = newStepOrderTypes[activeReservationIndex];\r\n\r\n            if (stepType === StepType.Calendar) {\r\n                if (calendar?.Type === CalendarType.Timetable) {\r\n                    newStepOrderType = StepOrderType.Timetable;\r\n                } else if (\r\n                    calendar?.Type === CalendarType.Classic &&\r\n                    (newStepOrderType === StepOrderType.Timetable ||\r\n                        newStepOrderType === StepOrderType.TimetableWithQuestions)\r\n                ) {\r\n                    newStepOrderType = StepOrderType.CalendarFirst;\r\n                }\r\n\r\n                newStepOrderTypes[activeReservationIndex] = newStepOrderType;\r\n            }\r\n\r\n            if ((stepType === StepType.Service || stepType === StepType.Timetable) && service) {\r\n                newStepOrderTypes[activeReservationIndex] = getMatchingStepOrderType(\r\n                    newStepOrderType,\r\n                    service.HasQuestions || service.HasArriveTime\r\n                );\r\n            }\r\n\r\n            return { ...state, stepOrderTypes: newStepOrderTypes };\r\n        }\r\n\r\n        case BookingFlowActionTypes.SET_ACTIVE_STEP_INDEX: {\r\n            return { ...state, activeStepIndex: action.value };\r\n        }\r\n\r\n        default:\r\n            return state;\r\n    }\r\n};\r\n\r\nexport const useBookingFlowReducer = (stepOrderType: StepOrderType) => {\r\n    const [state, dispatch] = useReducer(bookingFlowReducer, {\r\n        stepOrderTypes: [stepOrderType],\r\n        reservations: [\r\n            {\r\n                searchParams: {\r\n                    CalendarId: 'unset',\r\n                    ServiceId: 'unset',\r\n                    Date: 'unset',\r\n                },\r\n            },\r\n        ],\r\n        activeReservationIndex: 0,\r\n        hasAutoSelected: false,\r\n        activeStepIndex: 0,\r\n        reservationEndUser: initialUserState,\r\n        actions: {\r\n            setReservationEndUser: () => undefined,\r\n            handleUserChange: () => undefined,\r\n            handleInvoiceChange: () => undefined,\r\n            reloadReservations: () => undefined,\r\n            setReservationModel: () => undefined,\r\n            addNewReservation: () => undefined,\r\n            removeReservation: () => undefined,\r\n            setActiveReservation: () => undefined,\r\n            autoSelected: () => undefined,\r\n        },\r\n    });\r\n\r\n    const setReservationEndUser = (value: IReservationEndUser) => {\r\n        dispatch({ type: BookingFlowActionTypes.SET_RESERVATION_END_USER, value });\r\n    };\r\n    const handleUserChange = (value: unknown, name: keyof IReservationEndUser) => {\r\n        dispatch({ type: BookingFlowActionTypes.HANDLE_USER_CHANGE, value: { value, name } });\r\n    };\r\n    const handleInvoiceChange = (value: unknown, name: keyof IUserInvoice) => {\r\n        dispatch({ type: BookingFlowActionTypes.HANDLE_INVOICE_CHANGE, value: { value, name } });\r\n    };\r\n    const reloadReservations = (\r\n        reservationOrder: ReservationOrder,\r\n        newReservations: IReservationModel[]\r\n    ) => {\r\n        dispatch({\r\n            type: BookingFlowActionTypes.RELOAD_RESERVATIONS,\r\n            value: { reservationOrder, newReservations },\r\n        });\r\n    };\r\n    const setReservations = (stepType: StepType, value: IReservationModel) => {\r\n        dispatch({\r\n            type: BookingFlowActionTypes.SET_RESERVATIONS,\r\n            value: { stepType, value },\r\n        });\r\n    };\r\n    const addNewReservation = () => {\r\n        dispatch({ type: BookingFlowActionTypes.ADD_RESERVATION, value: { stepOrderType } });\r\n    };\r\n    const removeReservation = (index?: number) => {\r\n        dispatch({ type: BookingFlowActionTypes.REMOVE_RESERVATION, value: index });\r\n    };\r\n    const setActiveReservation = (value: number) => {\r\n        dispatch({ type: BookingFlowActionTypes.SET_ACTIVE_RESERVATION, value });\r\n    };\r\n    const autoSelected = () => {\r\n        dispatch({ type: BookingFlowActionTypes.SET_AUTO_SELECTED });\r\n    };\r\n    const setStepOrderTypes = (stepType: StepType, value: IReservationModel) => {\r\n        dispatch({ type: BookingFlowActionTypes.SET_STEP_ORDER_TYPES, value: { stepType, value } });\r\n    };\r\n    const setReservationModel = (stepType: StepType, value: IReservationModel) => {\r\n        setReservations(stepType, value);\r\n        setStepOrderTypes(stepType, value);\r\n    };\r\n    const setActiveStepIndex = (value: number) => {\r\n        dispatch({ type: BookingFlowActionTypes.SET_ACTIVE_STEP_INDEX, value });\r\n    };\r\n\r\n    return {\r\n        state: {\r\n            ...state,\r\n            actions: {\r\n                setReservationEndUser,\r\n                handleUserChange,\r\n                handleInvoiceChange,\r\n                reloadReservations,\r\n                setReservationModel,\r\n                addNewReservation,\r\n                removeReservation,\r\n                setActiveReservation,\r\n                autoSelected,\r\n                setActiveStepIndex,\r\n            },\r\n        },\r\n    };\r\n};\r\n","import classNames from 'classnames';\r\nimport React from 'react';\r\nimport { MessageDescriptor } from 'react-intl';\r\nimport { IReservationModel } from '../../../entities/reservation';\r\nimport { StepType } from '../../../services/getStepOrder';\r\nimport StepNumber from '../StepNumber/StepNumber';\r\nimport StepValue from '../StepValue/StepValue';\r\nimport JumpToEnd, { PendingJumpType } from '../JumpToEnd/JumpToEnd';\r\nimport { useContext, useState, useEffect } from 'react';\r\nimport { useLocation, useNavigate } from 'react-router-dom';\r\nimport { Routes } from 'src/routes';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { IStepModuleProps } from 'src/models/modules';\r\nimport { motion } from 'framer-motion';\r\nimport { isAppointmentCalendar } from 'src/entities/calendar';\r\nimport { scrollToStep } from 'src/services/scrollerFunctions';\r\nimport { BookingContext, IBookingFlowProvidedState } from 'src/contexts/BookingFlowContext';\r\n\r\nexport interface IStepState {\r\n    isModifiable: boolean;\r\n}\r\n\r\nexport interface IStepProps {\r\n    isActive: boolean;\r\n    isCompleted: boolean;\r\n    isLast: boolean;\r\n    isProgressBarHidden?: boolean;\r\n    name: MessageDescriptor;\r\n    content: React.FC<IStepModuleProps>;\r\n    step: StepType;\r\n    stepIndex: number;\r\n    nextHandler: () => void;\r\n    jumpToEndHandler: () => void;\r\n    modifyHandler: (stepIndex: number) => void;\r\n}\r\n\r\nexport const getStepSelectedValue = (step: StepType, reservation: IReservationModel = {}): string | MessageDescriptor => {\r\n    if (step === StepType.Calendar && !reservation[step]) {\r\n        return globalMessages.whichever\r\n    }\r\n    const currentStep = step as keyof Omit<IReservationModel, 'searchParams'>;\r\n    return reservation[currentStep] && reservation[currentStep]?.displayValue || '';\r\n}\r\n\r\nconst isEverySearchParamSet = (searchParams: IReservationModel['searchParams']) =>\r\n    searchParams && !Object.values(searchParams).includes('unset')\r\n\r\nconst variants: React.ComponentProps<typeof motion.div>['variants'] = {\r\n    visible: { opacity: 1, height: 'auto', overflow: 'hidden', transitionEnd: { overflow: 'visible' }, transition: { duration: 1 } },\r\n    hidden: { opacity: 0, height: 0, overflow: 'hidden', transitionEnd: { overflow: 'hidden' }, transition: { duration: 0.5 } },\r\n}\r\n\r\nconst Navigator: React.FunctionComponent<{ isOpen: boolean, index: number }> = ({ isOpen, index }) => {\r\n    useEffect(() => {\r\n        if (isOpen && index > 0) {\r\n            setTimeout(() => {\r\n                scrollToStep(index);\r\n            }, 0);\r\n        }\r\n    }, [isOpen, index])\r\n\r\n    return null;\r\n}\r\n\r\nconst Step: React.FunctionComponent<IStepProps> = (\r\n    { content, name, nextHandler, isActive, step, modifyHandler, isCompleted, stepIndex, isLast, isProgressBarHidden, jumpToEndHandler }\r\n) => {\r\n\r\n    const context: IBookingFlowProvidedState = useContext(BookingContext);\r\n    const location = useLocation();\r\n    const navigate = useNavigate();\r\n    const isHomeSlashRoute = location.pathname === Routes.HomeSlash;\r\n\r\n    const [isModifiable, setIsModifiable] = useState(true);\r\n\r\n    const [isLoading, setIsLoading] = useState(false);\r\n\r\n    const reservationData = context.reservations[context.activeReservationIndex] || {\r\n        searchParams: {\r\n            CalendarId: 'unset',\r\n            ServiceId: 'unset',\r\n            Date: 'unset'\r\n        }\r\n    };\r\n\r\n    const bookingStepClasses = classNames(\r\n        'booking-step',\r\n        { 'booking-step--touched': isActive || isCompleted },\r\n        { 'booking-step--progress-bar-hidden': isProgressBarHidden },\r\n        {\r\n            'booking-step--full-width':\r\n                step === StepType.Timetable\r\n                || step === StepType.Date && isAppointmentCalendar(reservationData[StepType.Calendar])\r\n        },\r\n        { 'booking-step--last': isLast }\r\n    )\r\n\r\n    const selectedValue = getStepSelectedValue(step, reservationData);\r\n    const showReservationsNumber = context.reservations.length > 1 && isLast;\r\n\r\n    const onCompleteHandler = (value: IReservationModel, hasSkipped?: boolean) => {\r\n        if (!hasSkipped && isHomeSlashRoute) {\r\n            navigate({\r\n                pathname: Routes.Book,\r\n                search: location.search\r\n            })\r\n        }\r\n\r\n        context.actions.setReservationModel(step, value);\r\n        if (!context.hasAutoSelected && isEverySearchParamSet(value.searchParams)) {\r\n            context.actions.autoSelected();\r\n        }\r\n        setIsModifiable(!hasSkipped)\r\n        nextHandler();\r\n    }\r\n\r\n    const isOpen = isActive && !isLoading;\r\n\r\n    return (\r\n        <article className={bookingStepClasses}>\r\n            <Navigator index={stepIndex} isOpen={isOpen} />\r\n            {isProgressBarHidden || <StepNumber name={name} index={stepIndex + 1} touched={isActive || isCompleted} isLoading={isActive && isLoading} />}\r\n            <div className={classNames('booking-step__body', { 'booking-step__body--open': isOpen })}>\r\n                <motion.div\r\n                    initial={isOpen ? 'visible' : 'hidden'}\r\n                    variants={variants}\r\n                    animate={isOpen ? 'visible' : 'hidden'}\r\n                >\r\n                    <div className=\"booking-step__module-wrapper\">\r\n                        {content({\r\n                            isActive,\r\n                            isFirst: stepIndex === 0,\r\n                            data: reservationData,\r\n                            onComplete: onCompleteHandler,\r\n                            onIsModifiable: setIsModifiable,\r\n                            onLoadingChanged: setIsLoading\r\n                        })}\r\n                    </div>\r\n                </motion.div>\r\n                {(isCompleted && !isActive || showReservationsNumber) &&\r\n                    <motion.div\r\n                        initial={{ opacity: 0 }}\r\n                        animate={{ opacity: 1 }}\r\n                        transition={{ delay: 0.5, duration: 0.3 }}\r\n                        className=\"booking-step__value\"\r\n                    >\r\n                        {showReservationsNumber\r\n                            ? <JumpToEnd type={PendingJumpType.Bottom} action={jumpToEndHandler} reservationCount={context.reservations.length - 1} />\r\n                            : <StepValue\r\n                                selectedValue={selectedValue}\r\n                                action={() => modifyHandler(stepIndex)}\r\n                                isModifiable={isModifiable}\r\n                            />\r\n                        }\r\n                    </motion.div>\r\n                }\r\n            </div>\r\n        </article>\r\n    );\r\n}\r\n\r\nexport default Step;\r\n","import React, { useContext } from 'react';\r\nimport { IStepModuleProps, ModuleSearchParam } from '../../../models/modules';\r\nimport { ISearchParams } from 'src/entities/reservation';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nexport interface ISearchParamsOptions<T> {\r\n    paramName: ModuleSearchParam;\r\n}\r\n\r\nconst withSearchParams = <P extends IStepModuleProps, T extends object>(\r\n    WrappedComponent: React.ComponentType<P>,\r\n    options: ISearchParamsOptions<T>\r\n) => {\r\n    const WithSearchParams: React.FC<P> = (props) => {\r\n        const context = useContext(BookingContext);\r\n        const searchParam = !context.hasAutoSelected\r\n            ? new URLSearchParams(window.location.search).get(options.paramName)\r\n            : null;\r\n\r\n        const searchParams = props.data.searchParams\r\n            ? { ...props.data.searchParams, [options.paramName]: searchParam }\r\n            : { [options.paramName]: searchParam };\r\n\r\n        const extendedData = { ...props.data, searchParams };\r\n\r\n        const newProps = { ...props, data: extendedData };\r\n\r\n        return <WrappedComponent {...newProps} />;\r\n    };\r\n\r\n    return WithSearchParams;\r\n};\r\n\r\nexport const getDateParam = (searchParams?: ISearchParams): string | undefined => {\r\n    return searchParams?.Date || undefined;\r\n};\r\n\r\nexport default withSearchParams;\r\n","import React from 'react';\r\nimport CustomScroll from 'react-custom-scroll';\r\nimport { FormattedDate, FormattedMessage } from 'react-intl';\r\nimport { ICalendar } from 'src/entities/calendar';\r\nimport PrimaryButton from '../form-components/PrimaryButton/PrimaryButton';\r\nimport SecondaryButton from '../form-components/SecondaryButton/SecondaryButton';\r\nimport { IPopupable } from '../Popup/Popup';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { useStyleLinks } from 'src/hooks';\r\nimport { useRef } from 'react';\r\n\r\ninterface ICalendarDescriptionProps extends IPopupable {\r\n    calendar: ICalendar;\r\n    firstFreeSlot: Date | null;\r\n    startReservation: () => void;\r\n}\r\n\r\nconst CalendarDescription: React.FunctionComponent<ICalendarDescriptionProps> = props => {\r\n    const { Description } = props.calendar;\r\n    const { firstFreeSlot, closePopup, startReservation } = props;\r\n    const handleOk = () => {\r\n        closePopup?.();\r\n        startReservation();\r\n    }\r\n\r\n    const bodyRef = useRef<HTMLDivElement>(null);\r\n    useStyleLinks(bodyRef);\r\n\r\n    return (\r\n        <section className=\"calendar-description\">\r\n            {firstFreeSlot &&\r\n                <div className=\"calendar-description__details\">\r\n                    <FormattedMessage {...globalMessages.firstFreeSlot} />{': '}\r\n                    <FormattedDate value={firstFreeSlot} />\r\n                </div>\r\n            }\r\n            {Description &&\r\n                <CustomScroll>\r\n                    <div ref={bodyRef} className=\"calendar-description__body\" dangerouslySetInnerHTML={{ __html: Description }} />\r\n                </CustomScroll>\r\n            }\r\n            <div className=\"calendar-description__buttons\">\r\n                {closePopup && <SecondaryButton className=\"calendar-description__button calendar-description__cancel\" onClick={closePopup} caption={globalMessages.close} />}\r\n                <PrimaryButton className=\"calendar-description__button\" onClick={handleOk} caption={globalMessages.firstStepAction} />\r\n            </div>\r\n        </section>\r\n    );\r\n}\r\n\r\nexport default CalendarDescription;","import React from 'react';\r\nimport { FormattedDate, FormattedMessage } from 'react-intl';\r\nimport { ICalendarBase, ICalendar, isRandomCalendar } from '../../../../../entities/calendar';\r\nimport { getCalendarFirstFreeSlot } from '../../../../../services/api/calendar';\r\nimport CalendarDescription from '../../../../CalendarDescription/CalendarDescription';\r\nimport Image from '../../../../Image/Image';\r\nimport Popup from '../../../../Popup/Popup';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { useContext, useCallback, useState } from 'react';\r\nimport { useSubscription } from 'src/hooks';\r\nimport { getServiceFirstFreeSlot } from 'src/services/api/service';\r\nimport { IServiceDetails } from 'src/entities/service';\r\nimport { Bone, TextSkeleton, ParagraphSkeleton } from 'src/components/Placeholder/Placeholder';\r\nimport { ButtonSkeleton } from 'src/components/form-components/Button/Button';\r\nimport { AppContext, IAppProvidedState } from 'src/contexts/AppContext';\r\n\r\ninterface ICalendarItemProps {\r\n    calendar: ICalendar;\r\n    service?: IServiceDetails;\r\n    button: React.ReactElement;\r\n    selectCalendar: (calendar: ICalendarBase) => void;\r\n    withLogoSpace: boolean;\r\n}\r\n\r\nconst CalendarItem: React.FunctionComponent<ICalendarItemProps> = ({ calendar, service, withLogoSpace, button, selectCalendar }) => {\r\n    const [isLongDescriptionVisible, setIsLongDescriptionVisible] = useState(false);\r\n\r\n    const { company } = useContext<IAppProvidedState>(AppContext);\r\n\r\n    const fetchFirstFreeSlot = useCallback(async () => {\r\n        if (!company?.ShouldDisplayFirstTime) {\r\n            return;\r\n        }\r\n\r\n        if (isRandomCalendar(calendar.Id)) {\r\n            if (!service) {\r\n                return;\r\n            }\r\n            return getServiceFirstFreeSlot(service.Id);\r\n        }\r\n\r\n        if (button.props.isFirstStep) {\r\n            return getCalendarFirstFreeSlot(calendar.Id);\r\n        }\r\n\r\n        return getCalendarFirstFreeSlot(calendar.Id, service?.Id);\r\n    }, [calendar.Id, company?.ShouldDisplayFirstTime]);\r\n\r\n    const [firstFreeSlot, isLoading] = useSubscription(fetchFirstFreeSlot);\r\n\r\n    return (\r\n        <div className=\"calendar-item\">\r\n            {calendar.PictureLink\r\n                ? <Image\r\n                    className=\"calendar-item__calendar-logo\"\r\n                    src={calendar.PictureLink}\r\n                />\r\n                : withLogoSpace && <div className=\"calendar-item__calendar-logo\" />\r\n            }\r\n            <header className=\"calendar-item__header\">\r\n                <h3 className=\"calendar-item__name\">\r\n                    {isRandomCalendar(calendar.Id) ?\r\n                        <FormattedMessage {...globalMessages.whichever} />\r\n                        : calendar.Name}\r\n                </h3>\r\n                <div className=\"calendar-item__first-free-slot\">\r\n                    {(firstFreeSlot || isLoading)\r\n                        && <>\r\n                            <span className=\"calendar-item__first-free-slot-text\">\r\n                                <FormattedMessage {...globalMessages.firstFreeSlot} />\r\n                            </span>\r\n                            {isLoading\r\n                                ? <TextSkeleton><FormattedDate value={0} /></TextSkeleton>\r\n                                : <time className=\"calendar-item__first-free-slot-text calendar-item__first-free-slot-value\">\r\n                                    <FormattedDate\r\n                                        value={firstFreeSlot!}\r\n                                        year=\"numeric\"\r\n                                        month=\"numeric\"\r\n                                        day=\"numeric\"\r\n                                        hour=\"numeric\"\r\n                                        minute=\"numeric\" />\r\n                                </time>}\r\n                        </>\r\n                    }\r\n                </div>\r\n            </header>\r\n            {button}\r\n            {\r\n                (calendar.ShortDescription || calendar.Description) &&\r\n                <div className=\"calendar-item__description\">\r\n                    {calendar.ShortDescription &&\r\n                        <p className=\"calendar-item__description-text p--light-text\">{calendar.ShortDescription}</p>\r\n                    }\r\n                    {calendar.Description &&\r\n                        <>\r\n                            <button className=\"calendar-item__more-description link\" onClick={() => setIsLongDescriptionVisible(true)}>\r\n                                <FormattedMessage {...globalMessages.readMore} />\r\n                            </button>\r\n                            <Popup\r\n                                visible={isLongDescriptionVisible}\r\n                                closePopup={() => setIsLongDescriptionVisible(false)}\r\n                                title={calendar.Name}>\r\n                                <CalendarDescription\r\n                                    calendar={calendar}\r\n                                    firstFreeSlot={firstFreeSlot ? new Date(firstFreeSlot) : null}\r\n                                    startReservation={() => selectCalendar(calendar)} />\r\n                            </Popup>\r\n                        </>\r\n                    }\r\n                </div>\r\n            }\r\n        </div >\r\n    );\r\n}\r\n\r\nexport const CalendarItemSkeleton = () =>\r\n    <div className=\"calendar-item\" role=\"presentation\">\r\n        <Bone className=\"calendar-item__calendar-logo\" />\r\n        <div className=\"calendar-item__header\">\r\n            <div className=\"calendar-item__name\">\r\n                <TextSkeleton>\r\n                    {'Skeleton calendar'}\r\n                </TextSkeleton>\r\n            </div>\r\n            <div className=\"calendar-item__first-free-slot\">\r\n                <TextSkeleton><FormattedMessage {...globalMessages.firstFreeSlot} /><FormattedDate value={0} /></TextSkeleton>\r\n            </div>\r\n        </div>\r\n        <ButtonSkeleton\r\n            className=\"calendar-item__select-button\"\r\n            caption={globalMessages.firstStepAction}\r\n        />\r\n        <div className=\"calendar-item__description\">\r\n            <ParagraphSkeleton lines={2} />\r\n        </div>\r\n    </div>\r\n\r\nexport default CalendarItem;","import React from 'react';\r\nimport SecondaryButton from 'src/components/form-components/SecondaryButton/SecondaryButton';\r\nimport PrimaryButton from 'src/components/form-components/PrimaryButton/PrimaryButton';\r\nimport { defineMessages } from 'react-intl';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { IButtonProps } from 'src/components/form-components/Button/Button';\r\n\r\nconst messages = defineMessages({\r\n    keepSelected: {\r\n        id: 'keepSelected',\r\n        defaultMessage: 'Maradjon'\r\n    }\r\n})\r\n\r\nconst getSelectCaption = (isFirstStep?: boolean) =>\r\n    isFirstStep ? globalMessages.firstStepAction : globalMessages.next\r\n\r\ninterface ISelectButtonProps extends Omit<IButtonProps, 'caption'> {\r\n    selected: boolean;\r\n    isFirstStep: boolean;\r\n}\r\n\r\nconst SelectButton: React.FC<ISelectButtonProps> = ({ selected, isFirstStep, onClick }) =>\r\n    !selected\r\n        ? <PrimaryButton\r\n            className=\"calendar-item__select-button\"\r\n            caption={getSelectCaption(isFirstStep)}\r\n            onClick={onClick}\r\n        />\r\n        : <SecondaryButton\r\n            className=\"calendar-item__select-button\"\r\n            caption={messages.keepSelected}\r\n            onClick={onClick}\r\n        />\r\n\r\nexport default SelectButton","import React, { useEffect, useRef, useState } from 'react';\r\nimport { IReservationModel } from 'src/entities/reservation';\r\nimport { ICalendarBase, ICalendar, randomCalendarItem } from '../../../../entities/calendar';\r\nimport { IStepModuleProps, ModuleSearchParam } from '../../../../models/modules';\r\nimport { getCalendars, getCalendarsByService } from '../../../../services/api/calendar';\r\nimport makeCancelable, { ICancelablePromise } from '../../../../services/cancelablePromise';\r\nimport { StepType } from '../../../../services/getStepOrder';\r\nimport withSearchParams, { ISearchParamsOptions } from '../withSearchParams';\r\nimport CalendarItem, { CalendarItemSkeleton } from './CalendarItem/CalendarItem';\r\nimport AvailabilityWarning from 'src/components/AvailabilityWarning';\r\nimport { isSame } from 'src/entities/common';\r\nimport SelectButton from '../SelectButton';\r\n\r\ninterface ICalendarSelectProps extends IStepModuleProps {\r\n    shouldGetByService?: boolean;\r\n    hasRandomCalendar?: boolean;\r\n    canUserSelectCalendar?: boolean;\r\n}\r\n\r\nconst searchParamsOptions: ISearchParamsOptions<ICalendarBase> = {\r\n    paramName: ModuleSearchParam.CalendarId,\r\n};\r\n\r\nexport const CalendarSelect: React.FC<ICalendarSelectProps> = ({\r\n    isActive,\r\n    isFirst,\r\n    data,\r\n    shouldGetByService,\r\n    hasRandomCalendar,\r\n    canUserSelectCalendar,\r\n    onIsModifiable,\r\n    onLoadingChanged,\r\n    onComplete = () =>\r\n        // eslint-disable-next-line no-console\r\n        console.warn(\r\n            'CalendarSelect module onComplete event is not set, please attach an event handler'\r\n        ),\r\n}) => {\r\n    const prevProps = useRef({ data });\r\n    const calendarsSubscription = useRef<ICancelablePromise<ICalendar[]>>();\r\n    const service = data[StepType.Service];\r\n    const selectedCalendar = data[StepType.Calendar] as ICalendar | undefined;\r\n    const [calendars, setCalendars] = useState<ICalendar[]>([]);\r\n    const [hasLoaded, setHasLoaded] = useState(false);\r\n    const [prevHasLoaded, setPrevHasLoaded] = useState(false);\r\n    const [shouldPreSelect, setShouldPreSelect] = useState(false);\r\n    const [shouldCheckSelectedCalendar, setShouldCheckSelectedCalendar] = useState(false);\r\n    const [shouldFetchWhenUpdate, setShouldFetchWhenUpdate] = useState(false);\r\n    const hasAnyLogo = calendars.some((calendar) => calendar.PictureLink);\r\n\r\n    const selectCalendar = (calendar: ICalendar, hasSkipped?: boolean) => {\r\n        if (isActive) {\r\n            onComplete(createSelectedCalendar(calendar), !canUserSelectCalendar || hasSkipped);\r\n        }\r\n    };\r\n\r\n    const checkSelectedCalendar = () => {\r\n        if (!data[StepType.Calendar]) {\r\n            const searchCalendar = getSearchCalendar();\r\n            if (searchCalendar) {\r\n                const calendar = calendars.find((c) => c.Id === +searchCalendar);\r\n                if (calendar) {\r\n                    selectCalendar(calendar);\r\n                } else {\r\n                    setCalendars([]);\r\n                }\r\n            }\r\n        }\r\n    };\r\n\r\n    const fetchCalendars = async () => {\r\n        setHasLoaded(false);\r\n        if (shouldGetByService && service) {\r\n            calendarsSubscription.current = makeCancelable<ICalendar[]>(getCalendarsByService(service.Id));\r\n        } else {\r\n            calendarsSubscription.current = makeCancelable<ICalendar[]>(getCalendars());\r\n        }\r\n\r\n        calendarsSubscription.current.promise\r\n            .then((calendarList) => {\r\n                if (hasRandomCalendar && calendarList.length > 1) {\r\n                    calendarList = [randomCalendarItem, ...calendarList];\r\n                }\r\n                setCalendars(calendarList);\r\n                setHasLoaded(true);\r\n                setShouldCheckSelectedCalendar(true);\r\n            })\r\n            .catch(() => null);\r\n    };\r\n\r\n    const createSelectedCalendar = (calendar: ICalendar): IReservationModel => {\r\n        if (calendar.Id <= 0) {\r\n            return {\r\n                ...data,\r\n                [StepType.Calendar]: undefined,\r\n            };\r\n        }\r\n        return {\r\n            ...data,\r\n            [StepType.Calendar]: {\r\n                ...calendar,\r\n                displayValue: calendar.Name,\r\n            },\r\n        };\r\n    };\r\n\r\n    const preSelect = () => {\r\n        if (isActive && hasLoaded && hasSingleEmptyCalendar()) {\r\n            selectCalendar(calendars[0], true);\r\n        }\r\n    };\r\n\r\n    const isCalendarEmpty = (calendar: ICalendar) => {\r\n        return !calendar.PictureLink && !calendar.ShortDescription && !calendar.Description;\r\n    };\r\n\r\n    const hasSingleEmptyCalendar = () => {\r\n        return calendars.length === 1 && isCalendarEmpty(calendars[0]);\r\n    };\r\n\r\n    const getSearchCalendar = () => {\r\n        const searchCalendar = data?.searchParams?.CalendarId;\r\n        return searchCalendar ?? null;\r\n    };\r\n\r\n    const handleCanUserSelectCalendar = (): boolean => {\r\n        if (!canUserSelectCalendar) {\r\n            if (onIsModifiable) {\r\n                onIsModifiable(false);\r\n            }\r\n            const searchCalendar = getSearchCalendar();\r\n            if (!searchCalendar) {\r\n                setHasLoaded(true);\r\n                return true;\r\n            }\r\n        }\r\n\r\n        return false;\r\n    };\r\n\r\n    useEffect(() => {\r\n        if (handleCanUserSelectCalendar()) {\r\n          return;\r\n        }\r\n        if (!isActive) {\r\n          setShouldFetchWhenUpdate(true);\r\n            return;\r\n        }\r\n        fetchCalendars();\r\n\r\n        return () => {\r\n            calendarsSubscription.current?.cancel();\r\n        };\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        if (shouldFetchWhenUpdate) {\r\n            fetchCalendars();\r\n            setShouldFetchWhenUpdate(false);\r\n        }\r\n\r\n        const serviceChanged = !isSame(\r\n            prevProps.current.data[StepType.Service],\r\n            data[StepType.Service]\r\n        );\r\n        if (shouldGetByService && serviceChanged) {\r\n            if (handleCanUserSelectCalendar()) {\r\n                prevProps.current = { data };\r\n                return;\r\n            }\r\n            fetchCalendars().then(() => setShouldPreSelect(true));\r\n        } else {\r\n            if (canUserSelectCalendar && onIsModifiable && data[StepType.Service]) {\r\n                onIsModifiable(!hasSingleEmptyCalendar());\r\n            }\r\n\r\n            setShouldPreSelect(true);\r\n        }\r\n\r\n        if (prevHasLoaded !== hasLoaded) {\r\n            onLoadingChanged?.(!hasLoaded);\r\n        }\r\n\r\n        prevProps.current = { data };\r\n        setPrevHasLoaded(hasLoaded);\r\n    }, [shouldFetchWhenUpdate, data, shouldGetByService, canUserSelectCalendar, hasLoaded]);\r\n\r\n    useEffect(() => {\r\n        if (shouldCheckSelectedCalendar) {\r\n            checkSelectedCalendar();\r\n            setShouldCheckSelectedCalendar(false);\r\n        }\r\n    }, [shouldCheckSelectedCalendar]);\r\n\r\n    useEffect(() => {\r\n        if (shouldPreSelect) {\r\n            preSelect();\r\n            setShouldPreSelect(false);\r\n        }\r\n    }, [shouldPreSelect])\r\n    \r\n\r\n    if (!hasLoaded) {\r\n        return (\r\n            <>\r\n                <CalendarItemSkeleton />\r\n                <CalendarItemSkeleton />\r\n            </>\r\n        );\r\n    }\r\n\r\n    if (!calendars.length) {\r\n        return <AvailabilityWarning type=\"bookingNotAvailable\" />;\r\n    }\r\n\r\n    return (\r\n        <section className=\"calendar-select\">\r\n            {calendars.map((calendar) => (\r\n                <CalendarItem\r\n                    key={calendar.Id}\r\n                    calendar={calendar}\r\n                    service={service}\r\n                    button={\r\n                        <SelectButton\r\n                            isFirstStep={!!isFirst}\r\n                            onClick={() => selectCalendar(calendar)}\r\n                            selected={selectedCalendar?.Id === calendar.Id}\r\n                        />\r\n                    }\r\n                    selectCalendar={selectCalendar}\r\n                    withLogoSpace={hasAnyLogo}\r\n                />\r\n            ))}\r\n        </section>\r\n    );\r\n};\r\n\r\nexport default withSearchParams<ICalendarSelectProps, ICalendarBase>(\r\n    CalendarSelect,\r\n    searchParamsOptions\r\n);\r\n","import React, { useEffect, useState } from 'react';\r\nimport { IStepModuleProps } from 'src/models/modules';\r\nimport { StepValue, IReservationModel } from 'src/entities/reservation';\r\nimport { StepType } from 'src/services/getStepOrder';\r\n\r\ninterface IMockModuleComponentProps extends IStepModuleProps {\r\n    name: StepType;\r\n}\r\n\r\nconst MockModule: React.FC<IMockModuleComponentProps> = ({ data, name, onComplete }) => {\r\n    const [value, setValue] = useState('');\r\n    const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n        setValue(event.target.value);\r\n    };\r\n\r\n    useEffect(() => {\r\n        const stepData: StepValue<object> | undefined =\r\n            data[name as keyof Omit<IReservationModel, 'searchParams'>];\r\n        setValue(stepData ? stepData.displayValue : '');\r\n    }, []);\r\n\r\n    return (\r\n        <div style={{ width: '100%' }}>\r\n            <p>{name} component</p>\r\n            <input type=\"text\" value={value} onChange={handleInputChange} />\r\n            <button\r\n                onClick={() =>\r\n                    onComplete({\r\n                        [name]: {\r\n                            Id: 1,\r\n                            Type: 1,\r\n                            Name: 'Calendar 1',\r\n                            displayValue: value,\r\n                        },\r\n                    })\r\n                }\r\n            >\r\n                Next\r\n            </button>\r\n            <div>\r\n                <p>\r\n                    Lorem Ipsum egy egyszerû szövegrészlete, szövegutánzata a betûszedõ és\r\n                    nyomdaiparnak. A Lorem Ipsum az 1500-as évek óta standard szövegrészletként\r\n                    szolgált az iparban; mikor egy ismeretlen nyomdász összeállította a\r\n                    betûkészletét és egy példa-könyvet vagy szöveget nyomott papírra, ezt használta.\r\n                    Nem csak 5 évszázadot élt túl, de az elektronikus betûkészleteknél is\r\n                    változatlanul megmaradt. Az 1960-as években népszerûsítették a Lorem Ipsum\r\n                    részleteket magukbafoglaló Letraset lapokkal, és legutóbb softwarekkel mint\r\n                    például az Aldus Pagemaker.\r\n                </p>\r\n            </div>\r\n        </div>\r\n    );\r\n};\r\n\r\nexport default MockModule;\r\n","import React from 'react';\r\nimport { FormattedMessage } from 'react-intl';\r\nimport Popup from 'src/components/Popup/Popup';\r\nimport ServiceDescription from 'src/components/ServiceDescription/ServiceDescription';\r\nimport { calculateGrossPrice, IService, IServiceDetails } from '../../../../../entities/service';\r\nimport Image from '../../../../Image/Image';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport FormattedPrice from '../FormattedPrice/FormattedPrice';\r\nimport { useState } from 'react';\r\nimport { CalendarItemSkeleton } from '../../CalendarSelect/CalendarItem/CalendarItem';\r\n\r\ninterface IServiceItemProps {\r\n    service: IServiceDetails;\r\n    selectService: (service: IService) => void;\r\n    button: React.ReactElement;\r\n    withLogoSpace: boolean;\r\n    needsPayment?: boolean;\r\n}\r\n\r\nconst ServiceItem: React.FC<IServiceItemProps> = ({ service, selectService, button, withLogoSpace, needsPayment }) => {\r\n\r\n    const [isLongDescriptionShown, setIsLongDescriptionShown] = useState(false);\r\n\r\n    const { PictureLink, Name, IsDurationVisible, DurationToUser, ShortDescription, Description, DisplayedPrice, DisplayedCurrency, Price, Currency, PaymentMethod, VatPercentage } = service;\r\n\r\n    return (\r\n        <div className=\"service-item\" id={`service-${service.Id}`}>\r\n            {PictureLink ?\r\n                <Image\r\n                    className=\"service-item__service-logo\"\r\n                    src={PictureLink}\r\n                />\r\n                : withLogoSpace && <div className=\"service-item__service-logo\" />\r\n            }\r\n            <header className=\"service-item__header\">\r\n                <h3 className=\"service-item__name\">{Name}</h3>\r\n                <div className=\"service-item__details\">\r\n                    <span >\r\n                        {IsDurationVisible &&\r\n                            <span className=\"service-item__detail\">\r\n                                <FormattedMessage {...globalMessages.minute} values={{ n: DurationToUser }} />\r\n                            </span>\r\n                        }\r\n                        {DisplayedPrice &&\r\n                            <span className=\"service-item__detail\">\r\n                                <FormattedPrice value={DisplayedPrice} currency={DisplayedCurrency} />\r\n                            </span>\r\n                        }\r\n                        {needsPayment &&\r\n                            <span className=\"service-item__price\">\r\n                                <span className=\"service-item__online-payable\">\r\n                                    <FormattedMessage {...globalMessages.toBePaid} />\r\n                                </span>\r\n                                <span className=\"service-item__online-price\">\r\n                                    <FormattedPrice value={calculateGrossPrice({ Price, Currency, PaymentMethod, VatPercentage })} currency={Currency} />\r\n                                </span>\r\n                            </span>\r\n                        }\r\n                    </span>\r\n                </div>\r\n            </header>\r\n            {button}\r\n            {(ShortDescription || Description) &&\r\n                <div className=\"service-item__description\">\r\n                    {ShortDescription &&\r\n                        <p className=\"service-item__description-text p--light-text\">\r\n                            {ShortDescription}\r\n                        </p>\r\n                    }\r\n                    {Description &&\r\n                        <>\r\n                            <button onClick={() => setIsLongDescriptionShown(true)} className=\"service-item__more-description link\">\r\n                                <FormattedMessage {...globalMessages.readMore} />\r\n                            </button>\r\n                            <Popup\r\n                                visible={isLongDescriptionShown}\r\n                                closePopup={() => setIsLongDescriptionShown(false)}\r\n                                title={service.Name}>\r\n                                <ServiceDescription\r\n                                    service={service}\r\n                                    startReservation={() => selectService(service)}\r\n                                    needsPayment={needsPayment}\r\n                                />\r\n                            </Popup>\r\n                        </>\r\n                    }\r\n                </div>\r\n            }\r\n        </div>\r\n    );\r\n}\r\n\r\nexport const ServiceItemSkeleton = CalendarItemSkeleton;\r\n\r\nexport default ServiceItem;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { IStepModuleProps, ModuleSearchParam } from '../../../../models/modules';\r\nimport { IReservationModel } from '../../../../entities/reservation';\r\nimport { IService, IServiceDetails } from '../../../../entities/service';\r\nimport { getServices, getServicesByCalendar } from '../../../../services/api/service';\r\nimport makeCancelable, { ICancelablePromise } from '../../../../services/cancelablePromise';\r\nimport { StepType } from '../../../../services/getStepOrder';\r\nimport withSearchParams, { ISearchParamsOptions } from '../withSearchParams';\r\nimport ServiceItem, { ServiceItemSkeleton } from './ServiceItem/ServiceItem';\r\nimport AvailabilityWarning from 'src/components/AvailabilityWarning';\r\nimport { isSame } from 'src/entities/common';\r\nimport SelectButton from '../SelectButton';\r\nimport { getPaymentNeed } from '../../ReservationEnd/functions/helperFunctions';\r\n\r\ninterface IServiceSelectProps extends IStepModuleProps {\r\n    shouldGetByCalendar?: boolean;\r\n    isPaymentEnabled?: boolean;\r\n}\r\n\r\nconst searchParamsOptions: ISearchParamsOptions<IService> = {\r\n    paramName: ModuleSearchParam.ServiceId,\r\n};\r\n\r\nexport const ServiceSelect: React.FC<IServiceSelectProps> = ({\r\n    shouldGetByCalendar,\r\n    isPaymentEnabled,\r\n    data,\r\n    isActive,\r\n    isFirst,\r\n    onComplete = () =>\r\n        // eslint-disable-next-line no-console\r\n        console.warn(\r\n            'ServiceSelect module onComplete event is not set, please attach an event handler'\r\n        ),\r\n    onIsModifiable,\r\n    onLoadingChanged,\r\n}) => {\r\n    const servicesSubscription = useRef<ICancelablePromise<IServiceDetails[]>>();\r\n    const selectedService = data[StepType.Service] as IServiceDetails;\r\n    const [services, setServices] = useState<IServiceDetails[]>([]);\r\n    const [hasLoaded, setHasLoaded] = useState(false);\r\n    const [prevHasLoaded, setPrevHasLoaded] = useState(false);\r\n    const [shouldPreSelect, setShouldPreSelect] = useState(false);\r\n    const hasAnyLogo = services.some((service) => service.PictureLink);\r\n    const prevProps = useRef({ isActive, data });\r\n\r\n    const fetchServices = async () => {\r\n        setHasLoaded(false);\r\n\r\n        const calendar = data[StepType.Calendar];\r\n\r\n        if (shouldGetByCalendar && calendar) {\r\n            servicesSubscription.current = makeCancelable<IServiceDetails[]>(\r\n                getServicesByCalendar(calendar.Id)\r\n            );\r\n        } else {\r\n            servicesSubscription.current = makeCancelable<IServiceDetails[]>(getServices(true));\r\n        }\r\n        try {\r\n            const servicesFormSubscription = await servicesSubscription.current.promise;\r\n            setServices(servicesFormSubscription);\r\n            setHasLoaded(true);\r\n        } catch (err) {\r\n            return;\r\n        }\r\n    };\r\n\r\n    const selectService = (service: IServiceDetails, hasSkipped?: boolean) => {\r\n        if (isActive) {\r\n            onComplete(createSelectedService(service), hasSkipped);\r\n        }\r\n    };\r\n\r\n    const createSelectedService = (service: IServiceDetails): IReservationModel => ({\r\n        ...data,\r\n        [StepType.Service]: {\r\n            ...service,\r\n            displayValue: service.Name,\r\n        },\r\n    });\r\n\r\n    const checkSelectedService = () => {\r\n        if (!data[StepType.Service]) {\r\n            const { searchParams } = data;\r\n            if (searchParams) {\r\n                const searchService = searchParams.ServiceId;\r\n                if (searchService) {\r\n                    if (services) {\r\n                        const service = services.find((s) => s.Id === +searchService);\r\n                        if (service) {\r\n                            selectService(service);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    };\r\n\r\n    const isServiceEmpty = (service: IServiceDetails) => {\r\n        return !service.PictureLink && !service.ShortDescription && !service.Description;\r\n    };\r\n\r\n    const hasSingleEmptyService = () => {\r\n        return (\r\n            services.length === 1 &&\r\n            isServiceEmpty(services[0]) &&\r\n            !getPaymentNeed(isPaymentEnabled, services[0].Payable)\r\n        );\r\n    };\r\n\r\n    const preSelect = () => {\r\n        if (hasLoaded) {\r\n            const isSingleEmptyService = hasSingleEmptyService();\r\n\r\n            if (isSingleEmptyService) {\r\n                selectService(services[0], true);\r\n            }\r\n\r\n            if (onIsModifiable) {\r\n                onIsModifiable(!isSingleEmptyService);\r\n            }\r\n        }\r\n    };\r\n\r\n    useEffect(() => {\r\n        if (isActive || (!hasLoaded && data[StepType.Service])) {\r\n            fetchServices().then(() => setShouldPreSelect(true));\r\n        }\r\n\r\n        return () => {\r\n            servicesSubscription?.current?.cancel();\r\n        };\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        if (hasLoaded) {\r\n            checkSelectedService();\r\n        }\r\n    }, [hasLoaded]);\r\n\r\n    useEffect(() => {\r\n        if (!isActive) {\r\n            prevProps.current = { isActive, data };\r\n            return;\r\n        }\r\n\r\n        const isActiveChanged = prevProps.current.isActive !== isActive;\r\n        const calendarChanged = !isSame(\r\n            prevProps.current.data[StepType.Calendar],\r\n            data[StepType.Calendar]\r\n        );\r\n        const shouldFetch =\r\n            isActiveChanged && (!hasLoaded || (shouldGetByCalendar && calendarChanged));\r\n\r\n        if (shouldFetch) {\r\n            fetchServices().then(() => setShouldPreSelect(true));\r\n        } else {\r\n            setShouldPreSelect(true);\r\n        }\r\n\r\n        if (prevHasLoaded !== hasLoaded) {\r\n            onLoadingChanged?.(!hasLoaded);\r\n        }\r\n\r\n        prevProps.current = { isActive, data };\r\n        setPrevHasLoaded(hasLoaded);\r\n    }, [isActive, data, shouldGetByCalendar, hasLoaded]);\r\n\r\n    useEffect(() => {\r\n        if (shouldPreSelect) {\r\n            preSelect()\r\n            setShouldPreSelect(false);\r\n        }        \r\n    }, [shouldPreSelect])\r\n    \r\n\r\n    if (!hasLoaded) {\r\n        return (\r\n            <>\r\n                <ServiceItemSkeleton />\r\n                <ServiceItemSkeleton />\r\n            </>\r\n        );\r\n    }\r\n\r\n    if (!services.length) {\r\n        return <AvailabilityWarning type=\"bookingNotAvailable\" />;\r\n    }\r\n\r\n    return (\r\n        <section className=\"service-select\">\r\n            {services.map((service, i) => (\r\n                <ServiceItem\r\n                    key={service.Id}\r\n                    service={service}\r\n                    selectService={selectService}\r\n                    needsPayment={getPaymentNeed(isPaymentEnabled, service.Payable)}\r\n                    button={\r\n                        <SelectButton\r\n                            autoFocus={i === 0}\r\n                            isFirstStep={!!isFirst}\r\n                            onClick={() => selectService(service)}\r\n                            selected={selectedService?.Id === service.Id}\r\n                        />\r\n                    }\r\n                    withLogoSpace={hasAnyLogo}\r\n                />\r\n            ))}\r\n        </section>\r\n    );\r\n};\r\n\r\nexport default withSearchParams<IServiceSelectProps, IService>(ServiceSelect, searchParamsOptions);\r\n","import Moment from 'moment';\r\nimport React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\r\nimport { useIntl } from 'react-intl';\r\nimport { IStepModuleProps, ModuleSearchParam } from '../../../../models/modules';\r\nimport {\r\n    IReservationModel,\r\n    reservationValueChanged,\r\n    IPendingReservation,\r\n} from '../../../../entities/reservation';\r\nimport { StepType } from '../../../../services/getStepOrder';\r\nimport withSearchParams, { ISearchParamsOptions, getDateParam } from '../withSearchParams';\r\nimport { getDate, getTime, setTimeOnDate } from 'src/services/dateTime';\r\nimport DateTimeSelect from './DateTimeSelect';\r\nimport ValidationMessage from 'src/components/form-components/ValidationMessage/ValidationMessage';\r\nimport FormValidator from 'src/services/formValidator';\r\nimport { dateTimeSelectRules } from 'src/services/validations/dateTimeSelectRules';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport makeCancelable, { ICancelablePromise } from 'src/services/cancelablePromise';\r\nimport {\r\n    getCalendarFirstFreeSlot,\r\n    googleSyncByCalendar,\r\n    googleSyncAll,\r\n} from 'src/services/api/calendar';\r\nimport AvailabilityWarning from 'src/components/AvailabilityWarning';\r\nimport { IResponseDto } from 'src/entities/common';\r\nimport { reservationModelToPendingRequest } from 'src/services/api/reservation';\r\nimport { getServiceFirstFreeSlot } from 'src/services/api/service';\r\nimport FixedButton from 'src/components/form-components/FixedButton/FixedButton';\r\nimport AppointmentCalendar from './AppointmentCalendar';\r\nimport Placeholder from 'src/components/Placeholder/Placeholder';\r\nimport { isAppointmentCalendar, isRandomCalendar, CalendarType } from 'src/entities/calendar';\r\nimport { BookingContext } from 'src/contexts/BookingFlowContext';\r\nimport { IDateTimeSelectStepState } from 'src/entities/dateTime';\r\n\r\nconst searchParamsOptions: ISearchParamsOptions<string> = {\r\n    paramName: ModuleSearchParam.Date,\r\n};\r\n\r\nconst DateTimeSelectStep: React.FC<IStepModuleProps> = ({\r\n    isActive,\r\n    data,\r\n    onLoadingChanged,\r\n    onComplete,\r\n}) => {\r\n    const prevProps = useRef({ isActive, data });\r\n    const intl = useIntl();\r\n    const { reservations } = useContext(BookingContext);\r\n    const firstFreeSlotSubScription = useRef<ICancelablePromise<string>>();\r\n    const googleSyncSubscription = useRef<ICancelablePromise<IResponseDto>>();\r\n    const validator = new FormValidator(dateTimeSelectRules);\r\n    const appointment = data[StepType.Date];\r\n    const [pendingReservations, setPendingReservations] = useState<IPendingReservation[]>([]);\r\n    const [prevHasLoaded, setPrevHasLoaded] = useState(false);\r\n    const [readyToFinish, setReadyToFinish] = useState(false);\r\n    const [state, setState] = useState<IDateTimeSelectStepState>({\r\n        ...(appointment\r\n            ? {\r\n                  personCount: appointment.personCount,\r\n                  selectedDate: getDate(appointment.startTime),\r\n                  selectedTime: getTime(appointment.startTime),\r\n                  submitted: false,\r\n              }\r\n            : {\r\n                  personCount: 1,\r\n                  selectedDate: '',\r\n                  submitted: false,\r\n              }),\r\n        firstFreeSlot: '',\r\n        hasLoaded: false,\r\n        calendarChanged: false,\r\n        clickedByUser: false,\r\n    });\r\n    const {\r\n        selectedDate,\r\n        selectedTime,\r\n        submitted,\r\n        firstFreeSlot,\r\n        hasLoaded,\r\n        calendarChanged,\r\n        clickedByUser,\r\n        personCount,\r\n    } = state;\r\n    const calendar = data[StepType.Calendar];\r\n    const service = data[StepType.Service];\r\n    const validation = submitted\r\n        ? validator.validate({ selectedDate, selectedTime: selectedTime || '' })\r\n        : validator.getInitial();\r\n    const autoSelectedDate = isActive ? getDateParam(data.searchParams) : undefined;\r\n    const isAppointmentView = isAppointmentCalendar(calendar);\r\n\r\n    const handleDateTimeChange = useCallback(\r\n        (newDateTime: string) => {\r\n            setState((prevState) => ({ ...prevState, selectedDate: newDateTime, selectedTime: getTime(newDateTime) }));\r\n            setReadyToFinish(true);\r\n        },\r\n        [state]\r\n    );\r\n    const handleDateChange = useCallback(\r\n        (newDate: string) => {\r\n            setState({\r\n                ...state,\r\n                selectedDate: newDate,\r\n                selectedTime: undefined,\r\n                clickedByUser: false,\r\n            });\r\n        },\r\n        [state]\r\n    );\r\n    const handleTimeChange = useCallback(\r\n        (newTime: string, clicked?: boolean) => {\r\n            setState({ ...state, selectedTime: newTime, clickedByUser: clicked ?? false });\r\n        },\r\n        [state]\r\n    );\r\n    const handlePersonCountChange = useCallback(\r\n        (newPersonCount: number) => {\r\n            setState({ ...state, personCount: newPersonCount });\r\n        },\r\n        [state]\r\n    );\r\n    const fetchFirstFreeSlot = () => {\r\n        if (!service) {\r\n            return;\r\n        }\r\n        firstFreeSlotSubScription.current = makeCancelable(\r\n            calendar\r\n                ? getCalendarFirstFreeSlot(calendar.Id, service.Id)\r\n                : getServiceFirstFreeSlot(service.Id)\r\n        );\r\n        firstFreeSlotSubScription.current.promise\r\n            .then((result) => {\r\n                setState((prevState) => ({ ...prevState, firstFreeSlot: result, hasLoaded: true }));\r\n            })\r\n            .catch(() => null);\r\n    };\r\n\r\n    const googleSync = () => {\r\n        if (calendar && !isRandomCalendar(calendar.Id) && !calendar.GoogleCalendarName) {\r\n            fetchFirstFreeSlot();\r\n            return;\r\n        }\r\n\r\n        if (!calendar || isRandomCalendar(calendar.Id)) {\r\n            googleSyncSubscription.current = makeCancelable(googleSyncAll());\r\n        } else if (calendar.GoogleCalendarName) {\r\n            googleSyncSubscription.current = makeCancelable(googleSyncByCalendar(calendar.Id));\r\n        }\r\n\r\n        googleSyncSubscription.current?.promise\r\n            .catch(() => null)\r\n            .finally(() => {\r\n                fetchFirstFreeSlot();\r\n            });\r\n    };\r\n\r\n    const finish = () => {\r\n        setState({ ...state, submitted: true });\r\n        if (selectedDate && selectedTime && service) {\r\n            const startTime = Moment.utc(setTimeOnDate(selectedDate, selectedTime)).format();\r\n            const endTime = Moment.utc(startTime).add(service.DurationToUser, 'minutes').format();\r\n            const reservation: IReservationModel = {\r\n                ...data,\r\n                [StepType.Date]: {\r\n                    startTime,\r\n                    endTime,\r\n                    personCount,\r\n                    displayValue: `${intl.formatDate(startTime)}, ${intl.formatTime(startTime)}`,\r\n                },\r\n            };\r\n            onComplete(reservation);\r\n        }\r\n    };\r\n\r\n    const recalculatePersonCount = (): number => {\r\n        let newPersonCount = personCount;\r\n        if (calendar && calendar.ConcurrentNum < newPersonCount) {\r\n            newPersonCount = 1;\r\n        }\r\n        return newPersonCount;\r\n    };\r\n\r\n    useEffect(() => {\r\n        if (isActive) {\r\n            googleSync();\r\n        }\r\n\r\n        setPendingReservations(\r\n            (reservations &&\r\n                (reservations.slice(0, -1) as IReservationModel[])\r\n                    .filter((r) => r.calendar?.Type === CalendarType.Classic)\r\n                    .map((r) => reservationModelToPendingRequest(r))) ||\r\n                []\r\n        );\r\n\r\n        return () => {\r\n            firstFreeSlotSubScription.current?.cancel();\r\n            googleSyncSubscription.current?.cancel();\r\n        };\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        if (readyToFinish) {\r\n            finish();\r\n        }\r\n    }, [readyToFinish]);\r\n\r\n    useEffect(() => {\r\n        const isCalendarChanged = reservationValueChanged(data, prevProps.current.data, 'calendar');\r\n        if (isCalendarChanged) {\r\n            setState((prevState) => ({\r\n                ...prevState,\r\n                personCount: recalculatePersonCount(),\r\n                calendarChanged: isCalendarChanged,\r\n            }));\r\n        }\r\n\r\n        if (!isActive) {\r\n            prevProps.current = { isActive, data };\r\n            return;\r\n        }\r\n\r\n        const isServiceChanged = reservationValueChanged(data, prevProps.current.data, 'service');\r\n        const isActiveChanged = prevProps.current.isActive !== isActive;\r\n        if (isActiveChanged || isCalendarChanged || isServiceChanged) {\r\n            setState((prevState) => ({\r\n                ...prevState,\r\n                firstFreeSlot: '',\r\n                submitted: false,\r\n                hasLoaded: false,\r\n            }));\r\n            setReadyToFinish(false);\r\n            googleSync();\r\n        }\r\n\r\n        if (prevHasLoaded !== hasLoaded) {\r\n            onLoadingChanged?.(!hasLoaded);\r\n        }\r\n\r\n        prevProps.current = { isActive, data };\r\n        setPrevHasLoaded(hasLoaded);\r\n    }, [isActive, data, hasLoaded]);\r\n\r\n    if (!hasLoaded) {\r\n        return <Placeholder />;\r\n    }\r\n\r\n    if (!firstFreeSlot) {\r\n        return <AvailabilityWarning type=\"noFreeIntervals\" modifier=\"color-red\" />;\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {(calendar && service && isAppointmentView && (\r\n                <AppointmentCalendar\r\n                    calendar={calendar}\r\n                    service={service}\r\n                    personCount={personCount}\r\n                    firstFreeSlot={firstFreeSlot}\r\n                    querySelectedDate={autoSelectedDate}\r\n                    onDateTimeSelect={!calendar?.Readonly ? handleDateTimeChange : undefined}\r\n                    onPersonCountChange={handlePersonCountChange}\r\n                    pendingReservations={pendingReservations}\r\n                />\r\n            )) || (\r\n                <DateTimeSelect\r\n                    calendar={calendar}\r\n                    service={service}\r\n                    intl={intl}\r\n                    time={selectedTime}\r\n                    date={selectedDate}\r\n                    firstFreeDay={getDate(firstFreeSlot)}\r\n                    personCount={personCount}\r\n                    autoSelect={autoSelectedDate}\r\n                    onDateChange={handleDateChange}\r\n                    onTimeChange={handleTimeChange}\r\n                    onPersonCountChange={handlePersonCountChange}\r\n                    allowAlreadySelected={false}\r\n                    pendingReservations={pendingReservations}\r\n                    isOnlyService={!calendar}\r\n                    calendarChanged={calendarChanged}\r\n                    clickedByUser={clickedByUser}\r\n                />\r\n            )}\r\n            <div className=\"validation-message-container\">\r\n                <ValidationMessage\r\n                    message={!validation.isValid ? globalMessages.dateTimeRequired : undefined}\r\n                />\r\n            </div>\r\n            {!isAppointmentView && !calendar?.Readonly && isActive && (\r\n                <FixedButton\r\n                    className=\"date-time-select-step__button\"\r\n                    caption={globalMessages.next}\r\n                    onClick={finish}\r\n                />\r\n            )}\r\n        </>\r\n    );\r\n};\r\n\r\nexport default withSearchParams<IStepModuleProps, object>(DateTimeSelectStep, searchParamsOptions);\r\n","import React, { useContext, useEffect, useRef, useState } from 'react';\r\nimport { useIntl } from 'react-intl';\r\nimport FixedButton from 'src/components/form-components/FixedButton/FixedButton';\r\nimport JsApiContext from 'src/contexts/JsApi/JsApiContext';\r\nimport { IJsApiQuestion, IQuestion } from 'src/entities/question';\r\nimport { reservationValueChanged } from 'src/entities/reservation';\r\nimport { getCustomParams } from 'src/services/api/service';\r\nimport makeCancelable from 'src/services/cancelablePromise';\r\nimport FormValidator from 'src/services/formValidator';\r\nimport { StepType } from 'src/services/getStepOrder';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport { createValidationRules } from 'src/services/validations/validations';\r\nimport { AppLocale, IStepModuleProps } from '../../../../models/modules';\r\nimport { toAnswers, toCustomerData } from '../helpers';\r\nimport CustomerData, { ICustomerData } from './CustomerData';\r\n\r\nconst CustomerDataStep: React.FC<IStepModuleProps> = ({\r\n    isActive,\r\n    data,\r\n    onLoadingChanged,\r\n    onComplete,\r\n}) => {\r\n    const intl = useIntl();\r\n    const jsApiContext = useContext(JsApiContext);\r\n    const prevProps = useRef({ data });\r\n    const customerDataStepValue = data[StepType.CustomerData];\r\n    const initialAnswers = customerDataStepValue\r\n        ? toCustomerData(customerDataStepValue.answers)\r\n        : {};\r\n    const [validator, setValidator] = useState<FormValidator | undefined>();\r\n    const [answers, setAnswers] = useState<ICustomerData>(initialAnswers);\r\n    const [questions, setQuestions] = useState<IQuestion[]>([]);\r\n    const [selectedArriveTime, setSelectedArriveTime] = useState(\r\n        customerDataStepValue?.arriveTime || ''\r\n    );\r\n    const [shouldValidate, setShouldValidate] = useState(false);\r\n    const [hasQuestionsLoaded, setHasQuestionsLoaded] = useState(false);\r\n    const [prevHasQuestionsLoaded, setPrevHasQuestionsLoaded] = useState(false);\r\n    const validation = validator\r\n        ? shouldValidate\r\n            ? validator.validate(answers)\r\n            : validator.getInitial()\r\n        : undefined;\r\n\r\n    const cleanAnswers = (currentAnswers: ICustomerData, currentQuestions: IQuestion[]) => {\r\n        return Object.entries(currentAnswers).reduce((acc, entry) => {\r\n            if (currentQuestions.some((q) => q.Id === +entry[0])) {\r\n                acc[+entry[0]] = entry[1];\r\n                jsApiContext.setQuestionValue(+entry[0], entry[1]);\r\n            } else {\r\n                jsApiContext.cleanQuestionValue(+entry[0]);\r\n            }\r\n            return acc;\r\n        }, {} as ICustomerData);\r\n    };\r\n\r\n    const fetchQuestions = () => {\r\n        const service = data[StepType.Service] || data[StepType.Timetable]?.service;\r\n\r\n        if (service) {\r\n            const questionsSubscription = makeCancelable<IQuestion[]>(getCustomParams(service.Id));\r\n            questionsSubscription.promise\r\n                .then((result) => {\r\n                    const contextDataMap = jsApiContext?.data\r\n                        ? jsApiContext.data.reduce((acc, question) => {\r\n                              acc[question.Id] = question;\r\n                              return acc;\r\n                          }, {} as Record<number, IJsApiQuestion>)\r\n                        : {};\r\n\r\n                    const mergedQuestions = result\r\n                        .filter((question) => result.some((q) => q.Id === question.Id))\r\n                        .map((question) => contextDataMap[question.Id] || question);\r\n\r\n                    jsApiContext.setData(mergedQuestions);\r\n\r\n                    setQuestions(mergedQuestions); // setting merged questions to state\r\n                    setAnswers(cleanAnswers(answers, mergedQuestions));\r\n                    setHasQuestionsLoaded(true);\r\n\r\n                    const event = new CustomEvent('new-questions', { detail: mergedQuestions });\r\n                    window.dispatchEvent(event);\r\n                })\r\n                .catch(() => null);\r\n            return questionsSubscription;\r\n        }\r\n        return undefined;\r\n    };\r\n\r\n    const setValidatorByQuestions = (value: IQuestion[]) => {\r\n        setValidator(new FormValidator(createValidationRules(value, intl.locale as AppLocale)));\r\n    };\r\n\r\n    const handleNext = () => {\r\n        setShouldValidate(true);\r\n    };\r\n\r\n    const handleChange = (question: IQuestion, currentAnswers: ICustomerData) => {\r\n        const event = new CustomEvent('new-valueChanged', {\r\n            detail: { question, answer: currentAnswers[question.Id] },\r\n        });\r\n        window.dispatchEvent(event);\r\n\r\n        jsApiContext.setQuestionValue(question.Id, currentAnswers[question.Id]);\r\n\r\n        setAnswers(currentAnswers);\r\n        setShouldValidate(false);\r\n    };\r\n\r\n    const handleArriveTimeChange = (arriveTime: string) => {\r\n        setSelectedArriveTime(arriveTime);\r\n    };\r\n\r\n    useEffect(() => {\r\n        const questionsSubscription = fetchQuestions();\r\n\r\n        return () => {\r\n            if (questionsSubscription) {\r\n                questionsSubscription.cancel();\r\n            }\r\n        };\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        if (reservationValueChanged(data, prevProps.current.data, 'service')) {\r\n            fetchQuestions();\r\n        }\r\n\r\n        if (prevHasQuestionsLoaded !== hasQuestionsLoaded) {\r\n            onLoadingChanged?.(!hasQuestionsLoaded);\r\n        }\r\n\r\n        if (jsApiContext.data.length > 0) {\r\n            setValidatorByQuestions(jsApiContext.data);\r\n        }\r\n\r\n        prevProps.current = { data };\r\n        setPrevHasQuestionsLoaded(hasQuestionsLoaded);\r\n    }, [data, hasQuestionsLoaded, jsApiContext.data]);\r\n\r\n    useEffect(() => {\r\n        if (hasQuestionsLoaded) {setValidatorByQuestions(questions);}\r\n    }, [hasQuestionsLoaded]);\r\n\r\n    useEffect(() => {\r\n        if (shouldValidate && validator?.validate(answers).isValid) {\r\n            const displayValue = intl.formatMessage(globalMessages.nAnswers, {\r\n                n: Object.values(answers).filter((a) => !!a).length,\r\n            });\r\n            onComplete({\r\n                ...data,\r\n                [StepType.CustomerData]: {\r\n                    answers: toAnswers(questions, answers),\r\n                    displayValue,\r\n                    arriveTime: selectedArriveTime,\r\n                },\r\n            });\r\n        }\r\n    }, [shouldValidate]);\r\n\r\n    return (\r\n        <div className=\"customer-data-step\">\r\n            <CustomerData\r\n                questions={jsApiContext.data}\r\n                calendar={data[StepType.Calendar]}\r\n                service={data[StepType.Service] || data[StepType.Timetable]?.service}\r\n                reservationStart={\r\n                    data[StepType.Date]?.startTime || data[StepType.Timetable]?.schedule.Start\r\n                }\r\n                answers={answers}\r\n                validation={validation}\r\n                selectedArriveTime={selectedArriveTime}\r\n                onChange={handleChange}\r\n                onArriveTimeChange={handleArriveTimeChange}\r\n                hasLoaded={hasQuestionsLoaded}\r\n            />\r\n            {isActive && (\r\n                <FixedButton\r\n                    className=\"customer-data-step__button\"\r\n                    caption={globalMessages.next}\r\n                    onClick={handleNext}\r\n                />\r\n            )}\r\n        </div>\r\n    );\r\n};\r\n\r\nexport default CustomerDataStep;\r\n","import React from 'react';\r\nimport { IStepModuleProps, ModuleSearchParam } from 'src/models/modules';\r\nimport { StepType } from 'src/services/getStepOrder';\r\nimport { useIntl } from 'react-intl';\r\nimport {\r\n    useSchedules,\r\n    handleEventRender,\r\n    handleEventClassNames,\r\n    IEventRenderInfo,\r\n} from 'src/components/BookingFlow/modules/TimeTableSelect/fullcalendarFunctions';\r\nimport { IServiceDetails } from 'src/entities/service';\r\nimport { ISchedule } from 'src/entities/schedule';\r\nimport { useSubscription } from 'src/hooks';\r\nimport { getCalendarFirstFreeSlot } from 'src/services/api/calendar';\r\nimport { lazy, Suspense } from 'react';\r\nimport Placeholder from 'src/components/Placeholder/Placeholder';\r\nimport withSearchParams, { getDateParam, ISearchParamsOptions } from '../withSearchParams';\r\nimport AvailabilityWarning from 'src/components/AvailabilityWarning';\r\nimport { ReadonlyInfo } from 'src/components/ReadonlyInfo/ReadonlyInfo';\r\n\r\nconst Timetable = lazy(\r\n    () => import(/* webpackChunkName: \"Timetable\" */ '../DateTimeSelect/Timetable')\r\n);\r\n\r\ninterface ITimeTableSelectProps extends IStepModuleProps {\r\n    isPaymentEnabled?: boolean;\r\n}\r\n\r\nconst TimeTableSelect: React.FunctionComponent<ITimeTableSelectProps> = ({\r\n    data,\r\n    onComplete,\r\n    isPaymentEnabled,\r\n}) => {\r\n    const calendar = data[StepType.Calendar]!;\r\n\r\n    const intl = useIntl();\r\n    const { getSchedules, scheduleLists, isLoading } = useSchedules(calendar);\r\n    const fetchFirstSlot = React.useCallback(\r\n        () => getCalendarFirstFreeSlot(calendar.Id),\r\n        [calendar.Id]\r\n    );\r\n    const [firstFreeSlot, isFirstFreeSlotLoading] = useSubscription(fetchFirstSlot, '');\r\n    const userViewSlotMinutes = calendar.UserViewSlotMinutes;\r\n\r\n    const handleServiceSelect = (\r\n        service: IServiceDetails,\r\n        schedule: ISchedule,\r\n        personCount: number\r\n    ) => {\r\n        onComplete({\r\n            ...data,\r\n            [StepType.Timetable]: {\r\n                service,\r\n                schedule,\r\n                personCount,\r\n                displayValue: service.Name,\r\n            },\r\n        });\r\n    };\r\n\r\n    const eventRender = (arg: IEventRenderInfo & { currentWeekDay: number | false }) =>\r\n        handleEventRender({\r\n            ...arg,\r\n            intl,\r\n            handleServiceSelect,\r\n            currentWeekDay: arg.currentWeekDay,\r\n            minTimeReserve: calendar.MinTimeReserve,\r\n            isReadonly: calendar.Readonly,\r\n            hideSeatCount: calendar.HideSeatCount,\r\n            isWeekendDisabled: calendar.WeekendDisabled,\r\n            isPaymentEnabled,\r\n            firstFreeSlot\r\n        });\r\n\r\n    const eventClassNames = (arg: IEventRenderInfo) =>\r\n        handleEventClassNames({\r\n            ...arg,\r\n            minTimeReserve: calendar.MinTimeReserve,\r\n            firstFreeSlot\r\n        });\r\n\r\n    if (isFirstFreeSlotLoading) {\r\n        return <Placeholder />;\r\n    }\r\n\r\n    if (!firstFreeSlot) {\r\n        return <AvailabilityWarning type=\"noFreeIntervals\" modifier=\"center\" />;\r\n    }\r\n\r\n    return (\r\n        <Suspense fallback={<Placeholder />}>\r\n            {calendar.Readonly && (\r\n                <ReadonlyInfo\r\n                    phoneNumber={calendar.PhoneNumber}\r\n                    className=\"readonly--booking-step\"\r\n                />\r\n            )}\r\n            <Timetable\r\n                {...{\r\n                    key: calendar.Id,\r\n                    calendar,\r\n                    getEventTimes: getSchedules,\r\n                    handleEventRender: eventRender,\r\n                    handleEventClassNames: eventClassNames,\r\n                    eventTimes: scheduleLists,\r\n                    slotDuration: userViewSlotMinutes,\r\n                    areEventsLoading: isLoading,\r\n                    firstFreeSlot,\r\n                    querySelectedDate: getDateParam(data.searchParams),\r\n                    userViewSlotMinutes,\r\n                }}\r\n            />\r\n        </Suspense>\r\n    );\r\n};\r\n\r\nconst searchParamsOptions: ISearchParamsOptions<string> = {\r\n    paramName: ModuleSearchParam.Date\r\n};\r\n\r\nexport default withSearchParams<ITimeTableSelectProps, any>(TimeTableSelect, searchParamsOptions);","import React, { useEffect, useState } from 'react';\r\nimport { defineMessages } from 'react-intl';\r\nimport { StepType } from '../../../services/getStepOrder';\r\nimport Step from '../Step/Step';\r\nimport JumpToEnd, { PendingJumpType } from '../JumpToEnd/JumpToEnd';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport CalendarSelect from '../modules/CalendarSelect/CalendarSelect';\r\nimport MockModule from 'src/test-mocks/MockModule';\r\nimport ServiceSelect from '../modules/ServiceSelect/ServiceSelect';\r\nimport DateTimeSelectStep from '../modules/DateTimeSelect/DateTimeSelectStep';\r\nimport CustomerDataStep from '../modules/CustomerData/CustomerDataStep';\r\nimport TimeTableSelect from '../modules/TimeTableSelect/TimeTableSelect';\r\nimport { ReservationOrder, ICompany } from 'src/entities/company';\r\nimport { IStepModuleProps } from 'src/models/modules';\r\nimport { useLocation, useNavigate } from 'react-router-dom';\r\nimport { Routes } from 'src/routes';\r\nimport { useAppContext } from 'src/contexts/AppContext';\r\nimport { useAutoRefresh } from 'src/hooks';\r\n\r\nconst stepNames = defineMessages({\r\n    [StepType.Calendar]: {\r\n        id: 'calendar',\r\n        defaultMessage: 'Naptár',\r\n    },\r\n    [StepType.Timetable]: {\r\n        id: 'timetable',\r\n        defaultMessage: 'Órarend',\r\n    },\r\n    [StepType.Service]: {\r\n        id: 'service',\r\n        defaultMessage: 'Szolgáltatás',\r\n    },\r\n    [StepType.Date]: globalMessages.dateTime,\r\n    [StepType.CustomerData]: globalMessages[StepType.CustomerData],\r\n    [StepType.ReservationEnd]: globalMessages[StepType.ReservationEnd],\r\n});\r\n\r\ntype CompletedStep = { [step in StepType]?: boolean };\r\n\r\nexport interface IStepperProps {\r\n    stepOrder: StepType[];\r\n    pendingLength: number;\r\n    isActive: boolean;\r\n    shouldHideInitialProgressBar?: boolean;\r\n    onChange: (activeStepIndex: number) => void;\r\n    activeStepIndex: number;\r\n    removeReservation: () => void;\r\n}\r\n\r\nconst Stepper: React.FC<IStepperProps> = ({\r\n    activeStepIndex,\r\n    stepOrder,\r\n    pendingLength,\r\n    isActive,\r\n    shouldHideInitialProgressBar,\r\n    onChange,\r\n    removeReservation,\r\n}) => {\r\n    useAutoRefresh();\r\n\r\n    const location = useLocation();\r\n    const navigate = useNavigate();\r\n    const { company: companyFromContext } = useAppContext();\r\n    const [completedSteps, setCompletedSteps] = useState<CompletedStep>({});\r\n    const [hasProgressed, setHasProgressed] = useState(false);\r\n    const lastIndex = stepOrder.length - 1;\r\n\r\n    useEffect(() => {\r\n        if (!hasProgressed && activeStepIndex > 0) {\r\n            setHasProgressed(true);\r\n        }\r\n\r\n        if (activeStepIndex && !Object.keys(completedSteps).length) {\r\n            const steps: CompletedStep = {};\r\n            stepOrder.forEach((step, index) => {\r\n                if (index !== stepOrder.length - 1) {\r\n                    steps[step] = true;\r\n                }\r\n            });\r\n            setCompletedSteps({ ...steps });\r\n        }\r\n    }, [activeStepIndex, stepOrder, completedSteps, hasProgressed]);\r\n\r\n    const getStepByIndex = (index: number): StepType => stepOrder[index];\r\n    const getStepIsCompleted = (index: number): boolean => !!completedSteps[getStepByIndex(index)];\r\n    const getAllStepIsCompleted = (): boolean => {\r\n        const steps = [...stepOrder];\r\n        steps.pop();\r\n        return steps.every((step) => completedSteps[step]);\r\n    };\r\n    const getStepsAfterModify = (modifiedStepIndex: number): CompletedStep => {\r\n        return Object.keys(completedSteps).reduce((steps: CompletedStep, currentStep: StepType) => {\r\n            if (modifiedStepIndex < stepOrder.findIndex((step) => step === currentStep)) {\r\n                steps[currentStep] = false;\r\n            }\r\n            return steps;\r\n        }, {});\r\n    };\r\n    const nextStep = () => {\r\n        let stepsToReset: CompletedStep = {};\r\n\r\n        if (getStepIsCompleted(activeStepIndex)) {\r\n            stepsToReset = getStepsAfterModify(activeStepIndex);\r\n        }\r\n\r\n        setCompletedSteps({\r\n            ...completedSteps,\r\n            [stepOrder[activeStepIndex]]: true,\r\n            ...stepsToReset,\r\n        });\r\n\r\n        if (activeStepIndex + 1 === stepOrder.length - 1) {\r\n            navigate({\r\n                pathname: Routes.ReservationEnd,\r\n                search: location.search,\r\n            });\r\n        }\r\n\r\n        onChange(activeStepIndex + 1);\r\n    };\r\n    const modifyStep = (stepIndex: number) => {\r\n        onChange(stepIndex);\r\n    };\r\n    const jumpToEnd = () => {\r\n        if (!getAllStepIsCompleted()) {\r\n            removeReservation();\r\n        } else {\r\n            onChange(stepOrder.length - 1);\r\n        }\r\n\r\n        navigate({\r\n            pathname: Routes.ReservationEnd,\r\n            search: location.search,\r\n        });\r\n    };\r\n    const getStepComponent = (\r\n        step: StepType,\r\n        isFirstStep: boolean,\r\n        company: ICompany | null\r\n    ): React.FC<IStepModuleProps> => {\r\n        switch (step) {\r\n            case StepType.Calendar:\r\n                return (props) => (\r\n                    <CalendarSelect\r\n                        {...props}\r\n                        shouldGetByService={!isFirstStep}\r\n                        hasRandomCalendar={\r\n                            company?.ReservationOrder ===\r\n                            ReservationOrder.ServiceFirstWithAllCalendarOption\r\n                        }\r\n                        canUserSelectCalendar={company?.CanUserSelectCalendar}\r\n                    />\r\n                );\r\n\r\n            case StepType.Timetable:\r\n                return (props) => (\r\n                    <TimeTableSelect\r\n                        {...props}\r\n                        isPaymentEnabled={company?.PaymentSettings.IsPaymentEnabled}\r\n                    />\r\n                );\r\n            case StepType.Service:\r\n                return (props) => (\r\n                    <ServiceSelect\r\n                        {...props}\r\n                        shouldGetByCalendar={!isFirstStep}\r\n                        isPaymentEnabled={company?.PaymentSettings.IsPaymentEnabled}\r\n                    />\r\n                );\r\n            case StepType.Date:\r\n                return (props) => <DateTimeSelectStep {...props} />;\r\n            case StepType.CustomerData:\r\n                return (props) => <CustomerDataStep {...props} />;\r\n            case StepType.ReservationEnd:\r\n                return (props) => <MockModule {...props} name={StepType.ReservationEnd} />;\r\n        }\r\n    };\r\n\r\n    if (!isActive) {\r\n        return null;\r\n    }\r\n    return (\r\n        <div className=\"stepper\">\r\n            {pendingLength > 1 && (\r\n                <JumpToEnd\r\n                    type={PendingJumpType.Top}\r\n                    action={jumpToEnd}\r\n                    reservationCount={pendingLength - 1}\r\n                />\r\n            )}\r\n            {stepOrder.map((step: StepType, i: number) => (\r\n                <Step\r\n                    key={`step-${step}`}\r\n                    isProgressBarHidden={!hasProgressed && shouldHideInitialProgressBar}\r\n                    isActive={i === activeStepIndex}\r\n                    isLast={i === lastIndex}\r\n                    isCompleted={getStepIsCompleted(i)}\r\n                    content={getStepComponent(step, i === 0, companyFromContext)}\r\n                    name={stepNames[step]}\r\n                    step={step}\r\n                    stepIndex={i}\r\n                    nextHandler={nextStep}\r\n                    modifyHandler={modifyStep}\r\n                    jumpToEndHandler={jumpToEnd}\r\n                />\r\n            ))}\r\n        </div>\r\n    );\r\n};\r\n\r\nexport default Stepper;\r\n","import React from 'react';\r\nimport { FormattedMessage, MessageDescriptor, defineMessages } from 'react-intl';\r\nimport { IContactInfo } from '../../entities/company';\r\nimport EmailIcon from '../icons/Email';\r\nimport Location from '../icons/Location';\r\nimport PhoneIcon from '../icons/Phone';\r\nimport Nl2br from '../Nl2br/Nl2br';\r\nimport Facebook from '../icons/Facebook';\r\nimport globalMessages from 'src/services/globalMessages';\r\nimport WebSite from '../icons/WebSite';\r\nimport { useLayoutEffect, useRef } from 'react';\r\nimport { useWindowWidth } from 'src/hooks';\r\nimport { isMessageDescriptor } from 'src/components/form-components/helpers';\r\n\r\nconst messages = defineMessages({\r\n    webpage: {\r\n        id: 'webpage',\r\n        defaultMessage: 'Weboldal'\r\n    },\r\n    facebookPage: {\r\n        id: 'facebookPage',\r\n        defaultMessage: 'Facebook oldal'\r\n    }\r\n});\r\n\r\nexport const enum ContactDetailType {\r\n    Phone = 'tel:',\r\n    Email = 'mailto:',\r\n    External = ''\r\n}\r\n\r\ninterface IContactDetailProps {\r\n    icon: JSX.Element,\r\n    text: string | MessageDescriptor,\r\n    type: ContactDetailType,\r\n    link: string | null\r\n}\r\n\r\nconst ContactDetail: React.FunctionComponent<IContactDetailProps> = ({ icon, text, type, link }) => {\r\n    const createRealLink = () => {\r\n        if (!link) {\r\n            return undefined;\r\n        }\r\n\r\n        if (type === ContactDetailType.External\r\n            && !(link.startsWith('http://') || link.startsWith('https://'))) {\r\n            return '//' + link;\r\n        }\r\n\r\n        return type + link;\r\n    }\r\n\r\n    const linkAttributes = {\r\n        href: createRealLink(),\r\n        className: 'contact',\r\n        target: type === ContactDetailType.External && link ? '_blank' : '_self',\r\n        rel: 'noopener noreferrer'\r\n    }\r\n\r\n    return (\r\n        <div className=\"contacts__item\">\r\n            <a {...linkAttributes}>\r\n                <div className=\"contact__icon\">\r\n                    {icon}\r\n                </div>\r\n                {isMessageDescriptor(text)\r\n                    ? <FormattedMessage {...text} />\r\n                    : <Nl2br {...{ text }} />\r\n                }\r\n            </a>\r\n        </div>\r\n    );\r\n}\r\n\r\nconst ContactInfo = (contactInfo: IContactInfo) => {\r\n\r\n    const { PublicEmail, PublicPhoneNumber, Address, MapLink, OpeningHours, WebPageLink, FacebookPageLink } = contactInfo;\r\n    const hasDetails = PublicEmail || PublicPhoneNumber || Address || MapLink;\r\n    const hasSocial = WebPageLink || FacebookPageLink;\r\n\r\n    const ref = useRef<HTMLElement>(null);\r\n\r\n    const Details = () =>\r\n        hasDetails ?\r\n            <section ref={ref} className=\"contacts\">\r\n                {PublicEmail && <ContactDetail text={PublicEmail} icon={<EmailIcon />} type={ContactDetailType.Email} link={PublicEmail} />}\r\n                {Address && <ContactDetail text={Address} icon={<Location />} type={ContactDetailType.External} link={MapLink} />}\r\n                {PublicPhoneNumber && <ContactDetail text={PublicPhoneNumber} icon={<PhoneIcon />} type={ContactDetailType.Phone} link={PublicPhoneNumber} />}\r\n            </section> : null\r\n\r\n    const Hours = () => OpeningHours ?\r\n        <section className=\"contact-info__opening-hours\">\r\n            {OpeningHours}\r\n        </section> : null\r\n\r\n    const Social = () => hasSocial ?\r\n        <section className=\"contacts\">\r\n            {WebPageLink && <ContactDetail text={messages.webpage} icon={<WebSite />} type={ContactDetailType.External} link={WebPageLink} />}\r\n            {FacebookPageLink && <ContactDetail text={messages.facebookPage} icon={<Facebook />} type={ContactDetailType.External} link={FacebookPageLink} />}\r\n        </section > : null\r\n\r\n    const windowWidth = useWindowWidth();\r\n\r\n    useLayoutEffect(() => {\r\n\r\n        if (!ref.current) {\r\n            return;\r\n        }\r\n\r\n        const contactsSection = ref.current;\r\n        contactsSection.classList.remove('contacts--vertical');\r\n\r\n        if (contactsSection.children.length > 1) {\r\n            const hasOverlappingElements =\r\n                twoCombinations(\r\n                    Array.from(contactsSection.children,\r\n                        c => c.children[0].getBoundingClientRect())\r\n                ).some(([rect1, rect2]) =>\r\n                    rect1.right > rect2.left)\r\n\r\n            if (hasOverlappingElements) {\r\n                contactsSection.classList.add('contacts--vertical');\r\n            }\r\n        }\r\n    }, [windowWidth, ref.current]);\r\n\r\n    return (\r\n        hasDetails || OpeningHours || hasSocial ?\r\n            <address className=\"contact-info\">\r\n                <h1 className=\"contact-info__title\">\r\n                    <FormattedMessage {...globalMessages.contactUs} />\r\n                </h1>\r\n                <Details />\r\n                <Hours />\r\n                <Social />\r\n            </address>\r\n            : null\r\n    );\r\n}\r\n\r\nconst twoCombinations = <T,>(arr: T[]): Array<[T, T]> => {\r\n    return (arr.length === 3\r\n        ? [\r\n            [arr[0], arr[1]],\r\n            [arr[0], arr[2]],\r\n            [arr[1], arr[2]]\r\n        ]\r\n        : [arr]\r\n    ) as Array<[T, T]>\r\n}\r\n\r\nexport default ContactInfo;\r\n","import { isSame } from 'src/entities/common';\r\nimport { IReservationModel } from 'src/entities/reservation';\r\nimport getStepOrder, { StepType, StepOrderType } from 'src/services/getStepOrder';\r\n\r\nexport const clearObsoleteStepValues = (\r\n    stepType: StepType,\r\n    orderType: StepOrderType,\r\n    newReservation: IReservationModel,\r\n    reservation: IReservationModel\r\n): IReservationModel => {\r\n    const currentStepOrder = getStepOrder(orderType);\r\n    const stepIndex = currentStepOrder.findIndex((step) => step === stepType);\r\n\r\n    const reservationStepType = stepType as keyof IReservationModel;\r\n    const value = newReservation[\r\n        reservationStepType\r\n    ] as IReservationModel[typeof reservationStepType] & { Id: number };\r\n    const value2 = reservation[\r\n        reservationStepType\r\n    ] as IReservationModel[typeof reservationStepType] & { Id: number };\r\n    const hasValueChanged = !isSame(value, value2);\r\n\r\n    const rules = [\r\n        {\r\n            stepIndex: 0,\r\n            dependentSteps: [1, 2],\r\n        },\r\n        {\r\n            stepIndex: 1,\r\n            dependentSteps: [2],\r\n        },\r\n    ];\r\n\r\n    const rule = rules.find((r) => r.stepIndex === stepIndex);\r\n\r\n    if (hasValueChanged && rule) {\r\n        return rule.dependentSteps.reduce(\r\n            (acc, i) => ({ ...acc, [currentStepOrder[i]]: undefined }),\r\n            {\r\n                ...newReservation,\r\n            }\r\n        );\r\n    }\r\n\r\n    return { ...newReservation };\r\n};\r\n","import React, { useContext, useEffect } from 'react';\r\nimport { AppContext } from 'src/contexts/AppContext';\r\nimport { BookingProvider } from 'src/contexts/BookingFlowContext';\r\nimport { ReservationOrder } from 'src/entities/company';\r\nimport { ICommonModuleProps } from '../../models/modules';\r\nimport getStepOrder, { mapReservationOrder } from '../../services/getStepOrder';\r\nimport ReservationEnd from './ReservationEnd/ReservationEnd';\r\nimport { createReservationEndUser } from './ReservationEnd/functions/createFunctions';\r\nimport Stepper from './Stepper/Stepper';\r\nimport { Routes } from 'src/routes';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { useBookingFlowReducer } from './BookingFlowReducer';\r\n\r\nexport interface IBookingFlowProps extends ICommonModuleProps {\r\n    shouldHideInitialProgressBar?: boolean;\r\n    reservationOrder: ReservationOrder;\r\n}\r\n\r\nconst BookingFlow: React.FC<IBookingFlowProps> = (props) => {\r\n    const { shouldHideInitialProgressBar, reservationOrder } = props;\r\n    const context = useContext(AppContext);\r\n    const location = useLocation();\r\n    const stepOrderType = mapReservationOrder(reservationOrder);\r\n    const { state } = useBookingFlowReducer(stepOrderType);\r\n    const { reservations, activeReservationIndex, stepOrderTypes, activeStepIndex, actions } =\r\n        state;\r\n    const { setReservationEndUser, addNewReservation, removeReservation, setActiveStepIndex } =\r\n        actions;\r\n    const stepOrder = getStepOrder(stepOrderTypes[activeReservationIndex]);\r\n\r\n    const handleActiveStepIndexChange = (index: number) => {\r\n        setActiveStepIndex(index);\r\n    };\r\n\r\n    const handleEndStep = () => {\r\n        setActiveStepIndex(stepOrder.length - 1);\r\n    };\r\n\r\n    useEffect(() => {\r\n        setReservationEndUser(createReservationEndUser(context.user));\r\n    }, []);\r\n\r\n    useEffect(() => {\r\n        if (reservations.length === 0) {\r\n            addNewReservation();\r\n        }\r\n    }, [reservations]);\r\n\r\n    useEffect(() => {\r\n        if (location.state?.newReservation) {\r\n            reservations.forEach(() => removeReservation());\r\n        }\r\n    }, [location]);\r\n\r\n    return (\r\n        <section className=\"booking-flow\">\r\n            <BookingProvider value={{ ...state, ...props }}>\r\n                {reservations.map((_, index) => (\r\n                    <Stepper\r\n                        key={`stepper-${index}`}\r\n                        isActive={\r\n                            activeStepIndex < stepOrder.length - 1 &&\r\n                            index === activeReservationIndex\r\n                        }\r\n                        activeStepIndex={activeStepIndex}\r\n                        stepOrder={getStepOrder(stepOrderTypes[index])}\r\n                        pendingLength={reservations.length}\r\n                        removeReservation={removeReservation}\r\n                        onChange={handleActiveStepIndexChange}\r\n                        shouldHideInitialProgressBar={shouldHideInitialProgressBar && index === 0}\r\n                    />\r\n                ))}\r\n                {location.pathname === Routes.ReservationEnd && (\r\n                    <ReservationEnd\r\n                        index={stepOrder.length - 1}\r\n                        isEndStep={activeStepIndex === stepOrder.length - 1}\r\n                        onEndStep={handleEndStep}\r\n                        reservationOrder={reservationOrder}\r\n                    />\r\n                )}\r\n            </BookingProvider>\r\n        </section>\r\n    );\r\n};\r\n\r\nexport default BookingFlow;\r\n","import React from 'react';\r\nimport Circle from './Circle';\r\n\r\nconst Email = () =>\r\n    <Circle>\r\n        <svg fill=\"currentColor\" focusable=\"false\" width=\"20px\" height=\"20px\" x=\"12\" y=\"9\" viewBox=\"-3.63064 -66.0327 1300.76 962.035\">\r\n            <path d=\"M1023.31 486.704c-1.36035 11.3115 -5.61426 21.7129 -12.0947 30.4648h0.160156l-0.879883 0.879883c-3.28027 4.32031 -7.12012 8.12793 -11.4082 11.5039l-417.28 403.408c-36.2236 36.2236 -99.5039 36.2881 -135.776 0l-417.216 -400.256 c-9.02441 -8.40039 -28.8809 -31.0889 -28.8809 -53.3447v-479.52c0 -35.1836 28.8164 -64 64 -64h896c35.1836 0 64 28.8164 64 64v478.256c0.223633 2.87988 -0.0644531 5.75977 -0.624023 8.60742zM269.794 233.665l-205.856 -189.567v371.184zM335.569 207.281 c2.28809 1.51953 4.46484 3.24805 6.36914 5.4082c0.368164 0.416016 0.624023 0.912109 0.959961 1.34375l141.168 130c7.24805 5.83984 15.8398 8.91211 24.8799 8.91211c9.18359 0 18.3672 -3.21582 24.5273 -8l383.6 -345.104h-806.736zM757.458 229.442l202.48 179.696 v-361.84zM103.778 517.171l387.501 370.544c6.06445 6.03223 14.0967 9.37598 22.625 9.37598c8.55957 0 16.5918 -3.34375 22.6562 -9.37598l361.376 -344.352h-0.975586l54.8965 -55.792l-242.304 -215.04l-135.248 121.664 c-37.6797 29.5361 -91.7754 30.8164 -131.68 -1.37598l-125.504 -115.584l-241.792 213.344l26.9922 26.5918h1.45605z\" />\r\n        </svg>\r\n    </Circle>\r\n\r\nexport default Email;","import React from 'react';\r\nimport Circle from './Circle';\r\n\r\nconst Location = () =>\r\n    <Circle>\r\n        <svg fill=\"currentColor\" focusable=\"false\" width=\"18px\" height=\"18px\" x=\"12\" y=\"10\" viewBox=\"-3.63064 -66.0327 1030.76 962.035\">\r\n            <path d=\"M966.912 661.84l-179.121 192c-6.08008 6.48047 -14.5439 10.1602 -23.4238 10.1602h-267.12l-1.00781 66c0 16.5596 -14.3359 30 -32 30s-30 -13.4404 -30 -30l-0.975586 -66h-352.768c-17.6797 0 -32 -14.3203 -32 -32v-384c0 -17.6797 14.3203 -32 32 -32h352.336 v-450c0 -16.5596 14.3359 -30 32 -30s32 13.4404 32 30v450h267.536c8.87988 0 17.3438 3.67969 23.4082 10.1602l179.12 192c11.4717 12.3037 11.4717 31.376 0.015996 43.6796zM750.463 480h-637.968v320h637.968l149.28 -160z\" />\r\n        </svg>\r\n    </Circle>\r\n\r\nexport default Location;","import React from 'react';\r\nimport Circle from './Circle';\r\n\r\nconst Phone = () =>\r\n    <Circle>\r\n        <svg fill=\"currentColor\" focusable=\"false\" width=\"18px\" height=\"20px\" x=\"11\" y=\"10\" viewBox=\"-3.63064 15 1030.76 962.035\">\r\n            <path d=\"M262.2 923c37.4004 -51.5996 82.002 -118.197 133.602 -199.598c13 -22 11 -48.4004 -5.7998 -79.4004c-6.40039 -13 -22.6006 -42.5996 -48.4004 -89.1992c28.4004 -40 71.6006 -89.2002 129.801 -147.2s106.601 -101.4 145.2 -129.801 c46.4004 27.2002 76.2002 43.7998 89.2002 50.3994c16.7998 9 33 13.5996 48.4004 13.5996c11.5996 0 22 -2.59961 31 -7.7998c59.4004 -36.2002 126.601 -80.7998 201.4 -133.6c14.2002 -10.4004 22.2002 -24.6006 24.2002 -42.6006 c2 -18.2002 -3.59961 -37.4004 -16.3994 -58.2002c-6.40039 -9 -16.8008 -22.2002 -31.001 -39.7998c-14.2002 -17.4004 -35.6006 -39.4004 -64.001 -65.8008s-51.6006 -39.8008 -69.8008 -39.8008h-2c-136.6 5.40039 -305 107.801 -504.4 307.201 c-199.6 199.6 -302 367.8 -307.2 504.6c0 18 13.2002 41.5996 39.7998 70.7998c26.4004 29 48.2002 50 64.7998 63c16.7998 12.7998 31 23.2002 42.5996 31c14.2002 10.4004 30.4004 15.4004 48.4004 15.4004c22.2002 0 38.7998 -7.7998 50.5996 -23.2002zM198.202 882.402 c-27.2002 -19.4004 -52.6035 -41.1982 -76.6035 -64.998c-23.7998 -24 -37.7998 -41.5996 -41.5996 -53.1992c5.2002 -120.2 101 -273.2 287.6 -459.2c186.6 -186 340 -282.2 460 -288.601c10.4004 3.7998 27.4004 18 51.4004 42.5996s45.5996 50.3994 64.7998 77.3994 c3.7998 5.2002 5.2002 9.60059 3.7998 13.6006c-77.4004 54.2002 -142 97.4004 -193.8 129.801c-5.2002 0 -11.6006 -2 -19.4004 -5.7998c-11.5996 -6.40039 -40.5996 -22.6006 -87.1992 -48.4004l-33 -19.4004l-33 21.4004 c-42.5996 29.5996 -94.1992 75.5996 -154.999 137.6c-60.5996 60.5996 -105.8 112.399 -135.6 154.999l-23.2002 31l19.4004 34.7998c25.7998 46.4004 42 75.6006 48.4004 87.2002c3.7998 7.7998 5.7998 14.2002 5.7998 19.4004c-46 73.4004 -88.5996 138 -127.399 193.6h-2 c-5 0 -9.59961 -1.40039 -13.3994 -3.80078z\" />\r\n        </svg>\r\n    </Circle>\r\n\r\nexport default Phone;\r\n\r\n","import React from 'react';\r\nimport Circle from './Circle';\r\n\r\nconst Facebook = () =>\r\n    <Circle>\r\n        <svg fill=\"currentColor\" focusable=\"false\" width=\"18px\" height=\"25px\" x=\"11\" y=\"5\" viewBox=\"-3.63064 -66.0327 1030.76 962.035\">\r\n            <path d=\"M581.76 879.504c3.80762 0 5.99902 -0.15918 5.99902 -0.15918h83.5684l-0.431641 -96h-83.0078c-45.6797 0 -44.624 -39.0078 -44.624 -39.0078v-152.192h161.632l-22.5596 -95.8721h-139.6v-479.776h-95.9043l-0.0644531 479.776h-127.408l-0.255859 95.8721h127.712 v149.184c0.015625 130.08 108.048 138.176 134.944 138.176zM671.327 879.345h0.160156h-0.160156zM581.76 943.505c-23.0078 0 -67.9697 -3.80859 -110.562 -29.4727c-40.3203 -24.2559 -88.3682 -73.9355 -88.3682 -172.688v-85.1836h-63.7119 c-17.0078 0 -33.3115 -6.78418 -45.3438 -18.8164c-12 -12.0645 -18.7197 -28.3682 -18.6553 -45.4082l0.255859 -95.8721c0.12793 -35.248 28.752 -63.7764 64 -63.7764h63.4082l0.0644531 -415.776c0 -35.3438 28.6562 -64 64 -64h95.9043c35.3438 0 64 28.6562 64 64 v415.776h75.5996c28.4004 0 53.4082 18.7197 61.4082 45.9678l22.5596 95.8721c5.67969 19.3438 1.90332 40.2559 -10.1924 56.3682c-12.0645 16.1602 -31.0566 25.6641 -51.2168 25.6641h-97.6318v63.1523l63.6318 0.0322266c35.2158 0 63.8398 28.4639 64 63.7119 l0.431641 92.752c0.0644531 1.18359 0.0966797 2.33594 0.0966797 3.53613c0 35.3438 -28.5918 64 -63.9355 64h-81.9355c-1.83984 0.0957031 -4.49609 0.160156 -7.80713 0.160643z\" />\r\n        </svg>\r\n    </Circle>\r\n\r\nexport default Facebook;","import React from 'react';\r\nimport Circle from './Circle';\r\n\r\nconst WebSite = () =>\r\n    <Circle>\r\n        <svg fill=\"currentColor\" focusable=\"false\" width=\"18px\" height=\"18px\" x=\"11\" y=\"9\" viewBox=\"-3.63064 -66.0327 1030.76 962.035\">\r\n            <path d=\"M960 864.192h-896c-35.1836 0 -64 -28.7998 -64 -64v-544.192c0 -35.1836 28.8164 -63.9834 64 -63.9834h416v-96.208h-160c-17.6641 0 -32 -14.3359 -32 -32s14.3359 -32 32 -32h384c17.6641 0 32 14.3359 32 32c0 17.6641 -14.3359 32 -32 32h-160v96.208h416 c35.1836 0 64 28.7998 64 63.9834v544.192c0 35.2002 -28.8164 64 -64 64zM960 256h-896v544.192h896v-544.192z\" />\r\n        </svg>\r\n    </Circle>\r\n\r\nexport default WebSite;\r\n\r\n","import React from 'react';\r\nimport { ICompany, IContactInfo, ReservationOrder } from 'src/entities/company';\r\nimport AboutUs from '../AboutUs/AboutUs';\r\nimport BookingFlow from '../BookingFlow/BookingFlow';\r\nimport ContactInfo from '../ContactInfo/ContactInfo';\r\nimport Placeholder, { PagePlaceholder } from '../Placeholder/Placeholder';\r\nimport { useReducer, useEffect } from 'react';\r\nimport AvailabilityWarning from '../AvailabilityWarning';\r\nimport { EmbedModeType } from 'src/embed';\r\nimport { Routes } from 'src/routes';\r\nimport CallToAction from '../CallToAction';\r\nimport { useEmbedOptions } from 'src/contexts/EmbedContext';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\ninterface IHomeProps {\r\n    company: ICompany | null;\r\n    contactInfo: IContactInfo | null;\r\n}\r\n\r\nconst Home = ({ company, contactInfo }: IHomeProps) => {\r\n    const location = useLocation();\r\n    const hasDetails = company && (\r\n        company.Description ||\r\n        company.ShortDescription ||\r\n        company.LogoLink ||\r\n        company.BackgroundLink\r\n    );\r\n\r\n    const isHomeSlashRoute = location.pathname === Routes.HomeSlash;\r\n    const isBookRoute = location.pathname === Routes.Book;\r\n    const embedOptions = useEmbedOptions();\r\n    const hideCompanyInfo = embedOptions && (embedOptions.hideCompanyInfo || embedOptions.mode !== EmbedModeType.WebPage);\r\n    const [key, resetBookingFlow] = useReducer(state => ++state, 0);\r\n\r\n    useEffect(() => {\r\n        if (isHomeSlashRoute) {\r\n            resetBookingFlow();\r\n        }\r\n    }, [isHomeSlashRoute])\r\n\r\n    if (!company) {\r\n        return <PagePlaceholder />\r\n    }\r\n\r\n    const hasBookingFlow = company.ReservationOrder !== ReservationOrder.OnlyPreReservation;\r\n\r\n    return <>\r\n        <div id=\"booking-flow\" className=\"home__section App__booking-module\">\r\n            {hasBookingFlow\r\n                ? <BookingFlow\r\n                    key={key}\r\n                    reservationOrder={embedOptions.order || company.ReservationOrder}\r\n                    shouldHideInitialProgressBar={\r\n                        !isBookRoute\r\n                        && embedOptions.mode !== EmbedModeType.ProgressBar\r\n                        && !!hasDetails\r\n                    }\r\n                />\r\n                : <AvailabilityWarning type=\"bookingNotAvailable\" />}\r\n        </div>\r\n\r\n        {isHomeSlashRoute && !hideCompanyInfo &&\r\n            <>\r\n                {company.Description &&\r\n                    <>\r\n                        <div id=\"about-us\" className=\"home__section\">\r\n                            <AboutUs body={company.Description} />\r\n                        </div>\r\n                        {hasBookingFlow &&\r\n                            <div className=\"home__section home__section--over\">\r\n                                <CallToAction />\r\n                            </div>\r\n                        }\r\n                    </>\r\n                }\r\n                <div id=\"contact-info\" className=\"home__section\">\r\n                    {contactInfo && <ContactInfo {...contactInfo} /> || <Placeholder />}\r\n                </div>\r\n            </>\r\n        }\r\n    </>\r\n}\r\n\r\nexport default Home;\r\n\r\n\r\n","import { IConfirmationLocationState } from 'src/components/BookingFlow/ReservationConfirm/ReservationConfirm';\r\n\r\nexport const redirectAfterSendReservation = (state: IConfirmationLocationState, customSuccesLink?: string): boolean => {\r\n    if (customSuccesLink) {\r\n        const hasAnyBlocked = state.Reservations!.some(r => r.Blocked);\r\n\r\n        if (!hasAnyBlocked) {\r\n            const queryParams = createQueryParams(state);\r\n            const divider = customSuccesLink.includes('?') ? '&' : '?';\r\n            window.location.href = `${customSuccesLink}${divider}${queryParams}`;\r\n            return true;\r\n        }\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\n\r\nconst createQueryParams = (state: IConfirmationLocationState): string => {\r\n    const params = new URLSearchParams();\r\n    const reservation = state.Reservations![0];\r\n\r\n    params.append('instanceUrl', window.location.hostname);\r\n\r\n    if (reservation.CalendarId) {\r\n        params.append('calendarId', reservation.CalendarId.toString());\r\n    }\r\n\r\n    params.append('serviceId', reservation.ServiceId.toString());\r\n    params.append('reservationId', reservation.Id.toString());\r\n\r\n    if (state.clientKey) {\r\n        params.append('clientKey', state.clientKey);\r\n    }\r\n    if (reservation.User) {\r\n        params.append('email', reservation.User.Email);\r\n        params.append('phone', reservation.User.Phone);\r\n        params.append('fullName', reservation.User.Name);\r\n    }\r\n\r\n    params.append('personCount', reservation.PersonCount.toString());\r\n\r\n    return params.toString();\r\n}","import { IReservationEndUser } from 'src/entities/user';\r\nimport { IValidationRule, required, emailFormat, phoneFormat, isChecked } from './validations';\r\nimport { personalDetailsFields } from './userDetailsRules';\r\n\r\nconst getReservationEndFields = () => {\r\n    const privacyField: keyof IReservationEndUser = 'PrivacyStatementAccepted';\r\n\r\n    return {\r\n        ...personalDetailsFields,\r\n        PrivacyStatementAccepted: privacyField,\r\n        TermsAccepted: 'TermsAccepted'\r\n    }\r\n}\r\n\r\nexport const reservationEndFields = getReservationEndFields();\r\n\r\nexport const reservationEndRules = (isEmailRequired: boolean, isPhoneNumberRequired: boolean, isNameRequired: boolean, isTermsRequired: boolean)\r\n    : IValidationRule[] => {\r\n    const rules = [\r\n        emailFormat(reservationEndFields.Email),\r\n        phoneFormat(reservationEndFields.Phone),\r\n        isChecked(reservationEndFields.PrivacyStatementAccepted)\r\n    ];\r\n\r\n    if (isEmailRequired) {\r\n        rules.push(required(reservationEndFields.Email));\r\n    }\r\n    if (isPhoneNumberRequired) {\r\n        rules.push(required(reservationEndFields.Phone));\r\n    }\r\n    if (isNameRequired) {\r\n        rules.push(required(reservationEndFields.Name));\r\n    }\r\n    if(isTermsRequired) {\r\n        rules.push(isChecked(reservationEndFields.TermsAccepted));\r\n    }\r\n\r\n    return rules;\r\n}\r\n\r\n\r\n","import { ISignupUser } from 'src/entities/user';\r\nimport { IValidationRule, required, emailFormat, phoneFormat, isChecked, isValidLength } from './validations';\r\nimport { } from './userDetailsRules';\r\nimport { reservationEndFields } from './reservationEndRules';\r\nimport config from 'src/constants';\r\n\r\nconst getSignupFields = () => {\r\n    const passwordField: keyof ISignupUser = 'Password';\r\n\r\n    return {\r\n        ...reservationEndFields,\r\n        Password: passwordField\r\n    }\r\n}\r\n\r\nexport const signupFields = getSignupFields();\r\n\r\nexport const signupRules: IValidationRule[] = [\r\n    required(signupFields.Name),\r\n    required(signupFields.Email),\r\n    emailFormat(signupFields.Email),\r\n    required(signupFields.Phone),\r\n    phoneFormat(signupFields.Phone),\r\n    isChecked(signupFields.PrivacyStatementAccepted),\r\n    required(signupFields.Password),\r\n    isValidLength(signupFields.Password, config.MIN_PASSWORD_LENGTH, config.MAX_PASSWORD_LENGTH)    \r\n];"],"names":["messages","callToAction","id","defaultMessage","location","to","pathname","Book","hash","search","className","closePopup","intl","useState","adminPrivacyStatement","setAdminPrivacyStatement","clientApprovalStatement","setClientApprovalStatement","useEffect","dataPolicySubscription","language","promise","then","dataPolicy","AdminPrivacyStatement","ClientApprovalStatement","catch","fetchDataPolicy","locale","cancel","dangerouslySetInnerHTML","__html","autoFocus","onClick","caption","dataPolicyOk","PendingJumpType","body","globalMessages","aboutUs","BookingContext","reservationEndUser","initialUserState","stepOrderTypes","reservations","activeReservationIndex","actions","setReservationEndUser","handleUserChange","handleInvoiceChange","reloadReservations","setReservationModel","addNewReservation","removeReservation","setActiveReservation","autoSelected","hasAutoSelected","activeStepIndex","reservationOrder","CalendarFirst","BookingProvider","Provider","Consumer","touched","name","index","isLoading","stepTouchedClass","size","color","form","PrimaryButton","Helmet","media","ReservationEndContext","hasOnlinePocket","selectedPayment","shouldSignUp","displayedSubtotal","setHasOnlinePocket","setSelectedPayment","setShouldSignUp","ReservationEndProvider","company","useContext","AppContext","Section","title","map","reservation","i","Reservation","key","displayReadMore","canModify","needsPayment","PaymentSettings","IsPaymentEnabled","service","timetable","onEdit","onDelete","isReservationEnd","IsCartDisabled","SecondaryButton","Price","subtotal","FormattedPrice","value","currency","Currency","createUserInvoice","actUser","InvoiceDetails","InvoiceName","Country","City","StreetAddress","PostalCode","PrivatePerson","TaxNumber","createReservationEndUser","Email","Name","Phone","PrivacyStatementAccepted","TermsAccepted","urlSearchParams","URLSearchParams","window","nameParam","get","createValidator","props","isTermsRequired","personalValidator","reservationEndRules","invoiceValidator","invoiceDetailsRules","createValidation","actValidator","data","submitted","validate","getInitial","reservationEndLogin","or","signUpOnReservation","PersonalDetailsSection","forwardRef","ref","validation","isAuthenticated","user","hideUser","EmbedContext","isLoginVisible","setLoginVisible","requiredFieldInfo","RequiredFieldInfo","toggleLogin","validator","signupRules","passwordValidation","personalDetails","autoComplete","noValidate","Checkbox","checked","onChange","PersonalDetails","defaultUser","isEmailRequired","isPhoneNumberRequired","isNameRequired","adminCountryCode","DefaultCountryCode","TextInput","type","Password","fieldName","label","password","required","ValidationMessage","message","fields","formatValues","messageValues","Popup","visible","Login","setUser","onSitePayment","onBarionPayment","onPayPalPayment","PayPalImg","src","BarionImg","result","pockets","paymentType","selected","hasInit","setHasInit","selectOptions","filter","pocket","Online","Type","IsActive","NeedAccept","NoNeedToPay","push","Id","PaymentProvider","NoProvider","NeedsInvoice","DisplayName","providerMessages","Barion","displayName","Paypal","o","providerMessage","undefined","addLocalizedDisplayNameToOptions","length","selectedPocket","find","opt","Radio","options","payment","rootClassName","buttonClassName","labelClassName","inputClassName","getLabel","Placeholder","count","paymentSelect","isSelectNeeded","pocketList","some","activePockets","otherTitle","PaymentType","IsBillingEnabled","invoiceDetails","UserInvoiceDetails","defaultUserInvoice","barionStatement","setDataPolicy","isDataPolicyVisible","setDataPolicyVisible","handleCheckBoxLinkClick","e","preventDefault","stopPropagation","privacyAccept","values","span","msg","dataPolicyTitle","DataPolicy","termsStatement","setTermsAccepted","TermsAndConditionsLink","a","href","target","rel","sendReservation","toPaymentSite","reservationWarningHeader","reservationWarningDefault","reservationWarningCollision","reservationWarningPayment","injectIntl","isEndStep","onEndStep","navigationType","navigate","isReservationEndRoute","ReservationEnd","sendCondition","setSendCondition","isWarningVisible","setIsWarningVisible","warningText","setWarningText","useCallback","postReservationParams","termsAccepted","postPaymentReservationParams","paymentReservations","paymentUser","Service","Promise","all","afterSend","responseAny","response","setLoading","PaymentReservationResponse","ReservedReservations","showWarningPopup","HasCollision","HasPaymentError","setItem","JSON","stringify","PaymentUrl","navigationState","UserEmail","Reservations","didSignUp","CustomSuccessLink","Confirmation","state","reason","setErrorMessage","errorMessage","submitting","setSubmitted","setValidator","personalDetailsRef","createRef","personalValidation","invoiceValidation","warningTextValue","current","reset","reservationModels","selectedPaymentId","Pop","reservationEndContext","NeedPay","isValid","signUpValidation","HomeSlash","action","selectedValue","isModifiable","modify","pendingCount","jumpTo","jumpToReservationEnd","confirmJumpToEnd","BookingFlowActionTypes","reservationCount","Top","n","description","affirmativeCaption","yes","affirmativeAction","variants","opacity","height","overflow","transitionEnd","transition","duration","hidden","Navigator","isOpen","setTimeout","content","nextHandler","isActive","step","modifyHandler","isCompleted","stepIndex","isLast","isProgressBarHidden","jumpToEndHandler","context","isHomeSlashRoute","setIsModifiable","setIsLoading","reservationData","searchParams","CalendarId","ServiceId","Date","bookingStepClasses","Timetable","Calendar","whichever","currentStep","displayValue","getStepSelectedValue","showReservationsNumber","div","initial","animate","isFirst","onComplete","hasSkipped","Object","includes","onIsModifiable","onLoadingChanged","delay","Bottom","getDateParam","WrappedComponent","searchParam","paramName","extendedData","newProps","Description","calendar","firstFreeSlot","startReservation","bodyRef","useRef","close","firstStepAction","CalendarItemSkeleton","role","Button","lines","withLogoSpace","button","selectCalendar","isLongDescriptionVisible","setIsLongDescriptionVisible","fetchFirstFreeSlot","ShouldDisplayFirstTime","isFirstStep","PictureLink","Image","year","month","day","hour","minute","ShortDescription","readMore","keepSelected","getSelectCaption","next","shouldGetByService","hasRandomCalendar","canUserSelectCalendar","console","warn","prevProps","calendarsSubscription","selectedCalendar","calendars","setCalendars","hasLoaded","setHasLoaded","prevHasLoaded","setPrevHasLoaded","shouldPreSelect","setShouldPreSelect","shouldCheckSelectedCalendar","setShouldCheckSelectedCalendar","shouldFetchWhenUpdate","setShouldFetchWhenUpdate","hasAnyLogo","createSelectedCalendar","fetchCalendars","calendarList","hasSingleEmptyCalendar","getSearchCalendar","searchCalendar","handleCanUserSelectCalendar","serviceChanged","c","checkSelectedCalendar","AvailabilityWarning","A","setValue","stepData","style","width","event","ServiceItemSkeleton","selectService","isLongDescriptionShown","setIsLongDescriptionShown","IsDurationVisible","DurationToUser","DisplayedPrice","DisplayedCurrency","PaymentMethod","VatPercentage","toBePaid","ServiceDescription","shouldGetByCalendar","isPaymentEnabled","servicesSubscription","selectedService","services","setServices","fetchServices","servicesFormSubscription","createSelectedService","s","checkSelectedService","isActiveChanged","calendarChanged","isSingleEmptyService","Payable","preSelect","useIntl","firstFreeSlotSubScription","googleSyncSubscription","dateTimeSelectRules","appointment","pendingReservations","setPendingReservations","readyToFinish","setReadyToFinish","personCount","selectedDate","startTime","selectedTime","clickedByUser","setState","autoSelectedDate","isAppointmentView","handleDateTimeChange","newDateTime","prevState","handleDateChange","newDate","handleTimeChange","newTime","clicked","handlePersonCountChange","newPersonCount","googleSync","GoogleCalendarName","finally","finish","format","endTime","add","formatDate","formatTime","slice","r","Classic","isCalendarChanged","ConcurrentNum","isServiceChanged","AppointmentCalendar","querySelectedDate","onDateTimeSelect","Readonly","onPersonCountChange","DateTimeSelect","time","date","firstFreeDay","autoSelect","onDateChange","onTimeChange","allowAlreadySelected","isOnlyService","dateTimeRequired","modifier","jsApiContext","JsApiContext","customerDataStepValue","CustomerData","initialAnswers","answers","setAnswers","questions","setQuestions","arriveTime","selectedArriveTime","setSelectedArriveTime","shouldValidate","setShouldValidate","hasQuestionsLoaded","setHasQuestionsLoaded","prevHasQuestionsLoaded","setPrevHasQuestionsLoaded","fetchQuestions","questionsSubscription","currentAnswers","currentQuestions","contextDataMap","reduce","acc","question","mergedQuestions","q","setData","entries","entry","setQuestionValue","cleanQuestionValue","CustomEvent","detail","dispatchEvent","setValidatorByQuestions","formatMessage","nAnswers","reservationStart","schedule","Start","answer","onArriveTimeChange","lazy","getSchedules","scheduleLists","fetchFirstSlot","isFirstFreeSlotLoading","userViewSlotMinutes","UserViewSlotMinutes","handleServiceSelect","Suspense","fallback","ReadonlyInfo","phoneNumber","PhoneNumber","getEventTimes","handleEventRender","arg","currentWeekDay","minTimeReserve","MinTimeReserve","isReadonly","hideSeatCount","HideSeatCount","isWeekendDisabled","WeekendDisabled","handleEventClassNames","eventTimes","slotDuration","areEventsLoading","stepNames","dateTime","stepOrder","pendingLength","shouldHideInitialProgressBar","companyFromContext","completedSteps","setCompletedSteps","hasProgressed","setHasProgressed","lastIndex","keys","forEach","getStepIsCompleted","getStepByIndex","nextStep","modifiedStepIndex","stepsToReset","steps","findIndex","modifyStep","jumpToEnd","pop","every","getStepComponent","ReservationOrder","ServiceFirstWithAllCalendarOption","CanUserSelectCalendar","ContactDetailType","bookingFlowReducer","SET_RESERVATION_END_USER","HANDLE_USER_CHANGE","HANDLE_INVOICE_CHANGE","RELOAD_RESERVATIONS","newReservations","newStepOrderTypes","newActiveReservationIndex","newActiveStepIndex","getStepOrder","SET_RESERVATIONS","stepType","currentReservation","currentStepOrder","newReservation","orderType","reservationStepType","value2","hasValueChanged","rule","dependentSteps","clearObsoleteStepValues","ADD_RESERVATION","stepOrderType","REMOVE_RESERVATION","removedReservations","_","removedStepOrderTypes","SET_ACTIVE_RESERVATION","indexOf","SET_AUTO_SELECTED","SET_STEP_ORDER_TYPES","newStepOrderType","TimetableWithQuestions","HasQuestions","HasArriveTime","SET_ACTIVE_STEP_INDEX","useReducer","dispatch","setReservations","setStepOrderTypes","setActiveStepIndex","useBookingFlowReducer","handleActiveStepIndexChange","Circle","fill","focusable","x","y","viewBox","d","webpage","facebookPage","ContactDetail","icon","text","link","linkAttributes","External","startsWith","createRealLink","Nl2br","contactInfo","PublicEmail","PublicPhoneNumber","Address","MapLink","OpeningHours","WebPageLink","FacebookPageLink","hasDetails","hasSocial","windowWidth","useLayoutEffect","contactsSection","classList","remove","children","hasOverlappingElements","arr","Array","from","getBoundingClientRect","rect1","rect2","right","left","contactUs","LogoLink","BackgroundLink","isBookRoute","embedOptions","hideCompanyInfo","mode","WebPage","resetBookingFlow","hasBookingFlow","OnlyPreReservation","order","ProgressBar","CallToAction","redirectAfterSendReservation","customSuccesLink","Blocked","queryParams","createQueryParams","divider","params","append","hostname","toString","clientKey","User","PersonCount","reservationEndFields","rules","signupFields","MIN_PASSWORD_LENGTH","MAX_PASSWORD_LENGTH"],"sourceRoot":""}