"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[357],{88797:function(e,s,i){var l=i(85893),a=i(67294),n=i(22546),t=i(86523),c=i(4533);i(13352);var r=i(62693),o=i.n(r),d=i(10155);t.ZP.use([t.W_,t.tl,t.N1,t.pt]);let m=0;s.Z=function(e){let{cinema:s=null}=e,[i,t]=(0,a.useState)([]),[r,u]=(0,a.useState)([]),[_,h]=(0,a.useState)(!0),v=(0,d.sh)(),x=(0,a.useRef)(null),g=(0,a.useRef)({}),j=async()=>{try{let e=await o().carousel();e=e.filter(e=>"video"!==e.slide_type);let i=e.filter(e=>"background"===e.slide_type&&"active"===e.status);if("background"===s.config2.defaultSliderType?u(i):u([]),Array.isArray(e)){let l=s.config2.defaultSliderType,a=e.filter(e=>l&&""!=l&&"regular"!=l?"active"===e.status&&e.slide_type===l:"active"===e.status&&"fullframe"!==e.slide_type&&"background"!==e.slide_type);a.sort((e,s)=>e.order-s.order);let n=a;a.length>6&&(n=a.slice(0,6)),t(n),h(!1)}else m<4&&(m++,setTimeout(j,3e3))}catch(c){m<4&&(m++,setTimeout(j,3e3))}};if((0,a.useEffect)(()=>{j()},[]),(0,a.useEffect)(()=>{r.length>0&&f()},[r]),!i.length)return null;let p=(e,s)=>e.length>s?e.slice(0,s)+"...":e,N=e=>{let s=e.activeIndex;i.forEach((e,i)=>{if(e.video_id){let l=g.current[(0,d.FT)(e.video_id)];l&&(i===s?l.playVideo():l.pauseVideo())}})},f=()=>{let e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",e.async=!0,document.body.appendChild(e),window.onYouTubeIframeAPIReady=()=>{r.forEach(e=>{let s=(0,d.aU)(e.video_id),l=(0,d.FT)(e.video_id);""!==l&&(g.current[l]=new window.YT.Player("player-".concat(l),{videoId:l,playerVars:{autoplay:1,mute:1,autohide:1,modestbranding:1,rel:0,showinfo:0,controls:0,disablekb:1,enablejsapi:1,iv_load_policy:3,loop:1,start:s},events:{onReady(e){let s=(0,d.FT)(i[0].video_id);s!=l&&e.target.pauseVideo();let a=document.querySelector(".video--".concat(l));if(a){let n=a.querySelector(".cover-image");n&&n.classList.add("is-hidden")}},onStateChange(e){e.data==window.YT.PlayerState.ENDED&&(e.target.seekTo(s),e.target.playVideo())}}}))})}},y=e=>{var i;let l=e.link?(i=e.link).startsWith("http")?i:v?"/".concat(s.cinemaUrl).concat(i):"".concat(i):null;return"background"==e.slide_type?k(e,l):"fullframe"==e.slide_type?w(e,l):b(e,l)},k=(e,s)=>{let{title:i,subtitle:a,linkTitle:n,imageUrl:t}=e,c=i||a||n;return s?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"slider__item slider__item--video video--".concat((0,d.FT)(e.video_id)," "),children:(0,l.jsxs)("a",{href:s,className:"slider__link",children:[e.imageUrl&&(0,l.jsx)("div",{className:"cover-image",children:(0,l.jsx)("img",{src:"".concat(e.imageUrl),alt:""})}),(0,l.jsx)("div",{className:"video-container",children:(0,l.jsx)("div",{id:"player-".concat((0,d.FT)(e.video_id)),className:"video-player"})}),c&&(0,l.jsxs)("div",{className:"slider__content slider__content--video",children:[i&&(0,l.jsx)("h2",{className:"slider__title",children:p(i,42)}),a&&(0,l.jsx)("p",{className:"slider__description",children:p(a,400)}),n&&(0,l.jsx)("span",{className:"slider__fake-link",children:n})]})]})})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"slider__item slider__item--video video--".concat((0,d.FT)(e.video_id)," "),children:(0,l.jsxs)("span",{className:"slider__link",children:[e.imageUrl&&(0,l.jsx)("div",{className:"cover-image",children:(0,l.jsx)("img",{src:"".concat(e.imageUrl),alt:""})}),(0,l.jsx)("div",{className:"video-container",children:(0,l.jsx)("div",{id:"player-".concat((0,d.FT)(e.video_id)),className:"video-player"})}),c&&(0,l.jsxs)("div",{className:"slider__content slider__content--video",children:[i&&(0,l.jsx)("h2",{className:"slider__title",children:p(i,42)}),a&&(0,l.jsx)("p",{className:"slider__description",children:p(a,400)}),n&&(0,l.jsx)("span",{className:"slider__fake-link",children:n})]})]})})})},b=(e,s)=>s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"slider__content",children:(0,l.jsxs)("a",{href:s,className:"slider__link",children:[(0,l.jsx)("h2",{className:"slider__title",children:p(e.title,42)}),(0,l.jsx)("p",{className:"slider__description",children:p(e.subtitle,400)}),(0,l.jsx)("span",{className:"slider__fake-link",children:e.linkTitle})]})}),(0,l.jsx)("div",{className:"slider__media slider__media--regular",children:(0,l.jsx)("a",{href:s,className:"slider__link",children:(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"slider__image"})})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"slider__content",children:(0,l.jsxs)("span",{className:"slider__link",children:[(0,l.jsx)("h2",{className:"slider__title",children:p(e.title,42)}),(0,l.jsx)("p",{className:"slider__description",children:p(e.subtitle,400)})]})}),(0,l.jsx)("div",{className:"slider__media",children:(0,l.jsx)("span",{className:"slider__link",children:(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"slider__image"})})})]}),w=(e,s)=>s?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"slider__media slider__media--fullframe",children:(0,l.jsxs)("a",{href:s,className:"slider__link",children:[(0,l.jsx)("div",{className:"slider__media--fullframe-mobile",children:(0,l.jsx)("img",{src:e.mobileImageUrl,alt:"",className:"slider__image"})}),(0,l.jsx)("div",{className:"slider__media--fullframe-desktop",children:(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"slider__image"})})]})})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"slider__media slider__media--fullframe",children:(0,l.jsxs)("span",{className:"slider__link",children:[(0,l.jsx)("div",{className:"slider__media--fullframe-mobile",children:(0,l.jsx)("img",{src:e.mobileImageUrl,alt:"",className:"slider__image"})}),(0,l.jsx)("div",{className:"slider__media--fullframe-desktop",children:(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"slider__image"})})]})})});return(0,l.jsx)(l.Fragment,{children:_?(()=>{let e=[];for(let s=0;s<1;s++)e.push((0,l.jsx)(a.Fragment,{children:(0,l.jsx)("div",{className:"slider slider--loader",children:(0,l.jsx)("div",{className:"slider__inner",children:(0,l.jsx)("div",{className:"swiper swiper-initialized swiper-horizontal yc-slider",children:(0,l.jsx)("div",{className:"swiper-wrapper",children:(0,l.jsx)("div",{className:"swiper-slide",children:(0,l.jsx)(c.Qh,{})})})})})})},s));return e})():(()=>{let e=s.config2.defaultSliderType;return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"slider slider-type--".concat(e),children:(0,l.jsxs)("div",{className:"slider__inner",children:[(0,l.jsx)(n.tq,{onSlideChange:e=>N(e),onSwiper:e=>x.current=e,spaceBetween:16,slidesPerView:1,navigation:!0,loop:!1,pagination:{clickable:!0,el:".swiper-bullets-wrapper"},grabCursor:!0,autoplay:"background"!==e&&{delay:6e3,disableOnInteraction:!1},mousewheel:!0,className:"yc-slider",breakpoints:{1024:{spaceBetween:64,slidesPerView:1,centeredSlides:!1}},children:(0,l.jsx)("div",{className:"swiper-wrapper",children:i.map((e,s)=>(0,l.jsx)(n.o5,{children:y(e)},s))})}),(0,l.jsx)("div",{className:"swiper-bullets-wrapper"})]})})})})()})}},16805:function(e,s,i){var l=i(85893);i(67294);var a=i(12519);s.Z=function(e){let{children:s,isModalOpen:i=!1,setModalValue:n=null,setPlayingStatus:t=null}=e,c=()=>{n(!i),t(!1)};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"modal ".concat(i?"is-open":""),onClick:c,children:(0,l.jsxs)("div",{className:"modal__inner",children:[(0,l.jsxs)("button",{className:"modal__button",onClick:c,children:[(0,a.Tw)(),(0,l.jsx)("span",{className:"screen-reader-text",children:"Close modal"})]}),(0,l.jsx)("div",{className:"modal__content",children:s})]})})})}},21581:function(e,s,i){i.d(s,{Z:function(){return I}});var l=i(85893),a=i(67294),n=i(57003),t=i(10198),c=i(47116),r=i(11163),o=i(62693),d=i.n(o),m=i(3238),u=i(10155),_=i(41664),h=i.n(_),v=i(22004),x=i(83914);let g=e=>{let{synopsis:s="",activeDay:i,locale:n=null}=e,[t,c]=(0,a.useState)(!1),[r,o]=(0,a.useState)("");(0,a.useEffect)(()=>{let e="";if(s&&""!==s){let i=s.split(" ");e=i.slice(0,25).join(" ")}o(e),c(!1)},[s,i]);let d=()=>{c(!t)};return(0,l.jsxs)("div",{className:"read-more-less ".concat(t?"show-more-visible":"show-more-hidden"),children:[(0,l.jsx)("span",{className:"read-more-less__text-container",dangerouslySetInnerHTML:{__html:t?s:"".concat(r,"... ")}}),(0,l.jsx)("button",{onClick:d,className:"read-more-less__toggle-button",children:t?null==n?void 0:n.less:null==n?void 0:n.more})]})};var j=i(16805),p=i(12519),N=function(e){let{rawMovies:s=null,timezone:i="Pacific/Auckland",locale:a=null}=e;if(!s)return null;let n=(e,s)=>{let i=new Date(s.getTime());return i.setDate(s.getDate()+1),e.sessionTimes.some(e=>{let s=new Date(e.date);return s>i||(0,u.KC)(s,i)&&(0,u.X_)(s,e.time)})},t=e=>e.imageVerticalUrl?(0,l.jsx)("img",{src:e.imageVerticalUrl,alt:"".concat(null==a?void 0:a.movie_poster_for," ").concat(e.title),loading:"lazy"}):(0,l.jsx)("div",{className:"coming-soon__placeholder",children:(0,l.jsx)("img",{src:logo,alt:"",loading:"lazy"})}),c=(0,u.ym)(i),r=((e,s,i)=>{let l=e.filter(e=>n(e,s));for(let a=l.length-1;a>0;a--){let t=Math.floor(Math.random()*a),c=l[a];l[a]=l[t],l[t]=c}return l.slice(0,5)})(s,c.dateInTimezone,0);return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"grid grid__container",children:(0,l.jsx)("div",{className:"grid__cell",children:(0,l.jsxs)("div",{className:"no-showtimes",children:[(0,l.jsxs)("p",{className:"no-showtimes--text-bigger",children:[":( ",null==a?void 0:a.no_sessions]}),(0,l.jsx)("p",{className:"no-showtimes--text-smaller",children:null==a?void 0:a.no_sessions_small}),0===r.length?(0,l.jsx)("div",{className:"container",children:(0,l.jsx)("div",{className:"empty-giga-divider"})}):null,(0,l.jsx)("ul",{className:"random-movies",children:r.map((e,s)=>(0,l.jsx)("li",{className:"random-movie",children:(0,l.jsx)(h(),{href:"movie/".concat(e.url),children:t(e)})},s))})]})})})})},f=function(e){let{moviesToShow:s=null,activeDay:i=null,timezone:n="Pacific/Auckland",logo:t="",locale:c=null,cinema:r=null}=e,[o,d]=(0,a.useState)(!1),[m,_]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),k=(0,u.sh)();if(!s&&!i)return null;let b=e=>{let s=(0,u.FT)(e);d(s),_(!m),y(!f)};if(!s.length)return(0,l.jsx)(N,{locale:c,rawMovies:s,timezone:n});let w=e=>e.imageVerticalUrl?(0,l.jsx)("img",{className:"movie-poster",src:e.imageVerticalUrl,alt:"".concat(null==c?void 0:c.movie_poster_for," ").concat(e.title),loading:"lazy"}):(0,l.jsx)("div",{className:"home-movie-poster-placeholder",children:(0,l.jsx)("img",{className:"movie-poster-home",src:t,alt:"",loading:"lazy"})});return(0,l.jsxs)(l.Fragment,{children:[s.map((e,s)=>{let n=k?"/".concat(r.cinemaUrl,"/movie/").concat(e.url):"/movie/".concat(e.url);return(0,l.jsx)("div",{className:"times-tickets-single-movie",children:(0,l.jsxs)("div",{className:"container container--small times-tickets-single-movie__container",children:[(0,l.jsxs)("div",{className:"times-tickets-single-movie__container-inner",children:[(0,l.jsx)("div",{className:"times-tickets-single-movie__media",children:(0,l.jsxs)("div",{className:"times-tickets-single-movie__media-inner",children:[(0,l.jsx)(h(),{href:"".concat(n),children:w(e)}),e.trailer&&(0,l.jsx)("button",{className:"times-tickets-single-movie__trailer-triggger",onClick:()=>b(e.trailer),children:(0,l.jsx)(p.IK,{})})]})}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__content",children:[(0,l.jsx)(h(),{className:"times-tickets-single-movie__link",href:"".concat(n),children:(0,l.jsx)("h3",{className:"times-tickets-single-movie__heading",children:e.title})}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__classification",children:[(0,l.jsxs)("span",{className:"times-tickets-single-movie__classification-rating",children:[e.classification," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__spacer",children:[" ","|"," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__duration",children:[e.duration," ",null==c?void 0:c.minutes]})]}),(0,l.jsx)("div",{className:"times-tickets-single-movie__synopsis",children:(0,l.jsx)(g,{locale:c,activeDay:i,synopsis:e.synopsisShort})}),(0,l.jsx)("div",{className:"sessions",children:(0,l.jsx)("ul",{className:"single-session__list grid grid--gap-single-session",children:e.sessionTimes.map((e,s)=>{if(e.date===i)return(0,l.jsx)(a.Fragment,{children:(0,l.jsx)(x.Z,{locale:c,details:e})},s)})})})]})]}),(0,l.jsx)("div",{className:"divider divider--times-tickets-single-movie"})]})},s)}),(0,l.jsx)(j.Z,{isModalOpen:m,setModalValue:_,setPlayingStatus:y,children:(0,l.jsx)(v.Z,{playing:f,loop:!0,playsinline:!0,controls:!0,rel:0,url:"https://www.youtube.com/watch?v=".concat(o)})})]})},y=i(22546);i(86523),i(13352);var k=function(e){let{cinemaTimezone:s,cinemaLanguage:i,movies:n,activeDay:t,handleDayButtonClick:c}=e,r=(0,a.useRef)(null),o=(0,u.d$)(n);return(0,a.useEffect)(()=>{let e=o.findIndex(e=>t===e);if(-1==e)return;let s=r.current.swiper.realIndex,i=r.current.swiper.params.slidesPerView;e>=s&&e<=s+i?r.current.swiper.slideTo(e-2):r.current.swiper.slideTo(e)},[t]),(0,l.jsx)("div",{className:"day-slider",children:(0,l.jsx)("div",{className:"day-slider__inner",children:(0,l.jsx)(y.tq,{ref:r,spaceBetween:5,slidesPerView:4.6,navigation:!0,loop:!1,pagination:!1,grabCursor:!0,mousewheel:!0,keyboard:!0,className:"day-slider",breakpoints:{768:{spaceBetween:30,slidesPerView:6}},children:(0,l.jsx)("div",{className:"swiper-wrapper",children:o.map((e,a)=>(0,l.jsx)(y.o5,{children:(0,l.jsx)("div",{className:"day-slider-slide__outer ".concat(t===e?"is-active":"is-not-active"),children:(0,l.jsx)("button",{className:"day-slider-slide__button",onClick:()=>c(e),children:(0,u.FF)(e,i,s)})})},a))})})})})},b=i(82992),w=i(80008),S=i.n(w),T=function(e){let{movies:s=null,activeDay:i,handleDayButtonClick:n,timezone:t="Pacific/Auckland",cinemaLanguage:c,locale:r=null}=e;if(!s||!i)return null;let[o,d]=(0,a.useState)(!1),[m,_]=(0,a.useState)(S()()),[h,v]=(0,a.useState)((0,u.d$)(s)),x=(0,u.ym)(t).dateInTimezone,g=new Date(x.getFullYear(),x.getMonth(),1);(0,a.useEffect)(()=>{_(S()(i))},[s,i]);let j=e=>{let s=(0,u.p6)(e,c),i=h.findIndex(e=>s===(0,u.p6)(e,c));n(h[i])},N=h.map(e=>S()(e));return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"yourcinema-calendar__outer",children:[(0,l.jsx)("button",{className:"calendar",onClick(){d(!o)},children:o?(0,l.jsx)(p.Tw,{}):(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"calendar__icon",children:(0,l.jsx)(p.yp,{})}),(0,l.jsx)("span",{className:"calendar__text",children:null==r?void 0:r.cal})]})}),(0,l.jsx)("div",{className:"yourcinema-calendar ".concat(o?"is-visible":"is-hidden"),children:(0,l.jsx)(b.ZP,{onChange:_,value:m,tileClassName:function(e){let{date:s,view:i}=e;if("month"===i){let l=N.find(e=>e.isSame(s));return l?"highlighted-date":null}return null},tileDisabled:function(e){let{date:s,view:i}=e;if("month"===i){let l=N.find(e=>e.isSame(s));return!l}return!0},navigationAriaLabel:null,minDetail:"month",maxDetail:"month",minDate:g,onClickDay:j,locale:c})})]})})},F=function(e){let{locale:s=null,movies:i=null,orderBy:n="session-times",showCalendar:t=null,timezone:c="Pacific/Auckland",logo:r=null,cinemaLanguage:o,cinemaTimezone:d,cinema:_=null}=e;if(!i)return null;let[h,v]=(0,a.useState)((0,u.d$)(i)[0]),[x,g]=(0,a.useState)(()=>(0,u.GP)((0,u.fL)(i,h),n)),[j,p]=(0,a.useState)(!1),[N,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=(0,u.k6)(i,h),s=(0,u.jR)(e),l=(0,u.GP)(s,n);g(l),y((0,u.Tq)(x))},[h,n]);let b=e=>{p(!0),v(e);let s=document.querySelector(".scroll-to-anchor"),i=document.querySelector(".playing-now__content"),l=i.querySelector(".sticky-outer-wrapper");l.classList.contains("active")&&s.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{p(!1)},"200")};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{enabled:!0,top:0,children:(0,l.jsx)("div",{className:"play-by-date",children:(0,l.jsxs)("div",{className:"grid grid__container grid__container--small",children:[(0,l.jsx)("div",{className:"grid__cell ".concat("enabled"===t?"grid__cell--10@medium":"grid__cell--12@medium"),children:(0,l.jsx)(k,{cinemaTimezone:d,cinemaLanguage:o,movies:i,activeDay:h,handleDayButtonClick:b})}),(0,l.jsx)("div",{className:"grid__cell grid__cell--2@medium calendar__outer",children:"enabled"===t&&(0,l.jsx)(T,{locale:s,movies:i,handleDayButtonClick:b,activeDay:h,timezone:c,cinemaLanguage:o})})]})})}),(0,l.jsx)("div",{className:"play-by-date__movies ".concat(j?"is-faded":"not-faded"," language-").concat(null==s?void 0:s.locale),children:(0,l.jsx)(f,{locale:s,logo:r,moviesToShow:x,activeDay:h,cinema:_})})]})},z=i(30122),C=function(e){let{locale:s=null,movies:i=null,orderBy:n="session-time",timezone:t="Pacific/Auckland",logo:c=null,sortBy:r=null,cinema:o=null}=e,d=S().tz(t).format("en");s&&(d=S().tz(t).format("".concat(s.locale_time_format)));let[m,_]=(0,a.useState)((0,u.$N)(i,n,d)),[x,g]=(0,a.useState)((0,u.Tq)(m)),[N,f]=(0,a.useState)(!1),[y,k]=(0,a.useState)(!1),[b,w]=(0,a.useState)(!1),T=(0,u.sh)();if(!i)return;(0,a.useEffect)(()=>{let e=(0,u.$N)(i,n,d),s=(0,u.jR)(e);_(s)},[n,r]);let F=e=>{let s=(0,u.FT)(e);f(s),k(!y),w(!b)},C=e=>e.imageVerticalUrl?(0,l.jsx)("img",{className:"movie-poster",src:e.imageVerticalUrl,alt:"Movie poster for ".concat(e.title),loading:"lazy"}):(0,l.jsx)("div",{className:"home-movie-poster-placeholder",children:(0,l.jsx)("img",{className:"movie-poster-home",src:c,alt:"",loading:"lazy"})});return(0,l.jsxs)(l.Fragment,{children:[m.map((e,i)=>{let n=(0,u.z$)(e.sessionTimes),c=T&&o?"/".concat(o.cinemaUrl,"/movie/").concat(e.url):"/movie/".concat(e.url);return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)("div",{className:"page-break"}),(0,l.jsx)("div",{className:"times-tickets-single-movie",children:(0,l.jsxs)("div",{className:"container container--small times-tickets-single-movie__container",children:[(0,l.jsxs)("div",{className:"times-tickets-single-movie__container-inner",children:[(0,l.jsx)("div",{className:"times-tickets-single-movie__media",children:(0,l.jsxs)("div",{className:"times-tickets-single-movie__media-inner",children:[(0,l.jsx)(h(),{className:"times-tickets-single-movie__link",href:"".concat(c),children:C(e)}),e.trailer&&(0,l.jsx)("button",{className:"times-tickets-single-movie__trailer-triggger",onClick:()=>F(e.trailer),children:(0,l.jsx)(p.IK,{})})]})}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__content",children:[(0,l.jsx)(h(),{className:"times-tickets-single-movie__link",href:"".concat(c),children:(0,l.jsx)("h3",{className:"times-tickets-single-movie__heading",children:e.title})}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__classification",children:[(0,l.jsxs)("span",{className:"times-tickets-single-movie__classification-rating",children:[e.classification," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__spacer",children:[" ","|"," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__duration",children:[e.duration," ",null==s?void 0:s.minutes]})]}),(0,l.jsx)(z.Z,{locale:s,sessions:n,countDesktop:4,countMobile:2,timezone:t})]})]}),(0,l.jsx)("div",{className:"divider divider--times-tickets-single-movie"})]})},e.id)]},i)}),(0,l.jsx)(j.Z,{isModalOpen:y,setModalValue:k,setPlayingStatus:w,children:(0,l.jsx)(v.Z,{playing:b,loop:!0,playsinline:!0,controls:!0,rel:0,url:"https://www.youtube.com/watch?v=".concat(N)})})]})},V=i(4533),P=function(e){let{locale:s=null,movies:i=null,orderBy:n="session-time",timezone:t="Pacific/Auckland",logo:c=null,sortBy:r=null,cinema:o=null}=e,d=S().tz(t).format("en");s&&(d=S().tz(t).format("".concat(s.locale_time_format)));let[m,_]=(0,a.useState)((0,u.$N)(i,n,d)),h=(0,u.sh)();if(!i)return;(0,a.useEffect)(()=>{let e=(0,u.$N)(i,n,d),s=(0,u.jR)(e);_(s)},[n,r]);let v=e=>e.imageVerticalUrl?(0,l.jsx)("img",{className:"movie-poster",src:e.imageVerticalUrl,alt:"Movie poster for ".concat(e.title),loading:"lazy"}):(0,l.jsx)("div",{className:"home-movie-poster-placeholder",children:(0,l.jsx)("img",{className:"movie-poster-home",src:c,alt:"",loading:"lazy"})});return(0,l.jsx)(l.Fragment,{children:m.map((e,i)=>{let n=(0,u.z$)(e.sessionTimes);return h&&o?"/".concat(o.cinemaUrl,"/movie/").concat(e.url):e.url,(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)("div",{className:"page-break"}),(0,l.jsx)("div",{className:"times-tickets-single-movie",children:(0,l.jsxs)("div",{className:"container container--small times-tickets-single-movie__container",children:[(0,l.jsxs)("div",{className:"times-tickets-single-movie__container-inner",children:[(0,l.jsx)("div",{className:"times-tickets-single-movie__media",children:(0,l.jsx)("div",{className:"times-tickets-single-movie__media-inner",children:v(e)})}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__content",children:[(0,l.jsx)("h3",{className:"times-tickets-single-movie__heading",children:e.title}),(0,l.jsxs)("div",{className:"times-tickets-single-movie__classification",children:[(0,l.jsxs)("span",{className:"times-tickets-single-movie__classification-rating",children:[e.classification," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__spacer",children:[" ","|"," "]}),(0,l.jsxs)("span",{className:"times-tickets-single-movie__duration",children:[e.duration," ",null==s?void 0:s.minutes]})]}),(0,l.jsx)(z.Z,{locale:s,sessions:n,countDesktop:6,countMobile:2,timezone:t})]})]}),(0,l.jsx)("div",{className:"divider divider--times-tickets-single-movie"})]})},e.id)]},i)})})};let D=0,U=e=>{var s,i,o;let{cinema:m=null,locale:_=null}=e,{theme:h,defaultSessionOrder:v}=m.config2;(0,r.useRouter)();let[x,g]=(0,a.useState)(null),[j,N]=(0,a.useState)([]),[f,y]=(0,a.useState)(h),[k,b]=(0,a.useState)(v),w=(0,a.useRef)(),S=(0,c.useReactToPrint)({content:()=>w.current,documentTitle:"".concat(document.title," session times")}),{showPrintButton:T,showCalendar:z}=m.config2,U=null!==(o=null==m?void 0:null===(s=m.config2)||void 0===s?void 0:null===(i=s.css)||void 0===i?void 0:i["v2-home-calendar-text-buttons"])&&void 0!==o?o:"#000",I=async()=>{try{let e=await d().playingNow();Array.isArray(e)?(g(e),N((0,u.Tq)(e))):D<4&&(setTimeout(I,3e3),D++)}catch(s){D<4&&(setTimeout(I,3e3),D++)}};(0,a.useEffect)(()=>{I(),document.body.classList.add(f)},[f]);let{Option:M}=n.c,E=e=>(0,l.jsx)(M,{...e,children:(0,l.jsxs)("div",{className:"option-value-wrap",style:{display:"flex"},children:[(0,l.jsx)("div",{style:{marginRight:"10px",marginTop:"-1px"},children:e.data.icon}),(0,l.jsx)("div",{children:e.data.label})]})}),Z=e=>(0,l.jsxs)("div",{className:"select-value-wrap",style:{display:"flex",marginTop:"-14px"},children:[(0,l.jsx)("div",{style:{marginRight:"10px",marginTop:"-1px"},children:e.data.icon}),(0,l.jsx)("div",{children:e.data.label})]}),L=[{value:"release-date",label:null==_?void 0:_.newest_first},{value:"alpha",label:null==_?void 0:_.order_alphabetically},{value:"session-times",label:null==_?void 0:_.order_by_session}],R=L.findIndex(e=>e.value===k),A=[{value:"by-day",label:null==_?void 0:_.by_day,icon:(0,l.jsx)(p.f,{})},{value:"by-movie",label:null==_?void 0:_.by_movie,icon:(0,l.jsx)(p.xC,{})}],B=A.findIndex(e=>e.value===f),q={dropdownIndicator:e=>({...e,padding:"8px 8px 8px 0"}),menuList:e=>({...e,padding:"0",borderRadius:"3px"}),valueContainer:e=>({...e,padding:"2px 0 2px 8px"}),option(e,s){let{data:i,isDisabled:l,isFocused:a,isSelected:n}=s;return{...e,backgroundColor:a?"rgba(255,255,255,0.1)":"inherit"}}};return x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"scroll-to",children:(0,l.jsx)("div",{className:"scroll-to-anchor"})}),(0,l.jsxs)("div",{className:"playing-now",children:[(0,l.jsxs)("div",{className:"playing-now__navigation",children:[(0,l.jsxs)("div",{className:"grid grid__container grid__container--small",children:[(0,l.jsx)("div",{className:"grid__cell grid__cell--6@medium",children:(0,l.jsx)("h2",{className:"playing-now__main-heading",children:null==_?void 0:_.times_and_tickets})}),(0,l.jsx)("div",{className:"grid__cell grid__cell--6@medium",children:(0,l.jsxs)("ul",{className:"playing-now__actions",children:[(0,l.jsx)("li",{className:"playing-now__actions-item",children:(0,l.jsx)(t.ZP,{components:{Option:E,SingleValue:Z},className:"playing-now__select",options:A,defaultValue:A[B],isSearchable:!1,onChange(e){document.body.classList=[],document.body.classList.add(e.value),y(e.value)},styles:q,theme:e=>({...e,borderRadius:3,colors:{...e.colors,text:"orangered",primary25:"#F2F2F2",primary:U,neutral20:"#010101",neutral80:"#010101"}})})}),(0,l.jsx)("li",{className:"playing-now__actions-item playing-now__actions-item--spacing",children:(0,l.jsx)(t.ZP,{className:"playing-now__select playing-now__select--longer",options:L,styles:q,defaultValue:L[R],isSearchable:!1,onChange:e=>b(e.value),theme:e=>({...e,borderRadius:3,colors:{...e.colors,text:"orangered",primary25:"#F2F2F2",primary:U,neutral20:"#010101",neutral80:"#010101"}})})}),"enabled"===T&&(0,l.jsx)("li",{className:"playing-now__actions-item playing-now__actions-item--spacing playing-now__actions-item--print",children:(0,l.jsxs)("button",{className:"playing-now__print",onClick:S,children:[(0,l.jsx)("span",{className:"playing-now__print-icon",children:(0,l.jsx)(p.Kh,{})}),(0,l.jsx)("span",{className:"playing-now__print-content",children:null==_?void 0:_.print})]})})]})})]}),(0,l.jsx)("div",{className:"container container--small",children:(0,l.jsx)("div",{className:"divider divider--spacing-only-top"})})]}),(0,l.jsxs)("div",{className:"playing-now__content",children:["by-movie"===f?(0,l.jsx)(C,{locale:_,movies:x,orderBy:k,sortBy:f,timezone:m.timezone,logo:m.config2.logo,cinema:m}):(0,l.jsx)(F,{locale:_,movies:x,orderBy:k,showCalendar:z,timezone:m.timezone,logo:m.config2.logo,cinemaLanguage:m.language,cinemaTimezone:m.timezone,cinema:m}),j&&j.length>0&&(0,l.jsx)("div",{className:"container container--small ",children:(0,l.jsxs)("div",{className:"session-attribute-legend",children:[(0,l.jsx)("p",{children:null==_?void 0:_.sessions_key}),(0,l.jsx)("ul",{children:j.map((e,s)=>(0,l.jsxs)("li",{children:[(0,l.jsx)("b",{children:e.shortName})," - ",e.description,"."]},"".concat(s)))})]})})]})]}),(0,l.jsx)("div",{className:"hidden-print hidden-for-good",ref:w,children:(0,l.jsx)(P,{locale:_,movies:x,orderBy:k,sortBy:f,timezone:m.timezone})})]}):(0,l.jsx)("div",{className:"main-loader",children:(0,l.jsx)("div",{className:"main-loader__inner",children:(0,l.jsx)(V.xk,{})})})};var I=U},30122:function(e,s,i){var l=i(85893),a=i(67294),n=i(83914);i(10155);var t=i(80008),c=i.n(t);i(83496);let r=e=>{let{sessions:s=null,countDesktop:i=4,countMobile:t=2,timezone:r="Pacific/Auckland",locale:o=null}=e,[d,m]=(0,a.useState)(!1),u=Object.entries(s),_=u.slice(0,5),h=u.slice(5),v=()=>{m(!d)},x=(e,s,r)=>{let d=c()(e).isSame(c()().tz(r).format("YYYY-MM-DD"),"day"),m=c()(e).locale("".concat(null==o?void 0:o.locale)).format(null==o?void 0:o.locale_date_string);return d&&(m=m.replace(c()(e).locale("".concat(null==o?void 0:o.locale)).format("dddd"),null==o?void 0:o.today)),(0,l.jsxs)("div",{className:"single-session",children:[(0,l.jsx)("h2",{className:"single-session__date",children:m}),(0,l.jsx)("ul",{className:"single-session__list grid grid--gap-single-session",children:s.map((e,s)=>(0,l.jsx)(a.Fragment,{children:(0,l.jsx)(n.Z,{locale:o,details:e,countDesktop:i,countMobile:t})},s))})]},e)};return s?(0,l.jsxs)(l.Fragment,{children:[_.map((e,s)=>{let[i,l]=e;return x(i,l,r)}),h.length>0&&(0,l.jsxs)("div",{className:"hidden-sessions__outer ".concat(d?"is-visible":"is-hidden"),children:[(0,l.jsx)("div",{className:"hidden-sessions__button",children:(0,l.jsx)("button",{onClick:()=>v(),children:null==o?void 0:o.see_all})}),(0,l.jsx)("div",{className:"hidden-sessions__wrapper",children:h.map((e,s)=>{let[i,l]=e;return x(i,l,r)})})]})]}):null};s.Z=r},83914:function(e,s,i){var l=i(85893),a=i(67294),n=i(30381),t=i.n(n);let c=e=>{let{details:s=null,countDesktop:i=4,countMobile:n=2,locale:c=null}=e,[r,o]=(0,a.useState)(!1),{time:d,bookingLink:m,attributes:u,isSoldOut:_}=s,h=12/i,v=12/n,x=u.map(e=>e.shortName),g=x.join(", "),j=()=>{o(!0)},p=()=>{o(!1)},N=e=>{let s;if(c){if(!(s=e.toLowerCase().includes("am")||e.toLowerCase().includes("pm")?t()(e,"h:mm a"):t()(e,"HH:mm")).isValid())throw Error("Invalid time format");return s.locale(null==c?void 0:c.locale).format(null==c?void 0:c.locale_time_format)}},f=r?"has-hover":"";return(0,l.jsx)(l.Fragment,{children:_?u.length?(0,l.jsxs)("li",{className:"time-slot time-slot--has-attribute time-slot--sold-out grid__cell--".concat(v," grid__cell--").concat(h,"@medium"),"data-buy":"".concat(null==c?void 0:c.book),children:[(0,l.jsxs)("span",{className:"time-slot__sold-out-wrapper",children:[(0,l.jsxs)("span",{className:"time-slot__time",children:[N(d),"  "]}),(0,l.jsxs)("span",{className:"time-slot__item-sold-out-text",children:["(",null==c?void 0:c.sold_out,")"]})]}),(0,l.jsx)("span",{className:"time-slot__attribute",id:"your-cinema-tooltip--".concat(void 0),children:g})]}):(0,l.jsxs)("li",{className:"time-slot time-slot--sold-out grid__cell--".concat(v," grid__cell--").concat(h,"@medium"),"data-buy":"".concat(null==c?void 0:c.book),children:[(0,l.jsx)("span",{className:"time-slot__time",children:N(d)}),(0,l.jsxs)("span",{className:"time-slot__item-sold-out-text",children:["(",null==c?void 0:c.sold_out,")"]})]}):u.length?(0,l.jsx)("li",{className:"time-slot time-slot--has-attribute grid__cell--".concat(v," grid__cell--").concat(h,"@medium ").concat(f),onMouseEnter:j,onMouseLeave:p,"data-buy":"".concat(null==c?void 0:c.book),children:(0,l.jsxs)("a",{className:"time-slot__link",href:m,children:[(0,l.jsx)("span",{className:"time-slot__time",children:N(d)}),(0,l.jsx)("span",{className:"time-slot__attribute",id:"your-cinema-tooltip--".concat(void 0),children:g})]})}):(0,l.jsx)("li",{className:"time-slot time-slot--default grid__cell--".concat(v," grid__cell--").concat(h,"@medium ").concat(f),onMouseEnter:j,onMouseLeave:p,"data-buy":"".concat(null==c?void 0:c.book),children:(0,l.jsx)("a",{className:"time-slot__link",href:m,children:(0,l.jsx)("span",{className:"time-slot__time",children:N(d)})})})})};s.Z=c}}]);