function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _possibleConstructorReturn(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:n}function _inherits(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}function Showtimes_FilterItem(n){return React.createElement("div",{className:"attributes-list__item "+(n.isActive?"isActive":"")},React.createElement("div",{className:"attributes-list__item-inner",onClick:function(){return n.handleSelect(n.attributeId)}},React.createElement("div",{className:"attributes-list__item-content"},n.attributeImage?React.createElement("img",{src:n.attributeImage,alt:n.attributeName}):React.createElement("span",null,n.attributeName))))}function Showtimes_FilterExtraItem(n){return React.createElement("div",{className:"attributes-extras__item"},React.createElement("div",{className:"attributes-extras__item-inner"},React.createElement("div",{className:"attributes-extras__item-content"},n.attributeLink?React.createElement("a",{href:n.attributeLink,target:n.attributeTarget},n.attributeImage?React.createElement("img",{src:n.attributeImage,alt:n.attributeName}):React.createElement("span",null,n.attributeName)):n.attributeImage?React.createElement("img",{src:n.attributeImage,alt:n.attributeName}):React.createElement("span",null,n.attributeName))))}function Showtimes_FilmTrailer(n){return React.createElement("button",{type:"button","data-trailer-btn":n.trailer,filmCode:n.filmCode,className:"trailer-icon"},React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#trailer-icon"})))}function Showtimes_FilmsItemWithSessions(n){var i=n.trailer?React.createElement(Showtimes_FilmTrailer,{trailer:n.trailer,filmCode:n.filmCode}):null,t=(n.selectedCinemaFriendly?"/"+n.selectedCinemaFriendly:"")+"/movie-info/"+n.session.FriendlyName;return React.createElement("div",{className:"listing mb-2"},React.createElement("div",{className:"listing__poster"},React.createElement("div",{className:"poster"},React.createElement("a",{href:t},n.image&&React.createElement("img",{className:"poster__image",src:n.image,alt:n.title,title:n.title}),React.createElement("div",{className:"poster__content"}),i))),React.createElement("div",{className:"listing__main listing__main--showtimes"},React.createElement("div",{className:"listing__details"},React.createElement("div",null,React.createElement("span",{className:"h2"},React.createElement("a",{href:t},n.title)),React.createElement("span",null,n.cert," • ",n.runTime," Mins"))),React.createElement("div",{className:"listing__showtimes"},React.createElement(Showtimes_SessionsList,{sessions:n.session.Sessions,selectedType:n.selectedType,showPopup:n.showPopup,popUpAttributes:n.popUpAttributes,display:!0,selectedCinemaId:n.selectedCinemaId,splitByAttributes:n.splitByAttributes,filmID:n.FilmId,showDate:!0,title:n.title,filterDate:n.filterDate}),n.selectedCinemaId===-1&&React.createElement("h4",null,"Please select a theatre to see showtimes"))))}function Showtimes_FilmsItem(n){var i=n.trailer?React.createElement(Showtimes_FilmTrailer,{trailer:n.trailer,filmCode:n.filmCode}):null,t=n.prefixUrl+"/movie-info/"+n.session.FriendlyName;return React.createElement("div",{className:"flickity-listing__item"},React.createElement("div",{className:"listing__poster"},React.createElement("div",{className:"poster"},n.image&&React.createElement("img",{className:"poster__image",src:n.image,alt:n.title,title:n.title}),!n.isHome&&React.createElement("div",{className:"poster__btn"},React.createElement("a",{className:"btn btn--white btn--icon btn--showtimes",href:t},"INFO & SHOWTIMES",React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#button-arrow-right"})))),i)),React.createElement("div",{className:"listing__details mb-2"},n.isHome&&n.isComingSoon&&React.createElement("div",{className:"mt-1 ta__center"},React.createElement("a",{className:"btn btn--icon btn--outline btn--buytickets",href:t},"More Info",React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-arrow-right.svg#arrow-right-default"})))),n.isHome&&!n.isComingSoon&&React.createElement("div",{className:"mt-1 ta__center"},React.createElement("a",{className:"btn btn--icon btn--outline btn--buytickets",href:t},"Buy Tickets",React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-arrow-right.svg#arrow-right-default"})))),n.isMovies&&React.createElement("div",null,React.createElement("div",{className:"listing__title h5"},React.createElement("a",{href:t},n.title)),React.createElement("p",{className:"ta__center mt-0"},n.cert," • ",n.runTime," Mins"))))}function Showtimes_TimesList(n){return React.createElement("div",{className:"times"},n.selectedCinemaId<0?React.createElement(ShowTimes_GroupList,{showPopup:n.showPopup,popUpAttributes:n.popUpAttributes,cinemas:n.data.Cinemas,display:!0,splitByAttributes:n.splitByAttributes,showDate:n.showDate,filmID:n.FilmId,title:n.title}):React.createElement(ShowTimes_SingleList,{showPopup:n.showPopup,popUpAttributes:n.popUpAttributes,sessions:n.sessions,display:!0,isFilmInfo:n.isFilmInfo,splitByAttributes:n.splitByAttributes,showDate:n.showDate,filmID:n.FilmId,title:n.title}))}function ShowTimes_GroupList(n){var t=[];return n.cinemas.forEach(function(i,r){t.push(React.createElement("div",{key:r},React.createElement("p",{className:"icon-text icon-text--lrg h3"},React.createElement("svg",{className:"fill--primary"},React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#location"})),"SHOWTIMES AT: ",React.createElement("b",{className:"ml-1"},i.CinemaName)),i.Sessions!==undefined&&i.Sessions.length>0?React.createElement(Showtimes_SessionsList,{showPopup:n.showPopup,popUpAttributes:n.popUpAttributes,sessions:i.Sessions,display:!0,splitByAttributes:n.splitByAttributes,showDate:n.showDate,filmID:n.filmId,title:n.title}):React.createElement("div",null,"There are no sessions available at this theatre.")))}),React.createElement("div",null,t)}function ShowTimes_SingleList(n){return React.createElement("div",null,n.sessions!==undefined&&n.sessions.length>0?React.createElement(Showtimes_SessionsList,{showPopup:n.showPopup,popUpAttributes:n.popUpAttributes,sessions:n.sessions,display:!0,isFilmInfo:n.isFilmInfo,splitByAttributes:n.splitByAttributes,showDate:n.showDate,filmID:n.filmId,title:n.title}):React.createElement("div",null,"There are no sessions available at this theatre."))}function EventCategoriesItemLeft(n){return React.createElement("section",{className:"container container--content-area section-block--lrcontent"},React.createElement("div",{className:"lr-panel lr-panel--reverse"},React.createElement("div",{className:"lr-panel__image lr-panel__image--reverse"},n.image&&React.createElement("img",{src:n.image.Src,alt:n.image.AltText,title:n.image.Title})),React.createElement("div",{className:"lr-panel__content lr-panel__content--reverse"},n.title&&React.createElement("div",{className:"events-title m-0"},n.title),n.subTitle&&React.createElement("p",{className:"subtitle"},n.subTitle),n.text&&React.createElement("p",{dangerouslySetInnerHTML:{__html:n.text}}),n.primaryButton.Url&&React.createElement("a",{href:n.primaryButton.Url,className:"btn btn--icon btn--blue"},n.primaryButton.Name,React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#button-arrow-right"}))))))}function EventCategoriesItemRight(n){return React.createElement("section",{className:"container container--content-area section-block--lrcontent"},React.createElement("div",{className:"lr-panel"},React.createElement("div",{className:"lr-panel__image"},n.image&&React.createElement("img",{src:n.image.Src,alt:n.image.AltText,title:n.image.Title})),React.createElement("div",{className:"lr-panel__content"},n.title&&React.createElement("div",{className:"events-title m-0"},n.title),n.subTitle&&React.createElement("p",{className:"subtitle"},n.subTitle),n.text&&React.createElement("p",{dangerouslySetInnerHTML:{__html:n.text}}),n.primaryButton.Url&&React.createElement("a",{href:n.primaryButton.Url,className:"btn btn--icon btn--blue"},n.primaryButton.Name,React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#button-arrow-right"}))))))}function EventCategoryBorder(){return React.createElement("div",{className:"container container--border pt-2 pb-2 mt-1 mb-1"},React.createElement("div",{className:"border--bottom"}))}function EventCategoriesList(n){for(var r=[],t,i=0;i<n.eventCategoriesList.length;i++)t=n.eventCategoriesList[i],i>0&&r.push(React.createElement(EventCategoryBorder,{key:i*30})),i%2==1?r.push(React.createElement(EventCategoriesItemLeft,{groupCinemas:t.EventCategoryCinemaIds,image:t.CategoryImage,text:t.Text,title:t.Title,primaryButton:t.PrimaryButton,key:i})):r.push(React.createElement(EventCategoriesItemRight,{groupCinemas:t.EventCategoryCinemaIds,image:t.CategoryImage,text:t.Text,title:t.Title,primaryButton:t.PrimaryButton,key:i}));return r}function EventItem(n){return React.createElement("div",{className:"event-content-panel"},React.createElement("div",{className:"gridRow content-panel p0"},React.createElement("div",{className:"gridCol-l-5 gridCol-m-6 gridCol-s-12 content-panel-image"},React.createElement("div",{className:"content-right-image"},n.image?React.createElement("img",{src:n.image.Src,alt:n.image.AltText,title:n.image.Title}):"")),React.createElement("div",{className:"gridCol-l-5 gridCol-m-6 gridCol-s-12 content-panel-text"},React.createElement("div",{className:"content-right-text"},n.title?React.createElement("h2",null,n.title):"",n.text?React.createElement("div",{dangerouslySetInnerHTML:{__html:n.text}}):"",n.ctaText?React.createElement("div",{className:"buttons-container"},React.createElement("a",{href:n.ctaLink,className:"btn-outline"},n.ctaText)):"")),React.createElement("div",{className:"gridCol-l-2 gridCol-m-0 gridCol-s-0"})),n.extendedTitle&&React.createElement("div",{className:"gridRow p0"},React.createElement("div",{className:"gridCol-s-12 gridCol-m-12 gridCol-l-12"},React.createElement("div",{className:"gridRow p0"},React.createElement("div",{className:"gridCol-l-10 gridCol-l-c gridCol-m-10 gridCol-m-c gridCol-s-12 p0"},React.createElement("div",{className:"gridRow p0"},React.createElement("div",{className:"gridCol-l-12 gridCol-m-12 gridCol-s-12 event-info-extended-text p0"},n.extendedTitle?React.createElement("h2",null,n.extendedTitle):"",n.extendedText?React.createElement("div",{dangerouslySetInnerHTML:{__html:n.extendedText}}):"")),React.createElement("div",{className:"gridRow p0"},React.createElement("div",{className:"gridCol-l-12 gridCol-m-12 gridCol-s-12 event-info-extended-image p0"},n.extendedImage?React.createElement("img",{src:n.extendedImage.Src,alt:n.extendedImage.AltText,title:n.extendedImage.Title}):"")))),React.createElement("div",{className:"stk-border-bottom"}))))}function EventItemsList(n){for(var r=[],t,i=0;i<n.EventItemsList.length;i++)t=n.EventItemsList[i],r.push(React.createElement(EventItem,{cinemaUrl:t.CinemaUrlName,ctaLink:t.CTALink,ctaText:t.CTAText,extendedImage:t.ExtendedImage,extendedText:t.ExtendedText,extendedTitle:t.ExtendedTitle,groupCinemas:t.GroupCinemaIds,image:t.EventImage,text:t.IntroductoryText,title:t.Title,trailerUrl:t.TrailerUrl,url:t.EventUrlName,key:i}));return React.createElement("div",null,r)}var _createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),Showtimes_FilterList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"printViewings",value:function(n){n.preventDefault();var i=document.getElementById("print"),t=document.getElementById("ifmcontentstoprint").contentWindow;t.document.open();t.document.write(i.innerHTML);t.document.close();t.focus();t.print()}},{key:"render",value:function(){var n=this,t=[],i=[],r;return t.push(React.createElement(Showtimes_FilterItem,{attributeName:"All Movies",attributeId:0,isActive:this.props.selectedAttributeId===0?!0:!1,handleSelect:this.props.handleSelect,attributeImage:null,key:999})),this.props.cmsAttributes&&this.props.cmsAttributes.length>0&&this.props.cmsAttributes.forEach(function(i,r){typeof i.FilterImage!="undefined"&&i.FilterImage!==null&&typeof i.FilterImage.Src!="undefined"&&i.FilterImage.Src!==null&&typeof i.Id!="undefined"&&i.Id!==null&&(n.props.selectedCinemaId>0?i.Cinemas.includes(n.props.selectedCinemaId.toString())&&t.push(React.createElement(Showtimes_FilterItem,{attributeName:i.ExternalId,attributeId:i.Id,isActive:n.props.selectedAttributeId===i.Id?!0:!1,handleSelect:n.props.handleSelect,attributeImage:i.FilterImage.Src,key:r})):t.push(React.createElement(Showtimes_FilterItem,{attributeName:i.ExternalId,attributeId:i.Id,isActive:n.props.selectedAttributeId===i.Id?!0:!1,handleSelect:n.props.handleSelect,attributeImage:i.FilterImage.Src,key:r})))}),this.props.allAttributes&&this.props.allAttributes.length>0&&this.props.allAttributes.forEach(function(t,r){t.FilterImage.Src&&t.Id===null&&n.props.selectedCinemaId>0&&t.Cinemas.includes(n.props.selectedCinemaId.toString())&&i.push(React.createElement(Showtimes_FilterExtraItem,{attributeName:t.ExternalId,attributeId:t.Id,isActive:n.props.selectedAttributeId===t.Id?!0:!1,content:t.Text,title:t.Title,attributeTarget:t.AttributeLink.Target||null,attributeLink:t.AttributeLink.Url||null,attributeImage:t.QuickBuyImage.Src||null,key:r}))}),r={maxWidth:t.length<7?t.length*200+"px":"100%"},React.createElement(React.Fragment,null,i.length>0&&this.props.isHome&&React.createElement("div",{className:"attributes-extras"},React.createElement("div",{className:"attributes-extras__title"},"ALSO AVAILABLE AT THIS THEATRE"),React.createElement("div",{className:"attributes-extras__list"},i)),React.createElement("div",{className:"attributes-list__outer-border attributes-list__outer-border--gold",style:r},React.createElement("div",{className:"attributes-list__outer-border attributes-list__outer-border--light"},React.createElement("div",{className:"attributes-list "+(this.props.disabled?"disabled":"")},React.createElement("div",{className:"grid grid--nogap "+(t.length<7?"grid--filter-"+t.length:"grid--filter")},t)))))}}]),t}(React.Component),Showtimes_FiltersPortal=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.el=document.getElementById("stackedFilterSelector"),i.state={allAttributes:i.el?JSON.parse(i.el.dataset.cmsAttributes):[]},i}return _inherits(t,n),_createClass(t,[{key:"componentDidMount",value:function(){this.state.allAttributes.length>0&&this.props.getPopUpAttributes(this.state.allAttributes)}},{key:"render",value:function(){return this.el?ReactDOM.createPortal(React.createElement(Showtimes_FilterList,{disabled:this.props.disabled,cmsAttributes:this.props.cmsAttributes,allAttributes:this.state.allAttributes,selectedCinemaId:this.props.selectedCinemaId,isHome:this.props.isHome,selectedAttributeId:this.props.selectedAttributeId,handleSelect:this.props.handleSelect}),this.el):null}}]),t}(React.Component),Showtimes_DatePortal=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.el=document.getElementById("dateFilterPortal"),i}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){return this.el?ReactDOM.createPortal(React.createElement(Shared_DateFilter,{isHome:this.props.isHome,isFilmInfo:this.props.isFilmInfo,availableDates:this.props.availableDates,filterDateDisplay:this.props.filterDateDisplay,handleNowShowing:this.props.handleNowShowing,handleEventMovies:this.props.handleEventMovies,handleComingSoon:this.props.handleComingSoon,handleAdvancedBooking:this.props.handleAdvancedBooking,selectFunction:this.props.selectFunction,handleClick:this.props.handleClick}),this.el):null}}]),t}(React.Component),Showtimes_FilmsList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this,t=[];return this.props.sessions&&this.props.sessions.length>0&&this.props.sessions.forEach(function(i,r){var u=n.props.placeholder;i.MediaItems.Poster&&(u="https://images.tbco.app/blob-image/"+i.MediaItems.Poster.replace(/(^\w+:|^)\/\//,"")+"?width=286");n.props.isHome?t.push(React.createElement(Showtimes_FilmsItem,{session:i,display:r>=n.props.filmsToShow?"dn":"active",title:i.Title,image:u,filmID:i.FilmId,filmCode:i.FilmCode,cert:i.Cert,runTime:i.RunTime,isComingSoon:n.props.comingSoon,isMovies:n.props.isMovies,isHome:n.props.isHome,selectedCinemaFriendly:n.props.selectedCinemaFriendly,trailer:i.Trailer?i.Trailer:i.MediaItems.Trailer?i.MediaItems.Trailer:i.MediaItems.YouTubeTrailer?i.MediaItems.YouTubeTrailer:null,key:r,prefixUrl:n.props.prefixUrl})):t.push(React.createElement(Showtimes_FilmsItemWithSessions,{session:i,display:r>=n.props.filmsToShow?"dn":"active",title:i.Title,splitByAttributes:n.props.splitByAttributes,showPopup:n.props.showPopup,popUpAttributes:n.props.popUpAttributes,image:u,filmID:i.FilmId,filmCode:i.FilmCode,cert:i.Cert,runTime:i.RunTime,trailer:i.MediaItems.Trailer?i.MediaItems.Trailer:i.MediaItems.YouTubeTrailer?i.MediaItems.YouTubeTrailer:null,selectedType:n.props.selectedType,selectedCinemaId:n.props.selectedCinemaId,selectedCinemaFriendly:n.props.selectedCinemaFriendly,key:r,filterDate:n.props.filterDate}))}),React.createElement(React.Fragment,null,t)}}]),t}(React.Component),Showtimes_SessionsList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this,i=new Date,t;return i.setHours(0,0,0,0),t=[],this.props.sessions&&this.props.sessions.length>0&&this.props.sessions.forEach(function(i){var r=n.props.splitByAttributes?getSessionItemsByAttribute(i.ExperienceTypes,n.props.title,i.DisplayDate,n.props.selectedCinemaId,i.NewDate,n.props.isFilmInfo?!0:!1,n.props.popUpAttributes,n.props.showPopup):getSessionItemsByDate(i.Times,n.props.title,i.DisplayDate,n.props.selectedCinemaId,i.NewDate),u;r.length>0&&(u=new Date(i.NewDate),u.setHours(0,0,0,0),t.push(React.createElement(SessionsDates_Wrapper,{displayDate:i.DisplayDate,isToday:!1,newDate:i.NewDate,filmID:n.props.filmID,isFilmInfo:n.props.isFilmInfo,sessionItems:r,showDate:n.props.showDate,key:t.length})))}),React.createElement("div",{className:t.length>0?"":"dn"},this.props.selectedType===CinemaSelectorSelectedType.CinemaGroup&&this.props.cinemaName!==undefined?React.createElement("p",{className:"icon-text icon-text--lrg h3"},React.createElement("svg",{className:"fill--primary"},React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#location"})),"SHOWTIMES AT: ",React.createElement("b",{className:"ml-1"},this.props.cinemaName)):"",t)}}]),t}(React.Component),SessionAttributes=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){return React.createElement("div",{className:"session__attributes"},React.createElement("div",{className:"session__attributes-list"},this.props.experiencesList),React.createElement("div",{className:"grid grid--"+(this.props.isFilmInfo?"6":"5")+"-col grid--filminfo mb-2"},this.props.sessionItems))}}]),t}(React.Component),Showtimes_FilmInfo=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n)),r=new Date;return i.state={selectedCinemaId:i.props.selectedCinemaId,selectedCinemaGroupId:i.props.selectedGroupId,selectedType:CinemaSelectorSelectedType.NotSelected,selectedAttributeId:0,sessions:[],popUpAttributes:[],filterDate:null,filterDateDisplay:"PICK A DATE",filmId:i.props.filmId,filmCode:i.props.filmCode,filterDateSelected:!1,loading:!1,cmsAttributes:[],selectedDate:r.getFullYear()+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+r.getDate(),splitByAttributes:!0,title:i.props.filmName,data:null,cinemaSelectorIsOpen:!1,filmInfoLapseTime:0},i.showPopup=i.showPopup.bind(i),i.hidePopUp=i.hidePopUp.bind(i),i.getPopUpAttributes=i.getPopUpAttributes.bind(i),i.getShowtimes=i.getShowtimes.bind(i),i.getFilteredShowtimes=i.getFilteredShowtimes.bind(i),i.getDatepickerDates=i.getDatepickerDates.bind(i),i.setupDatepicker=i.setupDatepicker.bind(i),i.handleFilterSelect=i.handleFilterSelect.bind(i),i.toggleLoading=i.toggleLoading.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.sendMovioTracking=i.sendMovioTracking.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"componentDidMount",value:function(){this.getShowtimes();this.getDatepickerDates();setTimeout(this.sendMovioTracking(),5e3)}},{key:"componentWillUnmount",value:function(){}},{key:"sendMovioTracking",value:function(){typeof pc.movioTrack!="undefined"&&typeof pc.movioTrack.filminfo!="undefined"&&this.props.filmCode!=="undefined"&&this.props.filmCode!==null&&(pc.filmInfoLapseTime=Math.round(performance.now()/1e3),pc.movioTrack.filminfo(this.props.filmCode))}},{key:"showPopup",value:function(n,t){var i=this.state.popUpAttributes.filter(function(t){return t.ExternalId===n})[0];this.setState({popUpIsOpen:!0,popUpTitle:i.PopupTitle,popUpMessage:i.PopupText,popUpLink:t})}},{key:"hidePopUp",value:function(){this.setState({popUpIsOpen:!1})}},{key:"getPopUpAttributes",value:function(n){var t=[];n.forEach(function(n){n.PopupText.length>0&&t.push(n)});this.props.isHome||this.setState({popUpAttributes:t})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i){var r=this;this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n,selectedCinemaGroupId:t,selectedType:i},function(){r.getShowtimes()})}},{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"handleFilterSelect",value:function(n){this.setState({selectedAttributeId:n},function(){this.state.filterDateSelected?this.getFilteredShowtimes(this.state.filterDate):this.getShowtimes()})}},{key:"getDatepickerDates",value:function(){var n=this;fetch("/Umbraco/Api/QuickbookApi/GetScheduledDates?"+(this.state.selectedCinemaId>0?"&cinemaNodeId="+this.state.selectedCinemaId:"")+"&filmId="+this.props.filmId).then(function(n){return n.json()}).then(function(t){n.setState({availableDates:t.Result||[]},function(){this.setupDatepicker()})})}},{key:"setupDatepicker",value:function(){var n=this.state.availableDates,i=this.handleDateSelector,t=this.getFilteredShowtimes;jQuery("#datepicker-btn").data("datepicker")&&jQuery("#datepicker-btn").datepicker("destroy").off("changeDate");jQuery("#datepicker-btn").datepicker({format:"yyyy-mm-dd",maxViewMode:2,startDate:"today",orientation:"bottom right",container:"#dateFilterPortal",beforeShowDay:function(t){var r=!1,u=n.length,f,i;if(t.setHours(0,0,0,0),f=t.valueOf(),u>0)for(i=0;i<u;i++)if(t=parseInt(dateObjFromString(n[i].Date).getTime().toFixed(0)),f===t){r=!0;break}return r}}).on("changeDate",function(n){t(n.format("yyyy-mm-dd"));jQuery(this).datepicker("hide");jQuery(".datepicker__close").hide()}).on("show",function(){jQuery(this).addClass("datepickerActive");jQuery(".datepicker__close").show()}).on("hide",function(){jQuery(this).removeClass("datepickerActive").removeClass("is-open");jQuery(".datepicker__close").hide()})}},{key:"getShowtimes",value:function(){var n=this,t="";this.state.selectedAttributeId!==0&&(t="&attributes="+this.state.selectedAttributeId);this.state.selectedCinemaId>0&&(this.toggleLoading(),fetch("/Umbraco/Api/MovieApi/GetSingleFilmByCinema?cinemaNodeId="+this.state.selectedCinemaId+"&filmId="+this.state.filmId+"&splitByAttributes=true"+t+"&days=0").then(function(n){return n.json()}).then(function(t){t.Sessions!==undefined&&t.Sessions.length>0?n.setState({sessions:t.Sessions,data:t,filterDateSelected:!1,loading:!1}):n.setState({sessions:[],data:!1,filterDateSelected:!1,loading:!1})}))}},{key:"getFilteredShowtimes",value:function(n){var t=this,i="";this.state.selectedAttributeId!==0&&(i="&attributes="+this.state.selectedAttributeId);this.state.selectedCinemaId>0&&(this.toggleLoading(),fetch("/Umbraco/Api/MovieApi/GetSingleFilmByCinema?cinemaNodeId="+this.props.selectedCinemaId+"&filmId="+this.props.filmId+"&splitByAttributes=true&startDate="+n+"&days=1"+i).then(function(n){return n.json()}).then(function(i){var r=dateObjFromString(n.toString()),u=pc.labels.dayFull[r.getDay()]+" "+pc.labels.monthShort[r.getMonth()]+" "+r.getDate()+pc.labels.ordinal(r.getDate());jQuery("#datepicker-btn").datepicker("update",r);i.Sessions!==undefined&&i.Sessions.length>0?t.setState({filterDate:n,filterDateDisplay:u,filterDateSelected:!0,sessions:i.Sessions,data:i,loading:!1}):t.setState({sessions:[],data:!1,filterDateSelected:!0,loading:!1})}))}},{key:"toggleLoading",value:function(){this.setState(function(n){return{loading:!n.check}})}},{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement(Showtimes_PopUp,{hidePopUp:this.hidePopUp,isOpen:this.state.popUpIsOpen,title:this.state.popUpTitle,link:this.state.popUpLink,message:this.state.popUpMessage}),React.createElement("div",{id:"showtimes",className:"filminfo-sessions-list "+(this.state.loading?"loading":"")},React.createElement("div",{className:"showtimes__title"}),React.createElement(Showtimes_DatePortal,{isFilmInfo:!0,availableDates:this.state.availableDates,filterDateDisplay:this.state.filterDateDisplay,handleNowShowing:this.getShowtimes,handleEventMovies:this.getEventCinema,handleComingSoon:this.getComingSoon,selectFunction:this.handleDateSelector,handleClick:this.handleClick}),React.createElement(Shared_CinemaSelectorPortal,{isOpen:this.state.cinemaSelectorIsOpen,toggleCinemaSelector:this.toggleCinemaSelector,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect}),React.createElement(Showtimes_FiltersPortal,{getPopUpAttributes:this.getPopUpAttributes,selectedAttributeId:this.state.selectedAttributeId,handleSelect:this.handleFilterSelect}),this.state.data?React.createElement(Showtimes_TimesList,{showPopup:this.showPopup,popUpAttributes:this.state.popUpAttributes,data:this.state.data,sessions:this.state.sessions,splitByAttributes:this.state.splitByAttributes,isFilmInfo:!0,showDate:!0,title:this.state.title,selectedCinemaId:this.props.selectedCinemaId}):this.state.data===null?React.createElement("p",{className:"h3 ta__center"},"Please select a cinema from the selector above to view showtimes"):React.createElement("p",{className:"h3 ta__center"},"No Showtimes available on this date, please pick another date.")))}}]),t}(React.Component),Showtimes_PrintList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this.props.sessions&&this.props.sessions.length>0?this.props.sessions.map(function(n,t){return React.createElement(Showtimes_PrintItem,{key:t,session:n})}):[];return React.createElement("div",{id:"print",className:"container print"},React.createElement("table",{style:{borderCollapse:"collapse",width:"100%",border:"2px solid black"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{colSpan:"2",style:{border:"2px solid black",padding:"12px"}},"Metropolitan Theatres Movie Showtimes"))),React.createElement("tbody",null,n)),React.createElement("iframe",{id:"ifmcontentstoprint",style:{height:"0px",width:"0px",position:"absolute"}}))}}]),t}(React.Component),Showtimes_PrintItem=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=[];return n=this.props.session.Sessions===undefined?this.props.session.Times.map(function(n,t){return React.createElement(React.Fragment,{key:t},React.createElement("span",{style:{textDecoration:"underline"}},n.StartTime),", ")}):this.props.session.Sessions.map(function(n,t){var i=n.Times.map(function(n,t){return React.createElement(React.Fragment,{key:t},React.createElement("span",{style:{textDecoration:"underline"}},n.StartTime),", ")});return React.createElement("tr",{key:t},React.createElement("td",{style:{border:"none",padding:"12px",minWidth:"200px",verticalAlign:"top",textAlign:"left"}},n.DisplayDate,":"),React.createElement("td",{style:{border:"none",padding:"12px",minWidth:"200px",verticalAlign:"top",textAlign:"left"}},React.createElement("p",null,i)))}),React.createElement("tr",null,React.createElement("td",{style:{border:"2px solid black",padding:"12px",minWidth:"200px",verticalAlign:"top",textAlign:"left"}},this.props.session.Sessions!==undefined?React.createElement(React.Fragment,null,React.createElement("p",null,React.createElement("b",null,this.props.session.DisplayTitle)),React.createElement("p",null,React.createElement("b",null,"Cast: ")," ",this.props.session.Cast),React.createElement("p",null,this.props.session.Cert),React.createElement("p",null,this.props.session.RunTime," Min")):React.createElement("p",null,this.props.session.DisplayDate)),React.createElement("td",{style:{border:"2px solid black",padding:"12px",minWidth:"200px",verticalAlign:"top",textAlign:"left"}},React.createElement("table",null,React.createElement("tbody",null,this.props.session.Sessions!==undefined?React.createElement(React.Fragment,null,n):React.createElement("tr",null,React.createElement("td",{style:{border:"none",padding:"12px",minWidth:"200px",verticalAlign:"top",textAlign:"left"}},n))))))}}]),t}(React.Component),Showtimes_CinemaSelectorTitlePortal=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.el=document.getElementById("showtimesCinemaListTitlePortal"),i}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){return this.el&&this.props.title?ReactDOM.createPortal(React.createElement(Shared_CinemaSelectorTitle,{title:this.props.title}),this.el):null}}]),t}(React.Component),Showtimes_AttributeFilter=function(n){return React.createElement("div",{className:"filter-attributes-qb"},n.attributes.map(function(t,i){return React.createElement("label",{key:i,className:"filter-label "+t.ExternalId.replace(" ","").toLowerCase()},React.createElement("input",{type:"radio",name:"attribute-qb-selector",onChange:function(){return n.handleAttributeSelector(t.Id)},value:t.Id}),t.QuickBuyImage.Title!=null?React.createElement("span",null,React.createElement("img",{src:t.QuickBuyImage.Src,alt:t.QuickBuyImage.Title})):React.createElement("span",null,t.Title))}),React.createElement("label",{className:"filter-label"},React.createElement("input",{defaultChecked:!0,onChange:function(){return n.handleAttributeSelector("-1")},type:"radio",name:"attribute-qb-selector",value:"-1"}),React.createElement("span",null,"All")))},getBoostBookingLink=function(n,t){return"/Umbraco/API/BoostBookingApi/Start?cinemaExternalId="+n+"&sessionExternalId="+t},getBoostBookingRelayLink=function(n){return"/Umbraco/API/BoostBookingApi/Relay?returnUrl="+n},Showtimes_App=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.state={selectedCinemaId:-1,selectedType:CinemaSelectorSelectedType.NotSelected,cinemaSelectorIsOpen:!1,loading:!1,filtersLoading:!1,noResults:!0,selectedCinemaFriendly:i.props.cinemas.filter(function(n){return n.CinemaNodeId===i.props.selectedCinemaId}).map(function(n){return n.UrlFriendlyName})[0]||null,eventsAttribute:i.props.eventAttributeId,selectedAttributeId:0,filterDate:null,comingSoon:!1,nowShowing:!0,eventCinema:!1,advancedBooking:!1,availableDates:[],cmsAttributes:[],popUpAttributes:[],maxFilms:0,filmsToShow:i.props.filmsPerPage,prefixUrl:"/"+(i.props.cinemas.filter(function(n){return n.CinemaNodeId===i.props.selectedCinemaId}).map(function(n){return n.UrlFriendlyName})[0]||""),flickityActive:!1,sessions:[],splitByAttributes:!0,popUpIsOpen:!1,popUpTitle:null,popUpMessage:null,popUpLink:null},i.showPopup=i.showPopup.bind(i),i.hidePopUp=i.hidePopUp.bind(i),i.getPopUpAttributes=i.getPopUpAttributes.bind(i),i.updatePrefixUrl=i.updatePrefixUrl.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.handleFilterSelect=i.handleFilterSelect.bind(i),i.getNowShowing=i.getNowShowing.bind(i),i.getAttributes=i.getAttributes.bind(i),i.getComingSoon=i.getComingSoon.bind(i),i.getEventCinema=i.getEventCinema.bind(i),i.getAdvancedBooking=i.getAdvancedBooking.bind(i),i.setupDatepicker=i.setupDatepicker.bind(i),i.getDatepickerDates=i.getDatepickerDates.bind(i),i.toggleLoading=i.toggleLoading.bind(i),i.toggleFiltersLoading=i.toggleFiltersLoading.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"componentDidMount",value:function(){var n=this,i=-1,t;i=this.props.selectedCinemaId>0?CinemaSelectorSelectedType.Cinema:CinemaSelectorSelectedType.NotSelected;t=0;this.props.isEventsShowtimes&&(t=parseInt(jQuery("[data-event-id]").attr("data-event-id")));this.setState({selectedCinemaId:this.props.selectedCinemaId,selectedType:i,selectedAttributeId:t},function(){n.getNowShowing();n.getDatepickerDates();n.getAttributes()})}},{key:"showPopup",value:function(n,t){var i=this.state.popUpAttributes.filter(function(t){return t.ExternalId===n})[0];this.setState({popUpIsOpen:!0,popUpTitle:i.PopupTitle,popUpMessage:i.PopupText,popUpLink:t})}},{key:"hidePopUp",value:function(){this.setState({popUpIsOpen:!1})}},{key:"getPopUpAttributes",value:function(n){var t=[];n.forEach(function(n){n.PopupText.length>0&&t.push(n)});this.props.isHome||this.setState({popUpAttributes:t})}},{key:"updatePrefixUrl",value:function(n){this.setState({prefixUrl:n})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i,r,u){var f=this;this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n,selectedType:i},function(){r||(f.state.nowShowing&&f.getNowShowing(),f.state.comingSoon&&f.getComingSoon(),f.state.advancedBooking&&f.getAdvancedBooking(),linkUpdate(u),f.props.isHome||(f.getDatepickerDates(),f.getAttributes()));return})}},{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"getDatepickerDates",value:function(){var n=this;fetch("/Umbraco/Api/QuickbookApi/GetScheduledDates?"+(this.state.selectedCinemaId>0?"&cinemaNodeId="+this.state.selectedCinemaId:"")).then(function(n){return n.json()}).then(function(t){n.setState({availableDates:t.Result||[]},function(){this.setupDatepicker()})})}},{key:"setupDatepicker",value:function(){var n=this.state.availableDates,r=this.handleDateSelector,t=this.getNowShowing,i=this.getAttributes;jQuery("#datepicker-btn").data("datepicker")&&jQuery("#datepicker-btn").datepicker("destroy").off("changeDate");jQuery("#datepicker-btn").datepicker({format:"yyyy-mm-dd",maxViewMode:2,startDate:"today",orientation:"bottom right",container:"#dateFilterPortal",beforeShowDay:function(t){var r=!1,u=n.length,f,i;if(t.setHours(0,0,0,0),f=t.valueOf(),u>0)for(i=0;i<u;i++)if(t=parseInt(dateObjFromString(n[i].Date).getTime().toFixed(0)),f===t){r=!0;break}return r}}).on("changeDate",function(n){t(n.format("yyyy-mm-dd"));i(n.format("yyyy-mm-dd"));jQuery(this).datepicker("hide");jQuery(".datepicker__close").hide()}).on("show",function(){jQuery(this).addClass("datepickerActive");jQuery(".datepicker__close").show()}).on("hide",function(){jQuery(this).removeClass("datepickerActive").removeClass("is-open");jQuery(".datepicker__close").hide()})}},{key:"getAttributes",value:function(){var i=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],t,r;this.toggleFiltersLoading(!0);n===!1&&(t=new Date,n=t.getFullYear()+"-"+("00"+(t.getMonth()+1)).slice(-2)+"-"+("00"+t.getDate()).slice(-2));r="/Umbraco/Api/AttributeApi/GetAttributesOnSchedules?cinemaNodeId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"");fetch(r).then(function(n){return n.json()}).then(function(n){typeof n!="undefined"&&n!==null&&n.length>0&&i.setState({cmsAttributes:n});i.toggleFiltersLoading(!1)})}},{key:"handleFilterSelect",value:function(n){this.setState({selectedAttributeId:n},function(){this.state.nowShowing?this.getNowShowing():this.state.advancedBooking&&this.getAdvancedBooking()})}},{key:"getNowShowing",value:function(){var t=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],i,r,u;this.toggleLoading();n===!1&&(i=new Date,n=i.getFullYear()+"-"+("00"+(i.getMonth()+1)).slice(-2)+"-"+("00"+i.getDate()).slice(-2));r="";this.state.selectedAttributeId!==0&&(r="&attributes="+this.state.selectedAttributeId);u=void 0;u=this.state.selectedType===CinemaSelectorSelectedType.Cinema?"/Umbraco/Api/MovieApi/GetNowShowingFilmsByCinema?cinemaId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"")+"&splitByAttributes=true"+r+"&includeAdvanceBooking=true":"/Umbraco/Api/PaginatedMoviesApi/GetByCircuit?liteVersion=false&expandAttributes=true"+r;fetch(u).then(function(n){return n.json()}).then(function(i){var r=dateObjFromString(n.toString()),u=pc.labels.dayFull[r.getDay()]+" "+pc.labels.monthShort[r.getMonth()]+" "+r.getDate()+pc.labels.ordinal(r.getDate());jQuery("#datepicker-btn").datepicker("update",r);t.state.flickityActive&&(jQuery(".flickity-listing").flickity("destroy"),flickityActive=!1);i!==null||typeof i=="undefined"?t.setState({comingSoon:!1,nowShowing:!0,advancedBooking:!1,sessions:i.Result!==undefined?i.Result:i,maxFilms:i.Result!==undefined?i.Result.length:i.length,filmsToShow:t.props.filmsPerPage,noResults:i.Result!==undefined?!i.Result.length>0:!i.length>0,loading:!1,filterDate:n,filterDateDisplay:u},function(){var n=Math.floor(jQuery(".flickity-listing").width()/jQuery(".flickity-listing__item").outerWidth(!0));jQuery(".flickity-listing").flickity({cellAlign:"center",pageDots:!1,prevNextButtons:!1,freeScroll:!0,wrapAround:t.state.maxFilms>n,draggable:!0,groupCells:!0});t.setState({flickityActive:!0})}):t.setState({noResults:!0,loading:!1,filterDate:n,filterDateDisplay:u,sessions:[],flickityActive:!1})})}},{key:"getComingSoon",value:function(){var n=this,t;this.toggleLoading();t=void 0;t="/Umbraco/Api/ComingSoonApi/GetComingSoonFilmsByCircuit?expandAttributes=true";fetch(t).then(function(n){return n.json()}).then(function(t){n.state.flickityActive&&(jQuery(".flickity-listing").flickity("destroy"),flickityActive=!1);n.setState({comingSoon:!0,nowShowing:!1,advancedBooking:!1,sessions:t.Result!==undefined?t.Result:t,maxFilms:t.Result!==undefined?t.Result.length:t.length,filmsToShow:n.props.filmsPerPage,noResults:t.Result!==undefined?!t.Result.length>0:!t.length>0,selectedAttributeId:0,loading:!1},function(){var t=Math.floor(jQuery(".flickity-listing").width()/jQuery(".flickity-listing__item").outerWidth(!0));jQuery(".flickity-listing").flickity({cellAlign:"center",pageDots:!1,wrapAround:n.state.maxFilms>=t,prevNextButtons:!1,freeScroll:!0,groupCells:!0});n.setState({flickityActive:!0})})})}},{key:"getEventCinema",value:function(){var t=this,n;this.toggleLoading();n=void 0;n=this.state.selectedType===CinemaSelectorSelectedType.Cinema?"/Umbraco/Api/MovieApi/GetNowShowingFilmsByRegion?cinemaGroupId="+this.state.selectedCinemaGroupId+"&cinemaNodeId="+this.state.selectedCinemaId+(this.props.isHome?"":"&sessionsOnCinemas=true")+"&attributes="+this.state.eventsAttribute:this.state.selectedType===CinemaSelectorSelectedType.CinemaGroup?"/Umbraco/Api/MovieApi/GetNowShowingFilmsByRegion?cinemaGroupId="+this.state.selectedCinemaGroupId+(this.props.isHome?"":"&sessionsOnCinemas=true")+"&attributes="+this.state.eventsAttribute:"/Umbraco/Api/PaginatedMoviesApi/GetByCircuit?liteVersion=false&expandAttributes=true&attributes="+this.state.eventsAttribute;fetch(n).then(function(n){return n.json()}).then(function(n){t.setState({comingSoon:!1,nowShowing:!1,eventCinema:!0,sessions:n.Result!==undefined?n.Result:n,maxFilms:n.Result!==undefined?n.Result.length:n.length,filmsToShow:t.props.filmsPerPage,noResults:n.Result!==undefined?!n.Result.length>0:!n.length>0,loading:!1})})}},{key:"getAdvancedBooking",value:function(){var n=this,t;this.toggleLoading();t=void 0;t=this.state.selectedType===CinemaSelectorSelectedType.Cinema?"/Umbraco/Api/ComingSoonApi/GetAdvancedBookingByCinema?cinemaId="+this.state.selectedCinemaId:"/Umbraco/Api/ComingSoonApi/GetAdvancedBookingByCircuit?expandAttributes=true";fetch(t).then(function(n){return n.json()}).then(function(t){n.state.flickityActive&&(jQuery(".flickity-listing").flickity("destroy"),flickityActive=!1);n.setState({comingSoon:!1,nowShowing:!1,advancedBooking:!0,sessions:t.Result!==undefined?t.Result:t,maxFilms:t.Result!==undefined?t.Result.length:t.length,filmsToShow:n.props.filmsPerPage,noResults:t.Result!==undefined?!t.Result.length>0:!t.length>0,selectedAttributeId:0,loading:!1},function(){var t=Math.floor(jQuery(".flickity-listing").width()/jQuery(".flickity-listing__item").outerWidth(!0));jQuery(".flickity-listing").flickity({cellAlign:"center",pageDots:!1,wrapAround:n.state.maxFilms>=t,prevNextButtons:!1,freeScroll:!0,groupCells:!0});n.setState({flickityActive:!0})})})}},{key:"toggleLoading",value:function(){this.setState(function(n){return{loading:!n.check}})}},{key:"toggleFiltersLoading",value:function(n){this.setState({filtersLoading:n})}},{key:"render",value:function(){return React.createElement("div",{className:this.state.loading||this.state.filtersLoading?"loading":""},this.state.popUpIsOpen&&React.createElement(Showtimes_PopUp,{hidePopUp:this.hidePopUp,isOpen:this.state.popUpIsOpen,title:this.state.popUpTitle,link:this.state.popUpLink,message:this.state.popUpMessage}),React.createElement(Showtimes_DatePortal,{isHome:this.props.isHome,availableDates:this.state.availableDates,filterDateDisplay:this.state.filterDateDisplay,handleNowShowing:this.getNowShowing,handleEventMovies:this.getEventCinema,handleComingSoon:this.getComingSoon,handleAdvancedBooking:this.getAdvancedBooking,selectFunction:this.handleDateSelector,handleClick:this.handleClick}),React.createElement(Showtimes_FiltersPortal,{disabled:this.state.comingSoon||this.state.eventCinema||this.state.advancedBooking,getPopUpAttributes:this.getPopUpAttributes,selectedAttributeId:this.state.selectedAttributeId,cmsAttributes:this.state.cmsAttributes,selectedCinemaId:this.state.selectedCinemaId,showPrintButton:this.state.nowShowing,isHome:this.props.isHome,handleSelect:this.handleFilterSelect}),React.createElement(Shared_CinemaSelectorPortal,{disabled:this.state.comingSoon,isOpen:this.state.cinemaSelectorIsOpen,disabled:this.state.comingSoon,toggleCinemaSelector:this.toggleCinemaSelector,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect,hasAllTheatres:this.props.hasAllTheatres,updatePrefixUrl:this.updatePrefixUrl}),React.createElement("div",{className:"listing__cc-message"},"All Feature Films Showtimes (excluding Drive In) have Closed Captions & Descriptive Audio"),!this.state.noResults&&React.createElement("div",{className:this.props.isHome?"flickity-listing":"container container--narrow mt-2"},React.createElement(Showtimes_FilmsList,{showPopup:this.showPopup,popUpAttributes:this.state.popUpAttributes,isHome:this.props.isHome,sessions:this.state.sessions,filmsToShow:this.state.filmsToShow,maxFilms:this.state.maxFilms,comingSoon:this.state.comingSoon,splitByAttributes:this.state.splitByAttributes,redirectUrl:this.state.redirectUrl,placeholder:this.props.placeholder,selectedType:this.state.selectedType,selectedCinemaId:this.state.selectedCinemaId,selectedCinemaFriendly:this.state.selectedCinemaFriendly,filterDate:this.state.filterDate,prefixUrl:this.state.prefixUrl})),this.state.noResults&&React.createElement("div",{className:"container container--narrow ta__center"},this.props.isHome===!0&&React.createElement("p",{className:"subtitle"},"No showtimes available on this date. Click the showtimes link to select another date."),this.props.isHome===!1&&React.createElement("p",{className:"subtitle"},"No Showtimes available on this date, please pick another date.")))}}]),t}(React.Component),Showtimes_PopUp=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.dropdown=React.createRef(),i}return _inherits(t,n),_createClass(t,[{key:"componentDidMount",value:function(){if(typeof this.dropdown.current!="undefined"&&this.dropdown.current!==null){var n=jQuery(this.dropdown.current);typeof n.data("jsp")!="undefined"&&n.data("jsp")!==null?n.data("jsp").reinitialise():jQuery(this.dropdown.current).jScrollPane()}}},{key:"render",value:function(){var n=this;return React.createElement("div",{className:"modal-popup "+(this.props.isOpen?"isOpen":"")},React.createElement("div",{className:"modal-popup__overlay"}),React.createElement("div",{className:"modal-popup__outer"},React.createElement("div",{className:"modal-popup__inner"},React.createElement("div",{className:"modal-popup__content"},React.createElement("div",{className:"modal-popup__header "},React.createElement("div",{className:"modal-popup__title ta__center h4"},this.props.title),React.createElement("div",{className:"modal-popup__text",ref:this.dropdown,dangerouslySetInnerHTML:{__html:this.props.message}})),React.createElement("div",{className:"modal-popup__actions ta__center"},React.createElement("div",{className:"f-container modal-popup__btn-container"},React.createElement("div",{className:"f-item modal-popup__btn"},React.createElement("a",{className:"btn btn--red",onClick:function(){return n.props.hidePopUp()}},"Cancel")),React.createElement("div",{className:"f-item modal-popup__btn"},React.createElement("a",{className:"btn btn--green",href:this.props.link},"Continue"))))))))}}]),t}(React.Component),Movies_App,EventCategories,EventItems,Event_Page;Showtimes_App.propTypes={cinemas:PropTypes.arrayOf(CinemaProps).isRequired,filmsPerPage:PropTypes.number.isRequired,isHome:PropTypes.bool.isRequired,isShowtimes:PropTypes.bool.isRequired,placeholder:PropTypes.string.isRequired,redirectUrl:PropTypes.string.isRequired,selectedCinemaId:PropTypes.number.isRequired,selectedGroupId:PropTypes.number};Movies_App=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.state={selectedCinemaId:-1,selectedType:CinemaSelectorSelectedType.NotSelected,cinemaSelectorIsOpen:!1,filtersLoading:!1,loading:!1,noResults:!0,selectedCinemaFriendly:i.props.cinemas.filter(function(n){return n.CinemaNodeId===i.props.selectedCinemaId}).map(function(n){return n.UrlFriendlyName})[0]||null,eventsAttribute:i.props.eventAttributeId,popUpAttributes:[],selectedAttributeId:0,filterDate:null,comingSoon:!1,nowShowing:!0,eventCinema:!1,advancedBooking:!1,availableDates:[],cmsAttributes:[],maxFilms:0,filmsToShow:i.props.filmsPerPage,prefixUrl:"/"+(i.props.cinemas.filter(function(n){return n.CinemaNodeId===i.props.selectedCinemaId}).map(function(n){return n.UrlFriendlyName})[0]||""),flickityActive:!1,sessions:[],splitByAttributes:!0},i.getPopUpAttributes=i.getPopUpAttributes.bind(i),i.updatePrefixUrl=i.updatePrefixUrl.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.toggleFiltersLoading=i.toggleFiltersLoading.bind(i),i.handleFilterSelect=i.handleFilterSelect.bind(i),i.getNowShowing=i.getNowShowing.bind(i),i.setupDatepicker=i.setupDatepicker.bind(i),i.getDatepickerDates=i.getDatepickerDates.bind(i),i.getAttributes=i.getAttributes.bind(i),i.toggleLoading=i.toggleLoading.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"componentDidMount",value:function(){var n=this,t=-1;t=this.props.selectedCinemaId>0?CinemaSelectorSelectedType.Cinema:CinemaSelectorSelectedType.NotSelected;this.setState({selectedCinemaId:this.props.selectedCinemaId,selectedType:t},function(){n.getNowShowing();n.getAttributes();n.getDatepickerDates()})}},{key:"getPopUpAttributes",value:function(n){var t=[];n.forEach(function(n){n.PopupText.length>0&&t.push(n)});this.props.isHome||this.setState({popUpAttributes:t})}},{key:"updatePrefixUrl",value:function(n){this.setState({prefixUrl:n})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i,r,u){var f=this;this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n,selectedType:i},function(){r||(f.getNowShowing(),linkUpdate(u),f.props.isHome||f.getDatepickerDates());return})}},{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"getDatepickerDates",value:function(){var t=this,n="";n=this.state.selectedCinemaId>0?"/Umbraco/Api/QuickbookApi/GetScheduledDates?"+(this.state.selectedCinemaId>0?"&cinemaNodeId="+this.state.selectedCinemaId:""):"/Umbraco/Api/PaginatedMoviesApi/GetByCircuit?liteVersion=false&expandAttributes=true";fetch(n).then(function(n){return n.json()}).then(function(n){var h=void 0,r,a,i,u,p,s,b;h=typeof n.Result!="undefined"?n.Result:n;var f=[],e=!0,c=!1,l=undefined;try{for(r=h[Symbol.iterator]();!(e=(a=r.next()).done);e=!0){if(i=a.value,typeof i.Date!="undefined"&&i.Date!==null){f.push({Date:i.Date,DisplayDate:i.DisplayDate});continue}if(typeof i.Sessions!="undefined"&&i.Sessions!==null&&i.Sessions.length!==0){var o=!0,v=!1,y=undefined;try{for(u=i.Sessions[Symbol.iterator]();!(o=(p=u.next()).done);o=!0)s=p.value,f.push({Date:s.Date,DisplayDate:s.DisplayDate})}catch(w){v=!0;y=w}finally{try{!o&&u.return&&u.return()}finally{if(v)throw y;}}}}}catch(w){c=!0;l=w}finally{try{!e&&r.return&&r.return()}finally{if(c)throw l;}}b=[].concat(_toConsumableArray(new Set(f)));t.setState({availableDates:b},function(){this.setupDatepicker()})})}},{key:"setupDatepicker",value:function(){var n=this.state.availableDates,i=this.handleDateSelector,t=this.getNowShowing;getAttributes=this.getAttributes;jQuery("#datepicker-btn").data("datepicker")&&jQuery("#datepicker-btn").datepicker("destroy").off("changeDate");jQuery("#datepicker-btn").datepicker({format:"yyyy-mm-dd",maxViewMode:2,startDate:"today",orientation:"bottom right",container:"#dateFilterPortal",beforeShowDay:function(t){var r=!1,u=n.length,f,i;if(t.setHours(0,0,0,0),f=t.valueOf(),u>0)for(i=0;i<u;i++)if(t=parseInt(dateObjFromString(n[i].Date).getTime().toFixed(0)),f===t){r=!0;break}return r}}).on("changeDate",function(n){t(n.format("yyyy-mm-dd"));getAttributes(n.format("yyyy-mm-dd"));jQuery(this).datepicker("hide")}).on("show",function(){jQuery(this).addClass("datepickerActive")}).on("hide",function(){jQuery(this).removeClass("datepickerActive").removeClass("is-open")})}},{key:"handleFilterSelect",value:function(n){this.setState({selectedAttributeId:n},function(){this.getNowShowing(this.state.filterDate)})}},{key:"getNowShowing",value:function(){var t=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],i,r,u;this.toggleLoading();n===!1&&(i=new Date,n=i.getFullYear()+"-"+("00"+(i.getMonth()+1)).slice(-2)+"-"+("00"+i.getDate()).slice(-2));r="";this.state.selectedAttributeId!==0&&(r="&attributes="+this.state.selectedAttributeId);u=void 0;u=this.state.selectedType===CinemaSelectorSelectedType.Cinema?"/Umbraco/Api/MovieApi/GetNowShowingFilmsByCinema?cinemaId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"")+"&splitByAttributes=true"+r+"&includeAdvanceBooking=true":"/Umbraco/Api/PaginatedMoviesApi/GetByCircuit?liteVersion=false&expandAttributes=true"+r+(n?"&startDate="+n+"&days=0":"");fetch(u).then(function(n){return n.json()}).then(function(i){var r=dateObjFromString(n.toString()),u=pc.labels.dayFull[r.getDay()]+" "+pc.labels.monthShort[r.getMonth()]+" "+r.getDate()+pc.labels.ordinal(r.getDate());jQuery("#datepicker-btn").datepicker("update",r);t.state.flickityActive&&(jQuery(".flickity-listing").flickity("destroy"),flickityActive=!1);i!==null||typeof i=="undefined"?t.setState({comingSoon:!1,nowShowing:!0,advancedBooking:!1,sessions:i.Result!==undefined?i.Result:i,maxFilms:i.Result!==undefined?i.Result.length:i.length,filmsToShow:t.props.filmsPerPage,noResults:i.Result!==undefined?!i.Result.length>0:!i.length>0,loading:!1,filterDate:n,filterDateDisplay:u},function(){jQuery(".flickity-listing").flickity({cellAlign:"center",pageDots:!1,prevNextButtons:!1,freeScroll:!0,draggable:!0,groupCells:!0});t.setState({flickityActive:!0})}):t.setState({availableDates:[],noResults:!0,loading:!1,filterDate:n,filterDateDisplay:u,sessions:[],flickityActive:!1})})}},{key:"getAttributes",value:function(){var i=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],t,r;this.toggleFiltersLoading(!0);n===!1&&(t=new Date,n=t.getFullYear()+"-"+("00"+(t.getMonth()+1)).slice(-2)+"-"+("00"+t.getDate()).slice(-2));r="/Umbraco/Api/AttributeApi/GetAttributesOnSchedules?cinemaNodeId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"");fetch(r).then(function(n){return n.json()}).then(function(n){(n!==null||typeof n=="undefined")&&i.setState({cmsAttributes:n});i.toggleFiltersLoading(!1)})}},{key:"toggleLoading",value:function(){this.setState(function(n){return{loading:!n.check}})}},{key:"toggleFiltersLoading",value:function(n){this.setState({filtersLoading:n})}},{key:"render",value:function(){return React.createElement("div",{className:this.state.loading||this.state.filtersLoading?"loading":""},React.createElement(Showtimes_DatePortal,{isHome:!1,availableDates:this.state.availableDates,filterDateDisplay:this.state.filterDateDisplay,handleNowShowing:this.getNowShowing,selectFunction:this.handleDateSelector,handleClick:this.handleClick}),React.createElement(Showtimes_FiltersPortal,{selectedAttributeId:this.state.selectedAttributeId,cmsAttributes:this.state.cmsAttributes,selectedCinemaId:this.state.selectedCinemaId,showPrintButton:this.state.nowShowing,getPopUpAttributes:this.getPopUpAttributes,handleSelect:this.handleFilterSelect}),React.createElement(Shared_CinemaSelectorPortal,{isOpen:this.state.cinemaSelectorIsOpen,toggleCinemaSelector:this.toggleCinemaSelector,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect,hasAllTheatres:this.props.hasAllTheatres,updatePrefixUrl:this.updatePrefixUrl}),!this.state.noResults&&React.createElement("div",{className:"container container--narrow mt-2 movies-page"},React.createElement("div",{className:"grid grid--4-col grid--gap-50"},React.createElement(Showtimes_FilmsList,{isHome:this.props.isHome,isMovies:this.props.isMovies,sessions:this.state.sessions,filmsToShow:this.state.filmsToShow,maxFilms:this.state.maxFilms,comingSoon:this.state.comingSoon,splitByAttributes:this.state.splitByAttributes,redirectUrl:this.state.redirectUrl,placeholder:this.props.placeholder,selectedType:this.state.selectedType,selectedCinemaId:this.state.selectedCinemaId,selectedCinemaFriendly:this.state.selectedCinemaFriendly,filterDate:this.state.filterDate,prefixUrl:this.state.prefixUrl}))),this.state.noResults&&React.createElement("div",{className:"container container--narrow ta__center"},React.createElement("p",{className:"subtitle"},"No Showtimes available on this date, please pick another date.")))}}]),t}(React.Component);Showtimes_App.propTypes={cinemas:PropTypes.arrayOf(CinemaProps).isRequired,filmsPerPage:PropTypes.number.isRequired,isHome:PropTypes.bool.isRequired,isShowtimes:PropTypes.bool.isRequired,placeholder:PropTypes.string.isRequired,redirectUrl:PropTypes.string.isRequired,selectedCinemaId:PropTypes.number.isRequired,selectedGroupId:PropTypes.number};EventCategories=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.state={selectedCinemaID:!1,selectedCinemaEvents:i.props.eventCategoriesList,cinemaSelectorIsOpen:!1},i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.updatePrefixUrl=i.updatePrefixUrl.bind(i),i.getEventCategories=i.getEventCategories.bind(i),i.handleCinemaSelector=i.handleCinemaSelector.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i,r,u){this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n},function(){r||linkUpdate(u);return})}},{key:"updatePrefixUrl",value:function(n){this.setState({prefixUrl:n})}},{key:"getEventCategories",value:function(n){var t=n.selectedCinemaID,i=[];i=t>-1?this.props.eventCategoriesList.filter(function(n){return n.EventCategoryCinemaIds.includes(t)}):this.props.eventCategoriesList;n.selectedCinemaEvents=t==="Please Select"?this.props.eventCategoriesList:i;this.setState(n)}},{key:"componentDidMount",value:function(){}},{key:"handleCinemaSelector",value:function(n){this.setState({selectedCinemaID:n.target.value},function(){this.getEventCategories({selectedCinemaID:n.target.value})})}},{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement(Shared_CinemaSelectorPortal,{isOpen:this.state.cinemaSelectorIsOpen,toggleCinemaSelector:this.toggleCinemaSelector,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect,hasAllTheatres:!0,updatePrefixUrl:this.updatePrefixUrl}),this.state.selectedCinemaEvents.length>0?React.createElement(EventCategoriesList,{eventCategoriesList:this.state.selectedCinemaEvents}):React.createElement("div",{className:"ta__center"},React.createElement("h2",null,"No events available at the selected location.")))}}]),t}(React.Component);EventItems=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.state={selectedCinemaID:jQuery("input[name='cinema-selector-page']:checked").val()||-1,selectedCinemaEvents:i.props.EventItemsList},i.getEventItems=i.getEventItems.bind(i),i.handleCinemaSelector=i.handleCinemaSelector.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"getEventItems",value:function(n){var t=n.selectedCinemaID,i=[];i=t>-1?this.props.EventItemsList.filter(function(n){return n.GroupCinemaIds.includes(t)}):this.props.EventItemsList;n.selectedCinemaEvents=t==="Please Select"?this.props.EventItemsList:i;this.setState(n)}},{key:"componentDidMount",value:function(){var n=this,t=document.getElementsByName("cinema-selector-page");Array.from(t).forEach(function(t){t.addEventListener("click",n.handleCinemaSelector)});this.getEventItems({selectedCinemaID:this.state.selectedCinemaID})}},{key:"componentWillUnmount",value:function(){var n=this,t=document.getElementsByName("cinema-selector-page");Array.from(t).forEach(function(t){t.removeEventListener("click",n.handleCinemaSelector)})}},{key:"handleCinemaSelector",value:function(n){this.setState({selectedCinemaID:n.target.value},function(){this.getEventItems({selectedCinemaID:n.target.value})})}},{key:"render",value:function(){return React.createElement("div",null,this.state.selectedCinemaEvents.length>0?React.createElement(EventItemsList,{EventItemsList:this.state.selectedCinemaEvents}):React.createElement("div",{className:"ta_c"},React.createElement("h2",null,"No events available.")),React.createElement("div",{className:"gridRow p0"},React.createElement("div",{className:"gridCol-s-12 gridCol-m-12 gridCol-l-12"},React.createElement("div",{className:"stk-border-bottom"}))))}}]),t}(React.Component);Event_Page=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.state={selectedCinemaID:-1,cinemaSelectorIsOpen:!1},i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.updatePrefixUrl=i.updatePrefixUrl.bind(i),i}return _inherits(t,n),_createClass(t,[{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i,r,u){this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n},function(){r||linkUpdate(u);return})}},{key:"updatePrefixUrl",value:function(n){this.setState({prefixUrl:n})}},{key:"render",value:function(){return React.createElement(Shared_CinemaSelectorPortal,{isOpen:this.state.cinemaSelectorIsOpen,toggleCinemaSelector:this.toggleCinemaSelector,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect,hasAllTheatres:!0,updatePrefixUrl:this.updatePrefixUrl})}}]),t}(React.Component)