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K,IAAa,CAAED,UAAW,EAAEE,QAAQ,iBAAkBqB,MAAOnD,EAAYkD,cAAiB,SAAK,KAAMtC,OAAOC,OAAO,CAAEe,UAAW,EAAEE,QAAQ,SAAW,CAAED,SAAU,IAAIpE,GAAWmJ,MAF5W,CAACC,EAAWC,KAAc,EAAAC,EAAA,GAAW,IAAIvG,KAAKqG,EAAU9B,SAAStE,UAAW,IAAID,KAAKsG,EAAU/B,SAAStE,aAE2RjC,KAAIV,IAAa,SAAK,KAAM8C,OAAOC,OAAO,CAAEe,UAAW,EAAEE,QAAQ,SAAW,CAAED,UAAU,SAAK,MAAOjB,OAAOC,OAAO,CAAEe,UAAW,EAAEE,QAAQ,mBAAqB,CAAED,UAAU,SAAK0C,EAAoB,CAAEzG,SAAUA,EAAU2G,mBAAoBA,EAAoBC,iBAAkBA,EAAkB1E,YAAaA,EAAa4C,OAAQA,EAAQ+B,WAAYA,EAAYC,kBAAmBA,SAA6B9G,EAASN,YAAe,IAE/0BkJ,EAAarF,YAAc,c,mFCV3B,MAAM3B,GAAI,OAAgB,mBACbsH,GAAuB,SAAS,EAAGC,wBAC5C,MAAMC,GAAa,aAAkBlG,EAAWiG,GAChD,OAAQ,SAAK,MAAOrG,OAAOC,OAAO,CAAEe,UAAWlC,EAAE0B,SAAW,CAAES,UAAU,SAAK,KAAMjB,OAAOC,OAAO,CAAEe,UAAWlC,EAAEoC,QAAQ,SAAW,CAAED,SAAUqF,EAAW1I,KAAI,CAAC2I,EAAGC,KAAO,SAAK,KAAMxG,OAAOC,OAAO,CAAEe,UAAWlC,EAAEoC,QAAQ,SAAW,CAAED,UAAU,SAAK,MAAO,CAAED,UAAWlC,EAAEoC,QAAQ,iBAAkB,CAAE,UAAc,QAAesF,UAAa,IAErVJ,EAAqB3F,YAAc,sB","sources":["webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-domain/dist/domains/filter/actions/create-showtime-filter.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/advance-booking-period-notification/subcomponents/ui.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/custom-action-list/subcomponents/action.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/custom-action-list/film-custom-action-list.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/runtime/types/config.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/runtime/types/props.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/runtime/film-runtime.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/runtime/types/display-text.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/synopsis/types/config.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/synopsis/types/props.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/synopsis/film-synopsis.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/components/film/synopsis/types/display-text.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/subcomponents/showtime-list/subcomponents/button.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/subcomponents/showtime-list/showtime-list.js","webpack://vista.digital.curzon/./node_modules/@vista/omnichannel-components-ui/lib/src/lib/subcomponents/showtime-list/subcomponents/skeleton.js"],"sourcesContent":["import { runInAction } from 'mobx';\r\nimport { isEmptyArray } from '../../../utils/array-utils';\r\nimport { getFilmById } from '../../browsing/selectors/films/get-film-by-id';\r\nimport { getFilterByIdAndType } from '../selectors/get-filter-by-id-and-type';\r\nimport { filterDomainStore } from '../store';\r\nimport { FilterType } from '../types/filter-type';\r\nimport { createFilterOptions } from '../utils/create-filter-option';\r\nimport { createFilterSection } from '../utils/create-filter-section';\r\nimport { updateFilterSection } from './utils/update-filter-section';\r\nexport const createShowtimeFilter = (id, showtimes, fixedValues) => {\r\n const existingFilter = getFilterByIdAndType(id, FilterType.Showtime);\r\n const newShowtimes = showtimes.filter(showtime => !(existingFilter === null || existingFilter === void 0 ? void 0 : existingFilter.baseData.includes(showtime.id)));\r\n // No need to update the existing filter if the underlying data hasn't changed.\r\n if (existingFilter && isEmptyArray(newShowtimes))\r\n return;\r\n const genreOptions = createFilterOptions(getGenreIdsForShowtimes(showtimes));\r\n const eventOptions = createFilterOptions(getEventIdsForShowtimes(showtimes));\r\n const attributeOptions = createFilterOptions(getAttributeIdsForShowtimes(showtimes));\r\n const showtimeIds = showtimes.map(showtime => showtime.id);\r\n // Update existing filter.\r\n if (existingFilter) {\r\n runInAction(() => {\r\n updateFilterSection(existingFilter.sections.genre, genreOptions);\r\n updateFilterSection(existingFilter.sections.attribute, attributeOptions);\r\n updateFilterSection(existingFilter.sections.event, eventOptions);\r\n existingFilter.baseData = showtimeIds;\r\n });\r\n return;\r\n }\r\n // Create a new filter.\r\n const filter = {\r\n id,\r\n type: FilterType.Showtime,\r\n sections: {\r\n genre: createFilterSection(genreOptions, fixedValues === null || fixedValues === void 0 ? void 0 : fixedValues.genre),\r\n attribute: createFilterSection(attributeOptions, fixedValues === null || fixedValues === void 0 ? void 0 : fixedValues.attribute),\r\n event: createFilterSection(eventOptions, fixedValues === null || fixedValues === void 0 ? void 0 : fixedValues.event)\r\n },\r\n baseData: showtimeIds\r\n };\r\n runInAction(() => {\r\n filterDomainStore.data.showtimeFilters[id] = filter;\r\n });\r\n};\r\nconst getGenreIdsForShowtimes = (showtimes) => {\r\n const genreIds = showtimes.reduce((acc, showtime) => {\r\n const film = getFilmById(showtime.filmId);\r\n if (!film)\r\n return acc;\r\n film.genreIds.forEach(genreId => acc.add(genreId));\r\n return acc;\r\n }, new Set());\r\n return [...genreIds];\r\n};\r\nconst getAttributeIdsForShowtimes = (showtimes) => {\r\n const attributeIds = showtimes.reduce((acc, showtime) => {\r\n showtime.attributeIds.forEach(attributeId => acc.add(attributeId));\r\n return acc;\r\n }, new Set());\r\n return [...attributeIds];\r\n};\r\nconst getEventIdsForShowtimes = (showtimes) => {\r\n const eventIds = showtimes.reduce((acc, showtime) => {\r\n if (showtime.eventId)\r\n acc.add(showtime.eventId);\r\n return acc;\r\n }, new Set());\r\n return [...eventIds];\r\n};\r\n","import { jsx as _jsx } from \"react/jsx-runtime\";\r\nimport { isMemberRewardFilmAdvanceBookingPeriod, NotificationType } from '@vista/omnichannel-components-domain';\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { isPast, isToday } from 'date-fns';\r\nimport { observer } from 'mobx-react';\r\nimport { useOccContext } from '../../../../context/occ/hooks/use-occ-context';\r\nimport { NotificationUI } from '../../../../subcomponents/notification/subcomponents/ui';\r\nconst b = bemClassBuilder('v-film-advance-booking-period-notification');\r\nexport const FilmAdvanceBookingPeriodNotificationUI = observer(props => {\r\n const { i18n, assets: { advanceBookingPeriodNotificationIconName }, displayText: { member: memberDisplayText } } = useOccContext();\r\n const { id, bookingPeriod, displayText, templateParameters } = props;\r\n const { messageFormat, todayMessageFormat } = displayText;\r\n if (!bookingPeriod)\r\n return null;\r\n const startDate = new Date(bookingPeriod.startsAt);\r\n if (isPast(startDate))\r\n return null;\r\n const template = isToday(startDate) ? todayMessageFormat : messageFormat;\r\n const message = i18n.template(template, Object.assign(Object.assign({}, templateParameters), { startsAt: bookingPeriod.startsAt }));\r\n const title = isMemberRewardFilmAdvanceBookingPeriod(bookingPeriod)\r\n ? memberDisplayText.rewardExclusiveLabel\r\n : undefined;\r\n return (_jsx(NotificationUI, { id: id, type: NotificationType.Error, title: title, messages: [message], iconName: advanceBookingPeriodNotificationIconName, wrapperClassName: b.block() }));\r\n});\r\nFilmAdvanceBookingPeriodNotificationUI.displayName = 'FilmAdvanceBookingPeriodNotificationUI';\r\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { useCallback } from 'react';\r\nimport { useI18n } from '../../../../context/occ/hooks/use-i18n';\r\nimport { Heading, HeadingLevel } from '../../../../subcomponents/heading';\r\nimport { Icon } from '../../../../subcomponents/icon/icon';\r\nimport { Link } from '../../../../subcomponents/link/link';\r\nconst b = bemClassBuilder('v-film-custom-action-list-action');\r\nexport const FilmCustomActionListAction = props => {\r\n const i18n = useI18n();\r\n const { customAction, film } = props;\r\n const { iconName, message, title, href, onClick } = customAction;\r\n const handleClick = useCallback(() => {\r\n onClick === null || onClick === void 0 ? void 0 : onClick(film);\r\n }, [onClick, film]);\r\n return (_jsxs(Link, Object.assign({ className: b.block(), href: href, onClick: onClick && handleClick }, { children: [iconName && (_jsx(\"div\", Object.assign({ className: b.element('icon-wrapper') }, { children: _jsx(Icon, { className: b.element('icon'), name: iconName }) }))), _jsxs(\"div\", Object.assign({ className: b.element('details') }, { children: [_jsx(Heading, Object.assign({ className: b.element('heading'), level: HeadingLevel.H5 }, { children: i18n.translatable(title) })), message && _jsx(\"p\", Object.assign({ className: b.element('message') }, { children: i18n.translatable(message) }))] }))] })));\r\n};\r\nFilmCustomActionListAction.displayName = 'FilmCustomActionListAction';\r\n","import { jsx as _jsx } from \"react/jsx-runtime\";\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { observer } from 'mobx-react';\r\nimport { useFilmContext } from '../../../context/film/hooks/use-film-context';\r\nimport { useOccConfig } from '../../../context/occ/hooks/use-occ-config';\r\nimport { withComponentWrapper } from '../../../utils/with-component-wrapper';\r\nimport { FilmCustomActionListAction } from './subcomponents/action';\r\nconst b = bemClassBuilder('v-film-custom-action-list');\r\nexport const FilmCustomActionList = observer(() => {\r\n const { film: filmConfig } = useOccConfig();\r\n const { film } = useFilmContext();\r\n if (!film)\r\n return null;\r\n const filmCustomActions = filmConfig.customActions[film.id];\r\n if (!filmCustomActions)\r\n return null;\r\n return (_jsx(\"ul\", Object.assign({ className: b.block() }, { children: filmCustomActions.map((customAction, index) => (_jsx(\"li\", Object.assign({ className: b.element('item') }, { children: _jsx(FilmCustomActionListAction, { film: film, customAction: customAction }) }), `action-${index}`))) })));\r\n});\r\nFilmCustomActionList.displayName = 'FilmCustomActionList';\r\n/**\r\n * The **Film Custom Action List** component renders a list of custom actions for the film.\r\n *\r\n * If there are no custom actions configured for the film, then the **Film Custom Action List** component will not render.\r\n */\r\nexport const FilmCustomActionListComponent = withComponentWrapper(FilmCustomActionList, {}, () => true);\r\n","import { Validator } from '@vista-digital/validator';\r\nimport { HeadingLevel } from '../../../../subcomponents';\r\nexport const filmRuntimeConfigValidator = Validator.object({\r\n labelHeadingLevel: Validator.oneOf(Object.values(HeadingLevel))\r\n});\r\nexport const defaultFilmRuntimeConfig = {\r\n labelHeadingLevel: HeadingLevel.H3\r\n};\r\n","import { Validator } from '@vista-digital/validator';\r\nimport { defaultFilmRuntimeConfig, filmRuntimeConfigValidator } from './config';\r\nimport { defaultFilmRuntimeDisplayText, filmRuntimeDisplayTextValidator } from './display-text';\r\nexport const defaultFilmRuntimeProps = {\r\n displayText: defaultFilmRuntimeDisplayText,\r\n config: defaultFilmRuntimeConfig\r\n};\r\nexport const filmRuntimePropsValidator = Validator.object({\r\n displayText: filmRuntimeDisplayTextValidator,\r\n config: filmRuntimeConfigValidator\r\n});\r\n","import { jsx as _jsx } from \"react/jsx-runtime\";\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { observer } from 'mobx-react';\r\nimport { useFilmContext } from '../../../context/film/hooks/use-film-context';\r\nimport { useOccContext } from '../../../context/occ/hooks/use-occ-context';\r\nimport { Detail, DetailSkeleton } from '../../../subcomponents/detail';\r\nimport { formatFilmRuntime } from '../../../utils/film-utils';\r\nimport { withComponentWrapper } from '../../../utils/with-component-wrapper';\r\nimport { defaultFilmRuntimeProps, filmRuntimePropsValidator } from './types/props';\r\nconst b = bemClassBuilder('v-film-runtime');\r\nexport const FilmRuntime = observer(props => {\r\n const { i18n, config: { enableSkeletonLoadingIndicators }, displayText: { film: filmDisplayText } } = useOccContext();\r\n const { displayText, config } = props;\r\n const { film } = useFilmContext();\r\n if (!film)\r\n return enableSkeletonLoadingIndicators ? _jsx(FilmRuntimeSkeleton, {}) : null;\r\n return (_jsx(Detail, { className: b.block(), headingLevel: config.labelHeadingLevel, heading: displayText.label, content: formatFilmRuntime(film.runtimeInMinutes, filmDisplayText, i18n) }));\r\n});\r\nFilmRuntime.displayName = 'FilmRuntime';\r\nexport const FilmRuntimeSkeleton = () => _jsx(DetailSkeleton, { className: b.block({ skeleton: true }) });\r\n/**\r\n * The **Film Runtime** component renders the runtime of a film.\r\n */\r\nexport const FilmRuntimeComponent = withComponentWrapper(FilmRuntime, defaultFilmRuntimeProps, filmRuntimePropsValidator);\r\n","import { nonEmptyStringValidator } from '@vista/omnichannel-components-domain';\r\nimport { Validator } from '@vista-digital/validator';\r\nexport const defaultFilmRuntimeDisplayText = {\r\n label: 'Runtime'\r\n};\r\nexport const filmRuntimeDisplayTextValidatorSchema = {\r\n label: Validator.optional(nonEmptyStringValidator)\r\n};\r\nexport const filmRuntimeDisplayTextValidator = Validator.object(filmRuntimeDisplayTextValidatorSchema);\r\n","import { Validator } from '@vista-digital/validator';\r\nimport { FilmSynopsisLength } from '../../../../types/film-synopsis-length';\r\n/**\r\n * Default configuration options for the Film Synopsis component.\r\n */\r\nexport const defaultFilmSynopsisConfig = {\r\n length: FilmSynopsisLength.Longest\r\n};\r\nexport const filmSynopsisConfigValidatorSchema = {\r\n length: Validator.oneOf(Object.values(FilmSynopsisLength))\r\n};\r\nexport const filmSynopsisConfigValidator = Validator.object(filmSynopsisConfigValidatorSchema);\r\n","import { Validator } from '@vista-digital/validator';\r\nimport { defaultFilmSynopsisConfig, filmSynopsisConfigValidator } from './config';\r\nimport { defaultFilmSynopsisDisplayText, filmSynopsisDisplayTextValidator } from './display-text';\r\nexport const defaultFilmSynopsisProps = {\r\n displayText: defaultFilmSynopsisDisplayText,\r\n config: defaultFilmSynopsisConfig\r\n};\r\nexport const filmSynopsisPropsValidator = Validator.object({\r\n displayText: filmSynopsisDisplayTextValidator,\r\n config: filmSynopsisConfigValidator\r\n});\r\n","import { jsx as _jsx } from \"react/jsx-runtime\";\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { observer } from 'mobx-react';\r\nimport { useFilmContext } from '../../../context/film/hooks/use-film-context';\r\nimport { useI18n } from '../../../context/occ/hooks/use-i18n';\r\nimport { useOccConfig } from '../../../context/occ/hooks/use-occ-config';\r\nimport { Detail, DetailSkeleton } from '../../../subcomponents/detail/detail';\r\nimport { HeadingLevel } from '../../../subcomponents/heading/heading';\r\nimport { getFilmSynopsisByLength } from '../../../utils/get-film-synopsis-by-length';\r\nimport { withComponentWrapper } from '../../../utils/with-component-wrapper';\r\nimport { defaultFilmSynopsisProps, filmSynopsisPropsValidator } from './types/props';\r\nconst b = bemClassBuilder('v-film-synopsis');\r\nexport const FilmSynopsis = observer(props => {\r\n const i18n = useI18n();\r\n const { enableSkeletonLoadingIndicators } = useOccConfig();\r\n const { displayText, config } = props;\r\n const { film } = useFilmContext();\r\n if (!film)\r\n return enableSkeletonLoadingIndicators ? _jsx(FilmSynopsisSkeleton, {}) : null;\r\n const synopsis = getFilmSynopsisByLength(film, config.length);\r\n if (!synopsis)\r\n return null;\r\n return (_jsx(Detail, { className: b.block(), headingLevel: HeadingLevel.H3, heading: displayText.label, content: i18n.translatable(synopsis) }));\r\n});\r\nFilmSynopsis.displayName = 'FilmSynopsis';\r\nexport const FilmSynopsisSkeleton = () => _jsx(DetailSkeleton, { className: b.block({ skeleton: true }) });\r\nFilmSynopsisSkeleton.displayName = 'FilmSynopsisSkeleton';\r\n/**\r\n * The **Film Synopsis** component renders a film's synopsis.\r\n */\r\nexport const FilmSynopsisComponent = withComponentWrapper(FilmSynopsis, defaultFilmSynopsisProps, filmSynopsisPropsValidator);\r\n","import { nonEmptyStringValidator } from '@vista/omnichannel-components-domain';\r\nimport { Validator } from '@vista-digital/validator';\r\nexport const defaultFilmSynopsisDisplayText = {\r\n label: 'Synopsis'\r\n};\r\nexport const filmSynopsisDisplayTextValidatorSchema = {\r\n label: Validator.optional(nonEmptyStringValidator)\r\n};\r\nexport const filmSynopsisDisplayTextValidator = Validator.object(filmSynopsisDisplayTextValidatorSchema);\r\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\r\nimport { getAttributesByIds, getScreenById } from '@vista/omnichannel-components-domain';\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { observer } from 'mobx-react';\r\nimport { useCallback, useMemo } from 'react';\r\nimport { useI18n } from '../../../context/occ/hooks/use-i18n';\r\nimport { useOccDisplayText } from '../../../context/occ/hooks/use-occ-display-text';\r\nimport { Attribute } from '../../attribute/attribute';\r\nimport { AttributeList } from '../../attribute-list/attribute-list';\r\nimport { getHeroAttributesForShowtime, getPromotedAttributeForShowtime, getStandardAttributesForShowtime } from '../../attribute-list/utils';\r\nimport { Link } from '../../link/link';\r\nconst b = bemClassBuilder('v-showtime-list-button');\r\nexport const ShowtimeListButton = observer(props => {\r\n const i18n = useI18n();\r\n const { showtime: showtimeDisplayText } = useOccDisplayText();\r\n const { showtime, hiddenAttributeIds, ianaTimeZoneName, displayText, config, cdnOptions, onShowtimeClicked } = props;\r\n const { showtimeUrlFactory, showScreenName } = config;\r\n const { attributeIds, schedule, screenId, isSoldOut } = showtime;\r\n const attributes = getAttributesByIds(attributeIds);\r\n const heroAttribute = getHeroAttributesForShowtime(attributes, i18n)[0]; // Can only show one of the hero attributes on the button. Picking the first one.\r\n const promotedAttribute = getPromotedAttributeForShowtime(attributes, i18n);\r\n const standardAttributes = getStandardAttributesForShowtime(attributes, i18n, hiddenAttributeIds);\r\n const timeString = i18n.date(schedule.startsAt, {\r\n format: displayText.showtimeTimeFormat,\r\n ianaTimeZoneName: ianaTimeZoneName\r\n });\r\n const amPmString = i18n.date(schedule.startsAt, {\r\n format: displayText.showtimeAmPmFormat,\r\n ianaTimeZoneName: ianaTimeZoneName\r\n });\r\n const screen = getScreenById(screenId);\r\n if (!screen)\r\n throw new Error(`No screen available for screen id: '${showtime.screenId}'.`);\r\n const showtimeUrl = useMemo(() => showtimeUrlFactory === null || showtimeUrlFactory === void 0 ? void 0 : showtimeUrlFactory(showtime), [showtimeUrlFactory, showtime]);\r\n const handleShowtimeClicked = useCallback(() => {\r\n onShowtimeClicked === null || onShowtimeClicked === void 0 ? void 0 : onShowtimeClicked(showtime);\r\n }, [onShowtimeClicked, showtime]);\r\n return (_jsxs(Link, Object.assign({ className: b.block(), href: showtimeUrl, onClick: onShowtimeClicked && handleShowtimeClicked, disabled: isSoldOut }, { children: [_jsxs(\"div\", Object.assign({ className: b.element('detail-wrapper') }, { children: [_jsxs(\"div\", Object.assign({ className: b.element('detail-start-time-wrapper') }, { children: [_jsx(\"time\", Object.assign({ className: b.element('detail-start-time'), dateTime: new Date(schedule.startsAt).toISOString() }, { children: timeString })), amPmString.length > 0 && _jsx(\"span\", Object.assign({ className: b.element('detail-start-time-ampm') }, { children: amPmString }))] })), showScreenName && _jsx(\"div\", Object.assign({ className: b.element('screen-name') }, { children: i18n.translatable(screen.name) })), isSoldOut && _jsx(\"div\", Object.assign({ className: b.element('sold-out') }, { children: showtimeDisplayText.soldOutLabel })), _jsx(AttributeList, { className: b.element('attribute-list'), attributes: standardAttributes, showDetails: false, iconCdnOptions: cdnOptions.attributeIcon })] })), heroAttribute && (_jsx(Attribute, { attribute: heroAttribute, showDetails: false, cdnOptions: cdnOptions.heroAttributeIcon })), promotedAttribute && (_jsx(Attribute, { attribute: promotedAttribute, showDetails: false, cdnOptions: cdnOptions.promotedAttributeIcon }))] })));\r\n});\r\nShowtimeListButton.displayName = 'ShowtimeListButton';\r\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { compareAsc } from 'date-fns';\r\nimport { observer } from 'mobx-react';\r\nimport { DisplayText } from '../display-text';\r\nimport { Heading, HeadingLevel } from '../heading/heading';\r\nimport { ShowtimeListButton } from './subcomponents/button';\r\nconst b = bemClassBuilder('v-showtime-list');\r\nexport const ShowtimeList = observer(props => {\r\n const { showtimes, hiddenAttributeIds, ianaTimeZoneName, displayText, config, cdnOptions, onShowtimeClicked } = props;\r\n const sortingPredicate = (showtime1, showtime2) => compareAsc(new Date(showtime1.schedule.startsAt), new Date(showtime2.schedule.startsAt));\r\n const showtimeListHeadingLevel = config.headingLevel || HeadingLevel.H3;\r\n return (_jsxs(\"div\", Object.assign({ className: b.block() }, { children: [displayText.heading && (_jsx(Heading, Object.assign({ className: b.element('heading'), level: showtimeListHeadingLevel }, { children: _jsx(DisplayText, { className: b.element('heading-label'), label: displayText.heading }) }))), _jsx(\"ul\", Object.assign({ className: b.element('list') }, { children: [...showtimes].sort(sortingPredicate).map(showtime => (_jsx(\"li\", Object.assign({ className: b.element('item') }, { children: _jsx(\"div\", Object.assign({ className: b.element('button-wrapper') }, { children: _jsx(ShowtimeListButton, { showtime: showtime, hiddenAttributeIds: hiddenAttributeIds, ianaTimeZoneName: ianaTimeZoneName, displayText: displayText, config: config, cdnOptions: cdnOptions, onShowtimeClicked: onShowtimeClicked }) })) }), showtime.id))) }))] })));\r\n});\r\nShowtimeList.displayName = 'ShowtimeList';\r\n","import { jsx as _jsx } from \"react/jsx-runtime\";\r\nimport { createFilledArray } from '@vista/omnichannel-components-domain';\r\nimport { bemClassBuilder } from '@vista-digital/bem-class-builder';\r\nimport { observer } from 'mobx-react';\r\nconst b = bemClassBuilder('v-showtime-list');\r\nexport const ShowtimeListSkeleton = observer(({ numberOfShowtimes }) => {\r\n const emptyArray = createFilledArray(undefined, numberOfShowtimes);\r\n return (_jsx(\"div\", Object.assign({ className: b.block() }, { children: _jsx(\"ul\", Object.assign({ className: b.element('list') }, { children: emptyArray.map((_, i) => (_jsx(\"li\", Object.assign({ className: b.element('item') }, { children: _jsx(\"div\", { className: b.element('button-wrapper', { ['skeleton']: true }) }) }), i))) })) })));\r\n});\r\nShowtimeListSkeleton.displayName = 'ShowtimeListSkeleton';\r\n"],"names":["createShowtimeFilter","id","showtimes","fixedValues","existingFilter","newShowtimes","filter","showtime","baseData","includes","genreOptions","getGenreIdsForShowtimes","eventOptions","getEventIdsForShowtimes","attributeOptions","getAttributeIdsForShowtimes","showtimeIds","map","sections","genre","attribute","event","type","reduce","acc","film","filmId","genreIds","forEach","genreId","add","Set","attributeIds","attributeId","eventId","b","FilmAdvanceBookingPeriodNotificationUI","props","i18n","assets","advanceBookingPeriodNotificationIconName","displayText","member","memberDisplayText","bookingPeriod","templateParameters","messageFormat","todayMessageFormat","startDate","Date","startsAt","template","message","Object","assign","title","rewardExclusiveLabel","undefined","messages","iconName","wrapperClassName","block","displayName","FilmCustomActionListAction","customAction","href","onClick","handleClick","useCallback","className","children","element","name","level","translatable","FilmCustomActionList","filmConfig","filmCustomActions","customActions","index","filmRuntimeConfigValidator","labelHeadingLevel","values","defaultFilmRuntimeConfig","defaultFilmRuntimeProps","config","filmRuntimePropsValidator","FilmRuntime","enableSkeletonLoadingIndicators","filmDisplayText","headingLevel","heading","label","content","runtimeInMinutes","FilmRuntimeSkeleton","skeleton","defaultFilmRuntimeDisplayText","filmRuntimeDisplayTextValidatorSchema","filmRuntimeDisplayTextValidator","defaultFilmSynopsisConfig","length","filmSynopsisConfigValidatorSchema","filmSynopsisConfigValidator","defaultFilmSynopsisProps","filmSynopsisPropsValidator","FilmSynopsis","FilmSynopsisSkeleton","synopsis","defaultFilmSynopsisDisplayText","filmSynopsisDisplayTextValidatorSchema","filmSynopsisDisplayTextValidator","ShowtimeListButton","showtimeDisplayText","hiddenAttributeIds","ianaTimeZoneName","cdnOptions","onShowtimeClicked","showtimeUrlFactory","showScreenName","schedule","screenId","isSoldOut","attributes","heroAttribute","promotedAttribute","standardAttributes","timeString","date","format","showtimeTimeFormat","amPmString","showtimeAmPmFormat","screen","Error","showtimeUrl","useMemo","handleShowtimeClicked","disabled","dateTime","toISOString","soldOutLabel","showDetails","iconCdnOptions","attributeIcon","heroAttributeIcon","promotedAttributeIcon","ShowtimeList","showtimeListHeadingLevel","sort","showtime1","showtime2","compareAsc","ShowtimeListSkeleton","numberOfShowtimes","emptyArray","_","i"],"sourceRoot":""}