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EACV,UACY,IAAZA,GACA,SACA,GAEV,OACIvB,EAAAA,EAAAA,KAAC4B,EAAAA,SAAc,CAAAvB,UACXL,EAAAA,EAAAA,KAAC6B,EAAAA,EAAK,CAACC,UAAW,EAAEzB,UAChBL,EAAAA,EAAAA,KAAA,OAAKF,UAAW,qBAAqB6B,KAActB,UAC/CL,EAAAA,EAAAA,KAAC+B,EAAAA,EAAI,CAAA1B,SAAEoB,UAGF,C","sources":["components/reservation-timer/reservation-timer.tsx"],"sourcesContent":["import './reservation-timer.scss';\r\n\r\nimport { Affix, Modal } from 'antd';\r\nimport Paragraph from 'antd/lib/typography/Paragraph';\r\nimport Text from 'antd/lib/typography/Text';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useState, useMemo } from 'react';\r\nimport { Trans, useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { push } from 'connected-react-router';\r\n\r\nimport { IApplicationState } from '../../store';\r\nimport { actionCreators as BookingActions, BookingStatus } from '../../store/Booking';\r\nimport { actionCreators as GiftVoucherActions, GiftVoucherStatus } from '../../store/GiftVoucher';\r\nimport { actionCreators as PaymentActions } from '../../store/Payments';\r\nimport { actionCreators as UIActions } from '../../store/UI';\r\nimport usePrevious from '../../hooks/usePrevious';\r\nimport Heading, { HeadingSize } from '../heading/heading';\r\nimport ZLButton, { ButtonType } from '../zl-button/zl-button';\r\nimport { useLocation } from 'react-router';\r\nimport useQuery from '../../hooks/useQuery';\r\nimport { PurchaseTypes } from '../../store/PurchaseTypes';\r\nimport Logging from '../../service/logging';\r\n\r\nexport interface IExpiredModalProps {\r\n showModal: boolean;\r\n}\r\n\r\nconst getTimerString = (seconds: number) => {\r\n const min = Math.floor(seconds / 60);\r\n const sec = seconds - min * 60;\r\n return `${String(min).padStart(2, '0')}:${String(sec).padStart(2, '0')}`;\r\n};\r\n\r\nconst ReservationTimer: React.FunctionComponent = () => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n const reservationTime = Number(process.env.REACT_APP_RESERVATION_TIME) ?? 8;\r\n\r\n const selectedPurchaseType = useSelector((state: IApplicationState) => state.purchaseType.selectedPurchaseType);\r\n const selectedSiteId = useSelector((state: IApplicationState) => state.sites.selectedSite?.siteId);\r\n\r\n const bookingId = useSelector((state: IApplicationState) => state.booking.booking?.bookingId);\r\n const bookingCreated = useSelector((state: IApplicationState) => state.booking.booking?.createdDateTime);\r\n const bookingStatus = useSelector((state: IApplicationState) => state.booking.status);\r\n\r\n const giftVoucherStatus = useSelector(\r\n (state: IApplicationState) => state.giftVoucher.giftVoucher?.giftVoucherStatusTypeId\r\n );\r\n\r\n const giftVoucherLoading = useSelector((state: IApplicationState) => state.giftVoucher.loading);\r\n const bookingLoading = useSelector((state: IApplicationState) => state.giftVoucher.loading);\r\n\r\n const giftVoucherPurchaseRef = useSelector(\r\n (state: IApplicationState) => state.giftVoucher.giftVoucher?.giftVoucherRef\r\n );\r\n const bookingPurchaseRef = useSelector((state: IApplicationState) => state.booking.booking?.bookingRef);\r\n const currentMoment = useSelector((state: IApplicationState) => state.intl.momentLocale);\r\n\r\n //payment details\r\n const paymentLoading = useSelector((state: IApplicationState) => state.payments.loading);\r\n\r\n const bookingRelatedPaymentId = useSelector((state: IApplicationState) => state.booking?.charge?.relatedPaymentId);\r\n const giftRelatedPaymentId = useSelector((state: IApplicationState) => state.giftVoucher?.charge?.relatedPaymentId);\r\n const chargeRelatedPaymentId =\r\n selectedPurchaseType === PurchaseTypes.Booking || selectedPurchaseType === PurchaseTypes.PrivateEvent\r\n ? bookingRelatedPaymentId\r\n : giftRelatedPaymentId;\r\n\r\n const loading =\r\n selectedPurchaseType === PurchaseTypes.Booking || selectedPurchaseType === PurchaseTypes.PrivateEvent\r\n ? bookingLoading\r\n : giftVoucherLoading;\r\n const purchaseRef =\r\n selectedPurchaseType === PurchaseTypes.Booking || selectedPurchaseType === PurchaseTypes.PrivateEvent\r\n ? bookingPurchaseRef\r\n : giftVoucherPurchaseRef;\r\n\r\n const paused = useSelector((state: IApplicationState) => state.payments.loading);\r\n const siteUrlKey = useSelector((state: IApplicationState) => state.sites.selectedSite?.urlKey);\r\n\r\n const deadline = useMemo(\r\n () => moment(bookingCreated).add(reservationTime, 'minutes'),\r\n [bookingCreated, reservationTime]\r\n );\r\n const [seconds, setSeconds] = useState(deadline.diff(moment(), 'seconds'));\r\n const [checkBookingCounter, setCheckCounter] = useState(2);\r\n const [dialogShown, setDialogShown] = useState(false);\r\n const [showBookingExpired, setShowBookingExpired] = useState(false);\r\n\r\n const previousDeadline = usePrevious({ deadline })?.deadline;\r\n const page = location.pathname.split('/').filter((o) => o !== '')[1];\r\n const processingPage = page === 'processing';\r\n const [processingStartTime, setProcessingStartTime] = useState(null);\r\n const query = useQuery();\r\n\r\n let timer: any = null;\r\n\r\n //detect when we first land on the processing page, so we can check how long the user has been waiting there\r\n useEffect(() => {\r\n if (processingPage && processingStartTime === null) {\r\n // Record the start time when processingPage first becomes true\r\n setProcessingStartTime(Date.now());\r\n } else if (!processingPage) {\r\n // Reset the start time when processingPage becomes false\r\n setProcessingStartTime(null);\r\n }\r\n }, [processingPage]);\r\n\r\n function updateSecondsIfDeadlineHasChanged() {\r\n if (previousDeadline && !previousDeadline.isSame(deadline)) {\r\n setSeconds(deadline.diff(moment(), 'seconds'));\r\n }\r\n }\r\n\r\n // Checking the status of a booking\r\n useEffect(() => {\r\n updateSecondsIfDeadlineHasChanged();\r\n\r\n //see the other use effect for gift voucher stuff\r\n if (selectedPurchaseType === PurchaseTypes.GiftVoucher) {\r\n return;\r\n }\r\n\r\n //if the booking is active, confirm things and move on\r\n if (bookingStatus === BookingStatus.Active && (page === 'checkout' || processingPage)) {\r\n dispatch(BookingActions.confirmBookingSuccess());\r\n setShowBookingExpired(false);\r\n\r\n return;\r\n }\r\n\r\n // Determine if we should be checking the status or if the booking is/should be expired\r\n var shouldRunStatusCheck = false;\r\n if (processingPage) {\r\n // if we are on the processing page, run the status check for a few minutes to see if payment succeeds in background\r\n // after a few minutes assume the booking is expired / dead on the api/db side\r\n // and let the user know we have charged them without giving them anything for it\r\n //eg stripe with a 3Ds auth step that completes after the booking expires on the background\r\n\r\n if (processingStartTime) {\r\n const currentTime = Date.now();\r\n const timeToWait = 2 * 60 * 1000; // minutes (in milliseconds)\r\n const timeSpent = currentTime - processingStartTime;\r\n if (timeSpent >= timeToWait) {\r\n //log error message to our logging api\r\n let logMsg = `Error processing payment. User lingered on processing page for over ${timeToWait} milliseconds. BookingId: ${bookingId}. PaymentId: ${chargeRelatedPaymentId}`;\r\n\r\n let newError = new Error(logMsg);\r\n newError.name = 'Processing Payment Error';\r\n Logging.LogError(newError);\r\n\r\n //display translated error message to user letting them know they need to contact the venue\r\n let purchaseType = t('purchaseTypes.bookingSingular');\r\n let paymentType = t('payments.titles.payment');\r\n let msg = t('errors.payments.contactVenue', {\r\n purchaseType: purchaseType,\r\n purchaseId: bookingId,\r\n paymentGateway: paymentType,\r\n paymentId: chargeRelatedPaymentId,\r\n });\r\n dispatch(UIActions.displayError('errors.payments.error', msg));\r\n\r\n //booking experience now in unrecoverable state; refresh the page and try again buddy\r\n } else {\r\n //console.log(`we are on processing page ${timeSpent} >= ${timeToWait}`);\r\n shouldRunStatusCheck = true;\r\n }\r\n } else {\r\n shouldRunStatusCheck = true;\r\n }\r\n } else if (bookingStatus === BookingStatus.Pending && seconds > 0) {\r\n //if the booking is pending and we have seconds remaining\r\n shouldRunStatusCheck = true;\r\n } else if (bookingStatus === BookingStatus.Pending && !loading) {\r\n //if the booking is pending but we have run out of time, and are not waiting for some processing, expire the booking\r\n setShowBookingExpired(true);\r\n } else if (bookingStatus === BookingStatus.Expired) {\r\n //otherwise if the booking is expired\r\n setShowBookingExpired(true);\r\n }\r\n\r\n //if we have a reason to be checking the status of the booking, start the timer\r\n if (shouldRunStatusCheck) {\r\n //clear any old version of the timer\r\n clearInterval(timer);\r\n\r\n //set up a new one\r\n timer = setInterval(() => {\r\n // Update seconds and perform checks\r\n const newSeconds = deadline.diff(moment(), 'seconds');\r\n setSeconds(newSeconds);\r\n\r\n // Check booking status periodically\r\n if (checkBookingCounter === 0 && purchaseRef) {\r\n dispatch(BookingActions.checkBookingExpired(purchaseRef));\r\n\r\n //check if the stripe payment was successful\r\n const paymentIntent = query.get('payment_intent');\r\n if (paymentIntent) {\r\n dispatch(PaymentActions.stripePaymentStatus(paymentIntent));\r\n }\r\n\r\n setCheckCounter(4); //run the api check every x seconds\r\n } else {\r\n setCheckCounter(checkBookingCounter - 1);\r\n }\r\n }, 1000);\r\n }\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }, [\r\n seconds,\r\n checkBookingCounter,\r\n purchaseRef,\r\n bookingCreated,\r\n dispatch,\r\n bookingStatus,\r\n loading,\r\n deadline,\r\n previousDeadline,\r\n paused,\r\n location.pathname,\r\n processingPage,\r\n processingStartTime,\r\n ]);\r\n\r\n // Checking the status of the gift voucher\r\n useEffect(() => {\r\n if (selectedPurchaseType !== PurchaseTypes.GiftVoucher) {\r\n return;\r\n }\r\n\r\n if (giftVoucherStatus === GiftVoucherStatus.Pending) {\r\n timer = setInterval(() => {\r\n if (checkBookingCounter === 0 && purchaseRef && selectedSiteId) {\r\n dispatch(GiftVoucherActions.getGiftVoucherDetails(selectedSiteId, purchaseRef));\r\n const paymentIntent = query.get('payment_intent');\r\n if (paymentIntent && processingPage) {\r\n dispatch(PaymentActions.stripePaymentStatus(paymentIntent));\r\n }\r\n setCheckCounter(4);\r\n } else {\r\n setCheckCounter(checkBookingCounter - 1);\r\n }\r\n }, 1000);\r\n } else if (giftVoucherStatus === GiftVoucherStatus.Active) {\r\n if (page === 'checkout' || processingPage) {\r\n dispatch(GiftVoucherActions.confirmGiftVoucherSuccess());\r\n }\r\n }\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }, [checkBookingCounter, purchaseRef, dispatch, giftVoucherStatus]);\r\n\r\n // Showing expiration modal if booking expired\r\n useEffect(() => {\r\n if (showBookingExpired && !dialogShown && !paymentLoading) {\r\n setDialogShown(true);\r\n\r\n if (purchaseRef && bookingId) {\r\n dispatch(BookingActions.bookingExpired(purchaseRef, bookingId));\r\n }\r\n\r\n clearInterval(timer);\r\n\r\n const modal = Modal.info({\r\n icon: undefined,\r\n centered: true,\r\n width: 'auto',\r\n maskClosable: false,\r\n className: 'expired-modal',\r\n title: {t('timer.titles.sessionExpired')},\r\n content: (\r\n \r\n \r\n To start over, return to the\r\n {\r\n dispatch(BookingActions.expireBooking());\r\n dispatch(BookingActions.clearBooking());\r\n if (siteUrlKey) {\r\n dispatch(push(`/${currentMoment}/book-now/${siteUrlKey}`));\r\n } else {\r\n dispatch(push(`/${currentMoment}/`));\r\n }\r\n modal.destroy();\r\n }}\r\n >\r\n Select Tickets Page\r\n \r\n \r\n \r\n ),\r\n okButtonProps: { style: { display: 'none' } },\r\n });\r\n }\r\n }, [showBookingExpired, dialogShown, purchaseRef, bookingId, loading, paymentLoading]);\r\n\r\n const minutes = Math.ceil(seconds / 60);\r\n const translation = t('timer.labels.hurryUp', { value: getTimerString(seconds) });\r\n const visualState =\r\n bookingStatus !== BookingStatus.Pending || processingPage\r\n ? 'hidden'\r\n : minutes > 1\r\n ? 'warning'\r\n : minutes === 1\r\n ? 'danger'\r\n : '';\r\n\r\n return (\r\n \r\n \r\n
\r\n {translation}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ReservationTimer;\r\n"],"names":["getTimerString","seconds","min","Math","floor","sec","String","padStart","ReservationTimer","_Number","_usePrevious","t","useTranslation","dispatch","useDispatch","location","useLocation","reservationTime","Number","process","selectedPurchaseType","useSelector","state","purchaseType","selectedSiteId","_state$sites$selected","sites","selectedSite","siteId","bookingId","_state$booking$bookin","booking","bookingCreated","_state$booking$bookin2","createdDateTime","bookingStatus","status","giftVoucherStatus","_state$giftVoucher$gi","giftVoucher","giftVoucherStatusTypeId","giftVoucherLoading","loading","bookingLoading","giftVoucherPurchaseRef","_state$giftVoucher$gi2","giftVoucherRef","bookingPurchaseRef","_state$booking$bookin3","bookingRef","currentMoment","intl","momentLocale","paymentLoading","payments","bookingRelatedPaymentId","_state$booking","_state$booking$charge","charge","relatedPaymentId","giftRelatedPaymentId","_state$giftVoucher","_state$giftVoucher$ch","chargeRelatedPaymentId","PurchaseTypes","Booking","PrivateEvent","purchaseRef","paused","siteUrlKey","_state$sites$selected2","urlKey","deadline","useMemo","moment","add","setSeconds","useState","diff","checkBookingCounter","setCheckCounter","dialogShown","setDialogShown","showBookingExpired","setShowBookingExpired","previousDeadline","usePrevious","page","pathname","split","filter","o","processingPage","processingStartTime","setProcessingStartTime","query","useQuery","timer","useEffect","Date","now","isSame","GiftVoucher","BookingStatus","Active","BookingActions","confirmBookingSuccess","shouldRunStatusCheck","timeToWait","newError","Error","name","Logging","LogError","paymentType","msg","purchaseId","paymentGateway","paymentId","UIActions","displayError","Pending","Expired","clearInterval","setInterval","newSeconds","checkBookingExpired","paymentIntent","get","PaymentActions","stripePaymentStatus","GiftVoucherStatus","GiftVoucherActions","getGiftVoucherDetails","confirmGiftVoucherSuccess","bookingExpired","modal","Modal","info","icon","undefined","centered","width","maskClosable","className","title","_jsx","Heading","level","HeadingSize","One","children","content","Paragraph","_jsxs","Trans","i18nKey","ZLButton","type","ButtonType","Link","onClick","expireBooking","clearBooking","push","destroy","okButtonProps","style","display","minutes","ceil","translation","value","visualState","React","Affix","offsetTop","Text"],"sourceRoot":""}